OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
GwTransportData.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
49
50#ifndef OPENSWMM_ENGINE_2D_GW_TRANSPORT_DATA_HPP
51#define OPENSWMM_ENGINE_2D_GW_TRANSPORT_DATA_HPP
52
53#include <cstdint>
54#include <string>
55#include <vector>
56
57namespace openswmm::twoD {
58
60enum class GwZone : int8_t {
61 SAT = 0,
62 UNSAT = 1,
63 LAYER = 2
64};
65
67enum class GwScope : int8_t {
68 GLOBAL = 0,
69 TAG = 1,
70 CELL = 2
71};
72
79 bool transport_msx = true;
80 bool transport_age = true;
82 bool dispersion = true;
83 bool conduction = true;
86 std::string surface_thermal_bc = "AIR";
90 std::string deep_thermal_bc = "GEOTHERMAL_FLUX";
91 std::string deep_thermal_arg;
92 double deep_depth = 0.0;
94 std::string thermal_mixing = "ARITHMETIC";
96 double c_diff = 0.4;
100 bool authored = false;
101};
102
106 std::string tag;
107 int cell = -1;
108 double rho_s = 2650.0;
109 double c_s = 880.0;
110 double lambda_s = 2.0;
111 double a_s = 0.0;
112 double alpha_L = 1.0;
113 double alpha_T = 0.1;
114 double D_m = 1.0e-9;
115 double D_v = 1.0e-9;
116 double geo_flux = 0.065;
117};
118
122 std::string tag;
123 int cell = -1;
124 std::string species;
125 double kd = 0.0;
126 double decay = -1.0;
127};
128
132 std::string tag;
133 int cell = -1;
135 int layer = -1;
136 std::string species;
137 double value = 0.0;
138};
139
142 int cell = -1;
143 int edge = -1;
144 std::string species;
146 std::string kind = "CONC";
147 double value = 0.0;
148 std::string ts_name;
149};
150
153 std::string species;
154 std::string kind = "CONC";
155 double value = 0.0;
156 std::string ts_name;
157};
158
161 std::string name;
163 std::string tag;
164 int cell = -1;
165 double x = 0.0, y = 0.0;
166 bool by_xy = false;
167 double flow = 0.0;
168 std::string flow_ts;
169 std::vector<GwSourceSpeciesTerm> species;
170};
171
182 std::vector<GwParamsRow> params;
183 std::vector<GwSorptionRow> sorption;
184 std::vector<GwInitialQualityRow> initial_quality;
187 std::vector<GwBoundaryQualityRow> boundary_quality;
188 std::vector<GwSourceRow> sources;
189
190 bool empty() const noexcept {
191 return !options.authored && params.empty() && sorption.empty() &&
192 initial_quality.empty() && initial_quality_file.empty() &&
193 boundary_quality.empty() && sources.empty();
194 }
195
196 void clear() { *this = GwTransportData{}; }
197};
198
199const char* gwZoneToken(GwZone z) noexcept;
200bool parseGwZone(const std::string& token, GwZone& z) noexcept;
201const char* gwScopeToken(GwScope s) noexcept;
202
203} // namespace openswmm::twoD
204
205#endif // OPENSWMM_ENGINE_2D_GW_TRANSPORT_DATA_HPP
Definition NodeCoupling.cpp:16
const char * gwScopeToken(GwScope s) noexcept
Definition GwTransportSections.cpp:138
GwScope
Scope of a per-cell row.
Definition GwTransportData.hpp:67
@ GLOBAL
the * row
Definition GwTransportData.hpp:68
@ CELL
one cell, by 0-based index (1-based in the file)
Definition GwTransportData.hpp:70
@ TAG
every cell carrying tag
Definition GwTransportData.hpp:69
const char * gwZoneToken(GwZone z) noexcept
Definition GwTransportSections.cpp:122
GwZone
Which zone of the two-zone column a row addresses.
Definition GwTransportData.hpp:60
@ UNSAT
unsaturated (upper) zone
Definition GwTransportData.hpp:62
@ SAT
saturated (lower) zone
Definition GwTransportData.hpp:61
@ LAYER
an explicit layer index (layer field)
Definition GwTransportData.hpp:63
bool parseGwZone(const std::string &token, GwZone &z) noexcept
Definition GwTransportSections.cpp:131
One [GW_BOUNDARY_QUALITY] row — a lateral edge BC.
Definition GwTransportData.hpp:141
int edge
local edge 0..nv-1 of that cell
Definition GwTransportData.hpp:143
int cell
0-based cell index
Definition GwTransportData.hpp:142
std::string species
Definition GwTransportData.hpp:144
double value
constant form
Definition GwTransportData.hpp:147
std::string ts_name
TS form (kind == "TS", or a TS argument)
Definition GwTransportData.hpp:148
std::string kind
CONC | TS | MASSFLUX | HEATFLUX.
Definition GwTransportData.hpp:146
One [GW_INITIAL_QUALITY] row.
Definition GwTransportData.hpp:130
GwZone zone
Definition GwTransportData.hpp:134
std::string species
Definition GwTransportData.hpp:136
double value
Definition GwTransportData.hpp:137
std::string tag
Definition GwTransportData.hpp:132
int layer
LAYER zone only.
Definition GwTransportData.hpp:135
GwScope scope
Definition GwTransportData.hpp:131
int cell
Definition GwTransportData.hpp:133
One [GW_TRANSPORT_PARAMS] row: solute + thermal matrix properties.
Definition GwTransportData.hpp:104
double rho_s
grain density (kg/m3)
Definition GwTransportData.hpp:108
double alpha_L
longitudinal dispersivity (m)
Definition GwTransportData.hpp:112
double lambda_s
grain thermal conductivity (W/m/K)
Definition GwTransportData.hpp:110
double a_s
specific surface area (m2/kg)
Definition GwTransportData.hpp:111
double D_v
vapour diffusivity (m2/s)
Definition GwTransportData.hpp:115
double D_m
molecular diffusivity (m2/s)
Definition GwTransportData.hpp:114
GwScope scope
Definition GwTransportData.hpp:105
double c_s
grain specific heat (J/kg/K)
Definition GwTransportData.hpp:109
double geo_flux
geothermal flux (W/m2) or deep temp (degC)
Definition GwTransportData.hpp:116
double alpha_T
transverse dispersivity (m)
Definition GwTransportData.hpp:113
int cell
CELL scope (0-based)
Definition GwTransportData.hpp:107
std::string tag
TAG scope.
Definition GwTransportData.hpp:106
One [GW_SORPTION] row: retardation input for one species in one scope.
Definition GwTransportData.hpp:120
double decay
1/day; < 0 = "use [POLLUTANTS] kdecay"
Definition GwTransportData.hpp:126
GwScope scope
Definition GwTransportData.hpp:121
int cell
Definition GwTransportData.hpp:123
std::string species
Definition GwTransportData.hpp:124
std::string tag
Definition GwTransportData.hpp:122
double kd
partition coefficient (L/kg)
Definition GwTransportData.hpp:125
One [GW_SOURCES] row — a well / point source or sink.
Definition GwTransportData.hpp:160
std::string name
Definition GwTransportData.hpp:161
double y
XY form (retained for the writer)
Definition GwTransportData.hpp:165
GwScope scope
CELL | TAG | (XY resolves to CELL)
Definition GwTransportData.hpp:162
bool by_xy
Definition GwTransportData.hpp:166
int cell
Definition GwTransportData.hpp:164
std::vector< GwSourceSpeciesTerm > species
Definition GwTransportData.hpp:169
double x
Definition GwTransportData.hpp:165
double flow
m3/s, + inject / − extract
Definition GwTransportData.hpp:167
std::string tag
Definition GwTransportData.hpp:163
std::string flow_ts
when the FLOW argument is a series
Definition GwTransportData.hpp:168
One [GW_SOURCES] species term.
Definition GwTransportData.hpp:152
std::string species
Definition GwTransportData.hpp:153
std::string kind
CONC | MASS.
Definition GwTransportData.hpp:154
double value
Definition GwTransportData.hpp:155
std::string ts_name
Definition GwTransportData.hpp:156
Every [GW_*] authoring row of one model.
Definition GwTransportData.hpp:180
std::vector< GwSourceRow > sources
Definition GwTransportData.hpp:188
void clear()
Definition GwTransportData.hpp:196
std::vector< GwInitialQualityRow > initial_quality
Definition GwTransportData.hpp:184
bool empty() const noexcept
Definition GwTransportData.hpp:190
std::vector< GwSorptionRow > sorption
Definition GwTransportData.hpp:183
std::string initial_quality_file
[GW_INITIAL_QUALITY] FILE <csv> (element,zone,species,value).
Definition GwTransportData.hpp:186
GwTransportOptions options
Definition GwTransportData.hpp:181
std::vector< GwBoundaryQualityRow > boundary_quality
Definition GwTransportData.hpp:187
std::vector< GwParamsRow > params
Definition GwTransportData.hpp:182
Definition GwTransportData.hpp:77
double c_diff
Explicit diffusion Courant number for the kernel's tier bound.
Definition GwTransportData.hpp:96
std::string surface_thermal_bc
Definition GwTransportData.hpp:86
std::string surface_thermal_arg
Definition GwTransportData.hpp:87
bool authored
Definition GwTransportData.hpp:100
std::string thermal_mixing
THERMAL_MIXING ARITHMETIC | GEOMETRIC.
Definition GwTransportData.hpp:94
bool transport_msx
Definition GwTransportData.hpp:79
bool transport_temperature
Definition GwTransportData.hpp:81
bool transport_pollutants
Definition GwTransportData.hpp:78
std::string deep_thermal_bc
Definition GwTransportData.hpp:90
double deep_depth
Definition GwTransportData.hpp:92
bool dispersion
α_L / α_T / D_m active
Definition GwTransportData.hpp:82
bool transport_age
Definition GwTransportData.hpp:80
std::string deep_thermal_arg
Definition GwTransportData.hpp:91
bool conduction
Definition GwTransportData.hpp:83