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

#include <ForcingData.hpp>

Collaboration diagram for openswmm::ForcingData:

Classes

struct  ElemClimateChannel
 

Public Member Functions

double elementAirTempF (const HeatElement &e, double base) const noexcept
 Resolve air-temperature forcing for one heat element.
 
double elementHumidity (const HeatElement &e, double base) const noexcept
 Resolve humidity forcing for one heat element.
 
double elementWindMph (const HeatElement &e, double base) const noexcept
 Resolve wind-speed forcing for one heat element.
 
double elementShortwave (const HeatElement &e, double base) const noexcept
 Resolve incoming-shortwave forcing for one heat element.
 
void resize (int n_nodes, int n_links, int n_subcatches, int n_gages, int n_pollutants)
 Replace object-channel arrays with NONE/zero/RESET defaults.
 
void clear_all ()
 Disable object and global-climate forcing modes.
 
void clear_reset_entries ()
 Clear only RESET-persistence entries (called at end of each step).
 
double effective_temperature (double broadcast) const noexcept
 Resolve the effective air temperature (deg F internal).
 
double effective_wind (double broadcast) const noexcept
 Resolve the effective wind speed (mph internal).
 
double effective_rainfall (std::size_t ui, double gage_rainfall) const noexcept
 Resolve the effective rainfall for a subcatchment.
 
double effective_climate_evap (double broadcast) const noexcept
 Resolve the effective system-wide evaporation rate (ft/sec).
 
double effective_snowfall (std::size_t ui, double gage_snowfall) const noexcept
 Resolve the effective snowfall for a subcatchment (ft/sec).
 
double effective_evap_rate (std::size_t ui, double broadcast_rate) const noexcept
 Resolve the effective evaporation rate for a subcatchment.
 

Static Public Member Functions

static int elemSlot (HeatElemKind k) noexcept
 Map a heat element category to the per-element climate slot.
 

Public Attributes

std::vector< ForcingMode > node_lat_inflow_mode
 
std::vector< double > node_lat_inflow_value
 
std::vector< ForcingPersist > node_lat_inflow_persist
 
std::vector< ForcingMode > node_head_boundary_mode
 
std::vector< double > node_head_boundary_value
 
std::vector< ForcingPersist > node_head_boundary_persist
 
std::vector< ForcingMode > node_quality_mode
 
std::vector< double > node_quality_value
 mass rate (mass/sec)
 
std::vector< ForcingPersist > node_quality_persist
 
std::vector< ForcingMode > node_temperature_mode
 
std::vector< double > node_temperature_value
 
std::vector< ForcingPersist > node_temperature_persist
 
std::vector< ForcingMode > node_age_mode
 
std::vector< double > node_age_value
 
std::vector< ForcingPersist > node_age_persist
 
std::vector< ForcingMode > link_flow_mode
 
std::vector< double > link_flow_value
 
std::vector< ForcingPersist > link_flow_persist
 
std::vector< ForcingMode > link_setting_mode
 
std::vector< double > link_setting_value
 0.0–1.0 for pump/orifice/weir
 
std::vector< ForcingPersist > link_setting_persist
 
std::vector< ForcingMode > link_seepage_mode
 
std::vector< double > link_seepage_value
 
std::vector< ForcingPersist > link_seepage_persist
 
std::vector< ForcingMode > link_quality_mode
 flattened link × pollutant
 
std::vector< double > link_quality_value
 OVERRIDE: concentration; ADD: mass rate (mass/sec)
 
std::vector< ForcingPersist > link_quality_persist
 
std::vector< ForcingMode > subcatch_rainfall_mode
 
std::vector< double > subcatch_rainfall_value
 user units (in/hr or mm/hr)
 
std::vector< ForcingPersist > subcatch_rainfall_persist
 
std::vector< ForcingMode > subcatch_evap_mode
 
std::vector< double > subcatch_evap_value
 prescribed PET rate, ft/sec (internal units; converted from in/day or mm/day at the C API boundary)
 
std::vector< ForcingPersist > subcatch_evap_persist
 
std::vector< ForcingMode > subcatch_snowfall_mode
 
std::vector< double > subcatch_snowfall_value
 ft/sec (internal; converted from in/hr or mm/hr at the C API boundary)
 
std::vector< ForcingPersist > subcatch_snowfall_persist
 
std::vector< ForcingMode > gage_rainfall_mode
 
std::vector< double > gage_rainfall_value
 user units (in/hr or mm/hr)
 
std::vector< ForcingPersist > gage_rainfall_persist
 
ForcingMode climate_temperature_mode = ForcingMode::NONE
 
double climate_temperature_value
 deg F (internal; converted from deg C at the C API boundary for SI)
 
ForcingPersist climate_temperature_persist = ForcingPersist::RESET
 
ForcingMode climate_wind_mode = ForcingMode::NONE
 
double climate_wind_value
 mph (internal; converted from km/hr at the C API boundary for SI)
 
ForcingPersist climate_wind_persist = ForcingPersist::RESET
 
ForcingMode climate_evap_mode = ForcingMode::NONE
 
double climate_evap_value
 ft/sec (internal; converted from in/day or mm/day at the C API boundary)
 
ForcingPersist climate_evap_persist = ForcingPersist::RESET
 
ElemClimateChannel elem_air_temp [2]
 deg F
 
ElemClimateChannel elem_humidity [2]
 %
 
ElemClimateChannel elem_wind [2]
 mph
 
ElemClimateChannel elem_shortwave [2]
 W/m2.
 
int n_nodes_ = 0
 
int n_links_ = 0
 
int n_subcatches_ = 0
 
int n_gages_ = 0
 
int n_pollutants_ = 0
 

Member Function Documentation

◆ clear_all()

void openswmm::ForcingData::clear_all ( )
inline

Disable object and global-climate forcing modes.

Preserves all values, persistence flags and dimensions. Does not visit the lazy per-element climate channels; callers requiring their reset clear those separately.

◆ clear_reset_entries()

void openswmm::ForcingData::clear_reset_entries ( )
inline

Clear only RESET-persistence entries (called at end of each step).

After the forcing has been applied for this timestep, entries with RESET persistence are set back to NONE so they do not carry forward to the next step. PERSIST entries are untouched.

◆ effective_climate_evap()

double openswmm::ForcingData::effective_climate_evap ( double broadcast) const
inlinenoexcept

Resolve the effective system-wide evaporation rate (ft/sec).

Parameters
broadcastClimate-derived evap rate (ft/sec), post-adjustment.
Returns
Prescribed (OVERRIDE), augmented (ADD), or broadcast value.

◆ effective_evap_rate()

double openswmm::ForcingData::effective_evap_rate ( std::size_t ui,
double broadcast_rate ) const
inlinenoexcept

Resolve the effective evaporation rate for a subcatchment.

Applies any prescribed PET forcing to the broadcast climate rate. An OVERRIDE prescription is used as-is (it replaces the climate rate, including any DRY_ONLY suppression already folded into broadcast_rate by the caller); ADD augments it.

Parameters
uiSubcatchment index.
broadcast_rateClimate-derived evap rate (ft/sec), after any caller-side DRY_ONLY handling.
Returns
Effective potential evaporation rate (ft/sec).
Here is the caller graph for this function:

◆ effective_rainfall()

double openswmm::ForcingData::effective_rainfall ( std::size_t ui,
double gage_rainfall ) const
inlinenoexcept

Resolve the effective rainfall for a subcatchment.

Applies any subcatchment rainfall forcing to the gage-derived rate. Units are the caller's (user units, in/hr or mm/hr — matching the C API contract of swmm_forcing_subcatch_rainfall).

Parameters
uiSubcatchment index.
gage_rainfallGage-derived rainfall in user units.
Returns
Effective rainfall in user units.
Here is the caller graph for this function:

◆ effective_snowfall()

double openswmm::ForcingData::effective_snowfall ( std::size_t ui,
double gage_snowfall ) const
inlinenoexcept

Resolve the effective snowfall for a subcatchment (ft/sec).

Applies any subcatchment snowfall forcing to the gage-derived (temperature-split) snowfall rate.

Parameters
uiSubcatchment index.
gage_snowfallGage-derived snowfall (ft/sec).
Returns
Effective snowfall (ft/sec).
Here is the caller graph for this function:

◆ effective_temperature()

double openswmm::ForcingData::effective_temperature ( double broadcast) const
inlinenoexcept

Resolve the effective air temperature (deg F internal).

Parameters
broadcastClimate-derived temperature (deg F).
Returns
Prescribed (OVERRIDE), augmented (ADD), or broadcast value.
Here is the caller graph for this function:

◆ effective_wind()

double openswmm::ForcingData::effective_wind ( double broadcast) const
inlinenoexcept

Resolve the effective wind speed (mph internal).

Parameters
broadcastClimate-derived wind speed (mph).
Returns
Prescribed (OVERRIDE), augmented (ADD), or broadcast value.
Here is the caller graph for this function:

◆ elementAirTempF()

double openswmm::ForcingData::elementAirTempF ( const HeatElement & e,
double base ) const
inlinenoexcept

Resolve air-temperature forcing for one heat element.

Does not validate model index, clamp physical range, or change shared ClimateState. Channel parallel arrays must be aligned.

Parameters
[in]eBorrowed element descriptor; LINK/NODE supported, other kinds return base. Negative/unallocated indices also fall back.
[in]baseBroadcast air-temperature in deg F.
Returns
Effective value in deg F using NONE/OVERRIDE/ADD channel semantics.
Here is the call graph for this function:

◆ elementHumidity()

double openswmm::ForcingData::elementHumidity ( const HeatElement & e,
double base ) const
inlinenoexcept

Resolve humidity forcing for one heat element.

Does not validate model index, clamp physical range, or change shared ClimateState. Channel parallel arrays must be aligned.

Parameters
[in]eBorrowed element descriptor; LINK/NODE supported, other kinds return base. Negative/unallocated indices also fall back.
[in]baseBroadcast humidity in % relative humidity.
Returns
Effective value in % relative humidity using NONE/OVERRIDE/ADD channel semantics.
Here is the call graph for this function:

◆ elementShortwave()

double openswmm::ForcingData::elementShortwave ( const HeatElement & e,
double base ) const
inlinenoexcept

Resolve incoming-shortwave forcing for one heat element.

Does not validate model index, clamp physical range, or change shared ClimateState. Channel parallel arrays must be aligned.

Parameters
[in]eBorrowed element descriptor; LINK/NODE supported, other kinds return base. Negative/unallocated indices also fall back.
[in]baseBroadcast incoming-shortwave in W/m2.
Returns
Effective value in W/m2 using NONE/OVERRIDE/ADD channel semantics.
Here is the call graph for this function:

◆ elementWindMph()

double openswmm::ForcingData::elementWindMph ( const HeatElement & e,
double base ) const
inlinenoexcept

Resolve wind-speed forcing for one heat element.

Does not validate model index, clamp physical range, or change shared ClimateState. Channel parallel arrays must be aligned.

Parameters
[in]eBorrowed element descriptor; LINK/NODE supported, other kinds return base. Negative/unallocated indices also fall back.
[in]baseBroadcast wind-speed in mph.
Returns
Effective value in mph using NONE/OVERRIDE/ADD channel semantics.
Here is the call graph for this function:

◆ elemSlot()

static int openswmm::ForcingData::elemSlot ( HeatElemKind k)
inlinestaticnoexcept

Map a heat element category to the per-element climate slot.

Parameters
[in]kHeat-element category; only LINK and NODE have channels.
Returns
0 for LINK, 1 for NODE, otherwise -1.
Here is the caller graph for this function:

◆ resize()

void openswmm::ForcingData::resize ( int n_nodes,
int n_links,
int n_subcatches,
int n_gages,
int n_pollutants )
inline

Replace object-channel arrays with NONE/zero/RESET defaults.

Stores counts before allocating flattened object-major quality arrays. Existing object forcing values are discarded; scalar climate and lazily allocated element-climate channels are unchanged. No negative/dimension overflow checks or transactional rollback on allocation failure.

Parameters
[in]n_nodesNonnegative node count.
[in]n_linksNonnegative link count.
[in]n_subcatchesNonnegative subcatchment count.
[in]n_gagesNonnegative rain-gage count.
[in]n_pollutantsNonnegative pollutants per node/link; dimension products must fit size_t.
Here is the caller graph for this function:

Member Data Documentation

◆ climate_evap_mode

ForcingMode openswmm::ForcingData::climate_evap_mode = ForcingMode::NONE

◆ climate_evap_persist

ForcingPersist openswmm::ForcingData::climate_evap_persist = ForcingPersist::RESET

◆ climate_evap_value

double openswmm::ForcingData::climate_evap_value
Initial value:
=
0.0

ft/sec (internal; converted from in/day or mm/day at the C API boundary)

◆ climate_temperature_mode

ForcingMode openswmm::ForcingData::climate_temperature_mode = ForcingMode::NONE

◆ climate_temperature_persist

ForcingPersist openswmm::ForcingData::climate_temperature_persist = ForcingPersist::RESET

◆ climate_temperature_value

double openswmm::ForcingData::climate_temperature_value
Initial value:
=
0.0

deg F (internal; converted from deg C at the C API boundary for SI)

◆ climate_wind_mode

ForcingMode openswmm::ForcingData::climate_wind_mode = ForcingMode::NONE

◆ climate_wind_persist

ForcingPersist openswmm::ForcingData::climate_wind_persist = ForcingPersist::RESET

◆ climate_wind_value

double openswmm::ForcingData::climate_wind_value
Initial value:
=
0.0

mph (internal; converted from km/hr at the C API boundary for SI)

◆ elem_air_temp

ElemClimateChannel openswmm::ForcingData::elem_air_temp[2]

deg F

[0] = LINK, [1] = NODE. Indexed by elemSlot below so the two kinds cannot be confused at a call site.

◆ elem_humidity

ElemClimateChannel openswmm::ForcingData::elem_humidity[2]

%

◆ elem_shortwave

ElemClimateChannel openswmm::ForcingData::elem_shortwave[2]

W/m2.

◆ elem_wind

ElemClimateChannel openswmm::ForcingData::elem_wind[2]

mph

◆ gage_rainfall_mode

std::vector<ForcingMode> openswmm::ForcingData::gage_rainfall_mode

◆ gage_rainfall_persist

std::vector<ForcingPersist> openswmm::ForcingData::gage_rainfall_persist

◆ gage_rainfall_value

std::vector<double> openswmm::ForcingData::gage_rainfall_value

user units (in/hr or mm/hr)

◆ link_flow_mode

std::vector<ForcingMode> openswmm::ForcingData::link_flow_mode

◆ link_flow_persist

std::vector<ForcingPersist> openswmm::ForcingData::link_flow_persist

◆ link_flow_value

std::vector<double> openswmm::ForcingData::link_flow_value

◆ link_quality_mode

std::vector<ForcingMode> openswmm::ForcingData::link_quality_mode

flattened link × pollutant

◆ link_quality_persist

std::vector<ForcingPersist> openswmm::ForcingData::link_quality_persist

◆ link_quality_value

std::vector<double> openswmm::ForcingData::link_quality_value

OVERRIDE: concentration; ADD: mass rate (mass/sec)

◆ link_seepage_mode

std::vector<ForcingMode> openswmm::ForcingData::link_seepage_mode

G-X4 (2026-09-20): a host's conduit ⇄ groundwater exchange rate (internal flow units, + OUT of the conduit — the seep_loss_rate sign). This is the HydroCouple link_exchange_flow inlet: an external groundwater model computes the exchange and the conduit routes it, in place of (OVERRIDE) or on top of (ADD) whatever the [LOSSES] rate or the internal signed law produced.

◆ link_seepage_persist

std::vector<ForcingPersist> openswmm::ForcingData::link_seepage_persist

◆ link_seepage_value

std::vector<double> openswmm::ForcingData::link_seepage_value

◆ link_setting_mode

std::vector<ForcingMode> openswmm::ForcingData::link_setting_mode

◆ link_setting_persist

std::vector<ForcingPersist> openswmm::ForcingData::link_setting_persist

◆ link_setting_value

std::vector<double> openswmm::ForcingData::link_setting_value

0.0–1.0 for pump/orifice/weir

◆ n_gages_

int openswmm::ForcingData::n_gages_ = 0

◆ n_links_

int openswmm::ForcingData::n_links_ = 0

◆ n_nodes_

int openswmm::ForcingData::n_nodes_ = 0

◆ n_pollutants_

int openswmm::ForcingData::n_pollutants_ = 0

◆ n_subcatches_

int openswmm::ForcingData::n_subcatches_ = 0

◆ node_age_mode

std::vector<ForcingMode> openswmm::ForcingData::node_age_mode

◆ node_age_persist

std::vector<ForcingPersist> openswmm::ForcingData::node_age_persist

◆ node_age_value

std::vector<double> openswmm::ForcingData::node_age_value

◆ node_head_boundary_mode

std::vector<ForcingMode> openswmm::ForcingData::node_head_boundary_mode

◆ node_head_boundary_persist

std::vector<ForcingPersist> openswmm::ForcingData::node_head_boundary_persist

◆ node_head_boundary_value

std::vector<double> openswmm::ForcingData::node_head_boundary_value

◆ node_lat_inflow_mode

std::vector<ForcingMode> openswmm::ForcingData::node_lat_inflow_mode

◆ node_lat_inflow_persist

std::vector<ForcingPersist> openswmm::ForcingData::node_lat_inflow_persist

◆ node_lat_inflow_value

std::vector<double> openswmm::ForcingData::node_lat_inflow_value

◆ node_quality_mode

std::vector<ForcingMode> openswmm::ForcingData::node_quality_mode

◆ node_quality_persist

std::vector<ForcingPersist> openswmm::ForcingData::node_quality_persist

◆ node_quality_value

std::vector<double> openswmm::ForcingData::node_quality_value

mass rate (mass/sec)

◆ node_temperature_mode

std::vector<ForcingMode> openswmm::ForcingData::node_temperature_mode

◆ node_temperature_persist

std::vector<ForcingPersist> openswmm::ForcingData::node_temperature_persist

◆ node_temperature_value

std::vector<double> openswmm::ForcingData::node_temperature_value

◆ subcatch_evap_mode

std::vector<ForcingMode> openswmm::ForcingData::subcatch_evap_mode

◆ subcatch_evap_persist

std::vector<ForcingPersist> openswmm::ForcingData::subcatch_evap_persist

◆ subcatch_evap_value

std::vector<double> openswmm::ForcingData::subcatch_evap_value

prescribed PET rate, ft/sec (internal units; converted from in/day or mm/day at the C API boundary)

◆ subcatch_rainfall_mode

std::vector<ForcingMode> openswmm::ForcingData::subcatch_rainfall_mode

◆ subcatch_rainfall_persist

std::vector<ForcingPersist> openswmm::ForcingData::subcatch_rainfall_persist

◆ subcatch_rainfall_value

std::vector<double> openswmm::ForcingData::subcatch_rainfall_value

user units (in/hr or mm/hr)

◆ subcatch_snowfall_mode

std::vector<ForcingMode> openswmm::ForcingData::subcatch_snowfall_mode

◆ subcatch_snowfall_persist

std::vector<ForcingPersist> openswmm::ForcingData::subcatch_snowfall_persist

◆ subcatch_snowfall_value

std::vector<double> openswmm::ForcingData::subcatch_snowfall_value

ft/sec (internal; converted from in/hr or mm/hr at the C API boundary)


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