![]() |
OpenSWMM Engine
6.0.0-alpha.3
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.3)
|
Functions | |
| SWMM_ENGINE_API int | swmm_forcing_node_lat_inflow (SWMM_Engine engine, int idx, double value, int mode, int persist) |
| Force a lateral inflow at a node. | |
| SWMM_ENGINE_API int | swmm_forcing_node_head_boundary (SWMM_Engine engine, int idx, double value, int mode, int persist) |
| Force a head boundary at an outfall node. | |
| SWMM_ENGINE_API int | swmm_forcing_node_quality (SWMM_Engine engine, int node_idx, int pollutant_idx, double mass_rate, int mode, int persist) |
| Force a quality mass flux at a node. | |
| SWMM_ENGINE_API int | swmm_forcing_link_flow (SWMM_Engine engine, int idx, double value, int mode, int persist) |
| Force a flow in a link. | |
| SWMM_ENGINE_API int | swmm_forcing_link_setting (SWMM_Engine engine, int idx, double value, int mode, int persist) |
| Force a control setting on a link (pump, orifice, weir, outlet). | |
| SWMM_ENGINE_API int | swmm_forcing_link_quality (SWMM_Engine engine, int link_idx, int pollutant_idx, double value, int mode, int persist) |
| Force pollutant quality on a link. | |
| SWMM_ENGINE_API int | swmm_forcing_subcatch_rainfall (SWMM_Engine engine, int idx, double value, int mode, int persist) |
| Force rainfall on a subcatchment (bypasses gage lookup). | |
| SWMM_ENGINE_API int | swmm_forcing_subcatch_evap (SWMM_Engine engine, int idx, double value, int mode, int persist) |
| Prescribe a potential evapotranspiration (PET) rate on a subcatchment. | |
| SWMM_ENGINE_API int | swmm_forcing_subcatch_snowfall (SWMM_Engine engine, int idx, double value, int mode, int persist) |
| Prescribe snowfall on a subcatchment. | |
| SWMM_ENGINE_API int | swmm_climate_get_evap_rate (SWMM_Engine engine, double *value) |
| Get the current climate-derived evaporation rate. | |
| SWMM_ENGINE_API int | swmm_forcing_climate_temperature (SWMM_Engine engine, double value, int mode, int persist) |
| Prescribe the air temperature used for snowmelt and temperature-derived evaporation. | |
| SWMM_ENGINE_API int | swmm_climate_get_temperature (SWMM_Engine engine, double *value) |
| Get the current air temperature (read-only). | |
| SWMM_ENGINE_API int | swmm_forcing_climate_wind (SWMM_Engine engine, double value, int mode, int persist) |
| Prescribe the wind speed used in rain-on-snow melt. | |
| SWMM_ENGINE_API int | swmm_climate_get_wind_speed (SWMM_Engine engine, double *value) |
| Get the current wind speed (read-only). | |
| SWMM_ENGINE_API int | swmm_forcing_climate_evap (SWMM_Engine engine, double value, int mode, int persist) |
| Prescribe the system-wide evaporation rate. | |
| SWMM_ENGINE_API int | swmm_climate_set_dry_only (SWMM_Engine engine, int flag) |
| Set the evaporation DRY_ONLY option at runtime. | |
| SWMM_ENGINE_API int | swmm_climate_get_dry_only (SWMM_Engine engine, int *flag) |
| Get the evaporation DRY_ONLY option. | |
| SWMM_ENGINE_API int | swmm_forcing_gage_rainfall (SWMM_Engine engine, int idx, double value, int mode, int persist) |
| Force rainfall on a rain gage (affects all linked subcatchments). | |
| SWMM_ENGINE_API int | swmm_forcing_clear (SWMM_Engine engine, int type, int idx) |
| Clear forcing on a specific element and channel. | |
| SWMM_ENGINE_API int | swmm_forcing_clear_all (SWMM_Engine engine) |
| Clear ALL forcings on ALL elements. | |
| SWMM_ENGINE_API int swmm_climate_get_dry_only | ( | SWMM_Engine | engine, |
| int * | flag ) |
Get the evaporation DRY_ONLY option.
| engine | Engine handle. | |
| [out] | flag | Receives 0/1. |
| SWMM_ENGINE_API int swmm_climate_get_evap_rate | ( | SWMM_Engine | engine, |
| double * | value ) |
Get the current climate-derived evaporation rate.
Returns the broadcast evaporation rate the engine would apply in the absence of any PET forcing, including monthly adjustments (read-only). Intended for caller-side composition: read this rate, apply your own adjustment logic, and prescribe the result via swmm_forcing_subcatch_evap.
| engine | Engine handle. | |
| [out] | value | Receives the rate in user units (in/day US, mm/day SI). |
| SWMM_ENGINE_API int swmm_climate_get_temperature | ( | SWMM_Engine | engine, |
| double * | value ) |
Get the current air temperature (read-only).
| engine | Engine handle. | |
| [out] | value | Receives the temperature in user units (deg F US, deg C SI). |
| SWMM_ENGINE_API int swmm_climate_get_wind_speed | ( | SWMM_Engine | engine, |
| double * | value ) |
Get the current wind speed (read-only).
| engine | Engine handle. | |
| [out] | value | Receives the wind speed in user units (mph US, km/hr SI). |
| SWMM_ENGINE_API int swmm_climate_set_dry_only | ( | SWMM_Engine | engine, |
| int | flag ) |
Set the evaporation DRY_ONLY option at runtime.
| engine | Engine handle. |
| flag | Nonzero suppresses evaporation during rainfall. |
| SWMM_ENGINE_API int swmm_forcing_clear | ( | SWMM_Engine | engine, |
| int | type, | ||
| int | idx ) |
Clear forcing on a specific element and channel.
| engine | Engine handle. |
| type | Forcing channel (SWMM_ForcingType enum). |
| idx | Element index within that channel. |
| SWMM_ENGINE_API int swmm_forcing_clear_all | ( | SWMM_Engine | engine | ) |
Clear ALL forcings on ALL elements.
| engine | Engine handle. |
| SWMM_ENGINE_API int swmm_forcing_climate_evap | ( | SWMM_Engine | engine, |
| double | value, | ||
| int | mode, | ||
| int | persist ) |
Prescribe the system-wide evaporation rate.
Replaces (OVERRIDE) or augments (ADD) the climate-derived evaporation rate after all sources and monthly adjustments, so it reaches every consumer. Per-subcatchment PET forcing (swmm_forcing_subcatch_evap) still takes precedence on its subcatchment.
| engine | Engine handle. |
| value | Evaporation rate in user units (in/day US, mm/day SI); must be >= 0 for OVERRIDE. |
| mode | SWMM_FORCING_OVERRIDE or SWMM_FORCING_ADD. |
| persist | SWMM_FORCING_RESET or SWMM_FORCING_PERSIST. |
| SWMM_ENGINE_API int swmm_forcing_climate_temperature | ( | SWMM_Engine | engine, |
| double | value, | ||
| int | mode, | ||
| int | persist ) |
Prescribe the air temperature used for snowmelt and temperature-derived evaporation.
Applied before derived climate quantities (saturation vapor pressure, psychrometric constant, Hargreaves moving average) are computed, so all temperature consumers stay consistent. An OVERRIDE prescription replaces the climate data-source value and bypasses monthly adjustments; ADD augments it.
| engine | Engine handle. |
| value | Air temperature in user units (deg F US, deg C SI). |
| mode | SWMM_FORCING_OVERRIDE or SWMM_FORCING_ADD. |
| persist | SWMM_FORCING_RESET or SWMM_FORCING_PERSIST. |
| SWMM_ENGINE_API int swmm_forcing_climate_wind | ( | SWMM_Engine | engine, |
| double | value, | ||
| int | mode, | ||
| int | persist ) |
Prescribe the wind speed used in rain-on-snow melt.
An OVERRIDE prescription replaces the monthly/climate-file value; ADD augments it.
| engine | Engine handle. |
| value | Wind speed in user units (mph US, km/hr SI). Must be >= 0 for OVERRIDE. |
| mode | SWMM_FORCING_OVERRIDE or SWMM_FORCING_ADD. |
| persist | SWMM_FORCING_RESET or SWMM_FORCING_PERSIST. |
| SWMM_ENGINE_API int swmm_forcing_gage_rainfall | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double | value, | ||
| int | mode, | ||
| int | persist ) |
Force rainfall on a rain gage (affects all linked subcatchments).
| engine | Engine handle. |
| idx | Gage index. |
| value | Rainfall rate (in/hr for US, mm/hr for SI). |
| mode | SWMM_FORCING_OVERRIDE or SWMM_FORCING_ADD. |
| persist | SWMM_FORCING_RESET or SWMM_FORCING_PERSIST. |
| SWMM_ENGINE_API int swmm_forcing_link_flow | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double | value, | ||
| int | mode, | ||
| int | persist ) |
Force a flow in a link.
| engine | Engine handle. |
| idx | Link index. |
| value | Flow rate (CFS for US, CMS for SI). |
| mode | SWMM_FORCING_OVERRIDE or SWMM_FORCING_ADD. |
| persist | SWMM_FORCING_RESET or SWMM_FORCING_PERSIST. |
| SWMM_ENGINE_API int swmm_forcing_link_quality | ( | SWMM_Engine | engine, |
| int | link_idx, | ||
| int | pollutant_idx, | ||
| double | value, | ||
| int | mode, | ||
| int | persist ) |
Force pollutant quality on a link.
Same semantics as swmm_forcing_node_quality: OVERRIDE sets the link concentration directly (not mass-balanced); ADD injects a mass rate (mass/sec) tracked in the quality mass-balance forcing bucket.
| engine | Engine handle. |
| link_idx | Link index. |
| pollutant_idx | Pollutant index. |
| value | Concentration (OVERRIDE) or mass rate (ADD). |
| mode | SWMM_FORCING_OVERRIDE or SWMM_FORCING_ADD. |
| persist | SWMM_FORCING_RESET or SWMM_FORCING_PERSIST. |
| SWMM_ENGINE_API int swmm_forcing_link_setting | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double | value, | ||
| int | mode, | ||
| int | persist ) |
Force a control setting on a link (pump, orifice, weir, outlet).
| engine | Engine handle. |
| idx | Link index. |
| value | Setting value (0.0–1.0 for fraction open; pump speed). |
| mode | SWMM_FORCING_OVERRIDE or SWMM_FORCING_ADD. |
| persist | SWMM_FORCING_RESET or SWMM_FORCING_PERSIST. |
| SWMM_ENGINE_API int swmm_forcing_node_head_boundary | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double | value, | ||
| int | mode, | ||
| int | persist ) |
Force a head boundary at an outfall node.
| engine | Engine handle. |
| idx | Node index (must be OUTFALL type). |
| value | Boundary head (ft for US, m for SI). |
| mode | SWMM_FORCING_OVERRIDE (only valid mode for head boundary). |
| persist | SWMM_FORCING_RESET or SWMM_FORCING_PERSIST. |
| SWMM_ENGINE_API int swmm_forcing_node_lat_inflow | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double | value, | ||
| int | mode, | ||
| int | persist ) |
Force a lateral inflow at a node.
| engine | Engine handle. |
| idx | Node index. |
| value | Lateral inflow rate (CFS for US, CMS for SI). |
| mode | SWMM_FORCING_OVERRIDE or SWMM_FORCING_ADD. |
| persist | SWMM_FORCING_RESET or SWMM_FORCING_PERSIST. |
| SWMM_ENGINE_API int swmm_forcing_node_quality | ( | SWMM_Engine | engine, |
| int | node_idx, | ||
| int | pollutant_idx, | ||
| double | mass_rate, | ||
| int | mode, | ||
| int | persist ) |
Force a quality mass flux at a node.
| engine | Engine handle. |
| node_idx | Node index. |
| pollutant_idx | Pollutant index. |
| mass_rate | Mass injection rate (mass/sec in concentration units × CFS). |
| mode | SWMM_FORCING_OVERRIDE or SWMM_FORCING_ADD. |
| persist | SWMM_FORCING_RESET or SWMM_FORCING_PERSIST. |
| SWMM_ENGINE_API int swmm_forcing_subcatch_evap | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double | value, | ||
| int | mode, | ||
| int | persist ) |
Prescribe a potential evapotranspiration (PET) rate on a subcatchment.
The prescribed rate replaces (OVERRIDE) or augments (ADD) the climate-derived evaporation rate for the subcatchment's surface, LID, and groundwater upper-zone evaporation. An OVERRIDE rate is applied as-is, bypassing the DRY_ONLY option and monthly adjustments. Actual evaporation remains capped by available water, so losses are tracked through the normal runoff continuity totals.
| engine | Engine handle. |
| idx | Subcatchment index. |
| value | PET rate in user units (in/day for US, mm/day for SI). |
| mode | SWMM_FORCING_OVERRIDE or SWMM_FORCING_ADD. |
| persist | SWMM_FORCING_RESET or SWMM_FORCING_PERSIST. |
| SWMM_ENGINE_API int swmm_forcing_subcatch_rainfall | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double | value, | ||
| int | mode, | ||
| int | persist ) |
Force rainfall on a subcatchment (bypasses gage lookup).
| engine | Engine handle. |
| idx | Subcatchment index. |
| value | Rainfall rate (in/hr for US, mm/hr for SI). |
| mode | SWMM_FORCING_OVERRIDE or SWMM_FORCING_ADD. |
| persist | SWMM_FORCING_RESET or SWMM_FORCING_PERSIST. |
| SWMM_ENGINE_API int swmm_forcing_subcatch_snowfall | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double | value, | ||
| int | mode, | ||
| int | persist ) |
Prescribe snowfall on a subcatchment.
The prescribed rate replaces (OVERRIDE) or augments (ADD) the gage-derived, temperature-split snowfall used for snow pack accumulation, plowing, and melt computation. Only meaningful for subcatchments with an assigned snow pack.
| engine | Engine handle. |
| idx | Subcatchment index. |
| value | Snowfall rate in user units (in/hr for US, mm/hr for SI), as snow water equivalent. Must be >= 0 for OVERRIDE. |
| mode | SWMM_FORCING_OVERRIDE or SWMM_FORCING_ADD. |
| persist | SWMM_FORCING_RESET or SWMM_FORCING_PERSIST. |