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

Classes

class  LagrangianSolver
 
class  RwptDispersion
 Persistent particle field + the per-substep exchange operator. More...
 
class  SegmentStore
 
struct  SpeciesRowLayout
 The segment store's species-row layout, computed in ONE place. More...
 

Functions

SpeciesRowLayout rowLayout (const SimulationContext &ctx)
 The single source of truth for the row layout. Reserved rows are appended after the pollutants in a fixed order (age, then temperature) so an index means the same thing everywhere.
 
std::uint64_t rwpt_hash (std::uint64_t z)
 Mix one unsigned64-bit deterministic random key.
 
double rwpt_uniform (std::uint64_t seed, std::uint64_t link, std::uint64_t stepc, std::uint64_t particle, std::uint64_t draw)
 Uniform in (0,1), keyed. draw distinguishes multiple draws per particle.
 
double rwpt_normal (std::uint64_t seed, std::uint64_t link, std::uint64_t stepc, std::uint64_t particle, std::uint64_t draw)
 Standard normal (Box–Muller on two keyed uniforms).
 
double rwpt_u_dev (double eta, double ubar, double ustar, bool turbulent)
 Velocity DEVIATION u(η) − ū. Turbulent: log-law; laminar: parabola.
 
double rwpt_d_eta (double eta, double h, double ustar, bool turbulent)
 Vertical diffusivity in η-units (D_t/h²), and its η-gradient (the Itô drift). Turbulent: Rouse parabola κ·u*·h·η(1−η); laminar: molecular.
 
double rwpt_d_eta_grad (double eta, double h, double ustar, bool turbulent)
 Evaluate coordinate diffusivity gradient used as stochastic drift.
 
double rwpt_hyd_radius (double area, double depth, double diam, bool circular)
 Hydraulic radius: exact for CIRCULAR from flow area, ≈ depth otherwise (wide-channel v1 approximation, recorded).
 

Variables

constexpr double kTinyFlow = 1.0e-8
 cfs; below this a link moves nothing
 
constexpr int kRwptParticlesPerLink = 2000
 
constexpr double kKappa = 0.41
 von Kármán
 
constexpr double kNuWater = 1.05e-5
 kinematic viscosity, ft²/s
 
constexpr double kDm = 1.3454e-8
 molecular diffusivity, ft²/s
 
constexpr double kEtaMin = 1.0e-3
 log-law floor
 
constexpr double kReTurb = 2000.0
 
constexpr int kMaxSegmentsPerLink = 100
 
constexpr double kMergeAtol = 1.0e-6
 
constexpr double kMergeRtol = 1.0e-4
 

Function Documentation

◆ rowLayout()

SpeciesRowLayout openswmm::lard::rowLayout ( const SimulationContext & ctx)
inline

The single source of truth for the row layout. Reserved rows are appended after the pollutants in a fixed order (age, then temperature) so an index means the same thing everywhere.

Resolve the carried network1D row order for the LARD owner.

Parameters
[in]ctxStable transport class policy and active legacy-reaction profile.
Returns
Pollutants first, optional age seconds, temperature degC, then enabled native MSX species; absent row selectors=-1, ns is total. No state/clock change, allocation or shape preparation.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rwpt_d_eta()

double openswmm::lard::rwpt_d_eta ( double eta,
double h,
double ustar,
bool turbulent )
inline

Vertical diffusivity in η-units (D_t/h²), and its η-gradient (the Itô drift). Turbulent: Rouse parabola κ·u*·h·η(1−η); laminar: molecular.

Evaluate diffusivity in the dimensionless vertical particle coordinate.

Parameters
[in]etaDimensionless particle ordinate, caller supplies0..1 for physical profile.
[in]hFinite positive water depth ft; no zero guard.
[in]ustarFinite nonnegative friction speed ft/s.
[in]turbulentTrue selects shear profile, false molecular laminar profile.
Returns
Inverse-seconds diffusivity: laminar molecular Dm/h², turbulent kappa*ustar*clamp(eta,0,1)*(1-clamp(eta,0,1))/h.
Note
Pure/no allocation; no generic sign/finite/dry-depth validation.
Here is the caller graph for this function:

◆ rwpt_d_eta_grad()

double openswmm::lard::rwpt_d_eta_grad ( double eta,
double h,
double ustar,
bool turbulent )
inline

Evaluate coordinate diffusivity gradient used as stochastic drift.

Parameters
[in]etaDimensionless particle ordinate, caller supplies0..1 for physical profile.
[in]hFinite positive water depth ft; no zero guard.
[in]ustarFinite nonnegative friction speed ft/s.
[in]turbulentTrue selects shear profile, false molecular laminar profile.
Returns
0 for laminar, otherwise kappa*ustar*(1-2*eta)/h in inverse seconds; eta is not clamped here.
Note
Pure/no allocation; no generic sign/finite/dry-depth validation.
Here is the caller graph for this function:

◆ rwpt_hash()

std::uint64_t openswmm::lard::rwpt_hash ( std::uint64_t z)
inline

Mix one unsigned64-bit deterministic random key.

Parameters
[in]zCounter/key input, unsigned overflow intentionally wraps modulo2^64.
Returns
SplitMix-style mixed key; pure, allocation-free, independent of shared random state.
Here is the caller graph for this function:

◆ rwpt_hyd_radius()

double openswmm::lard::rwpt_hyd_radius ( double area,
double depth,
double diam,
bool circular )
inline

Hydraulic radius: exact for CIRCULAR from flow area, ≈ depth otherwise (wide-channel v1 approximation, recorded).

Estimate hydraulic radius for the RWPT turbulence calculation.

Parameters
[in]areaUnused area argument retained for geometry-call symmetry; circle area is recomputed.
[in]depthWater depth ft; noncircular/invalid-circle fallback max(depth,0).
[in]diamPositive circular full diameter ft when circular is true.
[in]circularTrue selects circular-segment wetted geometry.
Returns
Radius ft from circle area/perimeter after clamped acos argument; tiny angle/perimeter uses depth fallback. No finite geometry repair, allocation or state mutation.
Here is the caller graph for this function:

◆ rwpt_normal()

double openswmm::lard::rwpt_normal ( std::uint64_t seed,
std::uint64_t link,
std::uint64_t stepc,
std::uint64_t particle,
std::uint64_t draw )
inline

Standard normal (Box–Muller on two keyed uniforms).

Generate a deterministic Box-Muller normal variate from adjacent uniform draws.

Parameters
[in]seedReproducibility seed, no global generator state.
[in]linkStable native link identity key.
[in]stepcAccepted quality-step counter; repeat tuple reproduces sample.
[in]particleZero-based particle key; particle*8+draw wraps unsigned arithmetic.
[in]drawDraw stream key (draw+1 also used by normal).
Returns
Standard normal sample using draws draw and draw+1; no cached paired variate.
Note
Pure/no allocation or model mutation; counter tuple design, not call order, controls reproducibility.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rwpt_u_dev()

double openswmm::lard::rwpt_u_dev ( double eta,
double ubar,
double ustar,
bool turbulent )
inline

Velocity DEVIATION u(η) − ū. Turbulent: log-law; laminar: parabola.

Evaluate longitudinal particle velocity relative to cross-sectional mean.

Parameters
[in]etaDimensionless ordinate, normally0..1; turbulent log floors at1e-3.
[in]ubarMean positive speed ft/s used by laminar profile.
[in]ustarFriction speed ft/s used by turbulent log profile.
[in]turbulentTrue selects log-law, false parabolic laminar deviation.
Returns
Velocity deviation ft/s, not absolute velocity. No finite/range repair outside log floor, allocation or state mutation.
Here is the caller graph for this function:

◆ rwpt_uniform()

double openswmm::lard::rwpt_uniform ( std::uint64_t seed,
std::uint64_t link,
std::uint64_t stepc,
std::uint64_t particle,
std::uint64_t draw )
inline

Uniform in (0,1), keyed. draw distinguishes multiple draws per particle.

Generate a deterministic counter-keyed pseudorandom uniform variate.

Parameters
[in]seedReproducibility seed, no global generator state.
[in]linkStable native link identity key.
[in]stepcAccepted quality-step counter; repeat tuple reproduces sample.
[in]particleZero-based particle key; particle*8+draw wraps unsigned arithmetic.
[in]drawDraw stream key (draw+1 also used by normal).
Returns
Nominal open-unit variate from53 key bits with half-unit offset; final floating rounding can reach1.
Note
Pure/no allocation or model mutation; counter tuple design, not call order, controls reproducibility.
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ kDm

double openswmm::lard::kDm = 1.3454e-8
constexpr

molecular diffusivity, ft²/s

◆ kEtaMin

double openswmm::lard::kEtaMin = 1.0e-3
constexpr

log-law floor

◆ kKappa

double openswmm::lard::kKappa = 0.41
constexpr

von Kármán

◆ kMaxSegmentsPerLink

int openswmm::lard::kMaxSegmentsPerLink = 100
constexpr

EPANET-style cap on segments per link (strategy §4.1 default; the [OPTIONS] MAX_SEGMENTS_PER_LINK override arrives with X3).

◆ kMergeAtol

double openswmm::lard::kMergeAtol = 1.0e-6
constexpr

Merge tolerance for a released segment against the current front segment (strategy §4.5): merge when |dC| <= atol + rtol·|C_front| for EVERY species. Plug-flow stretches then collapse to one segment — the dominant constant-factor win in EPANET's LTD.

◆ kMergeRtol

double openswmm::lard::kMergeRtol = 1.0e-4
constexpr

◆ kNuWater

double openswmm::lard::kNuWater = 1.05e-5
constexpr

kinematic viscosity, ft²/s

◆ kReTurb

double openswmm::lard::kReTurb = 2000.0
constexpr

◆ kRwptParticlesPerLink

int openswmm::lard::kRwptParticlesPerLink = 2000
constexpr

◆ kTinyFlow

double openswmm::lard::kTinyFlow = 1.0e-8
constexpr

cfs; below this a link moves nothing