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

Per-cell resolved parameters and state (SoA). More...

#include <SubsurfaceData.hpp>

Collaboration diagram for openswmm::twoD::SubsurfaceState:

Public Member Functions

void resize (int n, int m)
 < the kernel ran this simulation
 
double storage () const noexcept
 Total water in both zones (m³) — the continuity check's storage term.
 
double liveStorage () const noexcept
 G-O: everything the aquifer HOLDS now, including water parked in a side accumulator (in flight between cells, received from the surface and not yet absorbed, pushed out and not yet taken) — what SWMM_GW2D_LED_STORAGE reports. nacc is deliberately not subtracted: that water is still inside hg until a cell applies it.
 
double ledgeredStorage () const noexcept
 G-O: the storage the LEDGER can account for — holdings less the two surface accumulators, which are always one firing out of phase with led_infil_in / led_dunne (see continuityResidual).
 
double continuityResidual () const noexcept
 G-O: ledgeredStorage − led_init_storage − (in − out) with in = infil_in + lateral.
 

Public Attributes

int n_cells = 0
 
int m_layers = 0
 σ layers per closure-B column (fixed)
 
std::vector< double > Ks
 
std::vector< double > zs
 
std::vector< double > theta_s
 
std::vector< double > theta_r
 
std::vector< double > alpha
 
std::vector< double > psi_b
 
std::vector< double > lambda
 
std::vector< double > vg_n
 
std::vector< double > vg_L
 
std::vector< double > c_loss
 
std::vector< int8_t > soil_char
 SoilChar.
 
std::vector< int8_t > closure
 GwClosure, AUTO already resolved.
 
std::vector< double > area
 cell planimetric area (m²)
 
std::vector< double > z_bed
 aquifer bottom elevation (m) = cell z − zs
 
std::vector< double > hg
 saturated thickness (m)
 
std::vector< double > hu
 
std::vector< double > theta_sigma
 
std::vector< double > q0_last
 recharge (m/s), + down, − capillary rise
 
std::vector< double > qnode_last
 node exchange (m³/s), + into the pipe
 
std::vector< double > qlat_last
 net lateral Darcy into the cell (m³/s)
 
std::vector< double > qdeep_last
 deep loss (m/s)
 
std::vector< double > qet_last
 subsurface ET (m/s, ≥ 0 out)
 
std::vector< double > dunne_last
 saturation-excess to the surface (m³/s)
 
std::vector< double > qplus_last
 infiltration delivered in (m/s)
 
std::vector< double > infil_capacity
 
std::vector< double > infil_remaining
 
std::vector< double > infil_refresh
 
std::vector< double > infil_interval
 
std::vector< double > wetting_front
 
std::vector< double > reject_last
 
std::vector< double > reject_cumulative
 
std::vector< double > dunne_cumulative
 
std::vector< double > et_pending
 
std::vector< double > et_potential_cumulative
 
std::vector< double > et_surface_cumulative
 
std::vector< double > et_soil_cumulative
 
std::vector< double > et_unused_cumulative
 
std::vector< double > et_surface_last
 
std::vector< double > et_potential_last
 
std::vector< double > et_stress
 
std::vector< double > et_refresh
 
std::vector< double > qlink_last
 G-X3: conduit seepage delivered in (m³/s)
 
std::vector< double > dt_cell
 min(Δt_g, Δt_u) per cell (s)
 
std::vector< uint8_t > tier
 
std::vector< double > eacc_L
 
std::vector< double > eacc_R
 
std::vector< double > xacc_from_surface
 
std::vector< double > xacc_to_surface
 
std::vector< double > nacc
 
std::vector< double > lacc
 
double led_recharge = 0.0
 unsat → sat (negative = capillary rise)
 
double led_lateral = 0.0
 net lateral Darcy across the domain edge
 
double led_deep = 0.0
 deep percolation out
 
double led_node = 0.0
 node exchange, + out of the aquifer
 
double led_reject = 0.0
 rejected top-interface delivery returned to surface
 
double led_dunne = 0.0
 saturation excess to the surface
 
double led_caprise = 0.0
 capillary rise (the negative recharge share)
 
double led_et = 0.0
 subsurface ET out
 
double led_infil_in = 0.0
 q⁺ delivered from the surface
 
double led_link = 0.0
 
double led_subcatch_in = 0.0
 
double led_init_storage = 0.0
 
double led_final_storage = 0.0
 
double led_source_in = 0.0
 
double led_source_out = 0.0
 wells, m3; separate from node/link exchange
 
double led_boundary_in = 0
 
double led_boundary_out = 0
 gross split of led_lateral; not counted twice
 
bool active = false
 

Detailed Description

Per-cell resolved parameters and state (SoA).

Sized to the mesh cell count at initialize. Under MODE PER_SUBCATCH the "mesh" is one degenerate cell per subcatchment and every lateral term is absent — the identical code path, which is what makes G1 and G2 the same kernel.

Member Function Documentation

◆ continuityResidual()

double openswmm::twoD::SubsurfaceState::continuityResidual ( ) const
noexcept

G-O: ledgeredStorage − led_init_storage − (in − out) with in = infil_in + lateral.

  • link + source_in, out = deep + node + et + dunne + reject + source_out; recharge and capillary rise are internal to a cell and do not appear. Zero to machine precision for a conserving kernel (swmm_gw2d_get_continuity_error).
Returns
Signed water balance residual m3: ledgeredStorage minus initial storage and net external ledger delivery. Source wells and rejected top delivery are included; recharge and capillary rise are internal and omitted. Positive means more accounted storage than net input.
Note
No normalization, tolerance check, mutation or phase synchronization occurs here.
Here is the call graph for this function:

◆ ledgeredStorage()

double openswmm::twoD::SubsurfaceState::ledgeredStorage ( ) const
noexcept

G-O: the storage the LEDGER can account for — holdings less the two surface accumulators, which are always one firing out of phase with led_infil_in / led_dunne (see continuityResidual).

Returns
storage() plus eacc_L/eacc_R, in m3. Surface-transfer and conduit receipts are excluded to match their ledger booking phase; this is not all current water holdings.
Note
Requires stable, correctly sized physical state; no arrays or ledgers are changed.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ liveStorage()

double openswmm::twoD::SubsurfaceState::liveStorage ( ) const
noexcept

G-O: everything the aquifer HOLDS now, including water parked in a side accumulator (in flight between cells, received from the surface and not yet absorbed, pushed out and not yet taken) — what SWMM_GW2D_LED_STORAGE reports. nacc is deliberately not subtracted: that water is still inside hg until a cell applies it.

Returns
storage() plus eacc_L, eacc_R, xacc_from_surface, xacc_to_surface and lacc, in m3. Node reservations nacc are excluded because their water remains in hg until gathered. Uses the current receipt phase; requires stable, consistently sized state and performs no validation.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ resize()

void openswmm::twoD::SubsurfaceState::resize ( int n,
int m )

< the kernel ran this simulation

Reset cell-sized arrays to default parameters, empty states and diagnostic sentinels.

Parameters
[in]nRequested cell count; negative values become zero.
[in]mRequested equal hydraulic layers; values below one become one. theta_sigma uses m_layers*n_cells entries in layer-major order.
Note
Resets cell diagnostics, accumulators and led_boundary_in/out, but retains all other scalar ledgers, active, and solver-sized eacc_L/eacc_R/nacc. Callers must reset those separately when starting another simulation. Allocation exceptions can leave dimensions and earlier arrays already changed; no transaction or extent-overflow check is provided. Invalidates vector views.

◆ storage()

double openswmm::twoD::SubsurfaceState::storage ( ) const
noexcept

Total water in both zones (m³) — the continuity check's storage term.

Returns
Water volume m3 in both physical zones. Saturated contribution is hg*theta_s*area; SIGMA integrates nonnegative unsaturated length against theta_sigma, other closures use hu.
Note
Arrays and layer-major extents must match n_cells/m_layers. No validation, clipping of stored water contents, accumulation receipts or synchronization is performed.
Here is the caller graph for this function:

Member Data Documentation

◆ active

bool openswmm::twoD::SubsurfaceState::active = false

◆ alpha

std::vector<double> openswmm::twoD::SubsurfaceState::alpha

◆ area

std::vector<double> openswmm::twoD::SubsurfaceState::area

cell planimetric area (m²)

◆ c_loss

std::vector<double> openswmm::twoD::SubsurfaceState::c_loss

◆ closure

std::vector<int8_t> openswmm::twoD::SubsurfaceState::closure

GwClosure, AUTO already resolved.

◆ dt_cell

std::vector<double> openswmm::twoD::SubsurfaceState::dt_cell

min(Δt_g, Δt_u) per cell (s)

◆ dunne_cumulative

std::vector<double> openswmm::twoD::SubsurfaceState::dunne_cumulative

◆ dunne_last

std::vector<double> openswmm::twoD::SubsurfaceState::dunne_last

saturation-excess to the surface (m³/s)

◆ eacc_L

std::vector<double> openswmm::twoD::SubsurfaceState::eacc_L

Lateral Darcy side accumulators, one pair per unique GW edge — the same ±ΔV strategy as the surface facc_L_/facc_R_, which is what makes cross-tier conservation a property inherited rather than re-proved (G-B).

◆ eacc_R

std::vector<double> openswmm::twoD::SubsurfaceState::eacc_R

◆ et_pending

std::vector<double> openswmm::twoD::SubsurfaceState::et_pending

◆ et_potential_cumulative

std::vector<double> openswmm::twoD::SubsurfaceState::et_potential_cumulative

◆ et_potential_last

std::vector<double> openswmm::twoD::SubsurfaceState::et_potential_last

◆ et_refresh

std::vector<double> openswmm::twoD::SubsurfaceState::et_refresh

◆ et_soil_cumulative

std::vector<double> openswmm::twoD::SubsurfaceState::et_soil_cumulative

◆ et_stress

std::vector<double> openswmm::twoD::SubsurfaceState::et_stress

◆ et_surface_cumulative

std::vector<double> openswmm::twoD::SubsurfaceState::et_surface_cumulative

◆ et_surface_last

std::vector<double> openswmm::twoD::SubsurfaceState::et_surface_last

◆ et_unused_cumulative

std::vector<double> openswmm::twoD::SubsurfaceState::et_unused_cumulative

◆ hg

std::vector<double> openswmm::twoD::SubsurfaceState::hg

saturated thickness (m)

◆ hu

std::vector<double> openswmm::twoD::SubsurfaceState::hu

closure A: bulk unsat storage (m of water)

◆ infil_capacity

std::vector<double> openswmm::twoD::SubsurfaceState::infil_capacity

◆ infil_interval

std::vector<double> openswmm::twoD::SubsurfaceState::infil_interval

◆ infil_refresh

std::vector<double> openswmm::twoD::SubsurfaceState::infil_refresh

◆ infil_remaining

std::vector<double> openswmm::twoD::SubsurfaceState::infil_remaining

◆ Ks

std::vector<double> openswmm::twoD::SubsurfaceState::Ks

◆ lacc

std::vector<double> openswmm::twoD::SubsurfaceState::lacc

G-X3: conduit-seepage accumulator per cell (m³, + into the aquifer), booked by the router at the ROUTING cadence from the conduits' seepage rates and gathered at the GW cell's firing — the xacc_from_surface pattern, one phase behind led_link for the same reason.

◆ lambda

std::vector<double> openswmm::twoD::SubsurfaceState::lambda

◆ led_boundary_in

double openswmm::twoD::SubsurfaceState::led_boundary_in = 0

◆ led_boundary_out

double openswmm::twoD::SubsurfaceState::led_boundary_out = 0

gross split of led_lateral; not counted twice

◆ led_caprise

double openswmm::twoD::SubsurfaceState::led_caprise = 0.0

capillary rise (the negative recharge share)

◆ led_deep

double openswmm::twoD::SubsurfaceState::led_deep = 0.0

deep percolation out

◆ led_dunne

double openswmm::twoD::SubsurfaceState::led_dunne = 0.0

saturation excess to the surface

◆ led_et

double openswmm::twoD::SubsurfaceState::led_et = 0.0

subsurface ET out

◆ led_final_storage

double openswmm::twoD::SubsurfaceState::led_final_storage = 0.0

◆ led_infil_in

double openswmm::twoD::SubsurfaceState::led_infil_in = 0.0

q⁺ delivered from the surface

◆ led_init_storage

double openswmm::twoD::SubsurfaceState::led_init_storage = 0.0

◆ led_lateral

double openswmm::twoD::SubsurfaceState::led_lateral = 0.0

net lateral Darcy across the domain edge

◆ led_link

double openswmm::twoD::SubsurfaceState::led_link = 0.0

G-X3: conduit seepage delivered in

◆ led_node

double openswmm::twoD::SubsurfaceState::led_node = 0.0

node exchange, + out of the aquifer

◆ led_recharge

double openswmm::twoD::SubsurfaceState::led_recharge = 0.0

unsat → sat (negative = capillary rise)

◆ led_reject

double openswmm::twoD::SubsurfaceState::led_reject = 0.0

rejected top-interface delivery returned to surface

◆ led_source_in

double openswmm::twoD::SubsurfaceState::led_source_in = 0.0

◆ led_source_out

double openswmm::twoD::SubsurfaceState::led_source_out = 0.0

wells, m3; separate from node/link exchange

◆ led_subcatch_in

double openswmm::twoD::SubsurfaceState::led_subcatch_in = 0.0

Diagnostic split of led_infil_in: the share booked from 1D subcatchments without a lumped aquifer, counted at delivery (not a second inflow — continuityResidual does not use it).

◆ m_layers

int openswmm::twoD::SubsurfaceState::m_layers = 0

σ layers per closure-B column (fixed)

◆ n_cells

int openswmm::twoD::SubsurfaceState::n_cells = 0

◆ nacc

std::vector<double> openswmm::twoD::SubsurfaceState::nacc

Node-exchange accumulator, per coupled node (m³), booked at tier-0 node-head sampling and gathered at the GW cell's firing.

◆ psi_b

std::vector<double> openswmm::twoD::SubsurfaceState::psi_b

◆ q0_last

std::vector<double> openswmm::twoD::SubsurfaceState::q0_last

recharge (m/s), + down, − capillary rise

◆ qdeep_last

std::vector<double> openswmm::twoD::SubsurfaceState::qdeep_last

deep loss (m/s)

◆ qet_last

std::vector<double> openswmm::twoD::SubsurfaceState::qet_last

subsurface ET (m/s, ≥ 0 out)

◆ qlat_last

std::vector<double> openswmm::twoD::SubsurfaceState::qlat_last

net lateral Darcy into the cell (m³/s)

◆ qlink_last

std::vector<double> openswmm::twoD::SubsurfaceState::qlink_last

G-X3: conduit seepage delivered in (m³/s)

◆ qnode_last

std::vector<double> openswmm::twoD::SubsurfaceState::qnode_last

node exchange (m³/s), + into the pipe

◆ qplus_last

std::vector<double> openswmm::twoD::SubsurfaceState::qplus_last

infiltration delivered in (m/s)

◆ reject_cumulative

std::vector<double> openswmm::twoD::SubsurfaceState::reject_cumulative

◆ reject_last

std::vector<double> openswmm::twoD::SubsurfaceState::reject_last

◆ soil_char

std::vector<int8_t> openswmm::twoD::SubsurfaceState::soil_char

◆ theta_r

std::vector<double> openswmm::twoD::SubsurfaceState::theta_r

◆ theta_s

std::vector<double> openswmm::twoD::SubsurfaceState::theta_s

◆ theta_sigma

std::vector<double> openswmm::twoD::SubsurfaceState::theta_sigma

Closure B: layer water content θ, [layer * n_cells + cell] — layer-major so a fixed-layer sweep walks contiguous cells and vectorizes ACROSS columns (the σ pivot's key win over the draft's per-cell MOC column).

◆ tier

std::vector<uint8_t> openswmm::twoD::SubsurfaceState::tier

assigned tier

◆ vg_L

std::vector<double> openswmm::twoD::SubsurfaceState::vg_L

◆ vg_n

std::vector<double> openswmm::twoD::SubsurfaceState::vg_n

◆ wetting_front

std::vector<double> openswmm::twoD::SubsurfaceState::wetting_front

◆ xacc_from_surface

std::vector<double> openswmm::twoD::SubsurfaceState::xacc_from_surface

Cross-domain accumulator: volume (m³) the SURFACE booked for this GW cell at the surface's finer cadence, gathered at the GW firing.

◆ xacc_to_surface

std::vector<double> openswmm::twoD::SubsurfaceState::xacc_to_surface

…and the reverse: volume the GW cell owes the surface twin (Dunne, exfiltration), gathered by the surface cell.

◆ z_bed

std::vector<double> openswmm::twoD::SubsurfaceState::z_bed

aquifer bottom elevation (m) = cell z − zs

◆ zs

std::vector<double> openswmm::twoD::SubsurfaceState::zs

The documentation for this struct was generated from the following files: