OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
WaterAgeLegacy.hpp File Reference

Phase A1b — the LEGACY (CSTR) engine's water-age mirror. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  openswmm
 
namespace  openswmm::transport
 

Functions

void openswmm::transport::routeLegacyAge (SimulationContext &ctx, double dt)
 

Detailed Description

Phase A1b — the LEGACY (CSTR) engine's water-age mirror.

A single-scalar rerun of the CSTR quality stages for the reserved age quantity, in the same order the pollutant arrays take (water age plan §5, LEGACY row):

  1. Aging: node and link ages advance by dt ("age advances by dt then mixes volume-weighted" — plan §1).
  2. Link-load accumulation (accumulateLinkLoads mirror): each flowing link contributes q · age_link to its downstream node; the loaders' per-source node_age_vol_in rates add on top. The VOLUME denominator is the same qual_vol_in the pollutant stages accumulated — this runs at the END of QualitySolver::execute, after those totals are complete.
  3. Node mixing (mixAtNodes mirror): the identical volume-balance formula and max-principle clamp. The EVAPORATION concentration factor is deliberately SKIPPED: per the plan's §8 proposal, evaporation removes volume at the parcel's current age, leaving the volume-intensive mean age unchanged.
  4. Link update (updateLinkQuality mirror with k = 0 and no evap factor): STEADY assigns the upstream node age; no-flow retains; zero-volume takes upstream; otherwise the legacy volume-balance mix with the DW q_in correction.

The mirror reads pollutant-side arrays (flows, volumes, qual_vol_in) and writes ONLY water_age_state — WATER_AGE ON leaves every pollutant trajectory bit-identical under LEGACY.

See also
plans/transport/WATER_AGE_TRACKING_PLAN.md §5, §7 A1
Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
License\n Apache-2.0