EPANET - Water Quality Analysis - Plot Tracking Algorithm


EPANET tracks the change in water quality of discrete parcels of water as they move through pipes and mix in the Junctions between time steps of fixed length. The following actions occur within each of these time steps:

  1. The water quality in each plot is updated to reflect any reactions that may have occurred over time
  2. For each node in topological order (from upstream to downstream):
    1. If the node is a junction or tank, water from the main portions of the connections flowing into it, if not zero, is combined to calculate a new water quality value. The contribution volume of each package is equal to the product of the flow rate of your link and the time interval. If this volume exceeds that of the package, then the packet is destroyed and the next one in line behind it starts contributing its volume.
    2. If the node is a junction, its new quality is calculated as its total mass Inflow divided by its total inflow volume.
      If it's a tank, its quality is updated depending on the method used to model the mixture in the tank
    3. Node concentration is adjusted for any contributions made by external water quality sources
    4. A new parcel is created on each link that flows out of the node. Its volume is equal to the product of the flow of the pipe and the time interval and its quality is equal to the new quality value calculated for the node

To reduce the number of segments, Step 2.4 is only performed if the quality of the new node differs by a specified tolerance by the user from that of the last packet on the outbound link. If the quality difference is below the tolerance, the size of the last current chunk on the link is simply increased by the volume flowing into the link over time and the new packet quality is a weighted average of node volume and current packet quality.

This process is then repeated for the next water quality time step. At the start of the next hydraulic time step, any link experiencing a flow reversal has the order of its installments inverted and if any flow reversal occurs, the network nodes are topologically reclassified, from upstream to downstream. Sorting the nodes topologically allows the method to conserve mass, even when very short pipes or zero-length pumps and valves are encountered. Initially, each pipe in the network consists of a single segment whose quality is equal to the initial quality assigned to the upstream node.