26#ifndef OPENSWMM_GROUNDWATER_HPP
27#define OPENSWMM_GROUNDWATER_HPP
29#ifndef OPENSWMM_RESTRICT
31# define OPENSWMM_RESTRICT __restrict
33# define OPENSWMM_RESTRICT __restrict__
38#include "../math/MathExpr.hpp"
42struct SimulationContext;
44namespace groundwater {
63static const char* GW_VAR_NAMES[] = {
64 "HGW",
"HSW",
"HCB",
"HGS",
"KS",
"K",
65 "THETA",
"PHI",
"FI",
"FU",
"A"
89 std::vector<double>
a1,
b1;
90 std::vector<double>
a2,
b2;
91 std::vector<double>
a3;
126 void init(
int n_subcatch);
147 const double* infil_rate,
const double* sw_head,
148 const double* frac_perv,
const double* perv_evap_rate);
157 static void batchUpperPerc(
167 static void batchGWFlow(
#define OPENSWMM_RESTRICT
Definition XSectBatch.hpp:41
Definition Groundwater.hpp:124
GWSoA & state()
Definition Groundwater.hpp:150
const GWSoA & state() const
Definition Groundwater.hpp:151
void execute(SimulationContext &ctx, double dt, double max_evap, const double *infil_rate, const double *sw_head, const double *frac_perv, const double *perv_evap_rate)
Compute groundwater for all subcatchments (batch).
Definition Groundwater.cpp:235
void init(int n_subcatch)
Definition Groundwater.cpp:62
GWVar
GW expression variable indices (matching legacy GWvariables enum).
Definition Groundwater.hpp:47
@ GWV_HSW
Surface water head.
Definition Groundwater.hpp:49
@ GWV_HCB
Channel bottom height (h_star)
Definition Groundwater.hpp:50
@ GWV_HGS
Ground surface height (total_depth)
Definition Groundwater.hpp:51
@ GWV_K
Unsaturated conductivity.
Definition Groundwater.hpp:53
@ GWV_FU
Upper zone percolation rate.
Definition Groundwater.hpp:57
@ GWV_A
Subcatchment area.
Definition Groundwater.hpp:58
@ GWV_PHI
Porosity.
Definition Groundwater.hpp:55
@ GWV_HGW
Water table height.
Definition Groundwater.hpp:48
@ GWV_MAX
Definition Groundwater.hpp:59
@ GWV_THETA
Upper zone moisture content.
Definition Groundwater.hpp:54
@ GWV_FI
Surface infiltration rate.
Definition Groundwater.hpp:56
@ GWV_KS
Saturated conductivity.
Definition Groundwater.hpp:52
Definition NodeCoupling.cpp:15
Central, reentrant simulation context.
Definition SimulationContext.hpp:274
Definition Groundwater.hpp:72
void resize(int n)
Definition Groundwater.cpp:27
std::vector< double > total_depth
Aquifer thickness (ft)
Definition Groundwater.hpp:86
std::vector< double > gw_flow
Lateral GW flow to node (cfs)
Definition Groundwater.hpp:102
std::vector< double > upper_evap
Upper zone evap (ft3/sec)
Definition Groundwater.hpp:103
std::vector< mathexpr::Expression > lateral_expr
Per-subcatch compiled lateral flow expression (added to standard formula).
Definition Groundwater.hpp:113
std::vector< double > lower_loss_coeff
Deep percolation coeff.
Definition Groundwater.hpp:85
std::vector< double > b2
Surface water interaction.
Definition Groundwater.hpp:90
std::vector< double > theta
Upper zone moisture content (0-φ)
Definition Groundwater.hpp:95
std::vector< double > tension_slope
Definition Groundwater.hpp:81
std::vector< double > porosity
Definition Groundwater.hpp:76
std::vector< double > old_flow
Previous step GW flow (for trapezoidal avg)
Definition Groundwater.hpp:99
std::vector< int > upper_evap_pat
Pattern index for monthly evap adjustment (-1 = none)
Definition Groundwater.hpp:83
std::vector< double > field_cap
Definition Groundwater.hpp:77
std::vector< double > max_infil_vol
Definition Groundwater.hpp:109
std::vector< double > lower_evap_depth
Definition Groundwater.hpp:84
std::vector< double > k_slope
Exponential decay slope.
Definition Groundwater.hpp:80
int n_subcatch
Definition Groundwater.hpp:73
std::vector< double > deep_loss
Definition Groundwater.hpp:105
std::vector< mathexpr::Expression > deep_expr
Per-subcatch compiled deep percolation expression (replaces standard formula).
Definition Groundwater.hpp:115
std::vector< double > b1
GW outflow.
Definition Groundwater.hpp:89
std::vector< double > wilt_point
Definition Groundwater.hpp:78
std::vector< double > a3
Cross-interaction.
Definition Groundwater.hpp:91
std::vector< double > upper_evap_frac
Definition Groundwater.hpp:82
std::vector< double > lower_depth
Lower zone depth (ft)
Definition Groundwater.hpp:96
std::vector< double > k_sat
Saturated conductivity (ft/sec)
Definition Groundwater.hpp:79
std::vector< double > a1
Definition Groundwater.hpp:89
std::vector< double > h_star
Threshold water table height (ft)
Definition Groundwater.hpp:92
std::vector< double > a2
Definition Groundwater.hpp:90
std::vector< double > lower_evap
Lower zone evap (ft3/sec)
Definition Groundwater.hpp:104