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

Classes

struct  FaceFlux
 
struct  FaceSide
 

Functions

OPENSWMM_KERNEL_FN void physicalFlux (const FaceSide &s, double &fh, double &fn, double &ft) noexcept
 Physical flux of the SWE in the normal frame: [h·un, h·un² + ½g h², h·un·ut].
 
OPENSWMM_KERNEL_FN void waveSpeeds (const FaceSide &L, const FaceSide &R, double &sl, double &sr) noexcept
 
OPENSWMM_KERNEL_FN void hllcFlux (const FaceSide &L, const FaceSide &R, double &fh, double &fn, double &ft, double &sstar) noexcept
 HLLC flux in the face-normal frame.
 
OPENSWMM_KERNEL_FN bool faceFlux (double etaL, double hL, double qxL, double qyL, double etaR, double hR, double qxR, double qyR, double nx, double ny, double h_dry, FaceFlux &out, double &corrL_x, double &corrL_y, double &corrR_x, double &corrR_y) noexcept
 Full face evaluation: hydrostatic reconstruction, rotation, HLLC, rotation back, and the per-side bed-slope corrections.
 
OPENSWMM_KERNEL_FN bool faceFluxRecon (double etaLf, double uxLf, double uyLf, double zL, double hL_cell, double etaRf, double uxRf, double uyRf, double zR, double hR_cell, double nx, double ny, double h_dry, FaceFlux &out, double &corrL_x, double &corrL_y, double &corrR_x, double &corrR_y) noexcept
 Face flux from RECONSTRUCTED side states (RECONSTRUCTION_ORDER 2).
 
OPENSWMM_KERNEL_FN double bjLimiter (double w, double wf, double wmin, double wmax) noexcept
 
OPENSWMM_KERNEL_FN void frictionUpdate (double &qx, double &qy, double h, double n, double dt) noexcept
 
OPENSWMM_KERNEL_FN double criticalDepth (double q) noexcept
 
OPENSWMM_KERNEL_FN double depthFromInvariantAndDischarge (double r, double q, double h_interior) noexcept
 Ghost depth of a SUBCRITICAL prescribed-discharge boundary.
 

Variables

constexpr double kGravity = 9.80665
 

Function Documentation

◆ bjLimiter()

OPENSWMM_KERNEL_FN double openswmm::twoD::swe::bjLimiter ( double w,
double wf,
double wmin,
double wmax )
noexcept

Barth–Jespersen limiter factor φ ∈ [0, 1] for one cell/variable given the cell value w, the extrapolated face value wf and the min/max over the cell and its neighbours.

◆ criticalDepth()

OPENSWMM_KERNEL_FN double openswmm::twoD::swe::criticalDepth ( double q)
noexcept

Critical depth for a per-metre discharge q: (q²/g)^{1/3} — the ghost depth of a prescribed-flow boundary entering a dry cell.

◆ depthFromInvariantAndDischarge()

OPENSWMM_KERNEL_FN double openswmm::twoD::swe::depthFromInvariantAndDischarge ( double r,
double q,
double h_interior )
noexcept

Ghost depth of a SUBCRITICAL prescribed-discharge boundary.

One characteristic leaves the domain there, so its Riemann invariant r = u + 2c is carried out from the interior and, with the prescribed per-metre discharge q = u·h, fixes the boundary depth:

q/h + 2·sqrt(g·h) = r      ⇔      2·sqrt(g)·s³ − r·s² + q = 0,  s = sqrt(h)

Safeguarded Newton on s from the interior depth (bracketed to s > 0, ≤ 40 iterations); returns h_interior when it cannot converge — the caller's mass flux is prescribed either way, so a fallback only costs accuracy in the momentum flux, never conservation. Signs follow the outward normal: an inflow has q < 0.

◆ faceFlux()

OPENSWMM_KERNEL_FN bool openswmm::twoD::swe::faceFlux ( double etaL,
double hL,
double qxL,
double qyL,
double etaR,
double hR,
double qxR,
double qyR,
double nx,
double ny,
double h_dry,
FaceFlux & out,
double & corrL_x,
double & corrL_y,
double & corrR_x,
double & corrR_y )
noexcept

Full face evaluation: hydrostatic reconstruction, rotation, HLLC, rotation back, and the per-side bed-slope corrections.

Parameters
etaL,hL,qxL,qyLleft cell free surface, depth, unit discharge
etaR,hR,qxR,qyRright cell
nx,nyunit normal L→R
h_drydepth below which a cell's velocity is zero
outflux (x/y frame), positive L→R
corrL_x,corrL_yout: bed-slope correction for L, ½g(h*_L² − h_L²)·n̂ (per unit face length; multiply by ξ·Δt)
corrR_x,corrR_yout: for R, ½g(h*_R² − h_R²)·(−n̂)
Returns
true when the face carries any flux (at least one side wet after reconstruction); false ⇒ every output is zero.
Here is the call graph for this function:

◆ faceFluxRecon()

OPENSWMM_KERNEL_FN bool openswmm::twoD::swe::faceFluxRecon ( double etaLf,
double uxLf,
double uyLf,
double zL,
double hL_cell,
double etaRf,
double uxRf,
double uyRf,
double zR,
double hR_cell,
double nx,
double ny,
double h_dry,
FaceFlux & out,
double & corrL_x,
double & corrL_y,
double & corrR_x,
double & corrR_y )
noexcept

Face flux from RECONSTRUCTED side states (RECONSTRUCTION_ORDER 2).

The free surface and velocities are the MUSCL-extrapolated face values and the bed stays piecewise constant per cell (z_side = η_cell − h_cell); the bed-slope correction uses the reconstructed face depth, so at rest (zero gradients) the face reduces exactly to the first-order well-balanced form.

Parameters
etaLf,uxLf,uyLfleft face-extrapolated free surface and velocity
zL,hL_cellleft cell bed and cell-mean depth
etaRf,...right side likewise
Here is the call graph for this function:

◆ frictionUpdate()

OPENSWMM_KERNEL_FN void openswmm::twoD::swe::frictionUpdate ( double & qx,
double & qy,
double h,
double n,
double dt )
noexcept

Semi-implicit Manning friction on a cell's unit discharge over Δt: q⃗ ← q⃗ / (1 + g·Δt·n²·|q⃗| / h^{7/3}). Only shrinks |q⃗|; never reverses it.

◆ hllcFlux()

OPENSWMM_KERNEL_FN void openswmm::twoD::swe::hllcFlux ( const FaceSide & L,
const FaceSide & R,
double & fh,
double & fn,
double & ft,
double & sstar )
noexcept

HLLC flux in the face-normal frame.

Parameters
L,Rreconstructed side states (h*, un, ut)
fhout: mass flux (m²/s), positive L→R
fnout: normal-momentum flux (m³/s²)
ftout: tangential-momentum flux (m³/s²)
sstarout: contact speed (m/s)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ physicalFlux()

OPENSWMM_KERNEL_FN void openswmm::twoD::swe::physicalFlux ( const FaceSide & s,
double & fh,
double & fn,
double & ft )
noexcept

Physical flux of the SWE in the normal frame: [h·un, h·un² + ½g h², h·un·ut].

Here is the caller graph for this function:

◆ waveSpeeds()

OPENSWMM_KERNEL_FN void openswmm::twoD::swe::waveSpeeds ( const FaceSide & L,
const FaceSide & R,
double & sl,
double & sr )
noexcept

Wave-speed estimates S_L ≤ S_R (Toro 2001 §10.4): two-rarefaction estimate for wet–wet faces, the exact dry-bed front speeds otherwise.

Here is the caller graph for this function:

Variable Documentation

◆ kGravity

double openswmm::twoD::swe::kGravity = 9.80665
inlineconstexpr