OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
SigmaColumn.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2//
3// Copyright 2026 Caleb Buahin
4//
5// Licensed under the Apache License, Version 2.0 (the "License");
6// you may not use this file except in compliance with the License.
7// You may obtain a copy of the License at
8//
9// http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing, software
12// distributed under the License is distributed on an "AS IS" BASIS,
13// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14// See the License for the specific language governing permissions and
15// limitations under the License.
16
78
79#ifndef OPENSWMM_ENGINE_2D_SIGMA_COLUMN_HPP
80#define OPENSWMM_ENGINE_2D_SIGMA_COLUMN_HPP
81
83#include <vector>
84
85namespace openswmm::twoD::sigma {
86
92 double old_length = 0, new_length = 0, infiltration = 0, evaporation = 0;
94};
95
97struct ColumnStep {
98 // ---- in ----
99 double L_old = 1.0;
100 double L_new = 1.0;
101 double dt = 1.0;
102 bool forward_euler = false;
103 double grid_rate = 0.0;
104 double q_in = 0.0;
105 double wilting_suction = 150.0;
106 double et_stress = 0.0;
107 double q_et = 0.0;
109 -1.0;
110 double q0_phys = 0.0;
111 bool capillary = false;
112
113 const std::vector<double>* layer_inflow =
114 nullptr;
116
117 // ---- out ----
118 double f_top = 0.0;
119 double rejected = 0.0;
120 double f_bot = 0.0;
121 double et_taken = 0.0;
122 double theta_bot = 0.0;
123 double dt_limit = 1.0e30;
128 double overflow_to_sat = 0.0;
131 double deficit_from_sat = 0.0;
132};
133
162void advanceColumn(const soil::Params& p, double* theta, int m, int stride,
163 ColumnStep& st) noexcept;
164
170 bool fixed_velocity = false;
171 double dt_limit = 1.0e30;
172};
173
175void prepareColumn(const soil::Params& p, const double* theta, int m, int stride,
176 const ColumnStep& st, ColumnPreparation& prepared) noexcept;
177
180void advanceColumn(const soil::Params& p, double* theta, int m, int stride, ColumnStep& st,
181 const ColumnPreparation& prepared) noexcept;
182
201double columnDtLimit(const soil::Params& p, const double* theta, int m, int stride, double L,
202 double Ldot, double c_col, bool capillary) noexcept;
203
218void seedHydrostatic(const soil::Params& p, double* theta, int m, int stride, double L) noexcept;
219
231double columnStorage(const double* theta, int m, int stride, double L) noexcept;
232
233} // namespace openswmm::twoD::sigma
234
235#endif // OPENSWMM_ENGINE_2D_SIGMA_COLUMN_HPP
G-steps 2 and 13 — the four production soil-characteristic laws and the closure-A quasi-steady rechar...
Definition SigmaColumn.cpp:33
void seedHydrostatic(const soil::Params &p, double *theta, int m, int stride, double L) noexcept
Seed a column to hydrostatic equilibrium above a table at depth L.
Definition SigmaColumn.cpp:88
void prepareColumn(const soil::Params &p, const double *theta, int m, int stride, const ColumnStep &st, ColumnPreparation &prepared) noexcept
Prepare reusable trial invariants. Same input preconditions as advanceColumn; m > 0.
Definition SigmaColumn.cpp:136
void advanceColumn(const soil::Params &p, double *theta, int m, int stride, ColumnStep &st) noexcept
Advance one σ column by st.dt.
Definition SigmaColumn.cpp:406
double columnDtLimit(const soil::Params &p, const double *theta, int m, int stride, double L, double Ldot, double c_col, bool capillary) noexcept
The explicit stability bound of a column, without advancing it (§2.3): Δt_u ≤ C_col·min_j[ L·Δσ / ( c...
Definition SigmaColumn.cpp:100
double columnStorage(const double *theta, int m, int stride, double L) noexcept
Total water in the column (m of water) — Σ θ_j·L·Δσ.
Definition SigmaColumn.cpp:80
Definition SigmaColumn.hpp:168
std::vector< double > diffusion_bound
Definition SigmaColumn.hpp:169
double dt_limit
Definition SigmaColumn.hpp:171
std::vector< double > psi
Definition SigmaColumn.hpp:169
std::vector< double > celerity
Definition SigmaColumn.hpp:169
bool fixed_velocity
Definition SigmaColumn.hpp:170
std::vector< double > diffusivity
Definition SigmaColumn.hpp:169
std::vector< double > conductivity
Definition SigmaColumn.hpp:169
What one column sweep needs and what it reports back.
Definition SigmaColumn.hpp:97
bool forward_euler
hold the old-state ALE velocity in an RK stage
Definition SigmaColumn.hpp:102
ColumnTransfers * transfers
optional accepted-sweep receipt
Definition SigmaColumn.hpp:115
bool capillary
include the diffusive term
Definition SigmaColumn.hpp:111
const std::vector< double > * layer_inflow
accepted internal contact water depths (m)
Definition SigmaColumn.hpp:113
double rejected
q_in − f_top (m/s, ≥ 0) back to the surface
Definition SigmaColumn.hpp:119
double et_taken
ET actually removed (m/s, ≤ q_et)
Definition SigmaColumn.hpp:121
double q_et
ET demand at the top (m/s, ≥ 0)
Definition SigmaColumn.hpp:107
double f_top
accepted top flux (m/s) — q_in after rejection
Definition SigmaColumn.hpp:118
double grid_rate
supplied Ldot for forward_euler; geometry still uses L_new
Definition SigmaColumn.hpp:103
double dt_limit
Definition SigmaColumn.hpp:123
double L_old
column thickness before the table moved (m)
Definition SigmaColumn.hpp:99
double q_in
infiltration offered at the top (m/s, ≥ 0)
Definition SigmaColumn.hpp:104
double dt
the cell's tier step (s)
Definition SigmaColumn.hpp:101
double L_new
…and after (m). Default L̇ = (L_new − L_old)/dt.
Definition SigmaColumn.hpp:100
double wilting_suction
SI suction magnitude; one top-boundary stress evaluation.
Definition SigmaColumn.hpp:105
double handover_theta
<0: actual bottom layer; otherwise paired table storage coefficient
Definition SigmaColumn.hpp:108
double deficit_from_sat
Definition SigmaColumn.hpp:131
double overflow_to_sat
Definition SigmaColumn.hpp:128
double et_stress
Definition SigmaColumn.hpp:106
double f_bot
total bottom flux incl. handover (m/s)
Definition SigmaColumn.hpp:120
double theta_bot
bottom-layer θ after the sweep (specific yield)
Definition SigmaColumn.hpp:122
double q0_phys
physical Darcy flux across the table (m/s)
Definition SigmaColumn.hpp:110
Definition SigmaColumn.hpp:91
double evaporation
Definition SigmaColumn.hpp:92
std::vector< double > faces
Definition SigmaColumn.hpp:93
double old_length
Definition SigmaColumn.hpp:92
std::vector< double > old_water
Definition SigmaColumn.hpp:93
std::vector< double > compression
Definition SigmaColumn.hpp:93
std::vector< double > grid
Definition SigmaColumn.hpp:93
double infiltration
Definition SigmaColumn.hpp:92
std::vector< double > support
Definition SigmaColumn.hpp:93
std::vector< double > new_water
Definition SigmaColumn.hpp:93
std::vector< double > contacts
Definition SigmaColumn.hpp:93
double new_length
Definition SigmaColumn.hpp:92
Definition SoilCharacteristic.hpp:91