OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmm::msxlid Namespace Reference

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.
 

Function Documentation

◆ drainValues()

const double * openswmm::msxlid::drainValues ( const SimulationContext & c,
int type,
int unit,
int control )

Borrow the prepared conventional reactive LID drain concentration tuple.

Parameters
[in]cStable opted-in control/offset/drain native state, alive through borrowed use.
[in]typeValid group type index with offsets[type] and offsets[type+1]; invalid returnsnull.
[in]unitValid nonnegative unit within that group; not independently checked against next offset.
[in]controlOpted-in native LID control ID; disabled returnsnull.
Returns
Nonowned pointer to n_species drain concentrations if flattened extent covered, else null. No count output or ownership transfer. Reinitialization/resize/route mutation can change/invalidate view; caller serializes lifecycle. Does not validate actual unit/control match, finite values, consume receipts, allocate or advance physical/clock state.
Here is the call graph for this function:

◆ heldMass()

double openswmm::msxlid::heldMass ( const SimulationContext & c,
int node,
int species )

Sum one node's held layer inventory for a reaction species.

Parameters
[in]cStable native storage mapping and lid.node_mass layout.
[in]nodeValid native node index supplied to storage_row mapping.
[in]speciesZero-based species below n_species; invalid returns0.
Returns
Sum all stored layer entries at species stride, native concentration*ft3;0 for absent storage mass. Does not require current opt-in, clear receipts or change clock. Read-only/no allocation.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ initialize()

void openswmm::msxlid::initialize ( SimulationContext & c)

Ensure opted-in native LID-node layer species stores exist at current seed phase.

Parameters
[in,out]cPrepared storage nodes/layer geometry/optional Richards water, compiled row count and native node concentrations; allocates lid.node_mass/outlet/mobile history by storage row.
Note
No control opt-ins returns. Correctly sized existing layer mass preserved; mismatched pools seed concentration*held layer water ft3, records native mobile volume. Does not validate BULK profile, book initial mass ledger or reset evolved correctly shaped stores. Parallel layer/native arrays must cover prepared counts. Allocation can leave partial shapes/seeds; exclusive lifecycle access, no hydraulic or engine clock advance.
Here is the caller graph for this function:

◆ initializeUnits()

void openswmm::msxlid::initializeUnits ( SimulationContext & c,
const lid::LIDSolver & solver )

Initialize conventional reactive LID native species pools and full-coverage ownership mask.

Parameters
[in,out]cPrepared configured reaction species/global concentrations/surface mass conversions and land area units; receives per-unit layer native stores, outlet/surface receipts and errors.
[in]solverStable resolved conventional LID groups/unit areas/type/control/subcatch identity.
Note
unsupported WALL species, covered reactive barrel, partial/mixed opt-in coverage append c.errors rather than rolling back state or throwing a profile exception.
No controls returns. Rebuilds offsets and zeroes all conventional LID stores, then seeds opted units concentration*water ft3 and books initial user mass with28.317*mcf. Requires BULK-only system, full subcatchment coverage and every unit opted; tolerates .1coverage mismatch floor. No water or clock advance. Shape/index/finite preconditions and signed products must qualify; allocation may throw after reset/earlier mass bookings. Exclusive initial lifecycle, not safe to repeat on evolved or already-ledgered owner without corresponding reset.
Here is the call graph for this function:

◆ mobileWater()

double openswmm::msxlid::mobileWater ( const SimulationContext & c,
int node,
double fallback )

Read the retained native LID-node mobile water history with caller fallback.

Parameters
[in]cStable storage mapping/opt-in and prepared node_mobile_old.
[in]nodeValid native node ID for mapping.
[in]fallbackCaller native ft3 value when no enabled/retained owner.
Returns
Stored old mobile ft3 or fallback, without validating finite/positive value. No mutation/allocation.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ outlet()

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.

Parameters
[in]cStable native storage mapping and node_outlet arrays.
[in]nodeValid native node ID.
[in]linkValid nonnegative native link index.
[in]speciesValid zero-based reaction row below n_species (not individually bounds checked).
[in]fallbackNative concentration when no covered finite exported port value.
Returns
Finite prepared outlet concentration or fallback. No lookup refresh, receipt consumption, allocation, physical/clock mutation; caller retains matching completed hydraulic port phase.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ prepareNodes()

void openswmm::msxlid::prepareNodes ( SimulationContext & c,
double dt )

Replay accepted native LID water transfers into layer/mobile species inventories before routing.

Parameters
[in,out]cPrepared 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]dtPositive finite accepted hydraulic interval s; nonpositive/NaN/no opt-ins returns.
Note
Requires consistent native node/link/layer/species shapes and one owner for completed transfer receipt. Reconstructs old layer/mobile ft3, partitions external incoming mass into capture, internal layer/mobile transfers, massless evaporation and seepage. External capture removes its rate share and books MSX inflow; ports with negative volume export layer donor concentration by link, retain NaN sentinel on unowned links. Publishes remaining mobile concentration/history; Richards surface mass is paired into mobile first. No hydraulic water/clock advance, receipt arrays not cleared here. Changes ledgers/stores progressively, can allocate/throw without rollback; exactly-once accepted receipt replay and exclusive context/native workspace required. Missing old-water shape skips node.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ publishUnits()

void openswmm::msxlid::publishUnits ( SimulationContext & c,
double dt )

Publish conventional reactive LID surface export as accepted subcatchment runoff concentration.

Parameters
[in,out]cPrepared 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]dtPositive finite matching accepted runoff duration s, not independently validated.
Note
For each reactive source, divides export+old carry by positive runoff*dt ft3, else publishes0 and retains all as carry. Does not clear surface_export, so repeated calls before routeUnits clears it can duplicate carry. No physical water/global ledger/clock update or allocation; exclusive owner, qualified extents and exactly-once publication chronology required.
Here is the call graph for this function:

◆ reactedSubcatchment()

bool openswmm::msxlid::reactedSubcatchment ( const SimulationContext & c,
int sc )

Test the prepared conventional-LID reactive subcatchment mask.

Parameters
[in]cStable reaction lid state.
[in]scZero-based subcatchment identity; invalid returnsfalse.
Returns
True for covered nonzero mask, independent of current wetness or reaction result. Read-only, allocation-free; does not activate, qualify or advance owner.
Here is the caller graph for this function:

◆ reactNodes()

void openswmm::msxlid::reactNodes ( SimulationContext & c,
double dt )

React native LID-node held layer pools and weighted mobile water portions once per interval.

Parameters
[in,out]cPrepared opted-in native storage geometry/optional Richards moisture, layer/node species inventories, compiled reaction laws and armed MSX reacted/clamped ledgers.
[in]dtPositive finite reaction duration s; reactPool handles nonpositive/no-water skips.
Note
No control opt-ins returns. Reacts each held cell with current volume/temperature; partitions positive native mobile water among eligible pore deficits, only surface cells for Richards, then recombines species deltas at original concentration. Books accepted signed reacted/clamped outputs; failed reactPool retains unreacted mass and warning, other pools can proceed. No hydraulic water, engine clock update or duplicate generic native reaction step should occur for the same ownership. Allocates scratch/mutates pools+ledgers progressively, may throw without rollback; exclusive prepared context/row/layer extents and once-only accepted reaction phase required.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ reactPool()

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.

Parameters
[in,out]cPrepared compiled reaction metadata/workspace identities; may append one failure warning or negative-rate clamp diagnostics. No hydraulic water or engine clock mutation.
[in]controlValid native LID control ID selecting laws.
[in]layerLayer selector; applies all-layer0 first then specific layer with later row wins.
[in]volumeFinite native water ft3; volume<=quality::ZERO_VOLUME or NaN returns success/no reaction.
[in,out]massWritable 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]dtPositive finite reaction interval s; nonpositive/NaN returns success/no reaction.
[in]tempHeld reaction temperature degC (temperature in declaration), passed as TEMP variable.
[out]reactedResized/reset n_species, then signed (before-after)*volume on accepted kinetics.
[out]clampedResized/reset n_species, then positive inventory added when negative RATE result is floored0. Other negative forms/nonfinite values refuse the solve.
Returns
True for skipped/no-law or accepted solve; false for integrator/value refusal, retaining physical mass and zeroed result arrays. Warns once per context on failed solve; transport callers may still continue water/native transfers after false.
Note
Builds private concentration/forms/spans/workspace, accepts only finite results and signed RATE intermediate, then installs clipped mass. No generic law-index/extent/input-finite validation. Allocation/integrator/warning operations may throw; failure during final clamp warnings may follow partial accepted mass updates. Exclusive reaction/context/output ownership and prepared row extents.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ receive()

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.

Parameters
[in,out]cPrepared enabled native LID-node layers, positive incoming quality ports and matching writable layer species inventories.
[in]nodeValid native storage node ID.
[in]linkValid native link identity matched against prepared ports.
[in]waterPositive finite total matching incoming hydraulic water ft3, denominator for port share.
[in]speciesValid nonnegative reaction row below n_species, unchecked.
[in]rateNative concentration*ft3/s incoming mass rate (named mass in declaration), negative floored0; no generic finite input check.
[in]dtPositive finite accepted interval s, used to convert captured rate into stored inventory.
Returns
Accepted native mass rate, not interval mass, or0 for disabled/nonpositive water/no positive matching port. Uses clamp(port.volume/water,0,1) and stops at first match.
Note
Adds rate*dt to existing layer mass, no hydraulic water/global ledger/clock change or receipt clear. No allocation/rollback; exclusive native owner and matching exactly-once port chronology.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ routeUnits()

void openswmm::msxlid::routeUnits ( SimulationContext & c,
const lid::LIDSolver & solver,
double dt )

Route/react native species through one accepted conventional LID hydraulic interval.

Parameters
[in,out]cPrepared 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]solverStable matching groups with accepted layer inflow/evaporation/surface/drain rates, infiltration depth and completed water storage, same unit order as initialized offsets.
[in]dtPositive finite accepted interval s; no controls/offsets/nonpositive/NaN returns.
Note
Rebuilds active footprint, clears this-step exports, distributes rainfall/runon into first present layer and processes top-to-bottom mixed donor transfers. Reactions run only for old/current layer water>.0353147ft3 using held finite layer temperature or default; false kinetics retains unreacted mass but transport continues. Internal/outlet/infiltration exports share finite mixed pool; evaporation removes water only. Native pools use concentration*ft3, user mass ledger conversion 28.317L/ft3*mcf. Does not advance hydraulic water/engine clock or publish final runoff concentration. Allocates and updates progressively; no generic shape/finite/profile validation or rollback. Requires exactly-once completed hydraulic receipt ownership, exclusive native/context state and compiled laws.
Here is the call graph for this function: