![]() |
OpenSWMM Engine
6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
|
OpenSWMM Engine — Pollutant / Water Quality C API. More...
#include "openswmm_engine.h"Go to the source code of this file.
Functions | |
| SWMM_ENGINE_API int | swmm_pollutant_count (SWMM_Engine engine) |
| Get the total number of pollutants in the model. | |
| SWMM_ENGINE_API int | swmm_pollutant_index (SWMM_Engine engine, const char *id) |
| Look up a pollutant's zero-based index by its string identifier. | |
| SWMM_ENGINE_API const char * | swmm_pollutant_id (SWMM_Engine engine, int idx) |
| Get the string identifier of a pollutant by index. | |
| SWMM_ENGINE_API int | swmm_pollutant_add (SWMM_Engine engine, const char *id, int units) |
| Add a new pollutant to the model. | |
| SWMM_ENGINE_API int | swmm_pollutant_set_kdecay (SWMM_Engine engine, int idx, double k) |
| Set the first-order decay coefficient for a pollutant. | |
| SWMM_ENGINE_API int | swmm_pollutant_set_rain_conc (SWMM_Engine engine, int idx, double conc) |
| Set the pollutant concentration in rainfall. | |
| SWMM_ENGINE_API int | swmm_pollutant_set_gw_conc (SWMM_Engine engine, int idx, double conc) |
| Set the pollutant concentration in groundwater. | |
| SWMM_ENGINE_API int | swmm_pollutant_set_init_conc (SWMM_Engine engine, int idx, double conc) |
| Set the initial concentration throughout the conveyance system. | |
| SWMM_ENGINE_API int | swmm_pollutant_get_units (SWMM_Engine engine, int idx, int *units) |
| Get the concentration units code for a pollutant. | |
| SWMM_ENGINE_API int | swmm_pollutant_get_kdecay (SWMM_Engine engine, int idx, double *k) |
| Get the first-order decay coefficient. | |
| SWMM_ENGINE_API int | swmm_pollutant_get_rain_conc (SWMM_Engine engine, int idx, double *conc) |
| Get the pollutant concentration in rainfall. | |
| SWMM_ENGINE_API int | swmm_pollutant_get_gw_conc (SWMM_Engine engine, int idx, double *conc) |
| Get the pollutant concentration in groundwater. | |
| SWMM_ENGINE_API int | swmm_pollutant_get_init_conc (SWMM_Engine engine, int idx, double *conc) |
| Get the initial concentration throughout the conveyance system. | |
| SWMM_ENGINE_API int | swmm_pollutant_set_rdii_conc (SWMM_Engine engine, int idx, double conc) |
| Set the RDII (Rainfall-Dependent Infiltration/Inflow) concentration. | |
| SWMM_ENGINE_API int | swmm_pollutant_get_rdii_conc (SWMM_Engine engine, int idx, double *conc) |
| Get the RDII concentration. | |
| SWMM_ENGINE_API int | swmm_pollutant_set_mwt (SWMM_Engine engine, int idx, double mwt) |
| Set the molecular weight of a pollutant. | |
| SWMM_ENGINE_API int | swmm_pollutant_get_mwt (SWMM_Engine engine, int idx, double *mwt) |
| Get the molecular weight of a pollutant. | |
| SWMM_ENGINE_API int | swmm_pollutant_set_co_pollutant (SWMM_Engine engine, int idx, int co_idx, double frac) |
| Set a co-pollutant relationship (concentration = fraction * co-pollutant). | |
| SWMM_ENGINE_API int | swmm_pollutant_get_co_pollutant (SWMM_Engine engine, int idx, int *co_idx, double *frac) |
| Get a co-pollutant relationship. | |
| SWMM_ENGINE_API int | swmm_pollutant_set_snow_only (SWMM_Engine engine, int idx, int flag) |
| Set whether a pollutant only builds up during snowfall events. | |
| SWMM_ENGINE_API int | swmm_pollutant_get_snow_only (SWMM_Engine engine, int idx, int *flag) |
| Get whether a pollutant only builds up during snowfall events. | |
| SWMM_ENGINE_API int | swmm_node_set_quality (SWMM_Engine engine, int node_idx, int pollut_idx, double conc) |
| Set the pollutant concentration at a node (runtime override). | |
| SWMM_ENGINE_API int | swmm_link_set_quality (SWMM_Engine engine, int link_idx, int pollut_idx, double conc) |
| Set the pollutant concentration in a link (runtime override). | |
OpenSWMM Engine — Pollutant / Water Quality C API.
Pollutant identity, creation, property setters, and runtime quality injection at nodes and links.
| SWMM_ENGINE_API int swmm_link_set_quality | ( | SWMM_Engine | engine, |
| int | link_idx, | ||
| int | pollut_idx, | ||
| double | conc | ||
| ) |
Set the pollutant concentration in a link (runtime override).
| engine | Engine handle (RUNNING state). |
| link_idx | Zero-based link index. |
| pollut_idx | Zero-based pollutant index. |
| conc | Concentration in pollutant units. |
| SWMM_ENGINE_API int swmm_node_set_quality | ( | SWMM_Engine | engine, |
| int | node_idx, | ||
| int | pollut_idx, | ||
| double | conc | ||
| ) |
Set the pollutant concentration at a node (runtime override).
| engine | Engine handle (RUNNING state). |
| node_idx | Zero-based node index. |
| pollut_idx | Zero-based pollutant index. |
| conc | Concentration in pollutant units. |
| SWMM_ENGINE_API int swmm_pollutant_add | ( | SWMM_Engine | engine, |
| const char * | id, | ||
| int | units | ||
| ) |
Add a new pollutant to the model.
| engine | Engine handle (SWMM_STATE_BUILDING). |
| id | Unique null-terminated identifier for the new pollutant. |
| units | Concentration units code (0=MG/L, 1=UG/L, 2=#/L). |
| SWMM_ENGINE_API int swmm_pollutant_count | ( | SWMM_Engine | engine | ) |
Get the total number of pollutants in the model.
| engine | Engine handle. |
| SWMM_ENGINE_API int swmm_pollutant_get_co_pollutant | ( | SWMM_Engine | engine, |
| int | idx, | ||
| int * | co_idx, | ||
| double * | frac | ||
| ) |
Get a co-pollutant relationship.
| engine | Engine handle. | |
| idx | Zero-based pollutant index. | |
| [out] | co_idx | Receives the co-pollutant index (-1 if none). |
| [out] | frac | Receives the fraction. |
| SWMM_ENGINE_API int swmm_pollutant_get_gw_conc | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double * | conc | ||
| ) |
Get the pollutant concentration in groundwater.
| engine | Engine handle. | |
| idx | Zero-based pollutant index. | |
| [out] | conc | Receives the concentration. |
| SWMM_ENGINE_API int swmm_pollutant_get_init_conc | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double * | conc | ||
| ) |
Get the initial concentration throughout the conveyance system.
| engine | Engine handle. | |
| idx | Zero-based pollutant index. | |
| [out] | conc | Receives the initial concentration. |
| SWMM_ENGINE_API int swmm_pollutant_get_kdecay | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double * | k | ||
| ) |
Get the first-order decay coefficient.
| engine | Engine handle. | |
| idx | Zero-based pollutant index. | |
| [out] | k | Receives the decay coefficient (1/day). |
| SWMM_ENGINE_API int swmm_pollutant_get_mwt | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double * | mwt | ||
| ) |
Get the molecular weight of a pollutant.
| engine | Engine handle. | |
| idx | Zero-based pollutant index. | |
| [out] | mwt | Receives the molecular weight. |
| SWMM_ENGINE_API int swmm_pollutant_get_rain_conc | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double * | conc | ||
| ) |
Get the pollutant concentration in rainfall.
| engine | Engine handle. | |
| idx | Zero-based pollutant index. | |
| [out] | conc | Receives the concentration. |
| SWMM_ENGINE_API int swmm_pollutant_get_rdii_conc | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double * | conc | ||
| ) |
Get the RDII concentration.
| engine | Engine handle. | |
| idx | Zero-based pollutant index. | |
| [out] | conc | Receives the RDII concentration. |
| SWMM_ENGINE_API int swmm_pollutant_get_snow_only | ( | SWMM_Engine | engine, |
| int | idx, | ||
| int * | flag | ||
| ) |
Get whether a pollutant only builds up during snowfall events.
| engine | Engine handle. | |
| idx | Zero-based pollutant index. | |
| [out] | flag | Receives 1 for snow-only, 0 otherwise. |
| SWMM_ENGINE_API int swmm_pollutant_get_units | ( | SWMM_Engine | engine, |
| int | idx, | ||
| int * | units | ||
| ) |
Get the concentration units code for a pollutant.
| engine | Engine handle. | |
| idx | Zero-based pollutant index. | |
| [out] | units | Receives the units code (0=MG/L, 1=UG/L, 2=#/L). |
| SWMM_ENGINE_API const char * swmm_pollutant_id | ( | SWMM_Engine | engine, |
| int | idx | ||
| ) |
Get the string identifier of a pollutant by index.
| engine | Engine handle. |
| idx | Zero-based pollutant index. |
| SWMM_ENGINE_API int swmm_pollutant_index | ( | SWMM_Engine | engine, |
| const char * | id | ||
| ) |
Look up a pollutant's zero-based index by its string identifier.
| engine | Engine handle. |
| id | Null-terminated pollutant identifier. |
| SWMM_ENGINE_API int swmm_pollutant_set_co_pollutant | ( | SWMM_Engine | engine, |
| int | idx, | ||
| int | co_idx, | ||
| double | frac | ||
| ) |
Set a co-pollutant relationship (concentration = fraction * co-pollutant).
| engine | Engine handle. |
| idx | Zero-based pollutant index. |
| co_idx | Zero-based index of the co-pollutant. |
| frac | Fraction of the co-pollutant concentration. |
| SWMM_ENGINE_API int swmm_pollutant_set_gw_conc | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double | conc | ||
| ) |
Set the pollutant concentration in groundwater.
| engine | Engine handle. |
| idx | Zero-based pollutant index. |
| conc | Concentration in pollutant units. |
| SWMM_ENGINE_API int swmm_pollutant_set_init_conc | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double | conc | ||
| ) |
Set the initial concentration throughout the conveyance system.
| engine | Engine handle. |
| idx | Zero-based pollutant index. |
| conc | Initial concentration in pollutant units. |
| SWMM_ENGINE_API int swmm_pollutant_set_kdecay | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double | k | ||
| ) |
Set the first-order decay coefficient for a pollutant.
| engine | Engine handle. |
| idx | Zero-based pollutant index. |
| k | Decay coefficient (1/day). |
| SWMM_ENGINE_API int swmm_pollutant_set_mwt | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double | mwt | ||
| ) |
Set the molecular weight of a pollutant.
| engine | Engine handle. |
| idx | Zero-based pollutant index. |
| mwt | Molecular weight (g/mol). |
| SWMM_ENGINE_API int swmm_pollutant_set_rain_conc | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double | conc | ||
| ) |
Set the pollutant concentration in rainfall.
| engine | Engine handle. |
| idx | Zero-based pollutant index. |
| conc | Concentration in pollutant units. |
| SWMM_ENGINE_API int swmm_pollutant_set_rdii_conc | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double | conc | ||
| ) |
Set the RDII (Rainfall-Dependent Infiltration/Inflow) concentration.
| engine | Engine handle. |
| idx | Zero-based pollutant index. |
| conc | RDII concentration in pollutant units. |
| SWMM_ENGINE_API int swmm_pollutant_set_snow_only | ( | SWMM_Engine | engine, |
| int | idx, | ||
| int | flag | ||
| ) |
Set whether a pollutant only builds up during snowfall events.
| engine | Engine handle. |
| idx | Zero-based pollutant index. |
| flag | Non-zero for snow-only; zero otherwise. |