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

Classes

struct  Block
 

Functions

void step (SimulationContext &ctx, Block &b, double dt_runoff, double old_runoff_time) noexcept
 Advance one species family's buildup/sweeping/washoff and pre-LID complete-mix concentration.
 
void bookPostLid (SimulationContext &ctx, Block &b, double dt_runoff, const std::vector< double > &lid_infil_vol) noexcept
 Book one accepted family's post-LID losses and delivered runoff load using pre-LID concentration.
 

Function Documentation

◆ bookPostLid()

void openswmm::surfacespecies::bookPostLid ( SimulationContext & ctx,
Block & b,
double dt_runoff,
const std::vector< double > & lid_infil_vol )
noexcept

Book one accepted family's post-LID losses and delivered runoff load using pre-LID concentration.

Parameters
[in,out]ctxPrepared accepted post-LID subcatchment runoff/drain flows, retained pre-LID washoff_vout1 and outlet topology. Reads water state without advancing its clock.
[in,out]bMatching family arrays from step(): conc/total_load n_subcatch*n, mcf and used ledgers n, optional LID-reactor mask n_subcatch. Required pointers/extents remain stable/live and writable destinations exclusive; mcf converts concentration mass into declared user mass.
[in]dt_runoffPositive finite accepted runoff interval s matching pre-LID step and water solve.
[in]lid_infil_volAt least n_subcatch finite nonnegative native soil infiltration volumes ft3 for this same LID interval; not a rate and not consumed/cleared by this helper.
Note
Returns for no species/subcatchments or ignore_quality. Skips nonpositive-area sources. Ordinary closure bounds infiltration by captured pre/post-LID lost volume, books remaining captured load as BMP removal, accumulates total source load from surface+drain outflow, and books system runoff only for outlet-node/self-outlet sources using surface runoff volume. Explicit LID-reactor sources instead book their accepted concentration*surface runoff directly, leaving reactor losses with that owner. Uses28.317L/ft3 and mcf; downstream subcatchment discharge is not booked twice. No array resize/general validation, physical inventory removal, state clamp or calendar advance; counts every call, so invoke exactly once after matching LID/water step. Progressive shared ledger updates require serial/external synchronization; noexcept dependencies must not throw.

Post-LID load bookings (legacy surfqual_getWashoff's tail): the captured volume split into LID infiltration and BMP removal, the outflow load, and the runoff ledger. lid_infil_vol[sc] is the LID units' infiltration volume this step (ft3).

Here is the caller graph for this function:

◆ step()

void openswmm::surfacespecies::step ( SimulationContext & ctx,
Block & b,
double dt_runoff,
double old_runoff_time )
noexcept

Advance one species family's buildup/sweeping/washoff and pre-LID complete-mix concentration.

Parameters
[in,out]ctxPrepared runoff subcatchment water/coverage/unit/geometry and table state. Writes shared per-subcatchment washoff_vout1 ft3 when sized, and may advance external-buildup table lookup cursor. Native water arrays themselves and engine calendar are not advanced.
[in,out]bBorrowed family arrays with n species, nlu landuses: bu/wo params nlu*n; buildup n_subcatch*nlu*n; conc/ponded/runon rate n_subcatch*n; mcf/rain/snow flags and each used ledger n. Optional co_pollut/co_frac pair, reacted ponded mass/mask, LID-reactor mask and sweeping triple follow the Block field contracts. Required pointers remain nonnull even with no landuses when their fields are accessed; all counts/products/indices and finite parameters must already qualify.
[in]dt_runoffPositive finite accepted runoff duration s; buildup time converted to days.
[in]old_runoff_timeFinite elapsed runoff interval start s, converted from start_date to absolute DateTime for external-buildup time series.
Note
n<=0 returns. Uses area-normalized project land area/curb length, dry/snow buildup gates, planned sweeping before washoff, EMC/exponential/rating laws and buildup donor cap. Mixes native rain/runon/old ponded water over non-LID area, books infiltration/BMP/deposition and closes stored mass with legacy concentration-depth or optional reacted residual-mass policy. Adds LID-footprint rain/full-cover runon only when no explicit LID reactor owns it; single forward co-pollutant pass adds generated buildup load after all species. Wet deposition runs even without landuses.

Water flow ft3/s, rainfall/infiltration ft/s, depths ft and volumes ft3; concentration mass uses 28.317 L/ft3, ledgers/total buildup use mcf conversion to declared user mass, age/thermal species are not generic pollutant mass here. Writes b.conc as native mass/L over pre-LID dilution volume; post-LID runoff load booking is separate and must follow the hydraulic LID update once. No global ignore_quality guard here: caller gates family eligibility. Updates arrays/ledgers progressively with no rollback or complete shape/finite validation. Declared noexcept means an unexpected dependency/allocation exception terminates; exclusive family/context/table-cursor use and accepted-step chronology required, no physical reaction kinetics executed here.

Buildup, washoff and the washoff concentration for one runoff step (legacy surfqual_getBuildup + surfqual_getWashoff). Runs before the LID units; writes subcatches.washoff_vout1 (shared by every family).

Here is the call graph for this function:
Here is the caller graph for this function: