OpenSWMM Engine  6.0.0-alpha.3
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.3)
Loading...
Searching...
No Matches
openswmm::twoD::SolverOptions2D Struct Reference

Configuration for the 2D surface routing CVODE solver. More...

#include <SolverOptions2D.hpp>

Collaboration diagram for openswmm::twoD::SolverOptions2D:

Public Attributes

double max_timestep = 10.0
 Max CVODE internal step (s)
 
double min_timestep = 0.001
 Min CVODE internal step (s)
 
double rel_tolerance = 1.0e-4
 CVODE relative tolerance.
 
double abs_tolerance = 1.0e-6
 CVODE absolute tolerance (m)
 
double dry_depth = 0.001
 Dry cell threshold (m)
 
double limiter_epsilon = 1.0e-6
 
double flux_dh_eps = 0.004
 Diffusive-flux gradient floor (m)
 
double coupling_cd = 0.65
 Default discharge coefficient.
 
int max_krylov_dim = 30
 Max Krylov subspace dimension.
 
int coupling_interval = 0
 
double coupling_window = -1.0
 
int max_cvode_steps = 500
 Max CVODE steps per advance.
 
bool active_set = false
 
int active_set_halo = 2
 
bool report_2d = true
 Write 2D results to output.
 
IntegratorType integrator = IntegratorType::CVODE
 
MomentumType momentum = MomentumType::DW
 
RainfallMode rainfall_mode = RainfallMode::NATURAL_NEIGHBOUR
 
LinearSolverType linear_solver = LinearSolverType::GMRES
 
PreconditionerType preconditioner = PreconditionerType::AMG
 
std::string mesh_file
 Path from [2D_MESH_FILE] FILE token. Empty = mesh is inline in main .inp.
 
std::string output_file
 
double len_1d_to_2d = 1.0
 1D length → 2D length (ft→m, 0.3048)
 
double len_2d_to_1d = 1.0
 2D length → 1D length (m→ft, 3.2808)
 
double vol_1d_to_2d = 1.0
 1D volume → 2D volume (ft³→m³, 0.02832)
 
double flow_1d_to_2d = 1.0
 1D flow → 2D flow (ft³/s→m³/s, 0.02832)
 
double flow_2d_to_1d = 1.0
 2D flow → 1D flow (m³/s→ft³/s, 35.315)
 
int num_threads = 1
 
bool mesh_units_si = false
 
bool mesh_scaled_to_si = false
 
bool pending_rows_drained = false
 

Detailed Description

Configuration for the 2D surface routing CVODE solver.

Populated from [2D_OPTIONS] input section. Defaults are chosen for typical urban drainage surface routing problems.

Member Data Documentation

◆ abs_tolerance

double openswmm::twoD::SolverOptions2D::abs_tolerance = 1.0e-6

CVODE absolute tolerance (m)

◆ active_set

bool openswmm::twoD::SolverOptions2D::active_set = false

Dry-cell active-set masking: restrict the RHS pipeline to wet/sourced cells plus an ACTIVE_SET_HALO-ring neighbourhood; frozen cells get ydot ≡ 0 (exactly their unmasked value — dry, source-free, walled). The CVODE system stays full size. Exactly OFF-able; default OFF until field-validated. Parsed from [2D_OPTIONS] ACTIVE_SET (YES/NO); env OPENSWMM_2D_ACTIVE_SET (0/1) overrides. CVODE+DW only.

◆ active_set_halo

int openswmm::twoD::SolverOptions2D::active_set_halo = 2

BFS halo ring count around the wet/sourced seed set (≥1); auto-doubled (capped) when a front crosses the whole halo within one window. Parsed from [2D_OPTIONS] ACTIVE_SET_HALO; env OPENSWMM_2D_ACTIVE_SET_HALO.

◆ coupling_cd

double openswmm::twoD::SolverOptions2D::coupling_cd = 0.65

Default discharge coefficient.

◆ coupling_interval

int openswmm::twoD::SolverOptions2D::coupling_interval = 0

0 = every SWMM step

◆ coupling_window

double openswmm::twoD::SolverOptions2D::coupling_window = -1.0

2D advance window in SECONDS of simulation time. −1 = AUTO (window = the nominal [OPTIONS] ROUTING_STEP, clamped to MAX_TIMESTEP); 0 = advance every routing step; > 0 = explicit window length. A time-based window is immune to 1D variable-step collapse — a step-count COUPLING_INTERVAL silently shrinks with the routing step, which is exactly the regime where the 2D advance cost explodes. An explicit COUPLING_WINDOW takes precedence over COUPLING_INTERVAL; AUTO defers to COUPLING_INTERVAL > 1 for backward compatibility. Parsed from [2D_OPTIONS] COUPLING_WINDOW; env OPENSWMM_2D_COUPLING_WINDOW overrides.

◆ dry_depth

double openswmm::twoD::SolverOptions2D::dry_depth = 0.001

Dry cell threshold (m)

◆ flow_1d_to_2d

double openswmm::twoD::SolverOptions2D::flow_1d_to_2d = 1.0

1D flow → 2D flow (ft³/s→m³/s, 0.02832)

◆ flow_2d_to_1d

double openswmm::twoD::SolverOptions2D::flow_2d_to_1d = 1.0

2D flow → 1D flow (m³/s→ft³/s, 35.315)

◆ flux_dh_eps

double openswmm::twoD::SolverOptions2D::flux_dh_eps = 0.004

Diffusive-flux gradient floor (m)

Head-difference regularization (m) for the diffusive-wave flux √|Δη|. Below this gradient the flux is linearized (C¹) so the transmissivity stays bounded as the water surface flattens — without it, deep near-level ponding (e.g. a large design storm draining) makes the flux Jacobian blow up and the implicit step collapse. Only affects millimeter-scale gradients, so bulk flow is preserved; raise it for extra robustness on very deep problems. Default 4 mm; 0 = bare √. Parsed from [2D_OPTIONS] FLUX_DH_EPS; env OPENSWMM_2D_FLUX_DH_EPS overrides.

◆ integrator

IntegratorType openswmm::twoD::SolverOptions2D::integrator = IntegratorType::CVODE

◆ len_1d_to_2d

double openswmm::twoD::SolverOptions2D::len_1d_to_2d = 1.0

1D length → 2D length (ft→m, 0.3048)

◆ len_2d_to_1d

double openswmm::twoD::SolverOptions2D::len_2d_to_1d = 1.0

2D length → 1D length (m→ft, 3.2808)

◆ limiter_epsilon

double openswmm::twoD::SolverOptions2D::limiter_epsilon = 1.0e-6

Slope limiter epsilon

◆ linear_solver

LinearSolverType openswmm::twoD::SolverOptions2D::linear_solver = LinearSolverType::GMRES

◆ max_cvode_steps

int openswmm::twoD::SolverOptions2D::max_cvode_steps = 500

Max CVODE steps per advance.

◆ max_krylov_dim

int openswmm::twoD::SolverOptions2D::max_krylov_dim = 30

Max Krylov subspace dimension.

◆ max_timestep

double openswmm::twoD::SolverOptions2D::max_timestep = 10.0

Max CVODE internal step (s)

◆ mesh_file

std::string openswmm::twoD::SolverOptions2D::mesh_file

Path from [2D_MESH_FILE] FILE token. Empty = mesh is inline in main .inp.

◆ mesh_scaled_to_si

bool openswmm::twoD::SolverOptions2D::mesh_scaled_to_si = false

Runtime-only: true after SurfaceRouter2D::initialize() applied the FLOW_UNITS ft→m in-place mesh scaling (vx/vy/vz, coupling areas). Lets serialization (InpWriter, GeoPackage) un-scale back to the authored units, and makes a repeated initialize() idempotent against double-scaling. Never parsed from input, never persisted.

◆ mesh_units_si

bool openswmm::twoD::SolverOptions2D::mesh_units_si = false

When true, the inline .inp or referenced .2dm declared ;; UNITS: SI (m) (or an equivalent metric keyword). The mesh on disk is already in SI metres, so SurfaceRouter2D::initialize SKIPS the FLOW_UNITS-based mesh scaling (vx/vy/vz and the coupling areas). The 1D⇄2D coupling factors (len_1d_to_2d, vol_1d_to_2d, flow_*) are unaffected — they are always the feet⇄metres conversion (the 1D side is always feet), not the mesh scaling.

◆ min_timestep

double openswmm::twoD::SolverOptions2D::min_timestep = 0.001

Min CVODE internal step (s)

◆ momentum

MomentumType openswmm::twoD::SolverOptions2D::momentum = MomentumType::DW

◆ num_threads

int openswmm::twoD::SolverOptions2D::num_threads = 1

Runtime-only: resolved OpenMP thread count for the embarrassingly- parallel 2D per-cell / per-vertex loops (RHS pipeline, Jacobi preconditioner, post-step diagnostics). Set in SurfaceRouter2D::initialize() from SimulationOptions::num_threads (the global THREADS option) using the same min(N,max) + size-gate DWSolver::setNumThreads applies. 1 = serial. The parallelised loops use schedule(static) and write only their own cell/vertex slot, so any thread count is bit-identical to serial. Never parsed/persisted.

◆ output_file

std::string openswmm::twoD::SolverOptions2D::output_file

HDF5 output file path from [2D_OPTIONS] OUTPUT_FILE token. Empty = no 2D output is written. Resolved relative to the parent .inp directory by the section handler.

◆ pending_rows_drained

bool openswmm::twoD::SolverOptions2D::pending_rows_drained = false

Runtime-only: true after SurfaceRouter2D::initialize() drained the pending [2D_BOUNDARY_CONDITIONS] / [2D_EDGE_CONVEYANCE] rows into BoundaryData / MeshData::edge_conveyance. Serialization collectors (Serialize2D.hpp) switch to the drained arrays once this is set — they are the live state that post-initialize API mutations edit; the retained pending rows would be stale. Never parsed/persisted.

◆ preconditioner

PreconditionerType openswmm::twoD::SolverOptions2D::preconditioner = PreconditionerType::AMG

◆ rainfall_mode

RainfallMode openswmm::twoD::SolverOptions2D::rainfall_mode = RainfallMode::NATURAL_NEIGHBOUR

◆ rel_tolerance

double openswmm::twoD::SolverOptions2D::rel_tolerance = 1.0e-4

CVODE relative tolerance.

◆ report_2d

bool openswmm::twoD::SolverOptions2D::report_2d = true

Write 2D results to output.

◆ vol_1d_to_2d

double openswmm::twoD::SolverOptions2D::vol_1d_to_2d = 1.0

1D volume → 2D volume (ft³→m³, 0.02832)


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