OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
MsxSurfaceQuality.hpp File Reference

BW-MSX (2026-09-19) — buildup, washoff and street sweeping of the reactions component's (MSX) species on subcatchment surfaces. More...

#include <string>
#include <vector>
Include dependency graph for MsxSurfaceQuality.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  openswmm
 
namespace  openswmm::msxsurf
 

Functions

double openswmm::msxsurf::speciesUnitFactor (const std::string &units, const SimulationOptions &opts)
 Map a species unit prefix to its concentration-mass to user-mass factor.
 
bool openswmm::msxsurf::active (const SimulationContext &ctx) noexcept
 Read whether the resolved surface species store is active.
 
std::vector< std::string > openswmm::msxsurf::resolve (SimulationContext &ctx)
 Resolve named surface rows then activate rainfall/reaction-only species storage.
 
void openswmm::msxsurf::refreshDerived (SimulationContext &ctx) noexcept
 Recalculate analytic buildup saturation times after a parameter edit.
 
void openswmm::msxsurf::initState (SimulationContext &ctx)
 Reset native surface state and seed initial dry buildup from loadings or dry days.
 
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.
 
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.
 
void openswmm::msxsurf::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 openswmm::msxsurf::rollLidDrain (SimulationContext &ctx) noexcept
 Retain current node underdrain species rates as previous step then clear current rates.
 
void openswmm::msxsurf::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 openswmm::msxsurf::consumeLidDrainRunon (SimulationContext &ctx, int receiver) noexcept
 Move queued LID underdrain species run-on into one receiver and clear that queue.
 
void openswmm::msxsurf::activateForRain (SimulationContext &ctx) noexcept
 Enable native surface storage needed by rainfall or scoped reaction/LID laws.
 
void openswmm::msxsurf::resolveLidRemovals (SimulationContext &ctx, std::vector< std::string > &warnings)
 Bind by-name LID removals to pollutant or native species identities.
 
double openswmm::msxsurf::remainingBuildup (const SimulationContext &ctx, int m) noexcept
 Sum retained surface and conventional-LID species inventory for final user-mass reporting.
 
void openswmm::msxsurf::clearRunon (SimulationContext &ctx) noexcept
 Clear every native surface species run-on mass-rate entry before assembly.
 
void openswmm::msxsurf::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 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.
 

Detailed Description

BW-MSX (2026-09-19) — buildup, washoff and street sweeping of the reactions component's (MSX) species on subcatchment surfaces.

The pollutant surface-quality step (SWMMEngine::stepSurfaceQuality, the A7 sweeping block and QualitySolver::addWetWeatherLoads) is keyed by pollutant index throughout. This module runs the SAME arithmetic — buildup accrual through the inverse-days form (POW / EXP / SAT / EXT), washoff EXP / RC / EMC with legacy's unit pre-multiplies, the available-buildup cap, the "no buildup function" ledger branch, BMP removal, and the per-(subcatchment, land use) sweeping schedule — over a separate MSX-keyed store (ReactionData::surface, MsxSurfaceData), and delivers the washoff into ReactionData::msx_ext_mass_in, the rate the ARD engine, the legacy MSX dispatch and LARD already consume for external species loads.

Rainfall concentrations, ponded mixing/reactions, scoped dry-buildup kinetics and opted-in LID species inventories are supported. Co-pollutant fraction coupling remains pollutant-only. The shared kernel partitions accepted reacted ponded mass among water destinations.

Units: buildup is user mass (lbs / kg) per normalizer unit; the per-species factor mcf converts concentration-mass to user mass from the species' declared units (D-A27: MG → UCF(MASS), UG → UCF(MASS)/1000, anything else → 1).

Design: plans/transport/OVERLAND_TRANSPORT_HEAT_MSX_PLAN_2026-09-01.md §8.9.

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
License
Apache-2.0