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

Classes

struct  Params
 

Functions

double effectiveSaturation (const Params &p, double psi) noexcept
 Effective saturation at suction head psi (m, ≥ 0). Se ∈ (0, 1].
 
double waterContent (const Params &p, double psi) noexcept
 Water content θ(ψ) = θ_r + Se·(θ_s − θ_r).
 
double relativeConductivity (const Params &p, double psi) noexcept
 Relative conductivity Kr(ψ) ∈ [0, 1].
 
double conductivity (const Params &p, double psi) noexcept
 Unsaturated conductivity K(ψ) = Ks·Kr(ψ) (m/s).
 
double suctionAtSaturation (const Params &p, double Se) noexcept
 Suction head at a given effective saturation — the retention inverse, needed to give the σ column a ψ from its θ. Returns 0 at Se ≥ 1.
 
double diffusivity (const Params &p, double psi) noexcept
 Soil-moisture diffusivity D(θ) = K(ψ)/|dθ/dψ| (m²/s) at suction psi. Evaluated from a centered finite difference of the retention curve. Callers decide whether the capillary term is enabled.
 
double equilibriumStorage (const Params &p, double L) noexcept
 Hydrostatic-equilibrium storage of a column of thickness L (m of water): ∫₀ᴸ θ(ψ) dψ. Gardner and Brooks–Corey are closed form; Russo and van Genuchten use fixed-order Gauss–Legendre.
 
double enslavedStorage (const Params &p, double L) noexcept
 The ENSLAVED reduction: hᵤ algebraic in h_g — the storage at which rechargeQ0 vanishes. For Gardner this is eq. 39.
 
double rechargeQ0 (const Params &p, double L, double hu) noexcept
 Closure-A quasi-steady recharge (m/s). + down, − capillary rise.
 
double alphaL (const Params &p, double L) noexcept
 αL, the dimensionless group the AUTO closure selection reads. For Brooks–Corey and van Genuchten the law's own inverse length replaces α (1/ψ_b, and the van Genuchten α), so the thresholds mean the same thing across laws.
 
double feddesStress (double psi, double psi_w) noexcept
 Feddes-style smooth stress multiplier on potential ET, from the column's mean suction. 1 in the readily-available range, falling smoothly to 0 at the wilting point — no if (infil <= 0) gate, which is the behaviour §7 retires. psi_w wilting suction (m).
 

Function Documentation

◆ alphaL()

double openswmm::twoD::soil::alphaL ( const Params & p,
double L )
noexcept

αL, the dimensionless group the AUTO closure selection reads. For Brooks–Corey and van Genuchten the law's own inverse length replaces α (1/ψ_b, and the van Genuchten α), so the thresholds mean the same thing across laws.

Parameters
[in]pBorrowed validated SI soil law: Ks m/s, alpha 1/m, psi_b m, 0 <= theta_r < theta_s <= 1, lambda > 0, vg_n > 1 and admissible dimensionless vg_L.
Note
Pure scalar calculation with no allocation or retained references. Physical parameter validity is established upstream; numerical floors do not replace model validation.
Parameters
[in]LFinite unsaturated column thickness in m; storage clamps negative L to zero, alphaL uses a 1e-3 m thickness floor.
Returns
Dimensionless capillary-thickness group: L/psi_b for Brooks-Corey, alpha*L otherwise.

◆ conductivity()

double openswmm::twoD::soil::conductivity ( const Params & p,
double psi )
noexcept

Unsaturated conductivity K(ψ) = Ks·Kr(ψ) (m/s).

Parameters
[in]pBorrowed validated SI soil law: Ks m/s, alpha 1/m, psi_b m, 0 <= theta_r < theta_s <= 1, lambda > 0, vg_n > 1 and admissible dimensionless vg_L.
Note
Pure scalar calculation with no allocation or retained references. Physical parameter validity is established upstream; numerical floors do not replace model validation.
Parameters
[in]psiFinite suction magnitude in m; nonpositive suction is treated as saturated by retention/conductivity.
Returns
Unsaturated hydraulic conductivity in m/s, Ks times the relative conductivity.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ diffusivity()

double openswmm::twoD::soil::diffusivity ( const Params & p,
double psi )
noexcept

Soil-moisture diffusivity D(θ) = K(ψ)/|dθ/dψ| (m²/s) at suction psi. Evaluated from a centered finite difference of the retention curve. Callers decide whether the capillary term is enabled.

Parameters
[in]pBorrowed validated SI soil law: Ks m/s, alpha 1/m, psi_b m, 0 <= theta_r < theta_s <= 1, lambda > 0, vg_n > 1 and admissible dimensionless vg_L.
Note
Pure scalar calculation with no allocation or retained references. Physical parameter validity is established upstream; numerical floors do not replace model validation.
Parameters
[in]psiFinite suction magnitude in m; nonpositive suction is treated as saturated by retention/conductivity.
Returns
Nonnegative capillary diffusivity in m2/s; zero when the finite-difference moisture slope magnitude is below 1e-12. It does not inspect a capillary-enable flag.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ effectiveSaturation()

double openswmm::twoD::soil::effectiveSaturation ( const Params & p,
double psi )
noexcept

Effective saturation at suction head psi (m, ≥ 0). Se ∈ (0, 1].

Parameters
[in]pBorrowed validated SI soil law: Ks m/s, alpha 1/m, psi_b m, 0 <= theta_r < theta_s <= 1, lambda > 0, vg_n > 1 and admissible dimensionless vg_L.
Note
Pure scalar calculation with no allocation or retained references. Physical parameter validity is established upstream; numerical floors do not replace model validation.
Parameters
[in]psiFinite suction magnitude in m; nonpositive suction is treated as saturated by retention/conductivity.
Returns
Dimensionless effective saturation in [1e-8,1] for validated finite inputs; saturated for psi <= 1e-12 m.
Here is the caller graph for this function:

◆ enslavedStorage()

double openswmm::twoD::soil::enslavedStorage ( const Params & p,
double L )
noexcept

The ENSLAVED reduction: hᵤ algebraic in h_g — the storage at which rechargeQ0 vanishes. For Gardner this is eq. 39.

Parameters
[in]pBorrowed validated SI soil law: Ks m/s, alpha 1/m, psi_b m, 0 <= theta_r < theta_s <= 1, lambda > 0, vg_n > 1 and admissible dimensionless vg_L.
Note
Pure scalar calculation with no allocation or retained references. Physical parameter validity is established upstream; numerical floors do not replace model validation.
Parameters
[in]LFinite unsaturated column thickness in m; storage clamps negative L to zero, alphaL uses a 1e-3 m thickness floor.
Returns
Hydrostatic water storage in m, exactly equilibriumStorage(p,L).
Here is the call graph for this function:

◆ equilibriumStorage()

double openswmm::twoD::soil::equilibriumStorage ( const Params & p,
double L )
noexcept

Hydrostatic-equilibrium storage of a column of thickness L (m of water): ∫₀ᴸ θ(ψ) dψ. Gardner and Brooks–Corey are closed form; Russo and van Genuchten use fixed-order Gauss–Legendre.

Parameters
[in]pBorrowed validated SI soil law: Ks m/s, alpha 1/m, psi_b m, 0 <= theta_r < theta_s <= 1, lambda > 0, vg_n > 1 and admissible dimensionless vg_L.
Note
Pure scalar calculation with no allocation or retained references. Physical parameter validity is established upstream; numerical floors do not replace model validation.
Parameters
[in]LFinite unsaturated column thickness in m; storage clamps negative L to zero, alphaL uses a 1e-3 m thickness floor.
Returns
Hydrostatic column storage in metres of WATER, including residual water, with four-point quadrature for Russo/van Genuchten.
Here is the caller graph for this function:

◆ feddesStress()

double openswmm::twoD::soil::feddesStress ( double psi,
double psi_w )
noexcept

Feddes-style smooth stress multiplier on potential ET, from the column's mean suction. 1 in the readily-available range, falling smoothly to 0 at the wilting point — no if (infil <= 0) gate, which is the behaviour §7 retires. psi_w wilting suction (m).

Parameters
[in]psiFinite suction in m; <= 0 receives no water-stress reduction.
[in]psi_wFinite wilting suction in m, numerically floored at 1e-6 m.
Returns
Dimensionless multiplier [0,1]: 1 at nonpositive psi, 0 at/above the floored wilting suction, smoothstep between. No allocation/state mutation.

◆ rechargeQ0()

double openswmm::twoD::soil::rechargeQ0 ( const Params & p,
double L,
double hu )
noexcept

Closure-A quasi-steady recharge (m/s). + down, − capillary rise.

Parameters
[in]Lunsaturated column thickness z_s − h_g (m)
[in]hubulk unsaturated storage as an equivalent water depth (m) For Gardner this IS eq. 22; see the file header for the other three.
[in]pBorrowed validated SI soil law: Ks m/s, alpha 1/m, psi_b m, 0 <= theta_r < theta_s <= 1, lambda > 0, vg_n > 1 and admissible dimensionless vg_L.
Note
Pure scalar calculation with no allocation or retained references. Physical parameter validity is established upstream; numerical floors do not replace model validation.
Returns
Water flux in m/s, positive downward and negative capillary rise. Uses a 1e-3 m thickness floor, converts water storage to saturation scale internally, and returns zero for singular/nonfinite computed rates.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ relativeConductivity()

double openswmm::twoD::soil::relativeConductivity ( const Params & p,
double psi )
noexcept

Relative conductivity Kr(ψ) ∈ [0, 1].

Parameters
[in]pBorrowed validated SI soil law: Ks m/s, alpha 1/m, psi_b m, 0 <= theta_r < theta_s <= 1, lambda > 0, vg_n > 1 and admissible dimensionless vg_L.
Note
Pure scalar calculation with no allocation or retained references. Physical parameter validity is established upstream; numerical floors do not replace model validation.
Parameters
[in]psiFinite suction magnitude in m; nonpositive suction is treated as saturated by retention/conductivity.
Returns
Dimensionless relative conductivity in [0,1]; underflow may produce exactly zero.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ suctionAtSaturation()

double openswmm::twoD::soil::suctionAtSaturation ( const Params & p,
double Se )
noexcept

Suction head at a given effective saturation — the retention inverse, needed to give the σ column a ψ from its θ. Returns 0 at Se ≥ 1.

Parameters
[in]pBorrowed validated SI soil law: Ks m/s, alpha 1/m, psi_b m, 0 <= theta_r < theta_s <= 1, lambda > 0, vg_n > 1 and admissible dimensionless vg_L.
Note
Pure scalar calculation with no allocation or retained references. Physical parameter validity is established upstream; numerical floors do not replace model validation.
Parameters
[in]SeFinite dimensionless effective saturation, numerically clamped to [1e-8,1].
Returns
Suction in m; zero near saturation. Russo uses at most six Newton iterations and returns the final estimate without a convergence status.
Here is the caller graph for this function:

◆ waterContent()

double openswmm::twoD::soil::waterContent ( const Params & p,
double psi )
noexcept

Water content θ(ψ) = θ_r + Se·(θ_s − θ_r).

Parameters
[in]pBorrowed validated SI soil law: Ks m/s, alpha 1/m, psi_b m, 0 <= theta_r < theta_s <= 1, lambda > 0, vg_n > 1 and admissible dimensionless vg_L.
Note
Pure scalar calculation with no allocation or retained references. Physical parameter validity is established upstream; numerical floors do not replace model validation.
Parameters
[in]psiFinite suction magnitude in m; nonpositive suction is treated as saturated by retention/conductivity.
Returns
Dimensionless volumetric water content theta_r + Se*(theta_s-theta_r).
Here is the call graph for this function:
Here is the caller graph for this function: