Persistent particle field + the per-substep exchange operator.
More...
#include <RwptDispersion.hpp>
|
| 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.
|
| |
Persistent particle field + the per-substep exchange operator.
◆ checkpoint()
Serialize/restore fixed particle state then validate position/ordinate values.
- Parameters
-
| [in,out] | a | Archive 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_error | Nonfinite 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_in | the volume that entered at the FRONT this substep (bulk-advection shift in volume coordinates). |
| stepc | global substep counter (RNG key component). |
| delta | scratch, ns entries — reused across calls. |
Exchange segment species inventory using deterministic reflected RWPT particles.
- Parameters
-
| [in,out] | ctx | Unused context retained by the transport interface; no mutation through this argument. |
| [in,out] | segs | Prepared finite nonnegative segment ring for l, matching initialized particle owner; updates concentrations by bounded pairwise transfers while preserving represented family inventory. |
| [in] | l | Valid native link below resized particle and segment counts. |
| [in] | ubar | Positive finite absolute mean speed ft/s; nonpositive returns. |
| [in] | h | Finite water depth ft; <=1e-3 returns. |
| [in] | rh | Finite nonnegative hydraulic radius ft, floored1e-3 for friction estimate. |
| [in] | n_manning | Finite 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_dt | Nonnegative absolute transported volume ft3 over this interval, scales velocity deviation. |
| [in] | dt | Positive 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] | seed | Fixed 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.
◆ resize()
Reset deterministic particle histories for new owner dimensions.
- Parameters
-
| [in] | n_links | Nonnegative link count, with fitting products. |
| [in] | n_per_link | Positive 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:
- /home/runner/work/openswmm.engine/openswmm.engine/src/engine/quality/lard/RwptDispersion.hpp