![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
Functions | |
| bool | reactPool (SimulationContext &c, int control, int layer, double volume, double *mass, double dt, double temp, std::vector< double > &reacted, std::vector< double > &clamped) |
| React one finite native LID water pool through scoped compiled species laws. | |
| void | initialize (SimulationContext &c) |
| Ensure opted-in native LID-node layer species stores exist at current seed phase. | |
| double | heldMass (const SimulationContext &c, int node, int species) |
| Sum one node's held layer inventory for a reaction species. | |
| double | mobileWater (const SimulationContext &c, int node, double fallback) |
| Read the retained native LID-node mobile water history with caller fallback. | |
| void | prepareNodes (SimulationContext &c, double dt) |
| Replay accepted native LID water transfers into layer/mobile species inventories before routing. | |
| double | outlet (const SimulationContext &c, int node, int link, int species, double fallback) |
| Read a prepared node-layer outlet concentration for one link/species. | |
| double | receive (SimulationContext &c, int node, int link, double water, int species, double rate, double dt) |
| Capture an accepted incoming link native mass-rate share into the first matching LID port. | |
| void | reactNodes (SimulationContext &c, double dt) |
| React native LID-node held layer pools and weighted mobile water portions once per interval. | |
| bool | reactedSubcatchment (const SimulationContext &c, int sc) |
| Test the prepared conventional-LID reactive subcatchment mask. | |
| void | initializeUnits (SimulationContext &c, const lid::LIDSolver &solver) |
| Initialize conventional reactive LID native species pools and full-coverage ownership mask. | |
| void | routeUnits (SimulationContext &c, const lid::LIDSolver &solver, double dt) |
| Route/react native species through one accepted conventional LID hydraulic interval. | |
| void | publishUnits (SimulationContext &c, double dt) |
| Publish conventional reactive LID surface export as accepted subcatchment runoff concentration. | |
| const double * | drainValues (const SimulationContext &c, int type, int unit, int control) |
| Borrow the prepared conventional reactive LID drain concentration tuple. | |
| const double * openswmm::msxlid::drainValues | ( | const SimulationContext & | c, |
| int | type, | ||
| int | unit, | ||
| int | control ) |
Borrow the prepared conventional reactive LID drain concentration tuple.
| [in] | c | Stable opted-in control/offset/drain native state, alive through borrowed use. |
| [in] | type | Valid group type index with offsets[type] and offsets[type+1]; invalid returnsnull. |
| [in] | unit | Valid nonnegative unit within that group; not independently checked against next offset. |
| [in] | control | Opted-in native LID control ID; disabled returnsnull. |
| double openswmm::msxlid::heldMass | ( | const SimulationContext & | c, |
| int | node, | ||
| int | species ) |
Sum one node's held layer inventory for a reaction species.
| [in] | c | Stable native storage mapping and lid.node_mass layout. |
| [in] | node | Valid native node index supplied to storage_row mapping. |
| [in] | species | Zero-based species below n_species; invalid returns0. |
| void openswmm::msxlid::initialize | ( | SimulationContext & | c | ) |
Ensure opted-in native LID-node layer species stores exist at current seed phase.
| [in,out] | c | Prepared storage nodes/layer geometry/optional Richards water, compiled row count and native node concentrations; allocates lid.node_mass/outlet/mobile history by storage row. |
| void openswmm::msxlid::initializeUnits | ( | SimulationContext & | c, |
| const lid::LIDSolver & | solver ) |
Initialize conventional reactive LID native species pools and full-coverage ownership mask.
| [in,out] | c | Prepared configured reaction species/global concentrations/surface mass conversions and land area units; receives per-unit layer native stores, outlet/surface receipts and errors. |
| [in] | solver | Stable resolved conventional LID groups/unit areas/type/control/subcatch identity. |
| double openswmm::msxlid::mobileWater | ( | const SimulationContext & | c, |
| int | node, | ||
| double | fallback ) |
Read the retained native LID-node mobile water history with caller fallback.
| [in] | c | Stable storage mapping/opt-in and prepared node_mobile_old. |
| [in] | node | Valid native node ID for mapping. |
| [in] | fallback | Caller native ft3 value when no enabled/retained owner. |
| double openswmm::msxlid::outlet | ( | const SimulationContext & | c, |
| int | node, | ||
| int | link, | ||
| int | species, | ||
| double | fallback ) |
Read a prepared node-layer outlet concentration for one link/species.
| [in] | c | Stable native storage mapping and node_outlet arrays. |
| [in] | node | Valid native node ID. |
| [in] | link | Valid nonnegative native link index. |
| [in] | species | Valid zero-based reaction row below n_species (not individually bounds checked). |
| [in] | fallback | Native concentration when no covered finite exported port value. |
| void openswmm::msxlid::prepareNodes | ( | SimulationContext & | c, |
| double | dt ) |
Replay accepted native LID water transfers into layer/mobile species inventories before routing.
| [in,out] | c | Prepared completed hydraulic layer receipts/ports, prior layer/native concentration, external species mass-rate arrays and native MSX ledgers. Uses initialize() and arms routing ledger. |
| [in] | dt | Positive finite accepted hydraulic interval s; nonpositive/NaN/no opt-ins returns. |
| void openswmm::msxlid::publishUnits | ( | SimulationContext & | c, |
| double | dt ) |
Publish conventional reactive LID surface export as accepted subcatchment runoff concentration.
| [in,out] | c | Prepared reactive subcatch mask, per-step surface_export/carry native inventories and current accepted runoff ft3/s. Writes surface.washoff_conc and carries undelivered inventory. |
| [in] | dt | Positive finite matching accepted runoff duration s, not independently validated. |
| bool openswmm::msxlid::reactedSubcatchment | ( | const SimulationContext & | c, |
| int | sc ) |
Test the prepared conventional-LID reactive subcatchment mask.
| [in] | c | Stable reaction lid state. |
| [in] | sc | Zero-based subcatchment identity; invalid returnsfalse. |
| void openswmm::msxlid::reactNodes | ( | SimulationContext & | c, |
| double | dt ) |
React native LID-node held layer pools and weighted mobile water portions once per interval.
| [in,out] | c | Prepared opted-in native storage geometry/optional Richards moisture, layer/node species inventories, compiled reaction laws and armed MSX reacted/clamped ledgers. |
| [in] | dt | Positive finite reaction duration s; reactPool handles nonpositive/no-water skips. |
| bool openswmm::msxlid::reactPool | ( | SimulationContext & | c, |
| int | control, | ||
| int | layer, | ||
| double | volume, | ||
| double * | mass, | ||
| double | dt, | ||
| double | temp, | ||
| std::vector< double > & | reacted, | ||
| std::vector< double > & | clamped ) |
React one finite native LID water pool through scoped compiled species laws.
| [in,out] | c | Prepared compiled reaction metadata/workspace identities; may append one failure warning or negative-rate clamp diagnostics. No hydraulic water or engine clock mutation. |
| [in] | control | Valid native LID control ID selecting laws. |
| [in] | layer | Layer selector; applies all-layer0 first then specific layer with later row wins. |
| [in] | volume | Finite native water ft3; volume<=quality::ZERO_VOLUME or NaN returns success/no reaction. |
| [in,out] | mass | Writable n_species native inventory tuple (concentration*ft3), valid/nonaliasing with output vectors and stable through call. Not dereferenced when no eligible laws/invalid-small pool. |
| [in] | dt | Positive finite reaction interval s; nonpositive/NaN returns success/no reaction. |
| [in] | temp | Held reaction temperature degC (temperature in declaration), passed as TEMP variable. |
| [out] | reacted | Resized/reset n_species, then signed (before-after)*volume on accepted kinetics. |
| [out] | clamped | Resized/reset n_species, then positive inventory added when negative RATE result is floored0. Other negative forms/nonfinite values refuse the solve. |
| double openswmm::msxlid::receive | ( | SimulationContext & | c, |
| int | node, | ||
| int | link, | ||
| double | water, | ||
| int | species, | ||
| double | rate, | ||
| double | dt ) |
Capture an accepted incoming link native mass-rate share into the first matching LID port.
| [in,out] | c | Prepared enabled native LID-node layers, positive incoming quality ports and matching writable layer species inventories. |
| [in] | node | Valid native storage node ID. |
| [in] | link | Valid native link identity matched against prepared ports. |
| [in] | water | Positive finite total matching incoming hydraulic water ft3, denominator for port share. |
| [in] | species | Valid nonnegative reaction row below n_species, unchecked. |
| [in] | rate | Native concentration*ft3/s incoming mass rate (named mass in declaration), negative floored0; no generic finite input check. |
| [in] | dt | Positive finite accepted interval s, used to convert captured rate into stored inventory. |
| void openswmm::msxlid::routeUnits | ( | SimulationContext & | c, |
| const lid::LIDSolver & | solver, | ||
| double | dt ) |
Route/react native species through one accepted conventional LID hydraulic interval.
| [in,out] | c | Prepared reactive conventional-LID offsets/pools, subcatch rainfall/runon/masks, compiled laws/thermal layer view and user-mass surface ledgers; receives surface/drain concentrations, exports, updated layer inventory/old-water and deposition/infiltration/reaction receipts. |
| [in] | solver | Stable matching groups with accepted layer inflow/evaporation/surface/drain rates, infiltration depth and completed water storage, same unit order as initialized offsets. |
| [in] | dt | Positive finite accepted interval s; no controls/offsets/nonpositive/NaN returns. |