![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
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 |
| 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. | |
| 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 | faceFluxReconBed (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, double zLf, double zRf) noexcept |
| Second-order face flux with independently reconstructed depth/bed. | |
| 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 |
| Piecewise-constant-bed compatibility entry point. | |
| OPENSWMM_KERNEL_FN double | 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. | |
| OPENSWMM_KERNEL_FN void | 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. | |
| OPENSWMM_KERNEL_FN double | 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. | |
| 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 |
|
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.
| [in] | w | Finite cell-centered variable in the variable's own units. |
| [in] | wf | Finite unlimited extrapolated face value in the same units. |
| [in] | wmin | Minimum over the cell and neighbors; must satisfy wmin <= w. |
| [in] | wmax | Maximum over the cell and neighbors; must satisfy w <= wmax. |
|
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.
| [in] | q | Finite signed unit-width discharge, m2/s; sign is squared. |
|
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)
Newton on s from the interior depth with positive/finite-step guards (≤ 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.
| [in] | r | Finite outgoing normal Riemann invariant u+2*sqrt(g*h), m/s. |
| [in] | q | Finite prescribed normal unit-width discharge, m2/s; outward-positive, inflow negative. |
| [in] | h_interior | Finite nonnegative interior depth/fallback, m. |
|
noexcept |
Full face evaluation: hydrostatic reconstruction, rotation, HLLC, rotation back, and the per-side bed-slope corrections.
| [in] | etaL | Finite left cell free surface, m. |
| [in] | hL | Finite nonnegative left mean depth, m. |
| [in] | qxL | Finite left X unit-width discharge, m2/s. |
| [in] | qyL | Finite left Y unit-width discharge, m2/s. |
| [in] | etaR | Finite right cell free surface, m. |
| [in] | hR | Finite nonnegative right mean depth, m. |
| [in] | qxR | Finite right X unit-width discharge, m2/s. |
| [in] | qyR | Finite right Y unit-width discharge, m2/s. |
| [in] | nx | Finite X component of a unit normal directed left-to-right. |
| [in] | ny | Finite Y component of the same normal. |
| [in] | h_dry | Finite nonnegative depth threshold in m for shoreline velocity suppression. |
| [out] | out | Completely assigned Cartesian FaceFlux: mass m2/s, momentum m3/s2, sstar m/s. |
| [out] | corrL_x | Left-side X bed-source correction, m3/s2 per unit face length. |
| [out] | corrL_y | Left-side Y bed-source correction in the same units. |
| [out] | corrR_x | Right-side X bed-source correction with opposite outward normal, m3/s2. |
| [out] | corrR_y | Right-side Y bed-source correction, m3/s2. |
|
noexcept |
Piecewise-constant-bed compatibility entry point.
| [in] | etaLf | Finite reconstructed left face free surface, m. |
| [in] | uxLf | Finite reconstructed left X velocity, m/s. |
| [in] | uyLf | Finite reconstructed left Y velocity, m/s. |
| [in] | zL | Finite left cell-equivalent bed elevation, m. |
| [in] | hL_cell | Finite nonnegative left cell mean depth, m. |
| [in] | etaRf | Finite reconstructed right face free surface, m. |
| [in] | uxRf | Finite reconstructed right X velocity, m/s. |
| [in] | uyRf | Finite reconstructed right Y velocity, m/s. |
| [in] | zR | Finite right cell-equivalent bed elevation, m. |
| [in] | hR_cell | Finite nonnegative right cell mean depth, m. |
| [in] | nx | Finite X component of a unit normal directed left-to-right. |
| [in] | ny | Finite Y component of the same normal. |
| [in] | h_dry | Finite nonnegative depth threshold in m for shoreline velocity suppression. |
| [out] | out | Completely assigned Cartesian FaceFlux: mass m2/s, momentum m3/s2, sstar m/s. |
| [out] | corrL_x | Left-side X bed-source correction, m3/s2 per unit face length. |
| [out] | corrL_y | Left-side Y bed-source correction in the same units. |
| [out] | corrR_x | Right-side X bed-source correction with opposite outward normal, m3/s2. |
| [out] | corrR_y | Right-side Y bed-source correction, m3/s2. |
|
noexcept |
Second-order face flux with independently reconstructed depth/bed.
zLf/zRf are face beds from the limited eta and depth reconstruction; zL/zR are the cell-equivalent beds. Add the hydrostatic face correction and the centered bed contribution -g*(h_cell+h_face)/2*(z_face-z_cell). The latter integrates a linear depth along the cell-to-face bed segment. For constant eta this reduces to g/2*(h_star^2-h_cell^2), preserving lake-at-rest balance even next to a first-order cell. On a flat bed the within-cell contribution vanishes. Face-depth positivity and cell-centered shoreline velocity are enforced by computeLimitedGradientsSwe().
| [in] | etaLf | Finite reconstructed left face free surface, m. |
| [in] | uxLf | Finite reconstructed left X velocity, m/s. |
| [in] | uyLf | Finite reconstructed left Y velocity, m/s. |
| [in] | zL | Finite left cell-equivalent bed elevation, m. |
| [in] | hL_cell | Finite nonnegative left cell mean depth, m. |
| [in] | etaRf | Finite reconstructed right face free surface, m. |
| [in] | uxRf | Finite reconstructed right X velocity, m/s. |
| [in] | uyRf | Finite reconstructed right Y velocity, m/s. |
| [in] | zR | Finite right cell-equivalent bed elevation, m. |
| [in] | hR_cell | Finite nonnegative right cell mean depth, m. |
| [in] | nx | Finite X component of a unit normal directed left-to-right. |
| [in] | ny | Finite Y component of the same normal. |
| [in] | h_dry | Finite nonnegative depth threshold in m for shoreline velocity suppression. |
| [out] | out | Completely assigned Cartesian FaceFlux: mass m2/s, momentum m3/s2, sstar m/s. |
| [out] | corrL_x | Left-side X bed-source correction, m3/s2 per unit face length. |
| [out] | corrL_y | Left-side Y bed-source correction in the same units. |
| [out] | corrR_x | Right-side X bed-source correction with opposite outward normal, m3/s2. |
| [out] | corrR_y | Right-side Y bed-source correction, m3/s2. |
| [in] | zLf | Finite reconstructed left face bed elevation, m. |
| [in] | zRf | Finite reconstructed right face bed elevation, m. |
|
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.
| [in,out] | qx | X unit-width discharge, m2/s. |
| [in,out] | qy | Y unit-width discharge, m2/s; distinct from qx. |
| [in] | h | Finite cell mean depth, m; nonpositive zeros both discharges. |
| [in] | n | Finite nonnegative Manning roughness, s/m^(1/3). |
| [in] | dt | Finite nonnegative update duration, s. |
|
noexcept |
HLLC flux in the face-normal frame.
| [in] | L | Borrowed finite reconstructed face state: nonnegative h in m and normal/tangential velocities in m/s. |
| [in] | R | Borrowed finite reconstructed face state: nonnegative h in m and normal/tangential velocities in m/s. |
| [out] | fh | Mass flux in m2/s, positive left-to-right. |
| [out] | fn | Normal momentum flux in m3/s2. |
| [out] | ft | Tangential momentum flux in m3/s2. |
| [out] | sstar | Contact-wave speed in m/s for passive-scalar donor selection. |
|
noexcept |
Physical flux of the SWE in the normal frame: [h·un, h·un² + ½g h², h·un·ut].
| [in] | s | Borrowed finite reconstructed face state: nonnegative h in m and normal/tangential velocities in m/s. |
| [out] | fh | Mass/unit-width volume flux in m2/s. |
| [out] | fn | Normal momentum flux in m3/s2. |
| [out] | ft | Tangential momentum flux in m3/s2. |
|
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.
| [in] | L | Borrowed finite reconstructed face state: nonnegative h in m and normal/tangential velocities in m/s. |
| [in] | R | Borrowed finite reconstructed face state: nonnegative h in m and normal/tangential velocities in m/s. |
| [out] | sl | Estimated leftmost wave speed, m/s. |
| [out] | sr | Estimated rightmost wave speed, m/s. |
|
inlineconstexpr |