![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
#include <QualityRouting.hpp>
Public Member Functions | |
| void | init (int n_nodes, int n_links, int n_pollutants) |
| void | execute (SimulationContext &ctx, double dt) |
| Execute one quality routing timestep. | |
| void | assembleExternalLoads (SimulationContext &ctx, double dt) |
| Stage 1 of execute() only: reset the assembly arrays and run the five external-load adders (washoff, RDII, DWF, GW, iface) into nodes.qual_mass_in / qual_vol_in — no mixing, decay, or link update. | |
| void | addExtInflowLoads (SimulationContext &ctx, double dt) |
Add direct external inflow ([INFLOWS] CONCEN/MASS) pollutant loads, and the direct inflow's water, to the node assembly arrays. | |
| void | addCouplingLoads (SimulationContext &ctx, double dt) |
| void | addWetWeatherLoads (SimulationContext &ctx, double dt) |
| Add subcatchment washoff quality loads to node inflows. | |
| void | updateLinkQuality (SimulationContext &ctx, double dt) |
| void | applyTreatment (SimulationContext &ctx, double dt) |
| void openswmm::quality::QualitySolver::addCouplingLoads | ( | SimulationContext & | ctx, |
| double | dt ) |
S3: 2D→1D junction drain — its water into qual_vol_in, its species mass (queued by SurfaceRouter2D, drained by assembleLateralInflows) into qual_mass_in. No-op when no 2D coupling is active.
| void openswmm::quality::QualitySolver::addExtInflowLoads | ( | SimulationContext & | ctx, |
| double | dt ) |
Add direct external inflow ([INFLOWS] CONCEN/MASS) pollutant loads, and the direct inflow's water, to the node assembly arrays.
The mass rates were evaluated by the inflow solver into nodes.ext_qual_mass (CONCEN rows already multiplied by the node's flow). This also folds the direct inflow volume into qual_vol_in, which is the mixing denominator — legacy divides by Node[j].inflow, a total that includes lateral inflow.
| void openswmm::quality::QualitySolver::addWetWeatherLoads | ( | SimulationContext & | ctx, |
| double | dt ) |
Add subcatchment washoff quality loads to node inflows.
For each subcatchment with runoff, adds the washoff concentration × flow as mass inflow to the outlet node. Matches legacy addWetWeatherInflows() in routing.c.
| void openswmm::quality::QualitySolver::applyTreatment | ( | SimulationContext & | ctx, |
| double | dt ) |
Apply treatment expressions at nodes with treatment defined. Public since E5b: the ARD engine reuses this exact evaluator for treatment interop — it runs on the PUBLISHED nodes.conc after the ARD step and the engine absorbs the treated concentrations back into its node stores (ArdEngine::absorbTreatedNodeConc). Books its own qual_routing_reacted losses.
| void openswmm::quality::QualitySolver::assembleExternalLoads | ( | SimulationContext & | ctx, |
| double | dt ) |
Stage 1 of execute() only: reset the assembly arrays and run the five external-load adders (washoff, RDII, DWF, GW, iface) into nodes.qual_mass_in / qual_vol_in — no mixing, decay, or link update.
Split out (behavior-preserving refactor) so the Eulerian ARD engine (QUALITY_SOLVER EULERIAN_ARD) can consume the same source loads while replacing the CSTR transport stages — master plan §4.3 source-attribution seam.
| void openswmm::quality::QualitySolver::execute | ( | SimulationContext & | ctx, |
| double | dt ) |
Execute one quality routing timestep.
| ctx | Simulation context. |
| dt | Timestep (seconds). |
| void openswmm::quality::QualitySolver::init | ( | int | n_nodes, |
| int | n_links, | ||
| int | n_pollutants ) |
| void openswmm::quality::QualitySolver::updateLinkQuality | ( | SimulationContext & | ctx, |
| double | dt ) |
Update link quality using volume-balance mixing with upstream node (DW/KW) or upstream node concentration with exponential decay (STEADY). Public for testing.