OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches
SimulationOptions.hpp
Go to the documentation of this file.
1
24#ifndef OPENSWMM_ENGINE_SIMULATION_OPTIONS_HPP
25#define OPENSWMM_ENGINE_SIMULATION_OPTIONS_HPP
26
27#include <string>
28#include <vector>
29#include <unordered_map>
30#include <cstdint>
31
32namespace openswmm {
33
34// ============================================================================
35// Enumerators matching legacy SWMM enums.h
36// ============================================================================
37
42enum class FlowUnits : int {
43 CFS = 0,
44 GPM = 1,
45 MGD = 2,
46 CMS = 3,
47 LPS = 4,
48 MLD = 5
49};
50
55enum class RoutingModel : int {
56 STEADY = 0,
57 KINWAVE = 1,
58 DYNWAVE = 2
59};
60
65enum class InfiltrationModel : int {
66 HORTON = 0,
67 MOD_HORTON = 1,
68 GREEN_AMPT = 2,
70 CURVE_NUMBER = 4
71};
72
77enum class RunoffModel : int {
78 NONE = 0,
79 NL_POND = 1
80};
81
82// ============================================================================
83// SimulationOptions struct
84// ============================================================================
85
101 // -----------------------------------------------------------------------
102 // Time control
103 // -----------------------------------------------------------------------
104
107 double start_date = 2453006.0; // Jan 1, 2004 Julian date (legacy default)
108
110 double end_date = 0.0;
111
113 double report_start = 0.0;
114
116 double routing_step = 20.0;
117
119 double min_routing_step = 0.5;
120
122 double dry_step = 3600.0;
123
125 double wet_step = 300.0;
126
128 double report_step = 900.0;
129
131 double dry_days = 0.0;
132
135 double variable_step = 0.75;
136
142 double lengthening_step = 0.0;
143
145 int sweep_start = 1;
146
148 int sweep_end = 365;
149
150 // -----------------------------------------------------------------------
151 // Flow and routing
152 // -----------------------------------------------------------------------
153
156
159
162
165
166 // -----------------------------------------------------------------------
167 // Solver settings
168 // -----------------------------------------------------------------------
169
171 int max_trials = 8;
172
175
178 int normal_flow_ltd = 2; // BOTH (legacy default)
179
183
186 int inertial_damping = 1; // PARTIAL (legacy default)
187
190 int link_offsets = 0; // DEPTH_OFFSET (legacy default)
191
193 double min_slope = 0.0;
194
196 double min_surf_area = 0.0; // 0 = use MIN_SURFAREA constant
197
200 double head_tol = 0.005;
201
204 double sys_flow_tol = 0.05;
205
208 double lat_flow_tol = 0.05;
209
210 // -----------------------------------------------------------------------
211 // System settings
212 // -----------------------------------------------------------------------
213
215 bool quality_routing = false;
216
218 bool allow_ponding = false;
219
221 bool ignore_rainfall = false;
222
224 bool ignore_snow_melt = false;
225
227 bool ignore_groundwater = false;
228
230 bool ignore_rdii = false;
231
233 bool ignore_routing = false;
234
236 bool ignore_quality = false;
237
238 // -----------------------------------------------------------------------
239 // Threading
240 // -----------------------------------------------------------------------
241
256 int num_threads = 1;
257
258 // -----------------------------------------------------------------------
259 // New in 6.0.0 — CRS (R06)
260 // -----------------------------------------------------------------------
261
278 std::string crs;
279
280 // -----------------------------------------------------------------------
281 // New in 6.0.0 — Extension options map (R05)
282 // -----------------------------------------------------------------------
283
301 std::unordered_map<std::string, std::string> ext_options;
302
303 // -----------------------------------------------------------------------
304 // Evaporation settings (from [EVAPORATION] section)
305 // -----------------------------------------------------------------------
306
308 int evap_type = 0;
309
311 double evap_values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
312
314 std::string evap_ts_name;
315
317 std::string evap_recovery_pat;
318
320 bool evap_dry_only = false;
321
322 // -----------------------------------------------------------------------
323 // Temperature settings (from [TEMPERATURE] section)
324 // -----------------------------------------------------------------------
325
327 int temp_source = 0;
328
330 std::string temp_ts_name;
331
333 std::string temp_file;
334
336 double temp_file_start = 0.0;
337
339 int wind_type = 0;
340
342 double wind_speed[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
343
345 double snow_divt = 34.0;
346
348 double snow_ati_wt = 0.5;
349
351 double snow_nrg_ratio = 0.6;
352
354 double snow_lat = 0.0;
355
357 double snow_min_melt = 0.0;
358
360 double snow_max_melt = 0.0;
361
363 double adc_imperv[10] = {1,1,1,1,1,1,1,1,1,1};
364
366 double adc_perv[10] = {1,1,1,1,1,1,1,1,1,1};
367
368 // -----------------------------------------------------------------------
369 // Report settings (from [REPORT] section)
370 // -----------------------------------------------------------------------
371
374
376 int rpt_nodes = 0;
377
379 int rpt_links = 0;
380
382 bool rpt_input = false;
383
385 bool rpt_continuity = true;
386
388 bool rpt_flowstats = true;
389
391 bool rpt_controls = false;
392
394 bool rpt_averages = false;
395
397 std::vector<std::string> rpt_subcatch_names;
398
400 std::vector<std::string> rpt_node_names;
401
403 std::vector<std::string> rpt_link_names;
404};
405
406} /* namespace openswmm */
407
408#endif /* OPENSWMM_ENGINE_SIMULATION_OPTIONS_HPP */
Definition Controls.cpp:24
InfiltrationModel
Infiltration methods.
Definition SimulationOptions.hpp:65
FlowUnits
Flow unit systems.
Definition SimulationOptions.hpp:42
@ GPM
Gallons per minute.
@ MGD
Million gallons per day.
@ CFS
Cubic feet per second.
@ MLD
Million liters per day.
@ CMS
Cubic meters per second.
@ LPS
Liters per second.
RunoffModel
Runoff routing methods.
Definition SimulationOptions.hpp:77
@ NL_POND
Non-linear reservoir (default)
RoutingModel
Flow routing methods.
Definition SimulationOptions.hpp:55
@ KINWAVE
Kinematic wave approximation.
@ STEADY
Steady-state (no routing)
@ DYNWAVE
Dynamic wave (full Saint-Venant)
All SWMM simulation options parsed from [OPTIONS] section.
Definition SimulationOptions.hpp:100
bool ignore_groundwater
Ignore groundwater.
Definition SimulationOptions.hpp:227
double dry_step
Dry-weather runoff timestep in seconds.
Definition SimulationOptions.hpp:122
double adc_imperv[10]
Areal depletion curve for impervious surfaces (10 fractions).
Definition SimulationOptions.hpp:363
bool rpt_continuity
Report continuity errors (default true).
Definition SimulationOptions.hpp:385
double routing_step
Hydraulic routing timestep in seconds. Legacy default: 20.
Definition SimulationOptions.hpp:116
double variable_step
Courant factor for variable time stepping (0 = fixed step).
Definition SimulationOptions.hpp:135
bool ignore_routing
Ignore routing.
Definition SimulationOptions.hpp:233
double snow_min_melt
Snowmelt: minimum melt coefficient.
Definition SimulationOptions.hpp:357
int rpt_links
Link reporting: 0=NONE, 1=ALL, 2=SOME.
Definition SimulationOptions.hpp:379
double min_routing_step
Minimum routing timestep in seconds (CFL floor).
Definition SimulationOptions.hpp:119
double end_date
Simulation end date/time (decimal days, Julian date).
Definition SimulationOptions.hpp:110
std::string crs
Coordinate reference system string.
Definition SimulationOptions.hpp:278
FlowUnits flow_units
Flow units system.
Definition SimulationOptions.hpp:155
int evap_type
Evaporation type: 0=CONSTANT, 1=MONTHLY, 2=TIMESERIES, 3=TEMPERATURE, 4=FILE.
Definition SimulationOptions.hpp:308
double lat_flow_tol
Lateral inflow tolerance (fraction, e.g., 0.05 = 5%).
Definition SimulationOptions.hpp:208
bool ignore_rainfall
Ignore rainfall (for hot start runs).
Definition SimulationOptions.hpp:221
double wet_step
Wet-weather runoff timestep in seconds.
Definition SimulationOptions.hpp:125
double snow_divt
Snowmelt: dividing temperature.
Definition SimulationOptions.hpp:345
std::string evap_ts_name
Timeseries name for evaporation (evap_type == 2).
Definition SimulationOptions.hpp:314
std::string evap_recovery_pat
Recovery pattern name for evaporation.
Definition SimulationOptions.hpp:317
int wind_type
Wind speed type: 0=MONTHLY, 1=FILE.
Definition SimulationOptions.hpp:339
RoutingModel routing_model
Routing method. Legacy default: DYNWAVE.
Definition SimulationOptions.hpp:158
bool ignore_snow_melt
Ignore snowmelt.
Definition SimulationOptions.hpp:224
std::unordered_map< std::string, std::string > ext_options
Key-value map for unknown [OPTIONS] keys.
Definition SimulationOptions.hpp:301
std::vector< std::string > rpt_link_names
Named links to report (used when rpt_links == 2).
Definition SimulationOptions.hpp:403
bool rpt_flowstats
Report flow statistics (default true).
Definition SimulationOptions.hpp:388
int surcharge_method
Surcharge method: 0=EXTRAN, 1=SLOT.
Definition SimulationOptions.hpp:174
bool rpt_controls
Report control actions (default false).
Definition SimulationOptions.hpp:391
double head_tol
Convergence head tolerance in project length units.
Definition SimulationOptions.hpp:200
int rpt_nodes
Node reporting: 0=NONE, 1=ALL, 2=SOME.
Definition SimulationOptions.hpp:376
double evap_values[12]
Monthly evaporation values (used when evap_type == 0 or 1).
Definition SimulationOptions.hpp:311
double snow_nrg_ratio
Snowmelt: negative melt ratio.
Definition SimulationOptions.hpp:351
double snow_max_melt
Snowmelt: maximum melt coefficient.
Definition SimulationOptions.hpp:360
RunoffModel runoff_model
Runoff routing method.
Definition SimulationOptions.hpp:164
int rpt_subcatchments
Subcatchment reporting: 0=NONE, 1=ALL, 2=SOME.
Definition SimulationOptions.hpp:373
int sweep_start
Street sweeping start day-of-year (1-365). 0 = not set.
Definition SimulationOptions.hpp:145
std::string temp_file
File path for temperature data.
Definition SimulationOptions.hpp:333
int inertial_damping
Inertial damping: 0=NONE, 1=PARTIAL, 2=FULL.
Definition SimulationOptions.hpp:186
double snow_lat
Snowmelt: latitude (degrees).
Definition SimulationOptions.hpp:354
std::string temp_ts_name
Timeseries name for temperature data.
Definition SimulationOptions.hpp:330
std::vector< std::string > rpt_node_names
Named nodes to report (used when rpt_nodes == 2).
Definition SimulationOptions.hpp:400
double temp_file_start
Temperature file start date (Julian).
Definition SimulationOptions.hpp:336
double report_start
Report start date/time.
Definition SimulationOptions.hpp:113
bool ignore_quality
Ignore water quality.
Definition SimulationOptions.hpp:236
double sys_flow_tol
System flow tolerance (fraction, e.g., 0.05 = 5%).
Definition SimulationOptions.hpp:204
int normal_flow_ltd
Normal flow limitation: 0=SLOPE, 1=FROUDE, 2=BOTH, 3=NEITHER.
Definition SimulationOptions.hpp:178
int force_main_eqn
Force main equation: 0=Hazen-Williams, 1=Darcy-Weisbach.
Definition SimulationOptions.hpp:182
std::vector< std::string > rpt_subcatch_names
Named subcatchments to report (used when rpt_subcatchments == 2).
Definition SimulationOptions.hpp:397
bool rpt_averages
Report time-averaged results (default false).
Definition SimulationOptions.hpp:394
int max_trials
Maximum number of flow routing iterations (dynamic wave).
Definition SimulationOptions.hpp:171
bool rpt_input
Report input summary.
Definition SimulationOptions.hpp:382
int link_offsets
Link offset mode: 0=DEPTH_OFFSET, 1=ELEV_OFFSET.
Definition SimulationOptions.hpp:190
bool evap_dry_only
If true, evaporation only occurs on dry days.
Definition SimulationOptions.hpp:320
double snow_ati_wt
Snowmelt: ATI weight (0–1).
Definition SimulationOptions.hpp:348
double start_date
Simulation start date/time (decimal days, Julian date).
Definition SimulationOptions.hpp:107
double adc_perv[10]
Areal depletion curve for pervious surfaces (10 fractions).
Definition SimulationOptions.hpp:366
double min_surf_area
Minimum node surface area (ft²).
Definition SimulationOptions.hpp:196
double wind_speed[12]
Monthly wind speed values (12 months).
Definition SimulationOptions.hpp:342
bool quality_routing
True if quality routing is enabled.
Definition SimulationOptions.hpp:215
bool allow_ponding
True if evaporation is included.
Definition SimulationOptions.hpp:218
double report_step
Reporting output interval in seconds.
Definition SimulationOptions.hpp:128
int temp_source
Temperature source: 0=NONE, 1=TIMESERIES, 2=FILE.
Definition SimulationOptions.hpp:327
InfiltrationModel infiltration
Infiltration method for subcatchments.
Definition SimulationOptions.hpp:161
bool ignore_rdii
Ignore RDII.
Definition SimulationOptions.hpp:230
double dry_days
Antecedent dry days.
Definition SimulationOptions.hpp:131
int num_threads
Number of OpenMP threads for parallel solver loops.
Definition SimulationOptions.hpp:256
double min_slope
Minimum conduit slope (ft/ft).
Definition SimulationOptions.hpp:193
int sweep_end
Street sweeping end day-of-year (1-365). 0 = not set.
Definition SimulationOptions.hpp:148
double lengthening_step
Conduit lengthening timestep (seconds, 0 = use routing_step).
Definition SimulationOptions.hpp:142