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

#include <ReactionData.hpp>

Collaboration diagram for openswmm::ReactionData:

Public Member Functions

int n_species () const noexcept
 
int find_species (std::string_view n) const
 
int find_coef (std::string_view n) const
 
int find_term (std::string_view n) const
 
void clear ()
 

Public Attributes

ReactionSolverKind solver = ReactionSolverKind::RK5
 Default integrator.
 
ReactionCoupling coupling = ReactionCoupling::NONE
 
ReactionRateUnits rate_units = ReactionRateUnits::HR
 
ReactionAreaUnits area_units = ReactionAreaUnits::FT2
 
double timestep = 0.0
 0 ⇒ follow QUALITY_STEP
 
double atol = 1.0e-6
 
double rtol = 1.0e-4
 
double default_temp_c = 20.0
 
int registry_base = -1
 first MSX index in the registry
 
std::vector< std::string > species_name
 cold
 
std::vector< uint8_t > species_is_wall
 0 = BULK, 1 = WALL
 
std::vector< std::string > species_units
 cold
 
std::vector< double > species_atol
 hot (0 ⇒ global)
 
std::vector< double > species_rtol
 hot (0 ⇒ global)
 
std::vector< std::string > coef_name
 cold
 
std::vector< uint8_t > coef_is_param
 1 = PARAMETER (overridable), 0 = CONSTANT
 
std::vector< double > coef_value
 
std::vector< std::string > term_name
 cold
 
std::vector< std::string > term_expr_src
 cold (compiled in R2)
 
std::vector< ReactionExprFormpipe_form
 size n_species
 
std::vector< std::string > pipe_expr_src
 size n_species (cold)
 
std::vector< ReactionExprFormtank_form
 
std::vector< std::string > tank_expr_src
 
std::vector< double > init_global
 size n_species
 
std::vector< uint8_t > init_elem_is_link
 0 = NODE row, 1 = LINK row
 
std::vector< int > init_elem_idx
 resolved node/link index
 
std::vector< int > init_elem_species
 0..n_species()-1
 
std::vector< double > init_elem_value
 
std::vector< RxTokentoken_pool
 hot: one contiguous pool
 
std::vector< RxExprSpanterm_expr
 per term, in-order evaluation
 
std::vector< RxExprSpanpipe_expr
 per species (len 0 ⇒ none)
 
std::vector< RxExprSpantank_expr
 per species
 
bool compiled = false
 R2 compile pass succeeded.
 
bool warned_react_failure = false
 
std::vector< double > msx_node_conc
 
std::vector< double > msx_link_conc
 
std::vector< double > msx_ext_mass_in
 
bool configured = false
 a reactions component applied
 

Member Function Documentation

◆ clear()

void openswmm::ReactionData::clear ( )
inline
Here is the caller graph for this function:

◆ find_coef()

int openswmm::ReactionData::find_coef ( std::string_view n) const
inline
Here is the caller graph for this function:

◆ find_species()

int openswmm::ReactionData::find_species ( std::string_view n) const
inline
Here is the caller graph for this function:

◆ find_term()

int openswmm::ReactionData::find_term ( std::string_view n) const
inline
Here is the caller graph for this function:

◆ n_species()

int openswmm::ReactionData::n_species ( ) const
inlinenoexcept
Here is the caller graph for this function:

Member Data Documentation

◆ area_units

ReactionAreaUnits openswmm::ReactionData::area_units = ReactionAreaUnits::FT2

◆ atol

double openswmm::ReactionData::atol = 1.0e-6

◆ 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

cold

◆ coef_value

std::vector<double> openswmm::ReactionData::coef_value

hot (global values; per-element overrides arrive with [REACTION_PARAMETERS])

◆ compiled

bool openswmm::ReactionData::compiled = false

R2 compile pass succeeded.

◆ configured

bool openswmm::ReactionData::configured = false

a reactions component applied

◆ coupling

ReactionCoupling openswmm::ReactionData::coupling = ReactionCoupling::NONE

◆ 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

resolved node/link index

◆ 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

size n_species

◆ msx_ext_mass_in

std::vector<double> openswmm::ReactionData::msx_ext_mass_in

◆ msx_link_conc

std::vector<double> openswmm::ReactionData::msx_link_conc

◆ msx_node_conc

std::vector<double> openswmm::ReactionData::msx_node_conc

◆ 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

size n_species (cold)

◆ pipe_form

std::vector<ReactionExprForm> openswmm::ReactionData::pipe_form

size n_species

◆ rate_units

ReactionRateUnits openswmm::ReactionData::rate_units = ReactionRateUnits::HR

◆ registry_base

int openswmm::ReactionData::registry_base = -1

first MSX index in the registry

◆ rtol

double openswmm::ReactionData::rtol = 1.0e-4

◆ solver

ReactionSolverKind openswmm::ReactionData::solver = ReactionSolverKind::RK5

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.

◆ species_atol

std::vector<double> openswmm::ReactionData::species_atol

hot (0 ⇒ global)

◆ species_is_wall

std::vector<uint8_t> openswmm::ReactionData::species_is_wall

0 = BULK, 1 = WALL

◆ species_name

std::vector<std::string> openswmm::ReactionData::species_name

cold

◆ species_rtol

std::vector<double> openswmm::ReactionData::species_rtol

hot (0 ⇒ global)

◆ species_units

std::vector<std::string> openswmm::ReactionData::species_units

cold

◆ tank_expr

std::vector<RxExprSpan> openswmm::ReactionData::tank_expr

per species

◆ tank_expr_src

std::vector<std::string> openswmm::ReactionData::tank_expr_src

◆ tank_form

std::vector<ReactionExprForm> openswmm::ReactionData::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

cold (compiled in R2)

◆ term_name

std::vector<std::string> openswmm::ReactionData::term_name

cold

◆ timestep

double openswmm::ReactionData::timestep = 0.0

0 ⇒ follow QUALITY_STEP

◆ token_pool

std::vector<RxToken> openswmm::ReactionData::token_pool

hot: one contiguous pool

◆ warned_react_failure

bool openswmm::ReactionData::warned_react_failure = false

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