![]() |
OpenSWMM Engine
6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
|
C API implementation — node identity, creation, properties, state, bulk. More...
Functions | |
| SWMM_ENGINE_API int | swmm_node_count (SWMM_Engine engine) |
| Get the total number of nodes in the model. | |
| SWMM_ENGINE_API int | swmm_node_index (SWMM_Engine engine, const char *id) |
| Look up a node's zero-based index by its string identifier. | |
| SWMM_ENGINE_API const char * | swmm_node_id (SWMM_Engine engine, int idx) |
| Get the string identifier of a node by index. | |
| SWMM_ENGINE_API int | swmm_node_add (SWMM_Engine engine, const char *id, int type) |
| Add a new node to the model. | |
| SWMM_ENGINE_API int | swmm_node_set_invert_elev (SWMM_Engine engine, int idx, double elev) |
| Set a node's invert elevation. | |
| SWMM_ENGINE_API int | swmm_node_set_max_depth (SWMM_Engine engine, int idx, double depth) |
| Set a node's maximum depth (distance from invert to crown). | |
| SWMM_ENGINE_API int | swmm_node_set_surcharge_depth (SWMM_Engine engine, int idx, double depth) |
| Set the allowed surcharge depth above the node's crown. | |
| SWMM_ENGINE_API int | swmm_node_set_pond_area (SWMM_Engine engine, int idx, double area) |
| Set the ponded surface area when depth exceeds the maximum. | |
| SWMM_ENGINE_API int | swmm_node_set_initial_depth (SWMM_Engine engine, int idx, double depth) |
| Set a node's initial water depth at simulation start. | |
| SWMM_ENGINE_API int | swmm_node_get_type (SWMM_Engine engine, int idx, int *type) |
| Get the type of a node. | |
| SWMM_ENGINE_API int | swmm_node_get_invert_elev (SWMM_Engine engine, int idx, double *elev) |
| Get a node's invert elevation. | |
| SWMM_ENGINE_API int | swmm_node_get_max_depth (SWMM_Engine engine, int idx, double *depth) |
| Get a node's maximum depth. | |
| SWMM_ENGINE_API int | swmm_node_get_depth (SWMM_Engine engine, int idx, double *depth) |
| Get the current water depth at a node. | |
| SWMM_ENGINE_API int | swmm_node_set_depth (SWMM_Engine engine, int idx, double depth) |
| Set the water depth at a node (runtime override). | |
| SWMM_ENGINE_API int | swmm_node_get_head (SWMM_Engine engine, int idx, double *head) |
| Get the current hydraulic head at a node (invert + depth). | |
| SWMM_ENGINE_API int | swmm_node_get_volume (SWMM_Engine engine, int idx, double *volume) |
| Get the current stored water volume at a node. | |
| SWMM_ENGINE_API int | swmm_node_get_lateral_inflow (SWMM_Engine engine, int idx, double *inflow) |
| Get the current lateral inflow at a node. | |
| SWMM_ENGINE_API int | swmm_node_get_overflow (SWMM_Engine engine, int idx, double *overflow) |
| Get the current overflow (flooding) rate at a node. | |
| SWMM_ENGINE_API int | swmm_node_get_inflow (SWMM_Engine engine, int idx, double *inflow) |
| Get the total inflow to a node (lateral + upstream links). | |
| SWMM_ENGINE_API int | swmm_node_set_lateral_inflow (SWMM_Engine engine, int idx, double flow) |
| Override the lateral inflow at a node for the current timestep. | |
| SWMM_ENGINE_API int | swmm_node_set_head_boundary (SWMM_Engine engine, int idx, double head) |
| Set a fixed head boundary condition at a node. | |
| SWMM_ENGINE_API int | swmm_node_get_quality (SWMM_Engine engine, int node_idx, int pollutant_idx, double *conc) |
| Get the pollutant concentration at a node. | |
| SWMM_ENGINE_API int | swmm_node_get_depths_bulk (SWMM_Engine engine, double *buf, int count) |
| Get depths for all nodes in a single call. | |
| SWMM_ENGINE_API int | swmm_node_get_heads_bulk (SWMM_Engine engine, double *buf, int count) |
| Get hydraulic heads for all nodes in a single call. | |
| SWMM_ENGINE_API int | swmm_node_get_inflows_bulk (SWMM_Engine engine, double *buf, int count) |
| Get total inflows for all nodes in a single call. | |
| SWMM_ENGINE_API int | swmm_node_get_overflows_bulk (SWMM_Engine engine, double *buf, int count) |
| Get overflow rates for all nodes in a single call. | |
| SWMM_ENGINE_API int | swmm_node_set_depths_bulk (SWMM_Engine engine, const double *buf, int count) |
| Set depths for all nodes in a single call (runtime override). | |
| SWMM_ENGINE_API int | swmm_node_set_lat_inflows_bulk (SWMM_Engine engine, const double *buf, int count) |
| Set lateral inflows for all nodes in a single call (runtime override). | |
| SWMM_ENGINE_API int | swmm_node_get_quality_bulk (SWMM_Engine engine, int pollutant_idx, double *buf, int count) |
| Get pollutant concentrations at all nodes for one pollutant. | |
| SWMM_ENGINE_API int | swmm_node_set_storage_curve (SWMM_Engine engine, int idx, int curve_idx) |
| Assign a storage curve (depth vs. area) to a storage node. | |
| SWMM_ENGINE_API int | swmm_node_get_storage_curve (SWMM_Engine engine, int idx, int *curve_idx) |
| Get the storage curve index assigned to a storage node. | |
| SWMM_ENGINE_API int | swmm_node_set_storage_functional (SWMM_Engine engine, int idx, double a, double b, double c) |
| Set functional storage parameters: Area = a * Depth^b + c. | |
| SWMM_ENGINE_API int | swmm_node_get_storage_functional (SWMM_Engine engine, int idx, double *a, double *b, double *c) |
| Get functional storage parameters. | |
| SWMM_ENGINE_API int | swmm_node_set_storage_seep_rate (SWMM_Engine engine, int idx, double rate) |
| Set the seepage rate for a storage node. | |
| SWMM_ENGINE_API int | swmm_node_get_storage_seep_rate (SWMM_Engine engine, int idx, double *rate) |
| Get the seepage rate for a storage node. | |
| SWMM_ENGINE_API int | swmm_node_set_exfil_params (SWMM_Engine engine, int idx, double suction, double ksat, double imd) |
| Set Green–Ampt exfiltration parameters for a storage node. | |
| SWMM_ENGINE_API int | swmm_node_get_exfil_params (SWMM_Engine engine, int idx, double *suction, double *ksat, double *imd) |
| Get Green–Ampt exfiltration parameters for a storage node. | |
| SWMM_ENGINE_API int | swmm_node_set_outfall_type (SWMM_Engine engine, int idx, int type) |
| Set the outfall boundary condition type. | |
| SWMM_ENGINE_API int | swmm_node_get_outfall_type (SWMM_Engine engine, int idx, int *type) |
| Get the outfall boundary condition type. | |
| SWMM_ENGINE_API int | swmm_node_set_outfall_stage (SWMM_Engine engine, int idx, double stage) |
| Set a fixed outfall stage (for FIXED type outfalls). | |
| SWMM_ENGINE_API int | swmm_node_set_outfall_tidal (SWMM_Engine engine, int idx, int curve_idx) |
| Assign a tidal curve to an outfall (for TIDAL type outfalls). | |
| SWMM_ENGINE_API int | swmm_node_set_outfall_timeseries (SWMM_Engine engine, int idx, int ts_idx) |
| Assign a time series to an outfall (for TIMESERIES type outfalls). | |
| SWMM_ENGINE_API int | swmm_node_get_outfall_param (SWMM_Engine engine, int idx, double *param) |
| Get the outfall stage parameter (fixed stage, or current computed stage). | |
| SWMM_ENGINE_API int | swmm_node_set_outfall_flap_gate (SWMM_Engine engine, int idx, int has_gate) |
| Set whether a flap gate exists at the outfall. | |
| SWMM_ENGINE_API int | swmm_node_get_outfall_flap_gate (SWMM_Engine engine, int idx, int *has_gate) |
| Get whether a flap gate exists at the outfall. | |
| SWMM_ENGINE_API int | swmm_node_get_surcharge_depth (SWMM_Engine engine, int idx, double *depth) |
| Get the surcharge depth above the node's crown. | |
| SWMM_ENGINE_API int | swmm_node_get_ponded_area (SWMM_Engine engine, int idx, double *area) |
| Get the ponded area at a node. | |
| SWMM_ENGINE_API int | swmm_node_get_initial_depth (SWMM_Engine engine, int idx, double *depth) |
| Get the initial depth at a node. | |
| SWMM_ENGINE_API int | swmm_node_get_crown_elev (SWMM_Engine engine, int idx, double *elev) |
| Get the crown elevation (invert + max depth) at a node. | |
| SWMM_ENGINE_API int | swmm_node_get_full_volume (SWMM_Engine engine, int idx, double *vol) |
| Get the full (maximum) stored volume at a node. | |
| SWMM_ENGINE_API int | swmm_node_get_losses (SWMM_Engine engine, int idx, double *losses) |
| Get the cumulative water losses at a node (evaporation + exfiltration). | |
| SWMM_ENGINE_API int | swmm_node_get_outflow (SWMM_Engine engine, int idx, double *outflow) |
| Get the total outflow from a node through downstream links. | |
| SWMM_ENGINE_API int | swmm_node_get_degree (SWMM_Engine engine, int idx, int *degree) |
| Get the degree (number of connected links) of a node. | |
| SWMM_ENGINE_API int | swmm_node_get_stat_max_depth (SWMM_Engine engine, int idx, double *val) |
| Get the maximum depth recorded at a node during the simulation. | |
| SWMM_ENGINE_API int | swmm_node_get_stat_max_overflow (SWMM_Engine engine, int idx, double *val) |
| Get the maximum overflow rate recorded at a node. | |
| SWMM_ENGINE_API int | swmm_node_get_stat_vol_flooded (SWMM_Engine engine, int idx, double *val) |
| Get the total flood volume at a node over the simulation. | |
| SWMM_ENGINE_API int | swmm_node_get_stat_time_flooded (SWMM_Engine engine, int idx, double *val) |
| Get the total time a node was flooded during the simulation. | |
C API implementation — node identity, creation, properties, state, bulk.
| SWMM_ENGINE_API int swmm_node_add | ( | SWMM_Engine | engine, |
| const char * | id, | ||
| int | type | ||
| ) |
Add a new node to the model.
The engine must be in SWMM_STATE_BUILDING. The node is appended to the model's node list and its index equals the previous count.
| engine | Engine handle. |
| id | Unique null-terminated identifier for the new node. |
| type | Node type (see SWMM_NodeType). |
| SWMM_ENGINE_API int swmm_node_count | ( | SWMM_Engine | engine | ) |
Get the total number of nodes in the model.
| engine | Engine handle. |
| SWMM_ENGINE_API int swmm_node_get_crown_elev | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double * | elev | ||
| ) |
Get the crown elevation (invert + max depth) at a node.
| engine | Engine handle. | |
| idx | Zero-based node index. | |
| [out] | elev | Receives the crown elevation in project length units. |
| SWMM_ENGINE_API int swmm_node_get_degree | ( | SWMM_Engine | engine, |
| int | idx, | ||
| int * | degree | ||
| ) |
Get the degree (number of connected links) of a node.
| engine | Engine handle. | |
| idx | Zero-based node index. | |
| [out] | degree | Receives the number of links connected to this node. |
| SWMM_ENGINE_API int swmm_node_get_depth | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double * | depth | ||
| ) |
Get the current water depth at a node.
| engine | Engine handle. | |
| idx | Zero-based node index. | |
| [out] | depth | Receives depth in project length units. |
| SWMM_ENGINE_API int swmm_node_get_depths_bulk | ( | SWMM_Engine | engine, |
| double * | buf, | ||
| int | count | ||
| ) |
Get depths for all nodes in a single call.
| engine | Engine handle. | |
| [out] | buf | Caller-allocated buffer of at least count doubles. |
| count | Number of elements (should equal swmm_node_count()). |
| SWMM_ENGINE_API int swmm_node_get_exfil_params | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double * | suction, | ||
| double * | ksat, | ||
| double * | imd | ||
| ) |
Get Green–Ampt exfiltration parameters for a storage node.
| engine | Engine handle. | |
| idx | Zero-based node index. | |
| [out] | suction | Receives the suction head. |
| [out] | ksat | Receives the saturated hydraulic conductivity. |
| [out] | imd | Receives the initial moisture deficit. |
| SWMM_ENGINE_API int swmm_node_get_full_volume | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double * | vol | ||
| ) |
Get the full (maximum) stored volume at a node.
| engine | Engine handle. | |
| idx | Zero-based node index. | |
| [out] | vol | Receives the full volume in project volume units. |
| SWMM_ENGINE_API int swmm_node_get_head | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double * | head | ||
| ) |
Get the current hydraulic head at a node (invert + depth).
| engine | Engine handle. | |
| idx | Zero-based node index. | |
| [out] | head | Receives the head in project length units. |
| SWMM_ENGINE_API int swmm_node_get_heads_bulk | ( | SWMM_Engine | engine, |
| double * | buf, | ||
| int | count | ||
| ) |
Get hydraulic heads for all nodes in a single call.
| engine | Engine handle. | |
| [out] | buf | Caller-allocated buffer of at least count doubles. |
| count | Number of elements. |
| SWMM_ENGINE_API int swmm_node_get_inflow | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double * | inflow | ||
| ) |
Get the total inflow to a node (lateral + upstream links).
| engine | Engine handle. | |
| idx | Zero-based node index. | |
| [out] | inflow | Receives the total inflow in project flow units. |
| SWMM_ENGINE_API int swmm_node_get_inflows_bulk | ( | SWMM_Engine | engine, |
| double * | buf, | ||
| int | count | ||
| ) |
Get total inflows for all nodes in a single call.
| engine | Engine handle. | |
| [out] | buf | Caller-allocated buffer of at least count doubles. |
| count | Number of elements. |
| SWMM_ENGINE_API int swmm_node_get_initial_depth | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double * | depth | ||
| ) |
Get the initial depth at a node.
| engine | Engine handle. | |
| idx | Zero-based node index. | |
| [out] | depth | Receives the initial depth in project length units. |
| SWMM_ENGINE_API int swmm_node_get_invert_elev | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double * | elev | ||
| ) |
Get a node's invert elevation.
| engine | Engine handle. | |
| idx | Zero-based node index. | |
| [out] | elev | Receives the invert elevation in project length units. |
| SWMM_ENGINE_API int swmm_node_get_lateral_inflow | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double * | inflow | ||
| ) |
Get the current lateral inflow at a node.
Lateral inflow is the externally applied flow (DWF, RDII, user inflows) as opposed to the total inflow which includes upstream link contributions.
| engine | Engine handle. | |
| idx | Zero-based node index. | |
| [out] | inflow | Receives the lateral inflow in project flow units. |
| SWMM_ENGINE_API int swmm_node_get_losses | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double * | losses | ||
| ) |
Get the cumulative water losses at a node (evaporation + exfiltration).
| engine | Engine handle. | |
| idx | Zero-based node index. | |
| [out] | losses | Receives the loss volume in project volume units. |
| SWMM_ENGINE_API int swmm_node_get_max_depth | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double * | depth | ||
| ) |
Get a node's maximum depth.
| engine | Engine handle. | |
| idx | Zero-based node index. | |
| [out] | depth | Receives the maximum depth in project length units. |
| SWMM_ENGINE_API int swmm_node_get_outfall_flap_gate | ( | SWMM_Engine | engine, |
| int | idx, | ||
| int * | has_gate | ||
| ) |
Get whether a flap gate exists at the outfall.
| engine | Engine handle. | |
| idx | Zero-based node index. | |
| [out] | has_gate | Receives 1 if flap gate present, 0 otherwise. |
| SWMM_ENGINE_API int swmm_node_get_outfall_param | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double * | param | ||
| ) |
Get the outfall stage parameter (fixed stage, or current computed stage).
| engine | Engine handle. | |
| idx | Zero-based node index. | |
| [out] | param | Receives the outfall parameter value. |
| SWMM_ENGINE_API int swmm_node_get_outfall_type | ( | SWMM_Engine | engine, |
| int | idx, | ||
| int * | type | ||
| ) |
Get the outfall boundary condition type.
| engine | Engine handle. | |
| idx | Zero-based node index. | |
| [out] | type | Receives the outfall type code. |
| SWMM_ENGINE_API int swmm_node_get_outflow | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double * | outflow | ||
| ) |
Get the total outflow from a node through downstream links.
| engine | Engine handle. | |
| idx | Zero-based node index. | |
| [out] | outflow | Receives the outflow in project flow units. |
| SWMM_ENGINE_API int swmm_node_get_overflow | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double * | overflow | ||
| ) |
Get the current overflow (flooding) rate at a node.
Overflow occurs when the water depth exceeds the node's maximum depth and ponding is not enabled (or the ponded area is exceeded).
| engine | Engine handle. | |
| idx | Zero-based node index. | |
| [out] | overflow | Receives the overflow rate in project flow units. |
| SWMM_ENGINE_API int swmm_node_get_overflows_bulk | ( | SWMM_Engine | engine, |
| double * | buf, | ||
| int | count | ||
| ) |
Get overflow rates for all nodes in a single call.
| engine | Engine handle. | |
| [out] | buf | Caller-allocated buffer of at least count doubles. |
| count | Number of elements. |
| SWMM_ENGINE_API int swmm_node_get_ponded_area | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double * | area | ||
| ) |
Get the ponded area at a node.
| engine | Engine handle. | |
| idx | Zero-based node index. | |
| [out] | area | Receives the ponded area in project area units. |
| SWMM_ENGINE_API int swmm_node_get_quality | ( | SWMM_Engine | engine, |
| int | node_idx, | ||
| int | pollutant_idx, | ||
| double * | conc | ||
| ) |
Get the pollutant concentration at a node.
| engine | Engine handle. | |
| node_idx | Zero-based node index. | |
| pollutant_idx | Zero-based pollutant index. | |
| [out] | conc | Receives the concentration in pollutant units. |
| SWMM_ENGINE_API int swmm_node_get_quality_bulk | ( | SWMM_Engine | engine, |
| int | pollutant_idx, | ||
| double * | buf, | ||
| int | count | ||
| ) |
Get pollutant concentrations at all nodes for one pollutant.
| engine | Engine handle. | |
| pollutant_idx | Zero-based pollutant index. | |
| [out] | buf | Caller-allocated buffer of at least count doubles. |
| count | Number of elements (should equal swmm_node_count()). |
| SWMM_ENGINE_API int swmm_node_get_stat_max_depth | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double * | val | ||
| ) |
Get the maximum depth recorded at a node during the simulation.
| engine | Engine handle (ENDED or RUNNING state). | |
| idx | Zero-based node index. | |
| [out] | val | Receives the maximum depth in project length units. |
| SWMM_ENGINE_API int swmm_node_get_stat_max_overflow | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double * | val | ||
| ) |
Get the maximum overflow rate recorded at a node.
| engine | Engine handle. | |
| idx | Zero-based node index. | |
| [out] | val | Receives the maximum overflow in project flow units. |
| SWMM_ENGINE_API int swmm_node_get_stat_time_flooded | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double * | val | ||
| ) |
Get the total time a node was flooded during the simulation.
| engine | Engine handle. | |
| idx | Zero-based node index. | |
| [out] | val | Receives the flooded duration in hours. |
| SWMM_ENGINE_API int swmm_node_get_stat_vol_flooded | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double * | val | ||
| ) |
Get the total flood volume at a node over the simulation.
| engine | Engine handle. | |
| idx | Zero-based node index. | |
| [out] | val | Receives the flooded volume in project volume units. |
| SWMM_ENGINE_API int swmm_node_get_storage_curve | ( | SWMM_Engine | engine, |
| int | idx, | ||
| int * | curve_idx | ||
| ) |
Get the storage curve index assigned to a storage node.
| engine | Engine handle. | |
| idx | Zero-based node index. | |
| [out] | curve_idx | Receives the curve index, or -1 if functional. |
| SWMM_ENGINE_API int swmm_node_get_storage_functional | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double * | a, | ||
| double * | b, | ||
| double * | c | ||
| ) |
Get functional storage parameters.
| engine | Engine handle. | |
| idx | Zero-based node index. | |
| [out] | a | Receives coefficient a. |
| [out] | b | Receives exponent b. |
| [out] | c | Receives constant c. |
| SWMM_ENGINE_API int swmm_node_get_storage_seep_rate | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double * | rate | ||
| ) |
Get the seepage rate for a storage node.
| engine | Engine handle. | |
| idx | Zero-based node index. | |
| [out] | rate | Receives the seepage rate. |
| SWMM_ENGINE_API int swmm_node_get_surcharge_depth | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double * | depth | ||
| ) |
Get the surcharge depth above the node's crown.
| engine | Engine handle. | |
| idx | Zero-based node index. | |
| [out] | depth | Receives the surcharge depth in project length units. |
| SWMM_ENGINE_API int swmm_node_get_type | ( | SWMM_Engine | engine, |
| int | idx, | ||
| int * | type | ||
| ) |
Get the type of a node.
| engine | Engine handle. | |
| idx | Zero-based node index. | |
| [out] | type | Receives the node type (see SWMM_NodeType). |
| SWMM_ENGINE_API int swmm_node_get_volume | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double * | volume | ||
| ) |
Get the current stored water volume at a node.
| engine | Engine handle. | |
| idx | Zero-based node index. | |
| [out] | volume | Receives the volume in project volume units. |
| SWMM_ENGINE_API const char * swmm_node_id | ( | SWMM_Engine | engine, |
| int | idx | ||
| ) |
Get the string identifier of a node by index.
| engine | Engine handle. |
| idx | Zero-based node index. |
| SWMM_ENGINE_API int swmm_node_index | ( | SWMM_Engine | engine, |
| const char * | id | ||
| ) |
Look up a node's zero-based index by its string identifier.
| engine | Engine handle. |
| id | Null-terminated node identifier. |
| SWMM_ENGINE_API int swmm_node_set_depth | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double | depth | ||
| ) |
Set the water depth at a node (runtime override).
| engine | Engine handle (RUNNING state). |
| idx | Zero-based node index. |
| depth | New depth in project length units. |
| SWMM_ENGINE_API int swmm_node_set_depths_bulk | ( | SWMM_Engine | engine, |
| const double * | buf, | ||
| int | count | ||
| ) |
Set depths for all nodes in a single call (runtime override).
| engine | Engine handle (RUNNING state). |
| buf | Array of depth values, one per node. |
| count | Number of elements (should equal swmm_node_count()). |
| SWMM_ENGINE_API int swmm_node_set_exfil_params | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double | suction, | ||
| double | ksat, | ||
| double | imd | ||
| ) |
Set Green–Ampt exfiltration parameters for a storage node.
Exfiltration models soil infiltration losses from the bottom and banks of a storage unit using the Green–Ampt method.
| engine | Engine handle. |
| idx | Zero-based node index (must be SWMM_NODE_STORAGE). |
| suction | Soil capillary suction head (project length units). |
| ksat | Saturated hydraulic conductivity (project length/time). |
| imd | Initial moisture deficit (fraction: 0–1). |
| SWMM_ENGINE_API int swmm_node_set_head_boundary | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double | head | ||
| ) |
Set a fixed head boundary condition at a node.
Useful for outfall nodes or real-time coupled boundary conditions. Applied for the current timestep only.
| engine | Engine handle (RUNNING state). |
| idx | Zero-based node index. |
| head | Head boundary in project length units. |
| SWMM_ENGINE_API int swmm_node_set_initial_depth | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double | depth | ||
| ) |
Set a node's initial water depth at simulation start.
| engine | Engine handle. |
| idx | Zero-based node index. |
| depth | Initial depth in project length units. |
| SWMM_ENGINE_API int swmm_node_set_invert_elev | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double | elev | ||
| ) |
Set a node's invert elevation.
| engine | Engine handle. |
| idx | Zero-based node index. |
| elev | Invert elevation in project length units. |
| SWMM_ENGINE_API int swmm_node_set_lat_inflows_bulk | ( | SWMM_Engine | engine, |
| const double * | buf, | ||
| int | count | ||
| ) |
Set lateral inflows for all nodes in a single call (runtime override).
| engine | Engine handle (RUNNING state). |
| buf | Array of lateral inflow values, one per node. |
| count | Number of elements. |
| SWMM_ENGINE_API int swmm_node_set_lateral_inflow | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double | flow | ||
| ) |
Override the lateral inflow at a node for the current timestep.
Applied for one timestep only; call each step to sustain. This replaces any externally defined inflows (DWF, RDII, etc.) for this node during the current step.
| engine | Engine handle (RUNNING state). |
| idx | Zero-based node index. |
| flow | Lateral inflow in project flow units. |
| SWMM_ENGINE_API int swmm_node_set_max_depth | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double | depth | ||
| ) |
Set a node's maximum depth (distance from invert to crown).
| engine | Engine handle. |
| idx | Zero-based node index. |
| depth | Maximum depth in project length units. |
| SWMM_ENGINE_API int swmm_node_set_outfall_flap_gate | ( | SWMM_Engine | engine, |
| int | idx, | ||
| int | has_gate | ||
| ) |
Set whether a flap gate exists at the outfall.
A flap gate prevents reverse flow through the outfall.
| engine | Engine handle. |
| idx | Zero-based node index (must be SWMM_NODE_OUTFALL). |
| has_gate | Non-zero to enable flap gate; zero to disable. |
| SWMM_ENGINE_API int swmm_node_set_outfall_stage | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double | stage | ||
| ) |
Set a fixed outfall stage (for FIXED type outfalls).
| engine | Engine handle. |
| idx | Zero-based node index (must be SWMM_NODE_OUTFALL). |
| stage | Fixed stage elevation in project length units. |
| SWMM_ENGINE_API int swmm_node_set_outfall_tidal | ( | SWMM_Engine | engine, |
| int | idx, | ||
| int | curve_idx | ||
| ) |
Assign a tidal curve to an outfall (for TIDAL type outfalls).
| engine | Engine handle. |
| idx | Zero-based node index (must be SWMM_NODE_OUTFALL). |
| curve_idx | Zero-based curve index defining hour-of-day vs. stage. |
| SWMM_ENGINE_API int swmm_node_set_outfall_timeseries | ( | SWMM_Engine | engine, |
| int | idx, | ||
| int | ts_idx | ||
| ) |
Assign a time series to an outfall (for TIMESERIES type outfalls).
| engine | Engine handle. |
| idx | Zero-based node index (must be SWMM_NODE_OUTFALL). |
| ts_idx | Zero-based time series index defining time vs. stage. |
| SWMM_ENGINE_API int swmm_node_set_outfall_type | ( | SWMM_Engine | engine, |
| int | idx, | ||
| int | type | ||
| ) |
Set the outfall boundary condition type.
Common types: 0=FREE, 1=NORMAL, 2=FIXED, 3=TIDAL, 4=TIMESERIES.
| engine | Engine handle. |
| idx | Zero-based node index (must be SWMM_NODE_OUTFALL). |
| type | Outfall type code. |
| SWMM_ENGINE_API int swmm_node_set_pond_area | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double | area | ||
| ) |
Set the ponded surface area when depth exceeds the maximum.
When ponding is modeled, excess water is stored on the surface using this area. Set to 0 to disable ponding at this node.
| engine | Engine handle. |
| idx | Zero-based node index. |
| area | Ponded area in project area units (e.g., ft² or m²). |
| SWMM_ENGINE_API int swmm_node_set_storage_curve | ( | SWMM_Engine | engine, |
| int | idx, | ||
| int | curve_idx | ||
| ) |
Assign a storage curve (depth vs. area) to a storage node.
| engine | Engine handle. |
| idx | Zero-based node index (must be SWMM_NODE_STORAGE). |
| curve_idx | Zero-based curve index (from swmm_curve_add()). |
| SWMM_ENGINE_API int swmm_node_set_storage_functional | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double | a, | ||
| double | b, | ||
| double | c | ||
| ) |
Set functional storage parameters: Area = a * Depth^b + c.
Defines the depth–area relationship using a power-law equation instead of a tabular curve.
| engine | Engine handle. |
| idx | Zero-based node index (must be SWMM_NODE_STORAGE). |
| a | Coefficient a. |
| b | Exponent b. |
| c | Constant c. |
| SWMM_ENGINE_API int swmm_node_set_storage_seep_rate | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double | rate | ||
| ) |
Set the seepage rate for a storage node.
| engine | Engine handle. |
| idx | Zero-based node index (must be SWMM_NODE_STORAGE). |
| rate | Seepage rate in project length/time units. |
| SWMM_ENGINE_API int swmm_node_set_surcharge_depth | ( | SWMM_Engine | engine, |
| int | idx, | ||
| double | depth | ||
| ) |
Set the allowed surcharge depth above the node's crown.
| engine | Engine handle. |
| idx | Zero-based node index. |
| depth | Surcharge depth in project length units. |