OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches

All SWMM simulation options parsed from [OPTIONS] section. More...

#include <SimulationOptions.hpp>

Collaboration diagram for openswmm::SimulationOptions:

Public Attributes

double start_date = 2453006.0
 Simulation start date/time (decimal days, Julian date).
 
double end_date = 0.0
 Simulation end date/time (decimal days, Julian date).
 
double report_start = 0.0
 Report start date/time.
 
double routing_step = 20.0
 Hydraulic routing timestep in seconds. Legacy default: 20.
 
double min_routing_step = 0.5
 Minimum routing timestep in seconds (CFL floor).
 
double dry_step = 3600.0
 Dry-weather runoff timestep in seconds.
 
double wet_step = 300.0
 Wet-weather runoff timestep in seconds.
 
double report_step = 900.0
 Reporting output interval in seconds.
 
double dry_days = 0.0
 Antecedent dry days.
 
double variable_step = 0.75
 Courant factor for variable time stepping (0 = fixed step).
 
double lengthening_step = 0.0
 Conduit lengthening timestep (seconds, 0 = use routing_step).
 
int sweep_start = 1
 Street sweeping start day-of-year (1-365). 0 = not set.
 
int sweep_end = 365
 Street sweeping end day-of-year (1-365). 0 = not set.
 
FlowUnits flow_units = FlowUnits::CFS
 Flow units system.
 
RoutingModel routing_model = RoutingModel::DYNWAVE
 Routing method. Legacy default: DYNWAVE.
 
InfiltrationModel infiltration = InfiltrationModel::HORTON
 Infiltration method for subcatchments.
 
RunoffModel runoff_model = RunoffModel::NL_POND
 Runoff routing method.
 
int max_trials = 8
 Maximum number of flow routing iterations (dynamic wave).
 
int surcharge_method = 0
 Surcharge method: 0=EXTRAN, 1=SLOT.
 
int normal_flow_ltd = 2
 Normal flow limitation: 0=SLOPE, 1=FROUDE, 2=BOTH, 3=NEITHER.
 
int force_main_eqn = 0
 Force main equation: 0=Hazen-Williams, 1=Darcy-Weisbach.
 
int inertial_damping = 1
 Inertial damping: 0=NONE, 1=PARTIAL, 2=FULL.
 
int link_offsets = 0
 Link offset mode: 0=DEPTH_OFFSET, 1=ELEV_OFFSET.
 
double min_slope = 0.0
 Minimum conduit slope (ft/ft).
 
double min_surf_area = 0.0
 Minimum node surface area (ft²).
 
double head_tol = 0.005
 Convergence head tolerance in project length units.
 
double sys_flow_tol = 0.05
 System flow tolerance (fraction, e.g., 0.05 = 5%).
 
double lat_flow_tol = 0.05
 Lateral inflow tolerance (fraction, e.g., 0.05 = 5%).
 
bool quality_routing = false
 True if quality routing is enabled.
 
bool allow_ponding = false
 True if evaporation is included.
 
bool ignore_rainfall = false
 Ignore rainfall (for hot start runs).
 
bool ignore_snow_melt = false
 Ignore snowmelt.
 
bool ignore_groundwater = false
 Ignore groundwater.
 
bool ignore_rdii = false
 Ignore RDII.
 
bool ignore_routing = false
 Ignore routing.
 
bool ignore_quality = false
 Ignore water quality.
 
int num_threads = 1
 Number of OpenMP threads for parallel solver loops.
 
std::string crs
 Coordinate reference system string.
 
std::unordered_map< std::string, std::string > ext_options
 Key-value map for unknown [OPTIONS] keys.
 
int evap_type = 0
 Evaporation type: 0=CONSTANT, 1=MONTHLY, 2=TIMESERIES, 3=TEMPERATURE, 4=FILE.
 
double evap_values [12] = {0,0,0,0,0,0,0,0,0,0,0,0}
 Monthly evaporation values (used when evap_type == 0 or 1).
 
std::string evap_ts_name
 Timeseries name for evaporation (evap_type == 2).
 
std::string evap_recovery_pat
 Recovery pattern name for evaporation.
 
bool evap_dry_only = false
 If true, evaporation only occurs on dry days.
 
int temp_source = 0
 Temperature source: 0=NONE, 1=TIMESERIES, 2=FILE.
 
std::string temp_ts_name
 Timeseries name for temperature data.
 
std::string temp_file
 File path for temperature data.
 
double temp_file_start = 0.0
 Temperature file start date (Julian).
 
int wind_type = 0
 Wind speed type: 0=MONTHLY, 1=FILE.
 
double wind_speed [12] = {0,0,0,0,0,0,0,0,0,0,0,0}
 Monthly wind speed values (12 months).
 
double snow_divt = 34.0
 Snowmelt: dividing temperature.
 
double snow_ati_wt = 0.5
 Snowmelt: ATI weight (0–1).
 
double snow_nrg_ratio = 0.6
 Snowmelt: negative melt ratio.
 
double snow_lat = 0.0
 Snowmelt: latitude (degrees).
 
double snow_min_melt = 0.0
 Snowmelt: minimum melt coefficient.
 
double snow_max_melt = 0.0
 Snowmelt: maximum melt coefficient.
 
double adc_imperv [10] = {1,1,1,1,1,1,1,1,1,1}
 Areal depletion curve for impervious surfaces (10 fractions).
 
double adc_perv [10] = {1,1,1,1,1,1,1,1,1,1}
 Areal depletion curve for pervious surfaces (10 fractions).
 
int rpt_subcatchments = 0
 Subcatchment reporting: 0=NONE, 1=ALL, 2=SOME.
 
int rpt_nodes = 0
 Node reporting: 0=NONE, 1=ALL, 2=SOME.
 
int rpt_links = 0
 Link reporting: 0=NONE, 1=ALL, 2=SOME.
 
bool rpt_input = false
 Report input summary.
 
bool rpt_continuity = true
 Report continuity errors (default true).
 
bool rpt_flowstats = true
 Report flow statistics (default true).
 
bool rpt_controls = false
 Report control actions (default false).
 
bool rpt_averages = false
 Report time-averaged results (default false).
 
std::vector< std::string > rpt_subcatch_names
 Named subcatchments to report (used when rpt_subcatchments == 2).
 
std::vector< std::string > rpt_node_names
 Named nodes to report (used when rpt_nodes == 2).
 
std::vector< std::string > rpt_link_names
 Named links to report (used when rpt_links == 2).
 

Detailed Description

All SWMM simulation options parsed from [OPTIONS] section.

This struct consolidates all options that were previously global variables in src/solver/globals.h (e.g., FlowUnits, RouteModel, RouteStep, etc.) into a single value type that lives inside SimulationContext.

The ext_options map stores any key in [OPTIONS] that is not recognized as a standard SWMM option. A SWMM_WARN_UNKNOWN_OPTION warning is issued. Extension options are available to plugins via the C API.

Member Data Documentation

◆ adc_imperv

double openswmm::SimulationOptions::adc_imperv[10] = {1,1,1,1,1,1,1,1,1,1}

Areal depletion curve for impervious surfaces (10 fractions).

◆ adc_perv

double openswmm::SimulationOptions::adc_perv[10] = {1,1,1,1,1,1,1,1,1,1}

Areal depletion curve for pervious surfaces (10 fractions).

◆ allow_ponding

bool openswmm::SimulationOptions::allow_ponding = false

True if evaporation is included.

◆ crs

std::string openswmm::SimulationOptions::crs

Coordinate reference system string.

Set via the CRS key in [OPTIONS]:

[OPTIONS]
CRS EPSG:4326

or using a PROJ string:

[OPTIONS]
CRS "+proj=utm +zone=33 +datum=WGS84"

Empty string if not specified. Also stored in SpatialFrame::crs.

◆ dry_days

double openswmm::SimulationOptions::dry_days = 0.0

Antecedent dry days.

◆ dry_step

double openswmm::SimulationOptions::dry_step = 3600.0

Dry-weather runoff timestep in seconds.

◆ end_date

double openswmm::SimulationOptions::end_date = 0.0

Simulation end date/time (decimal days, Julian date).

◆ evap_dry_only

bool openswmm::SimulationOptions::evap_dry_only = false

If true, evaporation only occurs on dry days.

◆ evap_recovery_pat

std::string openswmm::SimulationOptions::evap_recovery_pat

Recovery pattern name for evaporation.

◆ evap_ts_name

std::string openswmm::SimulationOptions::evap_ts_name

Timeseries name for evaporation (evap_type == 2).

◆ evap_type

int openswmm::SimulationOptions::evap_type = 0

Evaporation type: 0=CONSTANT, 1=MONTHLY, 2=TIMESERIES, 3=TEMPERATURE, 4=FILE.

◆ evap_values

double openswmm::SimulationOptions::evap_values[12] = {0,0,0,0,0,0,0,0,0,0,0,0}

Monthly evaporation values (used when evap_type == 0 or 1).

◆ ext_options

std::unordered_map<std::string, std::string> openswmm::SimulationOptions::ext_options

Key-value map for unknown [OPTIONS] keys.

Any key in [OPTIONS] that is not a recognized SWMM keyword is stored here as a string pair. A SWMM_WARN_UNKNOWN_OPTION warning is issued for each unknown key.

Plugins can retrieve values via swmm_options_get_ext(). Keys are stored uppercase-normalized.

Example:

[OPTIONS]
TURBULENCE_DAMP 0.85 ;; stored as ext_options["TURBULENCE_DAMP"] = "0.85"
PLUGIN_TIMEOUT 30 ;; stored as ext_options["PLUGIN_TIMEOUT"] = "30"
std::unordered_map< std::string, std::string > ext_options
Key-value map for unknown [OPTIONS] keys.
Definition SimulationOptions.hpp:301

◆ flow_units

FlowUnits openswmm::SimulationOptions::flow_units = FlowUnits::CFS

Flow units system.

◆ force_main_eqn

int openswmm::SimulationOptions::force_main_eqn = 0

Force main equation: 0=Hazen-Williams, 1=Darcy-Weisbach.

See also
Legacy: ForceMainEqn

◆ head_tol

double openswmm::SimulationOptions::head_tol = 0.005

Convergence head tolerance in project length units.

Legacy default: 0.0 (sentinel → runtime default 0.005 ft).

◆ ignore_groundwater

bool openswmm::SimulationOptions::ignore_groundwater = false

Ignore groundwater.

◆ ignore_quality

bool openswmm::SimulationOptions::ignore_quality = false

Ignore water quality.

◆ ignore_rainfall

bool openswmm::SimulationOptions::ignore_rainfall = false

Ignore rainfall (for hot start runs).

◆ ignore_rdii

bool openswmm::SimulationOptions::ignore_rdii = false

Ignore RDII.

◆ ignore_routing

bool openswmm::SimulationOptions::ignore_routing = false

Ignore routing.

◆ ignore_snow_melt

bool openswmm::SimulationOptions::ignore_snow_melt = false

Ignore snowmelt.

◆ inertial_damping

int openswmm::SimulationOptions::inertial_damping = 1

Inertial damping: 0=NONE, 1=PARTIAL, 2=FULL.

See also
Legacy: InertDamping

◆ infiltration

InfiltrationModel openswmm::SimulationOptions::infiltration = InfiltrationModel::HORTON

Infiltration method for subcatchments.

◆ lat_flow_tol

double openswmm::SimulationOptions::lat_flow_tol = 0.05

Lateral inflow tolerance (fraction, e.g., 0.05 = 5%).

Legacy default: 0.05. Input is in percent, divided by 100.

◆ lengthening_step

double openswmm::SimulationOptions::lengthening_step = 0.0

Conduit lengthening timestep (seconds, 0 = use routing_step).

Used to compute modified conduit lengths for CFL stability.

See also
Legacy: LengtheningStep

◆ link_offsets

int openswmm::SimulationOptions::link_offsets = 0

Link offset mode: 0=DEPTH_OFFSET, 1=ELEV_OFFSET.

See also
Legacy: LinkOffsets

◆ max_trials

int openswmm::SimulationOptions::max_trials = 8

Maximum number of flow routing iterations (dynamic wave).

◆ min_routing_step

double openswmm::SimulationOptions::min_routing_step = 0.5

Minimum routing timestep in seconds (CFL floor).

◆ min_slope

double openswmm::SimulationOptions::min_slope = 0.0

Minimum conduit slope (ft/ft).

See also
Legacy: MinSlope

◆ min_surf_area

double openswmm::SimulationOptions::min_surf_area = 0.0

Minimum node surface area (ft²).

See also
Legacy: MinSurfArea

◆ normal_flow_ltd

int openswmm::SimulationOptions::normal_flow_ltd = 2

Normal flow limitation: 0=SLOPE, 1=FROUDE, 2=BOTH, 3=NEITHER.

See also
Legacy: NormalFlowLtd

◆ num_threads

int openswmm::SimulationOptions::num_threads = 1

Number of OpenMP threads for parallel solver loops.

Parsed from the THREADS keyword in [OPTIONS].

  • 0 → use all available threads (omp_get_max_threads()).
  • 1 → single-threaded (default, no OpenMP overhead).
  • N → use min(N, omp_get_max_threads()) threads.

A performance threshold is applied at startup: if the number of conduit links is less than 4 × num_threads, threading is disabled to avoid overhead dominating on small networks.

See also
Legacy reference: globals.h NumThreads, project.c

◆ quality_routing

bool openswmm::SimulationOptions::quality_routing = false

True if quality routing is enabled.

◆ report_start

double openswmm::SimulationOptions::report_start = 0.0

Report start date/time.

◆ report_step

double openswmm::SimulationOptions::report_step = 900.0

Reporting output interval in seconds.

◆ routing_model

RoutingModel openswmm::SimulationOptions::routing_model = RoutingModel::DYNWAVE

Routing method. Legacy default: DYNWAVE.

◆ routing_step

double openswmm::SimulationOptions::routing_step = 20.0

Hydraulic routing timestep in seconds. Legacy default: 20.

◆ rpt_averages

bool openswmm::SimulationOptions::rpt_averages = false

Report time-averaged results (default false).

◆ rpt_continuity

bool openswmm::SimulationOptions::rpt_continuity = true

Report continuity errors (default true).

◆ rpt_controls

bool openswmm::SimulationOptions::rpt_controls = false

Report control actions (default false).

◆ rpt_flowstats

bool openswmm::SimulationOptions::rpt_flowstats = true

Report flow statistics (default true).

◆ rpt_input

bool openswmm::SimulationOptions::rpt_input = false

Report input summary.

◆ rpt_link_names

std::vector<std::string> openswmm::SimulationOptions::rpt_link_names

Named links to report (used when rpt_links == 2).

◆ rpt_links

int openswmm::SimulationOptions::rpt_links = 0

Link reporting: 0=NONE, 1=ALL, 2=SOME.

◆ rpt_node_names

std::vector<std::string> openswmm::SimulationOptions::rpt_node_names

Named nodes to report (used when rpt_nodes == 2).

◆ rpt_nodes

int openswmm::SimulationOptions::rpt_nodes = 0

Node reporting: 0=NONE, 1=ALL, 2=SOME.

◆ rpt_subcatch_names

std::vector<std::string> openswmm::SimulationOptions::rpt_subcatch_names

Named subcatchments to report (used when rpt_subcatchments == 2).

◆ rpt_subcatchments

int openswmm::SimulationOptions::rpt_subcatchments = 0

Subcatchment reporting: 0=NONE, 1=ALL, 2=SOME.

◆ runoff_model

RunoffModel openswmm::SimulationOptions::runoff_model = RunoffModel::NL_POND

Runoff routing method.

◆ snow_ati_wt

double openswmm::SimulationOptions::snow_ati_wt = 0.5

Snowmelt: ATI weight (0–1).

◆ snow_divt

double openswmm::SimulationOptions::snow_divt = 34.0

Snowmelt: dividing temperature.

◆ snow_lat

double openswmm::SimulationOptions::snow_lat = 0.0

Snowmelt: latitude (degrees).

◆ snow_max_melt

double openswmm::SimulationOptions::snow_max_melt = 0.0

Snowmelt: maximum melt coefficient.

◆ snow_min_melt

double openswmm::SimulationOptions::snow_min_melt = 0.0

Snowmelt: minimum melt coefficient.

◆ snow_nrg_ratio

double openswmm::SimulationOptions::snow_nrg_ratio = 0.6

Snowmelt: negative melt ratio.

◆ start_date

double openswmm::SimulationOptions::start_date = 2453006.0

Simulation start date/time (decimal days, Julian date).

Legacy default: Jan 1, 2004 = datetime_encodeDate(2004,1,1).

◆ surcharge_method

int openswmm::SimulationOptions::surcharge_method = 0

Surcharge method: 0=EXTRAN, 1=SLOT.

See also
Legacy: SurchargeMethod

◆ sweep_end

int openswmm::SimulationOptions::sweep_end = 365

Street sweeping end day-of-year (1-365). 0 = not set.

◆ sweep_start

int openswmm::SimulationOptions::sweep_start = 1

Street sweeping start day-of-year (1-365). 0 = not set.

◆ sys_flow_tol

double openswmm::SimulationOptions::sys_flow_tol = 0.05

System flow tolerance (fraction, e.g., 0.05 = 5%).

Legacy default: 0.05. Input is in percent, divided by 100.

◆ temp_file

std::string openswmm::SimulationOptions::temp_file

File path for temperature data.

◆ temp_file_start

double openswmm::SimulationOptions::temp_file_start = 0.0

Temperature file start date (Julian).

◆ temp_source

int openswmm::SimulationOptions::temp_source = 0

Temperature source: 0=NONE, 1=TIMESERIES, 2=FILE.

◆ temp_ts_name

std::string openswmm::SimulationOptions::temp_ts_name

Timeseries name for temperature data.

◆ variable_step

double openswmm::SimulationOptions::variable_step = 0.75

Courant factor for variable time stepping (0 = fixed step).

Legacy default: 0.75 (enabled).

◆ wet_step

double openswmm::SimulationOptions::wet_step = 300.0

Wet-weather runoff timestep in seconds.

◆ wind_speed

double openswmm::SimulationOptions::wind_speed[12] = {0,0,0,0,0,0,0,0,0,0,0,0}

Monthly wind speed values (12 months).

◆ wind_type

int openswmm::SimulationOptions::wind_type = 0

Wind speed type: 0=MONTHLY, 1=FILE.


The documentation for this struct was generated from the following file: