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

Persistent particle field + the per-substep exchange operator. More...

#include <RwptDispersion.hpp>

Collaboration diagram for openswmm::lard::RwptDispersion:

Public Member Functions

void checkpoint (detail::CompletedSourceArchive &a)
 Serialize/restore fixed particle state then validate position/ordinate values.
 
void resize (int n_links, int n_per_link=kRwptParticlesPerLink)
 Reset deterministic particle histories for new owner dimensions.
 
void disperse (SimulationContext &ctx, SegmentStore &segs, int l, double ubar, double h, double rh, double n_manning, double v_in, double q_dt, double dt, std::uint64_t stepc, std::uint64_t seed, std::vector< double > &delta)
 One substep of dispersive exchange on link l's segments.
 

Detailed Description

Persistent particle field + the per-substep exchange operator.

Member Function Documentation

◆ checkpoint()

void openswmm::lard::RwptDispersion::checkpoint ( detail::CompletedSourceArchive & a)
inline

Serialize/restore fixed particle state then validate position/ordinate values.

Parameters
[in,out]aArchive already dimensioned for this link/particle layout; fixed() may mutate zeta, eta and segment-index buffers on load. Counts/dimensions and scratch bounds are not archived.
Exceptions
std::runtime_errorNonfinite position or ordinate, or ordinate outside0..1; archive errors propagate. Negative finite zeta sentinel is accepted, seg_idx bounds are not validated here.
Note
Exclusive completed-source barrier; failures can leave changed arrays, no rollback or clock advance.

◆ disperse()

void openswmm::lard::RwptDispersion::disperse ( SimulationContext & ctx,
SegmentStore & segs,
int l,
double ubar,
double h,
double rh,
double n_manning,
double v_in,
double q_dt,
double dt,
std::uint64_t stepc,
std::uint64_t seed,
std::vector< double > & delta )
inline

One substep of dispersive exchange on link l's segments.

Parameters
v_inthe volume that entered at the FRONT this substep (bulk-advection shift in volume coordinates).
stepcglobal substep counter (RNG key component).
deltascratch, ns entries — reused across calls.

Exchange segment species inventory using deterministic reflected RWPT particles.

Parameters
[in,out]ctxUnused context retained by the transport interface; no mutation through this argument.
[in,out]segsPrepared finite nonnegative segment ring for l, matching initialized particle owner; updates concentrations by bounded pairwise transfers while preserving represented family inventory.
[in]lValid native link below resized particle and segment counts.
[in]ubarPositive finite absolute mean speed ft/s; nonpositive returns.
[in]hFinite water depth ft; <=1e-3 returns.
[in]rhFinite nonnegative hydraulic radius ft, floored1e-3 for friction estimate.
[in]n_manningFinite Manning coefficient in native US formulation used for slope estimate.
  • Additional argument v_in: Accepted incoming water ft3 shifting retained volume-coordinate particles.
[in]q_dtNonnegative absolute transported volume ft3 over this interval, scales velocity deviation.
[in]dtPositive finite accepted quality duration s for vertical diffusion/drift.
  • Additional argument stepc: Deterministic accepted-step counter; do not change on repeated trial of same phase.
[in]seedFixed simulation reproducibility seed.
  • Additional argument delta: Scratch with at least segs.species() entries, nonaliasing ring/particle state; overwritten for each crossed segment boundary, not cleared on skipped call.
Note
Fewer than2 segments or nonpositive total water returns. Rebuilds cumulative volume bounds, initializes/recycles particles, reflects ordinate in0..1 and volume coordinate in0..total water, then limits downhill concentration transfers by source mass and receiver concentration difference. Requires finite qualified inputs: infinite reflected positions can fail to terminate, no generic physical validation. Allocates bounds and mutates particle/segment state progressively; no rollback, global ledger/water/clock mutation. Scratch and store imply exclusive call, even for distinct links.
Here is the call graph for this function:

◆ resize()

void openswmm::lard::RwptDispersion::resize ( int n_links,
int n_per_link = kRwptParticlesPerLink )
inline

Reset deterministic particle histories for new owner dimensions.

Parameters
[in]n_linksNonnegative link count, with fitting products.
[in]n_per_linkPositive particles per link, default2000 for useful dispersion.
Note
Assigns zeta=-1 uninitialized sentinel, eta=.5, segment index0. Does not reset shared scratch bounds or hydraulic/clock state. No dimension/overflow validation; allocation may partially reset. Exclusive initialization/reconfiguration; reproducibility changes when particle count changes.

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