ENgetlinkvalue | R Documentation |
ENgetlinkvalue
retrieves the value of a specific link parameter for a link.
ENgetlinkvalue(linkindex, paramcode)
linkindex |
index of the link |
paramcode |
requested parameter type either as name or number |
The parameter value of a specified link.
Link indexes are consecutive integers starting from 1. Link parameter codes consist of the following constants:
EN_DIAMETER | 0 | Diameter |
EN_LENGTH | 1 | Length |
EN_ROUGHNESS | 2 | Roughness coeff. |
EN_MINORLOSS | 3 | Minor loss coeff. |
EN_INITSTATUS | 4 | Initial link status (0 = closed, 1 = open) |
EN_INITSETTING | 5 | Initial pipe roughness |
Initial pump speed | ||
Initial valve setting | ||
EN_KBULK | 6 | Bulk reaction coeff. |
EN_KWALL | 7 | Wall reaction coeff. |
EN_FLOW | 8 | Flow rate |
EN_VELOCITY | 9 | Flow velocity |
EN_HEADLOSS | 10 | Head loss |
EN_STATUS | 11 | Actual link status (0 = closed, 1 = open) |
EN_SETTING | 12 | Pipe roughness |
Actual pump speed | ||
Actal valve setting | ||
EN_ENERGY | 13 | Energy expended in kwatts |
Parameters 8 - 13 (EN_FLOW
through EN_ENERGY
) are computed values. The others
are design parameters.
Flow rate is positive if the direction of flow is from the designated start node of the link to its designated end node, and negative otherwise.
Values are returned in units which depend on the units used for flow rate in the EPANET input file.
ENgetlinkindex
ENgetflowunits
# path to Net1.inp example file included with this package
inp <- file.path( find.package("epanet2toolkit"), "extdata","Net1.inp")
ENopen(inp, "Net1.rpt")
ENgetlinkvalue(1, "EN_DIAMETER")
ENgetlinkvalue(1, "EN_LENGTH")
ENgetlinkvalue(8, "EN_DIAMETER")
ENgetlinkvalue(8, "EN_LENGTH")
ENclose()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.