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

X3b: RWPT longitudinal dispersion on LARD segments. More...

#include <algorithm>
#include <cmath>
#include <cstdint>
#include <vector>
#include "../../core/SimulationContext.hpp"
#include "SegmentStore.hpp"
Include dependency graph for RwptDispersion.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  openswmm::lard::RwptDispersion
 Persistent particle field + the per-substep exchange operator. More...
 

Namespaces

namespace  openswmm
 
namespace  openswmm::lard
 

Functions

std::uint64_t openswmm::lard::rwpt_hash (std::uint64_t z)
 
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)
 Uniform in (0,1), keyed. draw distinguishes multiple draws per particle.
 
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)
 Standard normal (Box–Muller on two keyed uniforms).
 
double openswmm::lard::rwpt_u_dev (double eta, double ubar, double ustar, bool turbulent)
 Velocity DEVIATION u(η) − ū. Turbulent: log-law; laminar: parabola.
 
double openswmm::lard::rwpt_d_eta (double eta, double h, double ustar, bool turbulent)
 
double openswmm::lard::rwpt_d_eta_grad (double eta, double h, double ustar, bool turbulent)
 
double openswmm::lard::rwpt_hyd_radius (double area, double depth, double diam, bool circular)
 

Variables

constexpr int openswmm::lard::kRwptParticlesPerLink = 2000
 
constexpr double openswmm::lard::kKappa = 0.41
 von Kármán
 
constexpr double openswmm::lard::kNuWater = 1.05e-5
 kinematic viscosity, ft²/s
 
constexpr double openswmm::lard::kDm = 1.3454e-8
 molecular diffusivity, ft²/s
 
constexpr double openswmm::lard::kEtaMin = 1.0e-3
 log-law floor
 
constexpr double openswmm::lard::kReTurb = 2000.0
 

Detailed Description

X3b: RWPT longitudinal dispersion on LARD segments.

Subplan X3b (strategy §5, §2.5; §16 D-L4/D-L6). Longitudinal dispersion emerges from resolved VERTICAL shear plus a vertical random walk — the Taylor/Elder mechanism — rather than from a fitted D_L coefficient (that deterministic alternative is the ARD engine's E3 machinery; the user chose RWPT for LARD).

D-X3b1 — particles carry no mass; they estimate the inter-segment dispersive exchange. Persistent per-particle state is (ζ, η): ζ ∈ [0, V] the volume coordinate from the link's FRONT (upstream) boundary — volume coordinates make the substep's bulk advection an exact uniform shift (ζ += V_in) — and η ∈ (0,1) the normalized depth, which holds the velocity memory that shear dispersion correlates against position. Each substep, after the segment field is final (post-RELEASE):

  1. ζ += V_in (ride the water); particles pushed past V are water that left — recycled as fresh entries near the front with a fresh η (deterministic draw).
  2. Shear + walk: ζ += (u(η) − ū)·dt·A ; η does a reflected random walk with the Itô drift term dD_η/dη·dt (omitting the drift piles particles into low-diffusivity zones — the standard RWPT defect).
  3. Every boundary crossing carries δm_s = C_s(ORIGIN segment)·V/N of each species across — an upwind-carried Monte-Carlo estimate of the dispersive flux. A uniform field exchanges symmetrically and does not move (no spurious drift); total mass is conserved EXACTLY by construction (every debit has a matching credit).

Profiles (v1, wide-channel forms, documented deviations):

  • Turbulent (Re ≥ 2000): log-law deviation u(η) − ū = (u_star/κ)(1 + ln η), κ = 0.41; D_t = κ·u_star·h·η(1−η) (Rouse parabola). u* = √(g·R_h·S_f), S_f from Manning at the link's own n, R_h exact for CIRCULAR, ≈ h otherwise. The emergent longitudinal coefficient's reference is Elder, D_L = 5.93·u*·h — vertical-shear-only, exactly what is resolved here.
  • Laminar (Re < 2000): parabolic u(η) = 1.5·ū·η(2−η) deviation, D_t = D_m (molecular, 1.25e-9 m²/s → 1.3454e-8 ft²/s).

D-L6 counter RNG: draws are a pure function of (seed, link, global substep counter, particle, draw#) via a splitmix64-style hash — bit-reproducible under any threading, schedule, or run repetition; RWPT_SEED changes every draw.

NOT here (recorded): inter-LINK particle dispersion (ζ reflects at both link ends; segment exchange stops at the boundary node's CSTR, which already mixes), transverse-shear dispersion (Fischer's field-scale term — a calibrated-D machinery, not a resolved one), particle-count adaptivity, wall species.

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
License\n Apache-2.0