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

Resolved MSX surface-quality parameters and state. More...

#include <MsxSurfaceData.hpp>

Collaboration diagram for openswmm::MsxSurfaceData:

Public Member Functions

bool active () const noexcept
 Test whether resolved MSX surface state has at least one species.
 
std::size_t pidx (int lu, int m) const noexcept
 Calculate a land-use-major parameter matrix index.
 
std::size_t bu_idx (int sc, int lu, int m) const noexcept
 Calculate a subcatchment/land-use/species buildup index.
 
std::size_t sidx (int sc, int m) const noexcept
 Calculate a subcatchment-major species matrix index.
 
void resize_params (int nlu, int nm)
 Replace resolved MSX buildup/washoff parameter matrices.
 
void resize_state (int nsc)
 Replace MSX subcatchment state and continuity ledgers with zero arrays.
 

Public Attributes

MsxSurfaceRows rows
 parse-time, by name
 
int n_landuses = 0
 
int n_species = 0
 MSX species count at resolve time.
 
int n_subcatch = 0
 
std::vector< int > bu_type
 0=NONE,1=POW,2=EXP,3=SAT,4=EXT
 
std::vector< double > bu_c1
 
std::vector< double > bu_c2
 
std::vector< double > bu_c3
 EXT: c3 = time-series index.
 
std::vector< int > bu_normalizer
 0=PER_AREA, 1=PER_CURB
 
std::vector< double > bu_max_days
 derived (99.9 % of max)
 
std::vector< int > wo_type
 0=NONE,1=EXP,2=RC,3=EMC
 
std::vector< double > wo_coeff
 
std::vector< double > wo_expon
 
std::vector< double > wo_sweep_effic
 
std::vector< double > wo_bmp_effic
 
std::vector< double > init_loading
 
std::vector< double > mcf
 D-A27: MG → UCF(MASS), UG → /1000, else 1.
 
std::vector< double > buildup
 bu_idx(sc, lu, m), per normalizer unit
 
std::vector< double > washoff_conc
 
std::vector< double > washoff_conc_old
 
std::vector< double > ponded_qual
 
std::vector< double > runon_qual_rate
 
std::vector< double > c_rain
 
std::vector< bool > snow_only
 
std::vector< double > lid_rmvl
 
std::vector< double > lid_drain_load
 
std::vector< double > lid_drain_load_old
 
std::vector< double > lid_drain_runon_load
 [sc * n_species + m] the species twin of SubcatchData::lid_drain_runon_qual.
 
std::vector< double > led_init_buildup
 
std::vector< double > led_buildup
 net accrual over the run
 
std::vector< double > led_runoff_load
 delivered to the network
 
std::vector< double > led_sweeping
 
std::vector< double > led_bmp_removal
 
std::vector< double > led_wet_deposition
 rainfall concentration × rain volume
 
std::vector< double > led_infil_loss
 infiltrated from ponded water and LID units
 
std::vector< double > led_reacted
 signed wet-pool reaction loss, user mass
 
std::vector< double > led_reaction_clamped
 numerical addition after a negative RATE
 
std::vector< double > led_ponded_lost
 ponded mass written off when a surface dried
 
std::vector< double > led_subcatch_load
 [sc * n_species + m], per-subcatchment total (report)
 
bool resolved = false
 

Detailed Description

Resolved MSX surface-quality parameters and state.

Index conventions (nlu = land uses, nm = MSX species, nsc = subcatchments):

  • parameters: [lu * nm + m]
  • buildup state: bu_idx(sc, lu, m) = (sc * nlu + lu) * nm + m (mass per normalizer unit — user mass per acre/ha or per curb unit — the SurfaceQualitySoA convention)
  • per-(sc, m) washoff concentration: [sc * nm + m] (concentration units)
  • ledgers per species [m] in USER MASS (lbs / kg), the mass_balance.qual_* convention.

Member Function Documentation

◆ active()

bool openswmm::MsxSurfaceData::active ( ) const
inlinenoexcept

Test whether resolved MSX surface state has at least one species.

Returns
resolved && n_species>0; land-use/subcatchment counts may still be zero.
Here is the caller graph for this function:

◆ bu_idx()

std::size_t openswmm::MsxSurfaceData::bu_idx ( int sc,
int lu,
int m ) const
inlinenoexcept

Calculate a subcatchment/land-use/species buildup index.

Parameters
[in]scExisting subcatchment index in [0,n_subcatch).
[in]luExisting land-use index.
[in]mExisting MSX species index.
Returns
(sc*n_landuses+lu)*n_species+m; unchecked, caller ensures dimensions and arithmetic.

◆ pidx()

std::size_t openswmm::MsxSurfaceData::pidx ( int lu,
int m ) const
inlinenoexcept

Calculate a land-use-major parameter matrix index.

Parameters
[in]luExisting land-use index in [0,n_landuses).
[in]mExisting species index in [0,n_species).
Returns
lu*n_species+m; unchecked, caller ensures bounds and size_t arithmetic.

◆ resize_params()

void openswmm::MsxSurfaceData::resize_params ( int nlu,
int nm )
inline

Replace resolved MSX buildup/washoff parameter matrices.

Stores counts, defaults all functions/coefficients to zero, PER_AREA normalizers, mcf=1 and snow_only=false. Preserves c_rain only when its existing length equals nm. Does not clear authored rows, resolved flag or runtime state; caller rebuilds those as needed. No transactional allocation rollback.

Parameters
[in]nluNonnegative land-use count.
[in]nmNonnegative species count; size_t products must fit.

◆ resize_state()

void openswmm::MsxSurfaceData::resize_state ( int nsc)
inline

Replace MSX subcatchment state and continuity ledgers with zero arrays.

Zeroes buildup, current/old concentrations, ponded/run-on loads, LID run-on and all per-species/subcatchment ledgers. Preserves initial loading only when shape matches. Does not resize lid_rmvl or node LID drain load arrays, alter parameter matrices or set resolved. Allocation failure can leave partial state.

Parameters
[in]nscNonnegative subcatchment count; configured land-use/species dimensions and products must be valid.

◆ sidx()

std::size_t openswmm::MsxSurfaceData::sidx ( int sc,
int m ) const
inlinenoexcept

Calculate a subcatchment-major species matrix index.

Parameters
[in]scExisting subcatchment index.
[in]mExisting MSX species index.
Returns
sc*n_species+m; unchecked, caller ensures bounds and size_t arithmetic.

Member Data Documentation

◆ bu_c1

std::vector<double> openswmm::MsxSurfaceData::bu_c1

◆ bu_c2

std::vector<double> openswmm::MsxSurfaceData::bu_c2

◆ bu_c3

std::vector<double> openswmm::MsxSurfaceData::bu_c3

EXT: c3 = time-series index.

◆ bu_max_days

std::vector<double> openswmm::MsxSurfaceData::bu_max_days

derived (99.9 % of max)

◆ bu_normalizer

std::vector<int> openswmm::MsxSurfaceData::bu_normalizer

0=PER_AREA, 1=PER_CURB

◆ bu_type

std::vector<int> openswmm::MsxSurfaceData::bu_type

0=NONE,1=POW,2=EXP,3=SAT,4=EXT

◆ buildup

std::vector<double> openswmm::MsxSurfaceData::buildup

bu_idx(sc, lu, m), per normalizer unit

◆ c_rain

std::vector<double> openswmm::MsxSurfaceData::c_rain

Per species: rainfall concentration (0 = rain falls clean) and the snow-only buildup flag (species have none; kept so the kernel reads the same fields for every family).

◆ init_loading

std::vector<double> openswmm::MsxSurfaceData::init_loading

◆ led_bmp_removal

std::vector<double> openswmm::MsxSurfaceData::led_bmp_removal

◆ led_buildup

std::vector<double> openswmm::MsxSurfaceData::led_buildup

net accrual over the run

◆ led_infil_loss

std::vector<double> openswmm::MsxSurfaceData::led_infil_loss

infiltrated from ponded water and LID units

◆ led_init_buildup

std::vector<double> openswmm::MsxSurfaceData::led_init_buildup

◆ led_ponded_lost

std::vector<double> openswmm::MsxSurfaceData::led_ponded_lost

ponded mass written off when a surface dried

◆ led_reacted

std::vector<double> openswmm::MsxSurfaceData::led_reacted

signed wet-pool reaction loss, user mass

◆ led_reaction_clamped

std::vector<double> openswmm::MsxSurfaceData::led_reaction_clamped

numerical addition after a negative RATE

◆ led_runoff_load

std::vector<double> openswmm::MsxSurfaceData::led_runoff_load

delivered to the network

◆ led_subcatch_load

std::vector<double> openswmm::MsxSurfaceData::led_subcatch_load

[sc * n_species + m], per-subcatchment total (report)

◆ led_sweeping

std::vector<double> openswmm::MsxSurfaceData::led_sweeping

◆ led_wet_deposition

std::vector<double> openswmm::MsxSurfaceData::led_wet_deposition

rainfall concentration × rain volume

◆ lid_drain_load

std::vector<double> openswmm::MsxSurfaceData::lid_drain_load

◆ lid_drain_load_old

std::vector<double> openswmm::MsxSurfaceData::lid_drain_load_old

◆ lid_drain_runon_load

std::vector<double> openswmm::MsxSurfaceData::lid_drain_runon_load

[sc * n_species + m] the species twin of SubcatchData::lid_drain_runon_qual.

◆ lid_rmvl

std::vector<double> openswmm::MsxSurfaceData::lid_rmvl

LID underdrain removal fraction [control * n_species + m] (from the LID REMOVALS rows that name a species), and the underdrain species load each node receives [node * n_species + m] (concentration mass / s) for this and the previous runoff step — the mirrors of LIDGroupSoA::drain_rmvl and NodeData::lid_drain_qual_load(_old).

◆ mcf

std::vector<double> openswmm::MsxSurfaceData::mcf

D-A27: MG → UCF(MASS), UG → /1000, else 1.

◆ n_landuses

int openswmm::MsxSurfaceData::n_landuses = 0

◆ n_species

int openswmm::MsxSurfaceData::n_species = 0

MSX species count at resolve time.

◆ n_subcatch

int openswmm::MsxSurfaceData::n_subcatch = 0

◆ ponded_qual

std::vector<double> openswmm::MsxSurfaceData::ponded_qual

Multispecies Phase 2: the pollutant kernel's ponded-water species mass [sc * n_species + m] (concentration mass) and run-on load rate (concentration mass / s), the mirrors of SubcatchData::ponded_qual and runon_qual_rate.

◆ resolved

bool openswmm::MsxSurfaceData::resolved = false

◆ rows

MsxSurfaceRows openswmm::MsxSurfaceData::rows

parse-time, by name

◆ runon_qual_rate

std::vector<double> openswmm::MsxSurfaceData::runon_qual_rate

◆ snow_only

std::vector<bool> openswmm::MsxSurfaceData::snow_only

◆ washoff_conc

std::vector<double> openswmm::MsxSurfaceData::washoff_conc

[sc * n_species + m], conc units (mg/L-like)

◆ washoff_conc_old

std::vector<double> openswmm::MsxSurfaceData::washoff_conc_old

Previous runoff step's washoff_conc, the "old" end of the routing-step interpolation the delivery seam does. The pollutant mirror of this is SubcatchData::conc_old, rolled by SubcatchData::save_state(); this one is rolled beside it, on the same runoff cadence.

◆ wo_bmp_effic

std::vector<double> openswmm::MsxSurfaceData::wo_bmp_effic

◆ wo_coeff

std::vector<double> openswmm::MsxSurfaceData::wo_coeff

◆ wo_expon

std::vector<double> openswmm::MsxSurfaceData::wo_expon

◆ wo_sweep_effic

std::vector<double> openswmm::MsxSurfaceData::wo_sweep_effic

◆ wo_type

std::vector<int> openswmm::MsxSurfaceData::wo_type

0=NONE,1=EXP,2=RC,3=EMC


The documentation for this struct was generated from the following file: