![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
Classes | |
| struct | NetworkMeshData |
| SoA mesh geometry and topology for the FV network solver. More... | |
| struct | NetworkStateData |
| Mutable solver state — the conserved variables and the node volumes. More... | |
| struct | SpeciesKernelView |
| Non-owning view over everything the species kernels read and write. More... | |
Enumerations | |
| enum class | Limiter |
| Slope limiter used by the second-order (MUSCL) reconstruction. More... | |
| enum class | ScalarScheme |
| Reconstruction used for the advected scalar field. More... | |
Functions | |
| void | reconstructScalars (const SpeciesKernelView &v, double dt) |
| Build bounded face-native concentrations and conservative limited scalar fluxes for all rows. | |
| void | limitSpeciesFluxes (const SpeciesKernelView &v, int species, double dt) |
| Assemble the face species fluxes and limit them (Zalesak FCT). | |
| void | dispersionSolve (const SpeciesKernelView &v, double dt) |
| Apply an implicit per-chain longitudinal dispersion solve to every native scalar row. | |
| double | limitSlope (double a, double b, Limiter lim) |
| Slope limiters for the second-order scalar reconstruction. All three are TVD; superbee is the sharpest and can artificially steepen smooth profiles, minmod the most diffusive and most robust. (Moved verbatim from ExplicitFvSolver.cpp; also used by the solver's hydrodynamic reconstructState.) | |
|
strong |
Slope limiter used by the second-order (MUSCL) reconstruction.
|
strong |
Reconstruction used for the advected scalar field.
| void openswmm::transport::fvkernels::dispersionSolve | ( | const SpeciesKernelView & | v, |
| double | dt ) |
Apply an implicit per-chain longitudinal dispersion solve to every native scalar row.
| [in] | v | Nonnull prepared mesh/state; cell_phi extent n_species*n_cells, area n_cells, valid chain CSR/cell indices and positive cell_dx ft. Optional cell_dispersion must cover n_cells with finite nonnegative ft2/s, overriding scalar dispersion of same units. View/pointees borrowed only for call; state scalar rows require exclusive access. |
| [in] | dt | Finite nonnegative dispersion duration s chosen by owner. |
Implicit longitudinal dispersion (decision D-FV1): one Thomas tridiagonal solve per cell chain per species; unconditionally stable, removes the Δx²/(2·D_L) explicit constraint. E3: honours v.cell_dispersion when set (per-conduit / FISCHER coefficients); scalar v.dispersion otherwise.
Cell coefficient under either model. E3 bitwise-preservation note: each face uses 0.5*(D_i + D_j). With cd == nullptr both operands are v.dispersion, and 0.5*(D + D) == D EXACTLY in binary floating point (the ×2 and ×0.5 are exponent shifts), so the face coefficient — and therefore every downstream product in the same evaluation order — is bit-identical to the pre-E3 v.dispersion * … expression. The FV solver passes cd == nullptr and keeps its bitwise contract (E0 gate).
|
inline |
Slope limiters for the second-order scalar reconstruction. All three are TVD; superbee is the sharpest and can artificially steepen smooth profiles, minmod the most diffusive and most robust. (Moved verbatim from ExplicitFvSolver.cpp; also used by the solver's hydrodynamic reconstructState.)
Limit two one-sided scalar slopes with van Leer, superbee or minmod.
| [in] | a | Finite left one-sided concentration gradient in common spatial units. |
| [in] | b | Finite right gradient of the same row/units. |
| [in] | lim | Limiter selection; unknown enum uses minmod. |
| void openswmm::transport::fvkernels::limitSpeciesFluxes | ( | const SpeciesKernelView & | v, |
| int | species, | ||
| double | dt ) |
Assemble the face species fluxes and limit them (Zalesak FCT).
Bracketing the reconstructed FACE value between its two cells is necessary but NOT sufficient for the discrete maximum principle: under reversing, unsteady flow with the cell areas evolving underneath the scalar, a face value legitimately inside its bracket can still drain more solute than its donor cell holds. Measured: QUICKEST-ULTIMATE produced −1.3e-3 on a step-function advection case with wall reflections, which is not acceptable in a water-quality model.
The fix has to limit the FLUX, not the result. Clipping the updated concentration would enforce the bound but destroy exact solute conservation (§6.11c) — the two properties trade off, and Zalesak (1979) is the construction that keeps both: blend each face's high-order flux back toward first-order upwind by the largest factor that no incident cell's bound rejects. The SAME limited flux updates both incident cells, so conservation is untouched.
| [in] | v | Prepared nonnull borrowed view; f_mass, face state/flux and active face vectors cover n_faces, active cell flags n_cells; old cell_phi and reconstructed face rows cover all species*cell/ face products. Writable f_phi_flux matches row-face layout; all low/anti/td/area/rplus/rminus scratch vectors are distinct and caller-owned. Every active cell's two face indices/sides and chain lengths must be valid, with positive dx; all borrowed owners live and stable through call. |
| [in] | species | Valid zero-based native row below state.n_species; unchecked. |
| [in] | dt | Positive finite hydraulic substep s, strictly nonzero for FCT capacity division. |
Assemble the face species fluxes and limit them (Zalesak FCT). See the implementation notes: limits the FLUX, not the result, so the discrete maximum principle and exact solute conservation hold together.
The flux record with the positivity-scaled mass flux substituted in, so the species rides on exactly the water the hydrodynamic update moved. (Formerly ExplicitFvSolver::adjustedFlux.)
| void openswmm::transport::fvkernels::reconstructScalars | ( | const SpeciesKernelView & | v, |
| double | dt ) |
Build bounded face-native concentrations and conservative limited scalar fluxes for all rows.
| [in] | v | Borrowed view with nonnull mesh/state and all scratch/face/velocity/active-list pointers accessed by reconstruction and limitSpeciesFluxes, even when n_species<=0 because aliases are bound first. Mesh/state dimensions and all indices must be prepared and mutually consistent. cell_phi extent n_species*n_cells; face-native buffers n_species*n_faces; slope n_cells, velocity n_cells, contact-speed n_faces. Caller retains every owner alive/stable and supplies exclusive writable scratch. |
| [in] | dt | Positive finite accepted hydraulic substep s, required by Courant/FCT capacity arithmetic. |
Scalar reconstruction — the anti-diffusion layer (FV plan §3.2). Computes limited face values for every species and calls limitSpeciesFluxes to assemble/limit the face species fluxes into f_phi_flux.