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

Classes

struct  Coefficients
 Discharge coefficients and the φ regularisation head. More...
 
struct  Geometry
 A coupling point's structure, SI. More...
 
struct  Result
 

Functions

OPENSWMM_EXCHANGE_HD double phi (double x, double eps)
 C¹-regularised √x: √x for x ≥ ε, (3/(2√ε))x − x²/(2ε^{3/2}) below.
 
OPENSWMM_EXCHANGE_HD double dphi (double x, double eps)
 dφ/dx (finite at 0).
 
OPENSWMM_EXCHANGE_HD double smoothstep (double t)
 Hermite smoothstep of t clamped to [0, 1].
 
OPENSWMM_EXCHANGE_HD double softmin (double a, double b, double &wa, double &wb)
 p-norm minimum, p = 16: (a^−16 + b^−16)^(−1/16) for a, b > 0, else 0. Evaluated as min / (1 + r^16)^(1/16), r = min/max ∈ (0, 1], with four square roots — no overflow, no pow. Weights ∂Q/∂a, ∂Q/∂b go to wa, wb.
 
OPENSWMM_EXCHANGE_HD Result exchange (const Geometry &geo, const Coefficients &c, double h2, double h1)
 Evaluate the bidirectional regularized weir/orifice exchange and damping.
 

Variables

constexpr double kGravity = 9.80665
 m/s²
 
constexpr double kSigmaBand = 0.1
 submergence blend width
 

Function Documentation

◆ dphi()

OPENSWMM_EXCHANGE_HD double openswmm::twoD::exchange::dphi ( double x,
double eps )

dφ/dx (finite at 0).

Parameters
[in]xFinite head difference in m; nonpositive values use the positive-side regularization derivative at zero.
[in]epsFinite strictly positive regularization head, m.
Returns
Positive-side derivative in 1/sqrt(m); for x <= 0 this is not the derivative of the clamped negative branch.
Note
Pure host/device scalar evaluation; invalid eps is not checked.
Here is the caller graph for this function:

◆ exchange()

OPENSWMM_EXCHANGE_HD Result openswmm::twoD::exchange::exchange ( const Geometry & geo,
const Coefficients & c,
double h2,
double h1 )

Evaluate the bidirectional regularized weir/orifice exchange and damping.

Parameters
[in]geoBorrowed validated geometry: crest m, weir length m, orifice area m2.
[in]cBorrowed nonnegative discharge coefficients and strictly positive h_eps in m.
[in]h2Finite surface water head, m in the crest datum.
[in]h1Finite network-node water head, m in the same datum.
Returns
Value-owned Result: q in m3/s, positive surface-to-network and negative network-to-surface; g in m2/s is nonnegative damping, with blend-weight derivatives deliberately omitted. Equal or below-crest inactive heads return zero.
Note
Inputs are not validated. Pure host/device calculation; no availability limiter, ledger mutation, or retained references.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ phi()

OPENSWMM_EXCHANGE_HD double openswmm::twoD::exchange::phi ( double x,
double eps )

C¹-regularised √x: √x for x ≥ ε, (3/(2√ε))x − x²/(2ε^{3/2}) below.

Parameters
[in]xFinite head difference in m; nonpositive values return zero.
[in]epsFinite strictly positive regularization head, m.
Returns
Regularized square root in sqrt(m).
Note
Pure host/device scalar evaluation; invalid eps is not checked.
Here is the caller graph for this function:

◆ smoothstep()

OPENSWMM_EXCHANGE_HD double openswmm::twoD::exchange::smoothstep ( double t)

Hermite smoothstep of t clamped to [0, 1].

Parameters
[in]tFinite dimensionless blend coordinate; clamped to [0,1].
Returns
Dimensionless Hermite blend in [0,1], with zero slope at both endpoints.
Note
Pure host/device calculation with no retained state.
Here is the caller graph for this function:

◆ softmin()

OPENSWMM_EXCHANGE_HD double openswmm::twoD::exchange::softmin ( double a,
double b,
double & wa,
double & wb )

p-norm minimum, p = 16: (a^−16 + b^−16)^(−1/16) for a, b > 0, else 0. Evaluated as min / (1 + r^16)^(1/16), r = min/max ∈ (0, 1], with four square roots — no overflow, no pow. Weights ∂Q/∂a, ∂Q/∂b go to wa, wb.

Parameters
[in]aFinite nonnegative first candidate flow, m3/s.
[in]bFinite nonnegative second candidate flow, m3/s.
[out]waDimensionless sensitivity to a; set to zero if either candidate is nonpositive.
[out]wbDimensionless sensitivity to b; set to zero if either candidate is nonpositive.
Returns
Smoothed limiting discharge in m3/s, no greater than min(a,b); zero if either candidate is nonpositive.
Precondition
wa and wb refer to separate output scalars. No pointer/state ownership or allocation.
Here is the caller graph for this function:

Variable Documentation

◆ kGravity

double openswmm::twoD::exchange::kGravity = 9.80665
constexpr

m/s²

◆ kSigmaBand

double openswmm::twoD::exchange::kSigmaBand = 0.1
constexpr

submergence blend width