![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
The two-zone groundwater kernel (G-steps 3, 6-12, 14, 16). More...
#include "core/ProcessPerf.hpp"#include "SubsurfaceSolver.hpp"#include "../coupling/Rk2RuntimeSources.hpp"#include "GroundwaterDispersion.hpp"#include "LayerTransport.hpp"#include "../data/MeshData.hpp"#include "../data/SolverOptions2D.hpp"#include "../data/SurfaceStateData.hpp"#include "../solver/InertialEdges.hpp"#include "../gw/GwTransportData.hpp"#include "../heat/LidNodeHeat.hpp"#include "../../data/NodeData.hpp"#include "../../transport/components/HeatFluxModules/SurfaceExchange.hpp"#include "../../core/SimulationContext.hpp"#include <algorithm>#include <cmath>#include <cstdio>#include <limits>#include <numeric>#include <stdexcept>Namespaces | |
| namespace | openswmm |
| namespace | openswmm::twoD |
The two-zone groundwater kernel (G-steps 3, 6-12, 14, 16).
Write total water per unit area as W = θ_s·h_g + S_col, with S_col the unsaturated column's storage. Each closure gives the same shape:
| closure | S_col | saturated equation |
|---|---|---|
| CLOSED_FORM | hᵤ, its own ODE | θ_s·ḣ_g = q₀ + lat/A − deep − node/A |
| SIGMA | Σ θ_j·L·Δσ | (θ_s − θ_bot)·ḣ_g = q₀_phys + … |
| ENSLAVED | hᵤ*(L), algebraic | (θ_s − θ(ψ=L))·ḣ_g = q⁺ + … |
For an unbounded SIGMA bottom flux, f_bot = q₀_phys − θ_bot·L̇, so θ_s·ḣ_g = f_bot rearranges to (θ_s − θ_bot)·ḣ_g = q₀_phys. The latter gives the table predictor. The final discrete balance uses actual bounded bottom water, compression surplus and residual support, since an explicit column sweep can limit or redirect these transfers.
ENSLAVED falls out of the same algebra: S_col = hᵤ*(L) gives Ṡ_col = d(hᵤ*)/dL · L̇ = −θ(ψ=L)·ḣ_g, since d(hᵤ*)/dL = θ(L) by the fundamental theorem. So the enslaved column contributes its top water content as a storage debit — no lag, no separate state, and q⁺ drives the table directly. This is the reduction plan step 14 asks for, and it is one line of code rather than a separate branch of physics.
fireCell gathers completed exchanges, computes Darcy recharge and a specific-yield table predictor. SIGMA then brackets the physical table interval while replaying the existing explicit column sweep from its original state. One final column/table pair closes the actual discrete bottom transfer; only excess outside the bracket becomes Dunne water or a withdrawal refund. CLOSED_FORM and ENSLAVED keep their existing update.