![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
#include <ForcingData.hpp>
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. | |
|
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.
|
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.
|
inlinenoexcept |
Resolve the effective system-wide evaporation rate (ft/sec).
| broadcast | Climate-derived evap rate (ft/sec), post-adjustment. |
|
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.
| ui | Subcatchment index. |
| broadcast_rate | Climate-derived evap rate (ft/sec), after any caller-side DRY_ONLY handling. |
|
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).
| ui | Subcatchment index. |
| gage_rainfall | Gage-derived rainfall in user units. |
|
inlinenoexcept |
Resolve the effective snowfall for a subcatchment (ft/sec).
Applies any subcatchment snowfall forcing to the gage-derived (temperature-split) snowfall rate.
| ui | Subcatchment index. |
| gage_snowfall | Gage-derived snowfall (ft/sec). |
|
inlinenoexcept |
Resolve the effective air temperature (deg F internal).
| broadcast | Climate-derived temperature (deg F). |
|
inlinenoexcept |
Resolve the effective wind speed (mph internal).
| broadcast | Climate-derived wind speed (mph). |
|
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.
| [in] | e | Borrowed element descriptor; LINK/NODE supported, other kinds return base. Negative/unallocated indices also fall back. |
| [in] | base | Broadcast air-temperature in deg F. |
|
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.
| [in] | e | Borrowed element descriptor; LINK/NODE supported, other kinds return base. Negative/unallocated indices also fall back. |
| [in] | base | Broadcast humidity in % relative humidity. |
|
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.
| [in] | e | Borrowed element descriptor; LINK/NODE supported, other kinds return base. Negative/unallocated indices also fall back. |
| [in] | base | Broadcast incoming-shortwave in W/m2. |
|
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.
| [in] | e | Borrowed element descriptor; LINK/NODE supported, other kinds return base. Negative/unallocated indices also fall back. |
| [in] | base | Broadcast wind-speed in mph. |
|
inlinestaticnoexcept |
Map a heat element category to the per-element climate slot.
| [in] | k | Heat-element category; only LINK and NODE have channels. |
|
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.
| [in] | n_nodes | Nonnegative node count. |
| [in] | n_links | Nonnegative link count. |
| [in] | n_subcatches | Nonnegative subcatchment count. |
| [in] | n_gages | Nonnegative rain-gage count. |
| [in] | n_pollutants | Nonnegative pollutants per node/link; dimension products must fit size_t. |
| ForcingMode openswmm::ForcingData::climate_evap_mode = ForcingMode::NONE |
| ForcingPersist openswmm::ForcingData::climate_evap_persist = ForcingPersist::RESET |
| double openswmm::ForcingData::climate_evap_value |
ft/sec (internal; converted from in/day or mm/day at the C API boundary)
| ForcingMode openswmm::ForcingData::climate_temperature_mode = ForcingMode::NONE |
| ForcingPersist openswmm::ForcingData::climate_temperature_persist = ForcingPersist::RESET |
| double openswmm::ForcingData::climate_temperature_value |
deg F (internal; converted from deg C at the C API boundary for SI)
| ForcingMode openswmm::ForcingData::climate_wind_mode = ForcingMode::NONE |
| ForcingPersist openswmm::ForcingData::climate_wind_persist = ForcingPersist::RESET |
| double openswmm::ForcingData::climate_wind_value |
mph (internal; converted from km/hr at the C API boundary for SI)
| 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.
| ElemClimateChannel openswmm::ForcingData::elem_humidity[2] |
%
| ElemClimateChannel openswmm::ForcingData::elem_shortwave[2] |
W/m2.
| ElemClimateChannel openswmm::ForcingData::elem_wind[2] |
mph
| std::vector<ForcingMode> openswmm::ForcingData::gage_rainfall_mode |
| std::vector<ForcingPersist> openswmm::ForcingData::gage_rainfall_persist |
| std::vector<double> openswmm::ForcingData::gage_rainfall_value |
user units (in/hr or mm/hr)
| std::vector<ForcingMode> openswmm::ForcingData::link_flow_mode |
| std::vector<ForcingPersist> openswmm::ForcingData::link_flow_persist |
| std::vector<double> openswmm::ForcingData::link_flow_value |
| std::vector<ForcingMode> openswmm::ForcingData::link_quality_mode |
flattened link × pollutant
| std::vector<ForcingPersist> openswmm::ForcingData::link_quality_persist |
| std::vector<double> openswmm::ForcingData::link_quality_value |
OVERRIDE: concentration; ADD: mass rate (mass/sec)
| 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.
| std::vector<ForcingPersist> openswmm::ForcingData::link_seepage_persist |
| std::vector<double> openswmm::ForcingData::link_seepage_value |
| std::vector<ForcingMode> openswmm::ForcingData::link_setting_mode |
| std::vector<ForcingPersist> openswmm::ForcingData::link_setting_persist |
| std::vector<double> openswmm::ForcingData::link_setting_value |
0.0–1.0 for pump/orifice/weir
| int openswmm::ForcingData::n_gages_ = 0 |
| int openswmm::ForcingData::n_links_ = 0 |
| int openswmm::ForcingData::n_nodes_ = 0 |
| int openswmm::ForcingData::n_pollutants_ = 0 |
| int openswmm::ForcingData::n_subcatches_ = 0 |
| std::vector<ForcingMode> openswmm::ForcingData::node_age_mode |
| std::vector<ForcingPersist> openswmm::ForcingData::node_age_persist |
| std::vector<double> openswmm::ForcingData::node_age_value |
| std::vector<ForcingMode> openswmm::ForcingData::node_head_boundary_mode |
| std::vector<ForcingPersist> openswmm::ForcingData::node_head_boundary_persist |
| std::vector<double> openswmm::ForcingData::node_head_boundary_value |
| std::vector<ForcingMode> openswmm::ForcingData::node_lat_inflow_mode |
| std::vector<ForcingPersist> openswmm::ForcingData::node_lat_inflow_persist |
| std::vector<double> openswmm::ForcingData::node_lat_inflow_value |
| std::vector<ForcingMode> openswmm::ForcingData::node_quality_mode |
| std::vector<ForcingPersist> openswmm::ForcingData::node_quality_persist |
| std::vector<double> openswmm::ForcingData::node_quality_value |
mass rate (mass/sec)
| std::vector<ForcingMode> openswmm::ForcingData::node_temperature_mode |
| std::vector<ForcingPersist> openswmm::ForcingData::node_temperature_persist |
| std::vector<double> openswmm::ForcingData::node_temperature_value |
| std::vector<ForcingMode> openswmm::ForcingData::subcatch_evap_mode |
| std::vector<ForcingPersist> openswmm::ForcingData::subcatch_evap_persist |
| 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)
| std::vector<ForcingMode> openswmm::ForcingData::subcatch_rainfall_mode |
| std::vector<ForcingPersist> openswmm::ForcingData::subcatch_rainfall_persist |
| std::vector<double> openswmm::ForcingData::subcatch_rainfall_value |
user units (in/hr or mm/hr)
| std::vector<ForcingMode> openswmm::ForcingData::subcatch_snowfall_mode |
| std::vector<ForcingPersist> openswmm::ForcingData::subcatch_snowfall_persist |
| std::vector<double> openswmm::ForcingData::subcatch_snowfall_value |
ft/sec (internal; converted from in/hr or mm/hr at the C API boundary)