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

Phase A4 — water age through the LID layer stack. 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::lid
 
namespace  openswmm::transport
 

Functions

void openswmm::transport::initLidLayerAge (SimulationContext &ctx, const lid::LIDSolver &solver)
 
void openswmm::transport::setLidInflowAge (SimulationContext &ctx, int type_index, int unit, int subcatch, double rain_rate, double q_imperv, double q_perv, double q_runon, double lid_area)
 
void openswmm::transport::routeLidLayerAge (SimulationContext &ctx, const lid::LIDSolver &solver, double dt)
 Advance the per-layer ages one runoff step, after LIDSolver::execute.
 

Detailed Description

Phase A4 — water age through the LID layer stack.

Each layer of each LID unit is a complete-mix tank: what it holds ages by dt, what arrives mixes in by volume, and what leaves — percolation to the layer below, evaporation, exfiltration, the underdrain — leaves at the layer's own age. Only the inflow is needed, which is the whole reason this phase does not repeat A3's defect.

Where the inflow rates come from
Every batch*Flux routine already computed each layer's inflow as a local (soil_infil, soil_perc, pavePerc, storageInflow, ...); A4 publishes them as LIDGroupSoA::in_surf/in_pave/in_soil/in_stor, written after every clamp. They are not f_old_*: f_old_surf is the Modified Puls net dx/dt of the surface layer and f_old_soil/stor/pave are allocated and never written. A net rate of change is precisely what made A3 report elapsed time rather than age, so the survey claim that those four fields were inter-layer fluxes does not hold and is not what this uses.
Which layer feeds which
Resolved from an explicit per-TYPE table rather than inferred, because the stacks genuinely differ and the solver itself is written one routine per type. The single conditional is permeable pavement, whose storage receives from the soil when there is one and from the pavement when there is not — mirroring the solver's own storageInflow_local.
Not in this phase
Hotstart persistence. LID layer depths are not in the hot start file (no surf_depth/soil_moist/stor_depth/pave_depth anywhere in HotStartManager.cpp), so a restored age would be a mean over a volume that was not restored — A3's reasoning, verified rather than inherited.

Surface overflow returns to the subcatchment, and its age is the surface layer's, but it is not fed back into A3's subarea ages here.

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