Skip to content

Water age simulation at a node downstream of a stagnant pipe can be incorrect #913

Open

Description

@sm-rana

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.

Image

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)

Image

Activity

  1. sm-rana commented on Apr 17, 2026

    @sm-rana
    Author

    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.
    """

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions