How does EPANET work on network branches

Hi everyone,
I’m working on Net3.inp (in EPANET). I would like to know how EPANET works on network branches. For example the total heads for three nodes 40, 39 and 38 are the same and equal to 47.32 m. Despite head difference between nodes 40 and 39 are zero, there is a flow rate from node 39 to 40 (pipe 44), which is equal to 0.22 L/s.
According to node flow continuity relationship, the algebraic sum of inflows to and outflows from a node must be zero. thus,
sum(Qx)+qj=0
in which Qx is pipe flow and qj is external flow (demand).This equation also can be expressed:
sum [(Hi-Hj)/R]^0.54+qj=0
According to the above explanation, how is this equation established in node 40?

Best Regards

Fatemeh

Net3.ok.inp (29.1 KB)