![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
Functions | |
| double | speciesUnitFactor (const std::string &units, const SimulationOptions &opts) |
| Map a species unit prefix to its concentration-mass to user-mass factor. | |
| bool | active (const SimulationContext &ctx) noexcept |
| Read whether the resolved surface species store is active. | |
| void | resolveLidRemovals (SimulationContext &ctx, std::vector< std::string > &warnings) |
| Bind by-name LID removals to pollutant or native species identities. | |
| void | activateForRain (SimulationContext &ctx) noexcept |
| Enable native surface storage needed by rainfall or scoped reaction/LID laws. | |
| std::vector< std::string > | resolve (SimulationContext &ctx) |
| Resolve named surface rows then activate rainfall/reaction-only species storage. | |
| void | refreshDerived (SimulationContext &ctx) noexcept |
| Recalculate analytic buildup saturation times after a parameter edit. | |
| void | initState (SimulationContext &ctx) |
| Reset native surface state and seed initial dry buildup from loadings or dry days. | |
| void | step (SimulationContext &ctx, double dt_runoff, double old_runoff_time) |
| Advance native dry/wet species reactions and shared surface buildup/washoff once. | |
| void | bookPostLid (SimulationContext &ctx, double dt_runoff, const std::vector< double > &lid_infil_vol) |
| Book native species deposition/infiltration and runoff after conventional LID routing. | |
| void | addLidDrain (SimulationContext &ctx, int control, int sc, int node, double drain_cfs, bool to_perv, bool runoff_load, double dt_runoff, const double *source) noexcept |
| Queue one conventional LID underdrain species export and optional runoff/BMP mass bookings. | |
| void | addLidDrainRunon (SimulationContext &ctx, int control, int sc, int receiver, double drain_cfs, bool to_perv, bool runoff_load, double dt_runoff, const double *source) noexcept |
| Queue one conventional LID underdrain species export and optional runoff/BMP mass bookings. | |
| void | consumeLidDrainRunon (SimulationContext &ctx, int receiver) noexcept |
| Move queued LID underdrain species run-on into one receiver and clear that queue. | |
| void | rollLidDrain (SimulationContext &ctx) noexcept |
| Retain current node underdrain species rates as previous step then clear current rates. | |
| double | remainingBuildup (const SimulationContext &ctx, int m) noexcept |
| Sum retained surface and conventional-LID species inventory for final user-mass reporting. | |
| void | clearRunon (SimulationContext &ctx) noexcept |
| Clear every native surface species run-on mass-rate entry before assembly. | |
| void | addRunon (SimulationContext &ctx, int donor, int receiver, double q) noexcept |
| Add donor previous-runoff species concentration to one receiver's run-on mass rate. | |
| void | deliver (SimulationContext &ctx, double dt_routing) |
Deliver this routing step's washoff into msx_ext_mass_in (+= interpolated old/new runoff mass rate per outlet node, the addWetWeatherLoads trapezoid on old/new runoff). Call after the external-inflow assembly has (re)zeroed the array for the step. | |
|
noexcept |
Enable native surface storage needed by rainfall or scoped reaction/LID laws.
| [in,out] | ctx | Configured native species and final land-use/subcatchment counts; may resize parameters and initial loading, set conversion factors/derived limits and mark resolved. |
Set the store up for a species that only rains in (called by resolve and initState).
|
noexcept |
Read whether the resolved surface species store is active.
True once rows resolved to at least one MSX species with a land use.
| [in] | ctx | Stable reaction surface dimensions/resolution flag. |
|
noexcept |
Queue one conventional LID underdrain species export and optional runoff/BMP mass bookings.
| [in,out] | ctx | Active surface concentrations, removal fractions, conversion factors and ledgers. |
| [in] | control | LID control ID; missing/invalid removal tuple uses fraction0, without clamping. |
| [in] | sc | Valid source subcatchment ID, required when source is null or source-ledger booking occurs. |
| [in] | node | Native destination node ID; invalid returns before state access. |
| [in] | drain_cfs | Accepted underdrain flow ft3/s, caller validates sign/finite value. |
| [in] | to_perv | True suppresses runoff/BMP/user-load bookings; destination queue still receives rate. |
| [in] | runoff_load | True books positive post-removal load as runoff when not routed to pervious land. |
| [in] | dt_runoff | Matching accepted runoff duration s used only for mass bookings. |
| [in] | source | Optional borrowed n_species underdrain concentrations; null uses source washoff. When supplied, books source total load as well. Must remain stable and not alias writable ledgers. |
LID underdrain species load from one unit (the A6b drain loop's species half), and the per-runoff-step roll of those loads.
|
noexcept |
Queue one conventional LID underdrain species export and optional runoff/BMP mass bookings.
| [in,out] | ctx | Active surface concentrations, removal fractions, conversion factors and ledgers. |
| [in] | control | LID control ID; missing/invalid removal tuple uses fraction0, without clamping. |
| [in] | sc | Valid source subcatchment ID, required when source is null or source-ledger booking occurs. |
| [in] | receiver | Destination subcatchment ID; invalid returns. Covered run-on tuples accumulate concentration-mass/s using28.317L/ft3; queue is not resized here. |
| [in] | drain_cfs | Accepted underdrain flow ft3/s, caller validates sign/finite value. |
| [in] | to_perv | True suppresses runoff/BMP/user-load bookings; destination queue still receives rate. |
| [in] | runoff_load | True books positive post-removal load as runoff when not routed to pervious land. |
| [in] | dt_runoff | Matching accepted runoff duration s used only for mass bookings. |
| [in] | source | Optional borrowed n_species underdrain concentrations; null uses source washoff. When supplied, books source total load as well. Must remain stable and not alias writable ledgers. |
A LID underdrain routed to another subcatchment: the species join that subcatchment's run-on (next runoff step), as the water does.
|
noexcept |
Add donor previous-runoff species concentration to one receiver's run-on mass rate.
| [in,out] | ctx | Active surface old washoff concentration and writable runon arrays, matching dimensions. |
| [in] | donor | Valid nonnegative subcatchment index; source tuple must be covered. |
| [in] | receiver | Valid nonnegative destination subcatchment index; destination tuple must be covered. |
| [in] | q | Routed runoff ft3/s; sign/finite value is not validated or clamped. |
| void openswmm::msxsurf::bookPostLid | ( | SimulationContext & | ctx, |
| double | dt_runoff, | ||
| const std::vector< double > & | lid_infil_vol ) |
Book native species deposition/infiltration and runoff after conventional LID routing.
| [in,out] | ctx | Active resolved native surface stores and matching accepted LID/runoff hydraulics; receives shared-kernel user-mass ledgers. |
| [in] | dt_runoff | Matching positive finite runoff interval s, caller qualified. |
| [in] | lid_infil_vol | Per-subcatchment accepted LID infiltration volumes ft3, covered for all sources. |
Post-LID bookings for the species, after the LID units have run (SWMMEngine::bookWashoffLoads' species half).
|
noexcept |
Clear every native surface species run-on mass-rate entry before assembly.
Run-on, beside the pollutant lines in SWMMEngine::assembleRunon.
| [in,out] | ctx | Writable surface runon_qual_rate, regardless of active flag. |
|
noexcept |
Move queued LID underdrain species run-on into one receiver and clear that queue.
| [in,out] | ctx | Active surface store with matching runon and underdrain queue extents. |
| [in] | receiver | Valid nonnegative subcatchment ID, with products fitting indexing types. |
| void openswmm::msxsurf::deliver | ( | SimulationContext & | ctx, |
| double | dt_routing ) |
Deliver this routing step's washoff into msx_ext_mass_in (+= interpolated old/new runoff mass rate per outlet node, the addWetWeatherLoads trapezoid on old/new runoff). Call after the external-inflow assembly has (re)zeroed the array for the step.
| [in,out] | ctx | Native node inflow destination and matching accepted surface/LID histories. |
| [in] | dt_routing | Unused routing duration s, retained for routing-dispatch interface consistency. |
| void openswmm::msxsurf::initState | ( | SimulationContext & | ctx | ) |
Reset native surface state and seed initial dry buildup from loadings or dry days.
Size the state and seed initial buildup: [LOADINGS] row when given, else the land use's function at [OPTIONS] DRY_DAYS (legacy landuse_getInitBuildup).
| [in,out] | ctx | Resolved species/land-use parameters, final coverage percentages, user-unit areas/curb lengths and DRY_DAYS. May activate rain-only storage, then resize/reset state/ledgers. |
|
noexcept |
Recalculate analytic buildup saturation times after a parameter edit.
Re-derive bu_max_days after a parameter edit (C API).
| [in,out] | ctx | Parallel surface bu_type/c1/c2/c3/max_days arrays with equal covered extents. Writes max_days for each configured row: exponential .1-percent remainder time, power cap time, saturation999*c3, otherwise0. |
|
noexcept |
Sum retained surface and conventional-LID species inventory for final user-mass reporting.
| [in] | ctx | Stable matching coverage, user-unit geometry, normalizers, conversion factors and surface/conventional-LID storage; all parallel configured extents prepared. |
| [in] | m | Zero-based native species; inactive/invalid yields0. |
Species m left on the land at the end (user mass), the qual_final_buildup row of the pollutants.
| std::vector< std::string > openswmm::msxsurf::resolve | ( | SimulationContext & | ctx | ) |
Resolve named surface rows then activate rainfall/reaction-only species storage.
Bind the by-name rows to (land use, species) — call after the reactions component has been applied and the name tables are final.
| [in,out] | ctx | Stable final species, pollutant, land-use, subcatchment and control names; receives resolved parameters/removal tables and activation state. |
| void openswmm::msxsurf::resolveLidRemovals | ( | SimulationContext & | ctx, |
| std::vector< std::string > & | warnings ) |
Bind by-name LID removals to pollutant or native species identities.
Bind LID REMOVALS entries kept by name (called by resolve).
| [in,out] | ctx | Final pollutant/species/LID control names; resets dense control*n_species MSX removals and migrates recognized pollutant rows into each control's indexed pollutant removal list. |
| [in,out] | warnings | Appends unknown-species warnings; preserves previous entries. |
|
noexcept |
Retain current node underdrain species rates as previous step then clear current rates.
| [in,out] | ctx | Surface current/old node*species underdrain rate arrays, even when inactive. |
| double openswmm::msxsurf::speciesUnitFactor | ( | const std::string & | units, |
| const SimulationOptions & | opts ) |
Map a species unit prefix to its concentration-mass to user-mass factor.
| [in] | units | Case-insensitive text: prefixes UG and MG select micrograms and milligrams; all other strings, including count units, select factor1. Prefixes need not occupy the full string. |
| [in] | opts | Unit system used by UCF(MASS). |
D-A27: concentration-mass → user-mass factor from a species' declared units (MG → UCF(MASS), UG → UCF(MASS)/1000, anything else → 1). Shared with the 2D cell store (S7).
| void openswmm::msxsurf::step | ( | SimulationContext & | ctx, |
| double | dt_runoff, | ||
| double | old_runoff_time ) |
Advance native dry/wet species reactions and shared surface buildup/washoff once.
One runoff step: buildup accrual then washoff for every (subcatchment, land use, species); stores the washoff concentration per (subcatchment, species) for delivery. Runs the pollutant kernel (SurfaceSpeciesKernel) over the species store (Multispecies Phase 2).
| [in,out] | ctx | Active resolved surface species, final parameters and completed runoff hydraulics; receives inventories/concentrations, user-mass ledgers and possible reaction warnings. |
| [in] | dt_runoff | Positive finite accepted runoff duration s; inactive/nonpositive/NaN returns. |
| [in] | old_runoff_time | Runoff step start in elapsed simulation seconds for external buildup/sweeps. |