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

Classes

struct  ColumnPreparation
 
struct  ColumnStep
 What one column sweep needs and what it reports back. More...
 
struct  ColumnTransfers
 

Functions

double columnStorage (const double *theta, int m, int stride, double L) noexcept
 Total water in the column (m of water) — Σ θ_j·L·Δσ.
 
void seedHydrostatic (const soil::Params &p, double *theta, int m, int stride, double L) noexcept
 Seed a column to hydrostatic equilibrium above a table at depth L.
 
double columnDtLimit (const soil::Params &p, const double *theta, int m, int stride, double L, double Ldot, double c_col, bool capillary) noexcept
 The explicit stability bound of a column, without advancing it (§2.3): Δt_u ≤ C_col·min_j[ L·Δσ / ( c(θ_j) + |σ_j·L̇| + 2·D̄_j/(L·Δσ) ) ] with celerity c(θ) = dK/dθ.
 
void prepareColumn (const soil::Params &p, const double *theta, int m, int stride, const ColumnStep &st, ColumnPreparation &prepared) noexcept
 Prepare reusable trial invariants. Same input preconditions as advanceColumn; m > 0.
 
void advanceColumn (const soil::Params &p, double *theta, int m, int stride, ColumnStep &st) noexcept
 Advance one σ column by st.dt.
 
void advanceColumn (const soil::Params &p, double *theta, int m, int stride, ColumnStep &st, const ColumnPreparation &prepared) noexcept
 

Function Documentation

◆ advanceColumn() [1/2]

void openswmm::twoD::sigma::advanceColumn ( const soil::Params & p,
double * theta,
int m,
int stride,
ColumnStep & st )
noexcept

Advance one σ column by st.dt.

Parameters
[in]pthe cell's soil law and parameters
[in,out]thetam layer water contents, layer 0 at the surface. Read and written in place; stride is the caller's (the SoA is layer-major, so the caller passes a gathered/scattered buffer or a strided view — see stride).
[in]mlayer count
[in]stridedistance between consecutive layers in theta (1 for a packed buffer, n_cells for the layer-major SoA)
[in,out]ststep inputs and outputs

Positivity is enforced per face by an availability share, the same idiom as the surface solver's volume share: a face may not take more water than its donor layer holds above θ_r, and the shares are scaled together when a layer's outgoing faces over-subscribe it. First-order upwind in v1 (D-N4); MUSCL is a recorded follow-up.

Precondition
For an advancing step, theta points to at least 1+(m-1)*stride doubles, stride > 0, and p contains validated SI soil parameters. Optional layer_inflow has at least m water-depth entries and does not alias outputs.
Postcondition
Updates strided volumetric theta and st's accepted/rejected fluxes in m/s, stability bound in s, and optional transfer water depths in m. Actual table/surface storage updates remain the caller's responsibility.
Note
m <= 0 or nonpositive/NaN dt returns immediately without resetting outputs. Uses per-thread reusable vectors; distinct input/output buffers permit separate-thread calls. Vector/receipt allocation occurs inside noexcept, so allocation failure terminates rather than returning a status. No caller pointers are retained.

◆ advanceColumn() [2/2]

void openswmm::twoD::sigma::advanceColumn ( const soil::Params & p,
double * theta,
int m,
int stride,
ColumnStep & st,
const ColumnPreparation & prepared )
noexcept

Advance using invariants prepared from exactly this old column and step inputs. L_new, boundary rates, layer inflows and capture receipts may differ between trials.

◆ columnDtLimit()

double openswmm::twoD::sigma::columnDtLimit ( const soil::Params & p,
const double * theta,
int m,
int stride,
double L,
double Ldot,
double c_col,
bool capillary )
noexcept

The explicit stability bound of a column, without advancing it (§2.3): Δt_u ≤ C_col·min_j[ L·Δσ / ( c(θ_j) + |σ_j·L̇| + 2·D̄_j/(L·Δσ) ) ] with celerity c(θ) = dK/dθ.

Parameters
[in]pBorrowed validated SI soil-law parameters.
[in]thetaRequired strided layer water-content array, dimensionless; at least 1+(m-1)*stride readable doubles.
[in]mStrictly positive layer count.
[in]strideStrictly positive distance in doubles between layers; 1 packed or n_cells for a layer-major SoA.
[in]LFinite column thickness in m.
[in]LdotFinite column-thickness rate in m/s, positive for a falling table.
[in]c_colFinite Courant factor, numerically floored at 1e-6.
[in]capillaryWhether to include the moisture diffusivity contribution.
Returns
Explicit stability interval in s, with L floored at 1e-3 m; a near-zero total celerity leaves the large 1e30 s sentinel scaled by c_col.
Note
No bounds/physical validation, allocation, state advancement or stored references.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ columnStorage()

double openswmm::twoD::sigma::columnStorage ( const double * theta,
int m,
int stride,
double L )
noexcept

Total water in the column (m of water) — Σ θ_j·L·Δσ.

Parameters
[in]thetaRequired borrowed dimensionless layer water contents, at least 1+(m-1)*stride doubles.
[in]mStrictly positive layer count.
[in]strideStrictly positive distance in doubles between layers.
[in]LFinite column thickness, m; negative thickness clamps to zero.
Returns
Summed water storage in metres of water. Read-only, no allocation/validation; contents are not clamped to residual/saturation here.
Here is the caller graph for this function:

◆ prepareColumn()

void openswmm::twoD::sigma::prepareColumn ( const soil::Params & p,
const double * theta,
int m,
int stride,
const ColumnStep & st,
ColumnPreparation & prepared )
noexcept

Prepare reusable trial invariants. Same input preconditions as advanceColumn; m > 0.

Here is the call graph for this function:

◆ seedHydrostatic()

void openswmm::twoD::sigma::seedHydrostatic ( const soil::Params & p,
double * theta,
int m,
int stride,
double L )
noexcept

Seed a column to hydrostatic equilibrium above a table at depth L.

Parameters
[in]pBorrowed validated SI soil-law parameters.
[out]thetaRequired strided layer water-content array, dimensionless; at least 1+(m-1)*stride writable doubles.
[in]mStrictly positive layer count.
[in]strideStrictly positive distance in doubles between layers; 1 packed or n_cells for a layer-major SoA.
[in]LFinite column thickness in m.
Postcondition
Sets each layer's center water content using its height above the table; negative L clamps to zero. Caller owns the array; no allocation or validation, and no other state is updated.
Here is the call graph for this function:
Here is the caller graph for this function: