OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
ArdConfigData.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
52
53#ifndef OPENSWMM_ENGINE_DATA_ARD_CONFIG_DATA_HPP
54#define OPENSWMM_ENGINE_DATA_ARD_CONFIG_DATA_HPP
55
56#include <string>
57#include <vector>
58
59namespace openswmm {
60
73 std::string element;
74 std::string species;
75 bool is_ts = false;
76 double value = 0.0;
78 std::string ts_name;
79};
80
82enum class ArdDispersionMode : int {
83 OFF = 0,
84 FISCHER = 1,
85 VALUE = 2,
86};
87
99 bool configured = false;
100
102
104 double dispersion_value = 0.0;
105
106 // Per-conduit overrides (parallel arrays, SoA): link index + coefficient
107 // in display units. Applied to every cell of the conduit; wins over the
108 // global model.
109 std::vector<int> conduit_disp_link;
110 std::vector<double> conduit_disp_value;
111
112 // ---- E5a: raw boundary/source rows (cold; see ArdTransportRow) -------
113 std::vector<ArdTransportRow> boundary_rows;
114 std::vector<ArdTransportRow> source_rows;
115
116 // ---- E5a: resolved rows (hot; filled by resolveArdTransportRows) -----
117 // Boundaries: the node's EXTERNAL INFLOW water carries the MSX species
118 // at the given concentration (species units — internal store mass is
119 // conc·ft³, so no conversion). Sources: distributed over the conduit's
120 // cells, INTERNAL units conc·ft³/s (converted from species-mass/s by
121 // dividing by kLitersPerFt3 at resolution).
122 std::vector<int> bc_node;
123 std::vector<int> bc_msx;
124 std::vector<double> bc_value;
125 std::vector<int> bc_ts;
126 std::vector<int> src_link;
127 std::vector<int> src_msx;
128 std::vector<double> src_value;
129 std::vector<int> src_ts;
132
133 // ---- E5b ------------------------------------------------------------
138 double target_dx = 0.0;
148 bool sets_scalar_scheme = false;
149 bool sets_limiter = false;
150
154
155 bool any_dispersion() const noexcept {
157 !conduit_disp_link.empty();
158 }
159 bool any_transport_rows() const noexcept {
160 return !boundary_rows.empty() || !source_rows.empty();
161 }
162
165 bool any_engine_content() const noexcept {
166 return any_dispersion() || any_transport_rows() ||
167 !detailed_output_path.empty() || target_dx > 0.0;
168 }
169};
170
173inline constexpr double kLitersPerFt3 = 28.316846592;
174
175} // namespace openswmm
176
177#endif // OPENSWMM_ENGINE_DATA_ARD_CONFIG_DATA_HPP
Definition NodeCoupling.cpp:16
constexpr double kLitersPerFt3
Definition ArdConfigData.hpp:173
ArdDispersionMode
Global dispersion coefficient model ([TRANSPORT_OPTIONS] DISPERSION).
Definition ArdConfigData.hpp:82
@ OFF
no global dispersion (per-conduit overrides still apply)
Definition ArdConfigData.hpp:83
@ FISCHER
Fischer et al. (1979): D = 0.011 v²B²/(Y·U*), U* = √(gYS)
Definition ArdConfigData.hpp:84
@ VALUE
uniform user value (display units, len²/s)
Definition ArdConfigData.hpp:85
Parsed model.ard state consumed by ArdEngine::init (phase E3).
Definition ArdConfigData.hpp:97
double target_dx
Definition ArdConfigData.hpp:138
std::vector< int > conduit_disp_link
Definition ArdConfigData.hpp:109
std::vector< ArdTransportRow > source_rows
Definition ArdConfigData.hpp:114
std::vector< int > src_ts
Definition ArdConfigData.hpp:129
std::vector< int > bc_ts
timeseries table index, -1 ⇒ VALUE
Definition ArdConfigData.hpp:125
std::vector< int > src_msx
Definition ArdConfigData.hpp:127
std::vector< int > src_link
link index (conduit)
Definition ArdConfigData.hpp:126
std::vector< int > bc_msx
ReactionData species index.
Definition ArdConfigData.hpp:123
ArdDispersionMode dispersion_mode
Definition ArdConfigData.hpp:101
std::vector< int > bc_node
node index
Definition ArdConfigData.hpp:122
bool configured
True once a [PROCESS_COMPONENTS] transport.ard registration applied.
Definition ArdConfigData.hpp:99
bool any_engine_content() const noexcept
Definition ArdConfigData.hpp:165
bool transport_rows_resolved
Definition ArdConfigData.hpp:131
bool any_dispersion() const noexcept
Definition ArdConfigData.hpp:155
double dispersion_value
Global coefficient for VALUE mode (display units, len²/s).
Definition ArdConfigData.hpp:104
bool sets_scalar_scheme
Definition ArdConfigData.hpp:148
bool any_transport_rows() const noexcept
Definition ArdConfigData.hpp:159
std::vector< ArdTransportRow > boundary_rows
Definition ArdConfigData.hpp:113
std::vector< double > conduit_disp_value
Definition ArdConfigData.hpp:110
bool sets_limiter
Definition ArdConfigData.hpp:149
std::vector< double > bc_value
VALUE-mode concentration.
Definition ArdConfigData.hpp:124
std::string detailed_output_path
Definition ArdConfigData.hpp:153
std::vector< double > src_value
VALUE-mode rate, internal conc·ft³/s.
Definition ArdConfigData.hpp:128
One raw [TRANSPORT_BOUNDARIES] or [TRANSPORT_SOURCES] row (E5a).
Definition ArdConfigData.hpp:72
std::string ts_name
TIMESERIES mode.
Definition ArdConfigData.hpp:78
std::string species
MSX species name (pollutants refused in E5a)
Definition ArdConfigData.hpp:74
bool is_ts
Definition ArdConfigData.hpp:75
double value
Definition ArdConfigData.hpp:76
std::string element
node name (boundary) / conduit name (source)
Definition ArdConfigData.hpp:73