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

Phase R4 — reaction binding for the LEGACY (CSTR) quality engine. More...

#include <limits>
Include dependency graph for ReactionLegacyBinding.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::transport
 

Functions

bool openswmm::transport::legacyReactionsActive (const SimulationContext &ctx)
 
void openswmm::transport::ensureMsxState (SimulationContext &ctx)
 
void openswmm::transport::reactSpeciesBlock (SimulationContext &ctx, bool tank, double dt, double *species_block, const double *pollut, double hrt_seconds, double temp_c)
 
void openswmm::transport::reactLegacyNodes (SimulationContext &ctx, double dt)
 
void openswmm::transport::reactLegacyLinks (SimulationContext &ctx, double dt)
 
void openswmm::transport::warnIfLegacyBindingBypassed (SimulationContext &ctx)
 

Detailed Description

Phase R4 — reaction binding for the LEGACY (CSTR) quality engine.

When a reactions component is configured:

  • Pollutant kdecay upgrades from the legacy linearized factor (1 − k·dt) to the EXACT exponential exp(−k·dt) at nodes and links (the "kdecay-as-RATE" semantics realized in closed form — pollutant decay is exactly first-order, so the integrator would only approximate what the exponential IS). Bit-parity holds when NO reactions component is present: the legacy applyDecay / in-mix decay paths are untouched then.
  • MSX species evolve per element (nodes: tank scope; links: pipe scope) via ReactionIntegrator, with the element's pollutant concentrations exposed READ-ONLY to their expressions (PUSH_POLLUT). MSX species are NOT yet transported between elements under LEGACY (R4b) — a RATE MSX species triggers a once-per-run warning. EQUIL/FORMULA MSX species are fully meaningful (element-local algebra over pollutants).
  • Integration failures are LOUD but not fatal: the element's block is left unchanged and a once-per-run warning carries the element id and the integrator's remedy text.
See also
plans/transport/MULTISPECIES_REACTIONS_MSX_PLAN.md §5 R4
Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
License\n Apache-2.0