![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
Classes | |
| class | QualitySolver |
Functions | |
| void | bookNegativeSourceClamp (SimulationContext &ctx, int node, int p, double shortfall) |
| Book one pollutant-row clamp: count it and un-book the shortfall from the external-extraction ledger row. | |
| void | bookNegativeAgeClamp (SimulationContext &ctx, int node) |
| void | bookNegativeCellSourceClamp (SimulationContext &ctx, int conduit, double shortfall) |
| P1.4: book one ARD cell-source clamp. Counted, NOT ledgered — and the reason is structural, not an omission. | |
| void | summarizeNegativeSourceClamps (SimulationContext &ctx) |
| void | applyNodeTreatment (SimulationContext &ctx, int node, double dt, double q_in_cfs, const double *cin) |
| One node's [TREATMENT] application, against the CALLER's inflow figures — the seam the LEGACY pass and the LARD MIX share. | |
Variables | |
| constexpr double | ZERO_VOLUME = 0.0353147 |
| 1 liter in ft3 | |
| constexpr double | ZERO_DEPTH = 0.003281 |
| 1 mm in ft | |
| void openswmm::quality::applyNodeTreatment | ( | SimulationContext & | ctx, |
| int | node, | ||
| double | dt, | ||
| double | q_in_cfs, | ||
| const double * | cin ) |
One node's [TREATMENT] application, against the CALLER's inflow figures — the seam the LEGACY pass and the LARD MIX share.
Evaluates the node's compiled expressions (removal- and concentration-typed, with co-treatment resolution and cycle detection), rewrites nodes.conc for every treated pollutant and books the removed mass into qual_routing_reacted. The inflow concentration and rate come from the CALLER because the two engines hold them in different places: LEGACY accumulates qual_mass_in/qual_vol_in, while LARD's node inflow lives in its solver-internal drain accumulators — reading the LEGACY arrays under LARD made an R-typed expression a literal no-op (cin read 0, and cOut = (c_in > 0) ? … : c_node kept the untreated value; P2.3's first draft shipped exactly that).
| q_in_cfs | Inflow rate feeding the node this interval, ft³/s. |
| cin | Per-pollutant inflow concentration, length np. |
|
inline |
Age-row clamp: counted, not ledgered (no age row until A2c) and not warned per-clamp (see bookNegativeSourceClamp's note).
|
inline |
P1.4: book one ARD cell-source clamp. Counted, NOT ledgered — and the reason is structural, not an omission.
The node seam un-books its shortfall from qual_routing_ex_in because the loaders booked the signed request there in advance. Cell sources have no such row to correct:
[TRANSPORT_SOURCES] rows resolve to MSX species rows only — ArdEngine.cpp pushes np + src_msx[i], so a cell source can never name a pollutant; andctx.mass_balance nowhere.So a per-pollutant row for this would be permanently zero, and inventing an MSX row here would be a third self-consistent balance (lesson 147) bolted on inside a defect fix. Giving MSX species real ledger rows (sizing the qual_* vectors by np + nm) is a deliberate, separate round — until it lands, the delivered mass reaches qual_routing_final through the end-of-run inventory sweep and therefore surfaces as CONTINUITY ERROR rather than as a labelled term. Recorded, not hidden.
| conduit | mesh conduit row of the first clamp (diagnostic only). |
| shortfall | the UNMET extraction (positive, internal mass units). |
|
inline |
Book one pollutant-row clamp: count it and un-book the shortfall from the external-extraction ledger row.
| shortfall | the UNMET extraction (positive, internal mass units). |
|
inline |
End-of-run summary (pushed once by SWMMEngine::end when anything clamped; gates read ctx.warnings, so .rpt ordering is not load-bearing).
|
constexpr |
1 mm in ft
|
constexpr |
1 liter in ft3