You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Water age simulation at a node downstream of a stagnant pipe can be incorrect #913
The issue was discovered while modeling a pump station, so I will use a pump station to illustrate, but should be replicable elsewhere too.
In the Net1 network, I have added a second pump parallel to the first pump (see attached image). I have also added a header pipe to the first pump. The two pumps join at the discharge node 10. The second pump (to the south) is always kept closed, which creates a stagnant header pipe (connecting node 3 and 10). When I ran a 240 hr simulation, the age profile at node 10 shows distinct jumps whenever the first pump is not running. This is because whenever the first pump is not running, age at node is calculated as some weighted average of the age of the water in two discharge headers in front of the two pumps.
The only way to simulate the correct age profile in node 10 is to actually set the status of the discharge header of the second pump to CLOSED (see attached picture below).
(Note: node 10 has no demands. Node 11 age is correctly impacted by the tank water age. Discharge headers for the two pumps have diameters of 12 inces and lengths of 10 ft)
ChatGpt provided the following diagnostics:
"""
The important bug-like behavior is the mismatch between these two pieces:
In flowdirchanged(), EPANET marks a link as ZERO_FLOW whenever |q| < Q_STAGNANT, where Q_STAGNANT = 0.005 gpm. Those links are then ignored by the topological sorting logic.
But in the actual transport routines, evalnodeinflow() and evalnodeoutflow() still use LINKFLOW(k), and LINKFLOW(k) only goes to zero when the link status is CLOSED; it does not zero out flows below Q_STAGNANT. So a link can be treated as “zero/negligible flow” for direction/sorting, while still transporting a tiny nonzero volume of aged water.
"""
Activity
sm-rana commentedon Apr 17, 2026
ChatGpt provided the following diagnostics:
"""
The important bug-like behavior is the mismatch between these two pieces:
In flowdirchanged(), EPANET marks a link as ZERO_FLOW whenever |q| < Q_STAGNANT, where Q_STAGNANT = 0.005 gpm. Those links are then ignored by the topological sorting logic.
But in the actual transport routines, evalnodeinflow() and evalnodeoutflow() still use LINKFLOW(k), and LINKFLOW(k) only goes to zero when the link status is CLOSED; it does not zero out flows below Q_STAGNANT. So a link can be treated as “zero/negligible flow” for direction/sorting, while still transporting a tiny nonzero volume of aged water.
"""