![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
Legacy link configuration and hydraulic property calculations. More...
Macros | |
| #define | _CRT_SECURE_NO_DEPRECATE |
Functions | |
| int | link_readParams (int j, int type, int k, char *tok[], int ntoks) |
| Reads parameters for a specific type of link from a tokenized line of input data. | |
| int | link_readXsectParams (char *tok[], int ntoks) |
| Reads a link's cross section parameters from a tokenized line of input data. Formats: Link Shape Geom1 Geom2 Geom3 Geom4 (Barrels Culvert) Link IRREGULAR TransectID Link STREET StreetID. | |
| int | link_readLossParams (char *tok[], int ntoks) |
| Reads local loss parameters for a link from a tokenized line of input data. Format: LinkID cInlet cOutlet cAvg FlapGate(YES/NO) SeepRate. | |
| void | link_validate (int j) |
| Validates a link's properties. | |
| void | link_initState (int j) |
| Initializes a link's state variables at start of simulation. | |
| double | link_getInflow (int j) |
| Finds total flow entering a link during current time step. | |
| void | link_setOldHydState (int j) |
| Replaces link's old hydraulic state values with current ones. | |
| void | link_setOldQualState (int j) |
| Replaces link's old water quality state values with current ones. | |
| void | link_setTargetSetting (int j) |
| Updates a link's target setting. | |
| void | link_setSetting (int j, double tstep) |
| Updates a link's setting as a result of a control action. | |
| int | link_setFlapGate (int j, int n1, int n2, double q) |
| Based on the sign of the flow, determines if a flap gate associated with the link should close or not. | |
| void | link_getResults (int j, double f, float x[]) |
| Retrieves time-weighted average of old and new results for a link. | |
| void | link_setOutfallDepth (int j) |
| Sets depth at outfall node connected to link j. | |
| double | link_getYcrit (int j, double q) |
| Computes critical depth for given flow rate. | |
| double | link_getYnorm (int j, double q) |
| Computes normal depth for given flow rate. | |
| double | link_getLength (int j) |
| Finds true length of a link. | |
| double | link_getVelocity (int j, double flow, double depth) |
| Finds flow velocity given flow and depth. | |
| double | link_getFroude (int j, double v, double y) |
| Computes Froude Number for given velocity and flow depth. | |
| double | link_getPower (int j) |
| Computes power consumed by head loss (or head gain) of water flowing through a link. | |
| double | link_getLossRate (int j, int routeModel, double q, double tstep) |
| Computes rate at which flow volume is lost in a link due to evaporation and seepage. | |
| char | link_getFullState (double a1, double a2, double aFull) |
| Determines if a link is upstream, downstream or completely full. | |
Legacy link configuration and hydraulic property calculations.
| #define _CRT_SECURE_NO_DEPRECATE |
| double link_getFroude | ( | int | j, |
| double | v, | ||
| double | y ) |
Computes Froude Number for given velocity and flow depth.
| [in] | j | Link index. |
| [in] | v | Flow velocity (fps). |
| [in] | y | Flow depth (ft). |
| char link_getFullState | ( | double | a1, |
| double | a2, | ||
| double | aFull ) |
Determines if a link is upstream, downstream or completely full.
| [in] | a1 | Upstream link area (ft2). |
| [in] | a2 | Downstream link area (ft2). |
| [in] | aFull | Area of full conduit. |
| double link_getInflow | ( | int | j | ) |
Finds total flow entering a link during current time step.
| [in] | j | Link index. |
| double link_getLength | ( | int | j | ) |
Finds true length of a link.
| [in] | j | Link index. |
| double link_getLossRate | ( | int | j, |
| int | routeModel, | ||
| double | q, | ||
| double | tstep ) |
Computes rate at which flow volume is lost in a link due to evaporation and seepage.
| [in] | j | Link index. |
| [in] | routeModel | Flow routing model type. |
| [in] | q | Flow rate (ft3/sec). |
| [in] | tstep | Time step (sec). |
| double link_getPower | ( | int | j | ) |
Computes power consumed by head loss (or head gain) of water flowing through a link.
| [in] | j | Link index. |
| void link_getResults | ( | int | j, |
| double | f, | ||
| float | x[] ) |
Retrieves time-weighted average of old and new results for a link.
| [in] | j | Link index. |
| [in] | f | Time weighting factor. |
| [out] | x | Array of weighted results. |
| double link_getVelocity | ( | int | j, |
| double | flow, | ||
| double | depth ) |
Finds flow velocity given flow and depth.
| [in] | j | Link index. |
| [in] | flow | Link flow rate (cfs). |
| [in] | depth | Link flow depth (ft). |
| double link_getYcrit | ( | int | j, |
| double | q ) |
Computes critical depth for given flow rate.
| [in] | j | Link index. |
| [in] | q | Link flow rate (cfs). |
| double link_getYnorm | ( | int | j, |
| double | q ) |
Computes normal depth for given flow rate.
| [in] | j | Link index. |
| [in] | q | Link flow rate (cfs). |
| void link_initState | ( | int | j | ) |
Initializes a link's state variables at start of simulation.
| [in] | j | Link index. |
| int link_readLossParams | ( | char * | tok[], |
| int | ntoks ) |
Reads local loss parameters for a link from a tokenized line of input data. Format: LinkID cInlet cOutlet cAvg FlapGate(YES/NO) SeepRate.
| tok | Array of string tokens. | |
| [in] | ntoks | Number of tokens. |
| int link_readParams | ( | int | j, |
| int | type, | ||
| int | k, | ||
| char * | tok[], | ||
| int | ntoks ) |
Reads parameters for a specific type of link from a tokenized line of input data.
| [in] | j | Link index. |
| [in] | type | Link type code. |
| [in] | k | Link type index. |
| tok | Array of string tokens. | |
| [in] | ntoks | Number of tokens. |
| int link_readXsectParams | ( | char * | tok[], |
| int | ntoks ) |
Reads a link's cross section parameters from a tokenized line of input data. Formats: Link Shape Geom1 Geom2 Geom3 Geom4 (Barrels Culvert) Link IRREGULAR TransectID Link STREET StreetID.
| tok | Array of string tokens. | |
| [in] | ntoks | Number of tokens. |
| int link_setFlapGate | ( | int | j, |
| int | n1, | ||
| int | n2, | ||
| double | q ) |
Based on the sign of the flow, determines if a flap gate associated with the link should close or not.
| [in] | j | Link index. |
| [in] | n1 | Index of node on upstream end of link. |
| [in] | n2 | Index of node on downstream end of link. |
| [in] | q | Signed flow value (value and units don't matter). |
| void link_setOldHydState | ( | int | j | ) |
Replaces link's old hydraulic state values with current ones.
| [in] | j | Link index. |
| void link_setOldQualState | ( | int | j | ) |
Replaces link's old water quality state values with current ones.
| [in] | j | Link index. |
| void link_setOutfallDepth | ( | int | j | ) |
Sets depth at outfall node connected to link j.
| [in] | j | Link index. |
| void link_setSetting | ( | int | j, |
| double | tstep ) |
Updates a link's setting as a result of a control action.
| [in] | j | Link index. |
| [in] | tstep | Time step over which setting is adjusted. |
| void link_setTargetSetting | ( | int | j | ) |
Updates a link's target setting.
| [in] | j | Link index. |
| void link_validate | ( | int | j | ) |
Validates a link's properties.
| [in] | j | Link index. |