#include <ReactionData.hpp>
|
| bool | lid_enabled (int control) const |
| | Test whether a LID control key occurs in the configured reaction list.
|
| |
| const double * | coefficients (bool link, int element, std::vector< double > &scratch) const |
| | Borrow global coefficients or gather element-specific parameter overrides.
|
| |
| bool | wet_enabled (int sc) const noexcept |
| | Test whether wet surface reactions can apply to one subcatchment.
|
| |
| bool | has_subcatch_reactions () const noexcept |
| | Test whether any global or sparse wet subcatchment reaction is configured.
|
| |
| int | n_species () const noexcept |
| | Count authored reaction species.
|
| |
| int | find_species (std::string_view n) const |
| | Find the first exact-case species name.
|
| |
| int | find_coef (std::string_view n) const |
| | Find the first exact-case coefficient name.
|
| |
| int | find_term (std::string_view n) const |
| | Find the first exact-case term name.
|
| |
| void | clear () |
| | Reset reaction configuration/runtime state while preserving authored surface rows.
|
| |
◆ clear()
| void openswmm::ReactionData::clear |
( |
| ) |
|
|
inline |
Reset reaction configuration/runtime state while preserving authored surface rows.
Moves surface aside, restores default ReactionData fields and moves surface back. Releases compiled pools, species/coefficient/expression lists and runtime concentrations/ledgers. The preserved .inp-authored surface rows require later msxsurf resolution when reapplying a component. Invalidates borrowed references to all replaced storage.
◆ coefficients()
| const double * openswmm::ReactionData::coefficients |
( |
bool | link, |
|
|
int | element, |
|
|
std::vector< double > & | scratch ) const |
|
inline |
Borrow global coefficients or gather element-specific parameter overrides.
Every matching override is applied in row order, so later duplicates win. Caller validates coefficient indices; this helper does not enforce PARAMETER kind. Pointer remains valid until its owning vector changes/dies; scratch copy can allocate/throw.
- Parameters
-
| [in] | link | True selects link overrides, false node overrides. |
| [in] | element | Element key; negative values return global coefficients directly. |
| [out] | scratch | Caller-owned vector overwritten with global coefficients only when overrides exist and element>=0; otherwise preserved. |
- Returns
- Pointer to coef_value or scratch data; length coef_value.size(), and an empty vector may return NULL.
◆ find_coef()
| int openswmm::ReactionData::find_coef |
( |
std::string_view | n | ) |
const |
|
inline |
Find the first exact-case coefficient name.
- Parameters
-
| [in] | n | Borrowed untrimmed name; comparison is byte-exact, including embedded NULs. |
- Returns
- First matching zero-based index, or -1; linear scan.
◆ find_species()
| int openswmm::ReactionData::find_species |
( |
std::string_view | n | ) |
const |
|
inline |
Find the first exact-case species name.
- Parameters
-
| [in] | n | Borrowed untrimmed name; comparison is byte-exact, including embedded NULs. |
- Returns
- First matching zero-based index, or -1; linear scan.
◆ find_term()
| int openswmm::ReactionData::find_term |
( |
std::string_view | n | ) |
const |
|
inline |
Find the first exact-case term name.
- Parameters
-
| [in] | n | Borrowed untrimmed name; comparison is byte-exact, including embedded NULs. |
- Returns
- First matching zero-based index, or -1; linear scan.
◆ has_subcatch_reactions()
| bool openswmm::ReactionData::has_subcatch_reactions |
( |
| ) |
const |
|
inlinenoexcept |
Test whether any global or sparse wet subcatchment reaction is configured.
- Returns
- True for a non-NONE global form or any wet_laws row; does not inspect sparse row forms or compiled status.
◆ lid_enabled()
| bool openswmm::ReactionData::lid_enabled |
( |
int | control | ) |
const |
|
inline |
Test whether a LID control key occurs in the configured reaction list.
- Parameters
-
| [in] | control | Stored LID-control index; no bounds or control-type validation. |
- Returns
- True on the first equal key, false otherwise; linear scan.
◆ n_species()
| int openswmm::ReactionData::n_species |
( |
| ) |
const |
|
inlinenoexcept |
Count authored reaction species.
- Returns
- species_name.size() converted to int; alignment and registry_base are not checked.
◆ wet_enabled()
| bool openswmm::ReactionData::wet_enabled |
( |
int | sc | ) |
const |
|
inlinenoexcept |
Test whether wet surface reactions can apply to one subcatchment.
Sparse form is not checked here; presence of even a NONE law returns true.
- Parameters
-
| [in] | sc | Subcatchment key compared to sparse wet_laws; no model-range validation. |
- Returns
- True if any global subcatch_form is non-NONE or any sparse wet law names sc.
◆ area_units
◆ atol
| double openswmm::ReactionData::atol = 1.0e-6 |
◆ booster_mass
| std::vector<double> openswmm::ReactionData::booster_mass |
◆ buildup_laws
| std::vector<SurfaceLaw> openswmm::ReactionData::buildup_laws |
◆ coef_is_param
| std::vector<uint8_t> openswmm::ReactionData::coef_is_param |
1 = PARAMETER (overridable), 0 = CONSTANT
◆ coef_name
| std::vector<std::string> openswmm::ReactionData::coef_name |
◆ coef_value
| std::vector<double> openswmm::ReactionData::coef_value |
hot (global values; per-element overrides use parameter_overrides below)
◆ compiled
| bool openswmm::ReactionData::compiled = false |
R2 compile pass succeeded.
◆ configured
| bool openswmm::ReactionData::configured = false |
a reactions component applied
◆ coupling
◆ default_temp_c
| double openswmm::ReactionData::default_temp_c = 20.0 |
TEMP's value when no heat-transport temperature exists for the element (HEAT_TRANSPORT off, or state not yet seeded). 20 degC is the standard water-quality reference temperature.
◆ init_elem_idx
| std::vector<int> openswmm::ReactionData::init_elem_idx |
◆ init_elem_is_link
| std::vector<uint8_t> openswmm::ReactionData::init_elem_is_link |
0 = NODE row, 1 = LINK row
◆ init_elem_species
| std::vector<int> openswmm::ReactionData::init_elem_species |
◆ init_elem_value
| std::vector<double> openswmm::ReactionData::init_elem_value |
◆ init_global
| std::vector<double> openswmm::ReactionData::init_global |
◆ lid
◆ lid_controls
| std::vector<int> openswmm::ReactionData::lid_controls |
◆ lid_laws
| std::vector<LidLaw> openswmm::ReactionData::lid_laws |
◆ msx_coupling_queue
| std::vector<double> openswmm::ReactionData::msx_coupling_queue |
Review D1/F21 (2026-10-15): species MASS (conc-units × ft³) handed to a node by the 2D surface drain and the aquifer bed, [node * ns + m]. Drained into msx_ext_mass_in every routing step by the same remaining-span rule as NodeData::coupling_qual_queue (transport::drainMsxCouplingQueue). Empty until a seam books into it.
◆ msx_ext_mass_in
| std::vector<double> openswmm::ReactionData::msx_ext_mass_in |
◆ msx_ledger
◆ msx_link_conc
| std::vector<double> openswmm::ReactionData::msx_link_conc |
◆ msx_node_conc
| std::vector<double> openswmm::ReactionData::msx_node_conc |
◆ parameter_overrides
◆ pattern_timestep
| double openswmm::ReactionData::pattern_timestep = 3600.0 |
seconds, independent of RATE_UNITS
◆ pipe_expr
| std::vector<RxExprSpan> openswmm::ReactionData::pipe_expr |
per species (len 0 ⇒ none)
◆ pipe_expr_src
| std::vector<std::string> openswmm::ReactionData::pipe_expr_src |
◆ pipe_form
◆ rain_conc
| std::vector<double> openswmm::ReactionData::rain_conc |
[REACTION_RAINFALL]: concentration of each species in rainfall, in its own units (0 = rain falls clean). Size n_species. Multispecies Phase 2.
◆ rate_units
◆ registry_base
| int openswmm::ReactionData::registry_base = -1 |
first MSX index in the registry
◆ report_enabled
| std::vector<uint8_t> openswmm::ReactionData::report_enabled |
Native result selection. Empty means all species (legacy default). Selection is retained through species edits and canonical serialization.
◆ reported_species
| std::vector<int> openswmm::ReactionData::reported_species |
◆ rtol
| double openswmm::ReactionData::rtol = 1.0e-4 |
◆ solver
Default integrator.
RK5, not an implicit solver. Measured substeps for one routing step, at the shipping tolerances below and at 1e-10/1e-8:
| case | RK5 | ROS2 | BDF2 |
| first-order decay, default | 5 | 134 | 197 |
| stiff (λ ratio 1e6), default | 2682 | 281 | 408 |
| stiff, atol 1e-10 | 2744 | 26938 | 39693 |
RK5 wins the common case by ~27x. It loses the stiff case at loose tolerance by ~10x but still COMPLETES, with the slow mode exact. At tight tolerance it beats both implicit solvers on the stiff problem, because RK5's step is STABILITY-limited (nearly flat in tolerance) while the Rosenbrock/BDF pairs are ACCURACY-limited and scale as sqrt(tol).
The cliff: RK5 costs about lambda_fast*dt/3.3 substeps, so past lambda_fast*dt ~ 3e5 it hits kMaxSubsteps and fails. That failure is loud and names ROS2/BDF2 as the remedy (ReactionIntegrator's substep-cap message) — a slow default that fails legibly beats an implicit default that is slower everywhere except the stiff-and-loose corner.
◆ source_patterns
| std::vector<SourcePattern> openswmm::ReactionData::source_patterns |
◆ sources
| std::vector<Source> openswmm::ReactionData::sources |
◆ species_atol
| std::vector<double> openswmm::ReactionData::species_atol |
◆ species_is_wall
| std::vector<uint8_t> openswmm::ReactionData::species_is_wall |
◆ species_name
| std::vector<std::string> openswmm::ReactionData::species_name |
◆ species_rtol
| std::vector<double> openswmm::ReactionData::species_rtol |
◆ species_units
| std::vector<std::string> openswmm::ReactionData::species_units |
◆ subcatch_expr
| std::vector<RxExprSpan> openswmm::ReactionData::subcatch_expr |
◆ subcatch_expr_src
| std::vector<std::string> openswmm::ReactionData::subcatch_expr_src |
◆ subcatch_form
◆ subsurface_laws
| std::vector<SubsurfaceLaw> openswmm::ReactionData::subsurface_laws |
◆ surface
BW-MSX (2026-09-19): surface buildup / washoff / sweeping of MSX species — rows parked by name at parse, resolved after this component is applied, stepped beside the pollutant surface-quality step, and delivered into msx_ext_mass_in each routing step. See quality/MsxSurfaceQuality.hpp.
◆ tank_expr
| std::vector<RxExprSpan> openswmm::ReactionData::tank_expr |
◆ tank_expr_src
| std::vector<std::string> openswmm::ReactionData::tank_expr_src |
◆ tank_form
◆ term_expr
| std::vector<RxExprSpan> openswmm::ReactionData::term_expr |
per term, in-order evaluation
◆ term_expr_src
| std::vector<std::string> openswmm::ReactionData::term_expr_src |
◆ term_name
| std::vector<std::string> openswmm::ReactionData::term_name |
◆ timestep
| double openswmm::ReactionData::timestep = 0.0 |
◆ token_pool
| std::vector<RxToken> openswmm::ReactionData::token_pool |
◆ wall_areas
| std::vector<WallArea> openswmm::ReactionData::wall_areas |
◆ wall_geometry
| bool openswmm::ReactionData::wall_geometry = false |
WALL densities use a fixed reference contact area.
◆ warned_negative_clamp
| bool openswmm::ReactionData::warned_negative_clamp = false |
review A2: once-per-run note
◆ warned_react_failure
| bool openswmm::ReactionData::warned_react_failure = false |
◆ wet_laws
| std::vector<SurfaceLaw> openswmm::ReactionData::wet_laws |
The documentation for this struct was generated from the following file:
- /home/runner/work/openswmm.engine/openswmm.engine/src/engine/data/ReactionData.hpp