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

Reaction kinetics integration over one reaction step (phase R3): EUL / RK5 (Cash–Karp) / ROS2 / BDF2 for RATE species, joint damped-Newton for EQUIL species, in-order FORMULA evaluation, rate-unit scaling. More...

#include <string>
#include <vector>
#include "../../../data/ReactionData.hpp"
Include dependency graph for ReactionIntegrator.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  openswmm::transport::RxStepReport
 
class  openswmm::transport::RxWorkspace
 
class  openswmm::transport::ReactionIntegrator
 

Namespaces

namespace  openswmm
 
namespace  openswmm::transport
 

Detailed Description

Reaction kinetics integration over one reaction step (phase R3): EUL / RK5 (Cash–Karp) / ROS2 / BDF2 for RATE species, joint damped-Newton for EQUIL species, in-order FORMULA evaluation, rate-unit scaling.

Semantics (MSX conventions, reactions plan §2/§3): per step of length dt on one element's local species block:

  1. RATE species integrate dφ/dt = expr · unit_factor with the configured solver. COUPLING FULL integrates the RATE set as one system; COUPLING NONE integrates each RATE species with every other species frozen at start-of-step values.
  2. EQUIL species solve the joint algebraic system {expr_s = 0} by damped Newton (FD Jacobian, step-halving line search, atol/rtol convergence, hard iteration cap).
  3. FORMULA species evaluate in declaration order (may reference any current value; declaration-order semantics are the documented contract). Terms re-evaluate (in their forward-only order) inside every right-hand-side evaluation — they are part of f(φ).

Hand-rolled per D-R7 (no CVODE/SUNDIALS): the workload is many tiny independent systems; BDF2 (D-R7 amendment) covers the practically stiff range with Newton + the same dense LU ROS2 uses. All scratch lives in a caller-owned workspace sized once — the step call is allocation-free (D-R3).

See also
plans/transport/MULTISPECIES_REACTIONS_MSX_PLAN.md §3.2 D-R3–D-R9
Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
License\n Apache-2.0