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

Functions

OPENSWMM_KERNEL_FN double faceDischarge (double hf, double slope, double nf, double s_eps) noexcept
 Manning quasi-steady face discharge (m²/s, positive L→R) for face depth hf, surface slope S = (η_R − η_L)·inv_dx (positive ⇒ flow R→L), face Manning n_f and slope floor s_eps.
 
OPENSWMM_KERNEL_FN double cellDiffusiveDt (double alpha, double lchar, double h, double n, double slope_abs, double s_eps) noexcept
 Explicit-diffusion step bound for a cell of characteristic length L, depth h, Manning n and the largest face slope |S| among its faces (floored at s_eps): Δt = α · L² · n · √S / (4 · h^{5/3}). Returns a huge value for a dry cell.
 

Function Documentation

◆ cellDiffusiveDt()

OPENSWMM_KERNEL_FN double openswmm::twoD::diffusive::cellDiffusiveDt ( double alpha,
double lchar,
double h,
double n,
double slope_abs,
double s_eps )
noexcept

Explicit-diffusion step bound for a cell of characteristic length L, depth h, Manning n and the largest face slope |S| among its faces (floored at s_eps): Δt = α · L² · n · √S / (4 · h^{5/3}). Returns a huge value for a dry cell.

Parameters
[in]alphaFinite positive Courant/diffusion safety factor, dimensionless.
[in]lcharFinite positive cell characteristic length, m.
[in]hFinite nonnegative mean depth, m; nonpositive selects the dry sentinel.
[in]nFinite positive Manning coefficient, s/m^(1/3).
[in]slope_absFinite nonnegative largest face-slope magnitude, dimensionless.
[in]s_epsFinite positive dimensionless slope floor.
Returns
Explicit diffusion step bound in seconds, or 1e30 s for a dry cell.
Note
Pure host/device arithmetic: no allocation, exceptions, retained pointers or model state mutation. Caller supplies finite valid physical inputs; no general validation.

◆ faceDischarge()

OPENSWMM_KERNEL_FN double openswmm::twoD::diffusive::faceDischarge ( double hf,
double slope,
double nf,
double s_eps )
noexcept

Manning quasi-steady face discharge (m²/s, positive L→R) for face depth hf, surface slope S = (η_R − η_L)·inv_dx (positive ⇒ flow R→L), face Manning n_f and slope floor s_eps.

Parameters
[in]hfFinite face flow depth, m; nonpositive returns zero.
[in]slopeSigned dimensionless (eta_R-eta_L)/normal distance; positive drives right-to-left.
[in]nfFinite positive Manning coefficient, s/m^(1/3); nonpositive returns zero.
[in]s_epsFinite positive dimensionless slope-magnitude floor.
Returns
Unit-width discharge in m2/s, positive left-to-right; exactly zero for zero slope.
Note
Pure host/device arithmetic: no allocation, exceptions, retained pointers or model state mutation. Caller supplies finite valid physical inputs; no general validation.