Compare commits
15 Commits
7ba5bb269f
...
51caa50374
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
51caa50374 | ||
|
|
39407a3a17 | ||
|
|
0bb2e73c8e | ||
|
|
0004dc2bec | ||
|
|
24013a95b2 | ||
|
|
f456d207db | ||
|
|
d5d431d34a | ||
|
|
d345541af7 | ||
|
|
b1630f3091 | ||
|
|
1605567fda | ||
|
|
1f24209516 | ||
|
|
e62f69c939 | ||
|
|
aabe60a6ae | ||
|
|
30e644330c | ||
|
|
2a75f1e83c |
@@ -70,7 +70,7 @@ EN_addlink(ph, "P1", EN_PIPE, "J1", "J2", &index);
|
||||
// additional function calls to complete building the network
|
||||
\endcode
|
||||
|
||||
See the @ref Example2 for a more complete example. The labels used to name objects cannot contain spaces, semi-colons, or double quotes nor exceed @ref EN_SizeLimits "EN_MAXID" characters in length. While adding objects their properties can be set as described in the next section. Attemtping to change a network's structure by adding or deleting nodes and links while the Toolkit's hydraulic or water quality solvers are open will result in an error condition.
|
||||
See the @ref Example2 for a more complete example. The labels used to name objects cannot contain spaces, semi-colons, or double quotes nor exceed @ref EN_SizeLimits "EN_MAXID" characters in length. While adding objects their properties can be set as described in the next section. Attempting to change a network's structure by adding or deleting nodes and links while the Toolkit's hydraulic or water quality solvers are open will result in an error condition.
|
||||
|
||||
@section Properties Setting Object Properties
|
||||
|
||||
@@ -179,14 +179,16 @@ int runConcurrentQuality(EN_Project ph)
|
||||
The @ref EN_getnodevalue and @ref EN_getlinkvalue functions can also be used to retrieve the results of hydraulic and water quality simulations. The computed parameters (and their Toolkit codes) that can be retrieved are as follows:
|
||||
|For Nodes: | For Links: |
|
||||
|------------------------------------ | ----------------------------------------- |
|
||||
|\b EN_DEMAND (total node outflow |\b EN_FLOW (flow rate) |
|
||||
|\b EN_DEMAND (total node outflow) |\b EN_FLOW (flow rate) |
|
||||
|\b EN_HEAD (hydraulic head) |\b EN_VELOCITY (flow velocity) |
|
||||
|\b EN_PRESSURE (pressure) |\b EN_HEADLOSS (head loss) |
|
||||
|\b EN_TANKLEVEL (tank water level) |\b EN_STATUS (link status) |
|
||||
|\b EN_TANKVOLUME (tank water volume) |\b EN_SETTING (pump speed or valve setting)|
|
||||
|\b EN_QUALITY (water quality) |\b EN_ENERGY (pump energy usage) |
|
||||
|\b EN_SOURCEMASS (source mass inflow)|\b EN_PUMP_EFFIC (pump efficiency) |
|
||||
| |\b EN_LINK_LEAKAGE (pipe leakage flow rate |
|
||||
|\b EN_SOURCEMASS (source mass inflow)|\b EN_LINKQUAL (water quality) |
|
||||
| |\b EN_PUMP_STATE (pump state) |
|
||||
| |\b EN_PUMP_EFFIC (pump efficiency) |
|
||||
| |\b EN_LINK_LEAKAGE (pipe leakage flow rate)|
|
||||
|
||||
In addition, the following quantities related to a node's outflow can be retrieved:
|
||||
-# EN_FULLDEMAND (consumer demand requested)
|
||||
@@ -194,6 +196,7 @@ In addition, the following quantities related to a node's outflow can be retriev
|
||||
-# EN_DEMANDDEFICIT (difference between consumer demand requested and delivered)
|
||||
-# EN_EMITTERFLOW (outflow through a node's emitter)
|
||||
-# EN_LEAKAGEFLOW (outflow due to leakage in a node's connecting pipes)
|
||||
|
||||
where `EN_DEMAND` is the sum of `EN_DEMANDFLOW`, `EN_EMITTERFLOW`, and `EN_LEAKAGEFLOW`.
|
||||
|
||||
The following code shows how to retrieve the pressure at each node of a network after each time step of a hydraulic analysis (`writetofile` is a user-defined function that will write a record to a file):
|
||||
|
||||
17
src/epanet.c
17
src/epanet.c
@@ -7,7 +7,7 @@
|
||||
Authors: see AUTHORS
|
||||
Copyright: see AUTHORS
|
||||
License: see LICENSE
|
||||
Last Updated: 04/23/2025
|
||||
Last Updated: 09/03/2025
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
@@ -4130,12 +4130,17 @@ int DLLEXPORT EN_setlinkvalue(EN_Project p, int index, int property, double valu
|
||||
case EN_STATUS:
|
||||
// Cannot set status for a check valve
|
||||
if (Link[index].Type == CVPIPE) return 207;
|
||||
|
||||
// Status 's' must be either EN_CLOSED (0) or EN_OPEN (1)
|
||||
// (to set the status of a valve to ACTIVE, assign a value to its
|
||||
// EN_INITSETTING or EN_SETTING property)
|
||||
s = (char)ROUND(value);
|
||||
if (s < 0 || s > 2) return 211;
|
||||
s = s + CLOSED;
|
||||
if (s < 0 || s > 1) return 211;
|
||||
|
||||
if (property == EN_INITSTATUS)
|
||||
{
|
||||
Link[index].InitStatus = s;
|
||||
// Convert 0/1 to StatusType CLOSED/OPEN
|
||||
Link[index].InitStatus = s + CLOSED;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4340,11 +4345,11 @@ int DLLEXPORT EN_setpipedata(EN_Project p, int index, double length,
|
||||
Link[index].Diam = diameter;
|
||||
Link[index].Kc = rough;
|
||||
if (p->hydraul.Formflag == DW) Link[index].Kc /= (1000.0 * Ucf[ELEV]);
|
||||
Link[index].Km = 0.02517 * mloss / SQR(Link[index].Diam) / SQR(Link[index].Diam);
|
||||
|
||||
// Update minor loss factor & pipe flow resistance
|
||||
// Update pipe flow resistance
|
||||
if (p->hydraul.OpenHflag)
|
||||
{
|
||||
Link[index].Km = 0.02517 * mloss / SQR(Link[index].Diam) / SQR(Link[index].Diam);
|
||||
resistcoeff(p, index);
|
||||
}
|
||||
else Link[index].InitSetting = Link[index].Kc;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
Authors: see AUTHORS
|
||||
Copyright: see AUTHORS
|
||||
License: see LICENSE
|
||||
Last Updated: 06/14/2024
|
||||
Last Updated: 09/10/2025
|
||||
******************************************************************************
|
||||
*/
|
||||
/*
|
||||
@@ -432,12 +432,15 @@ int leakagehasconverged(Project *pr)
|
||||
|
||||
// Directly compute a reference leakage at this pressure head
|
||||
qref = 0.0;
|
||||
if ( h > 0.0)
|
||||
{
|
||||
// Contribution from pipes with fixed area leaks
|
||||
if (hyd->Leakage[i].cfa > 0.0)
|
||||
qref = sqrt(h / hyd->Leakage[i].cfa);
|
||||
// Contribution from pipes with variable area leaks
|
||||
if (hyd->Leakage[i].cva > 0.0)
|
||||
qref += pow((h / hyd->Leakage[i].cva), 1.5);
|
||||
}
|
||||
|
||||
// Compare reference leakage to solution leakage
|
||||
qtest = hyd->Leakage[i].qfa + hyd->Leakage[i].qva;
|
||||
|
||||
@@ -750,7 +750,7 @@ int EXPORT_OUT_API ENR_getNodeResult(ENR_Handle p_handle, int periodIndex,
|
||||
else
|
||||
{
|
||||
for (j = 0; j < NNODERESULTS; j++)
|
||||
temp[j] = getNodeValue(p_handle, periodIndex, nodeIndex, j);
|
||||
temp[j] = getNodeValue(p_handle, periodIndex, nodeIndex, j + 1);
|
||||
|
||||
*outValueArray = temp;
|
||||
*length = NNODERESULTS;
|
||||
@@ -778,7 +778,7 @@ int EXPORT_OUT_API ENR_getLinkResult(ENR_Handle p_handle, int periodIndex,
|
||||
else
|
||||
{
|
||||
for (j = 0; j < NLINKRESULTS; j++)
|
||||
temp[j] = getLinkValue(p_handle, periodIndex, linkIndex, j);
|
||||
temp[j] = getLinkValue(p_handle, periodIndex, linkIndex, j + 1);
|
||||
|
||||
*outValueArray = temp;
|
||||
*length = NLINKRESULTS;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
Authors: see AUTHORS
|
||||
Copyright: see AUTHORS
|
||||
License: see LICENSE
|
||||
Last Updated: 04/19/2025
|
||||
Last Updated: 09/03/2025
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
@@ -31,7 +31,7 @@ typedef int INT4;
|
||||
Various constants
|
||||
----------------------------------------------
|
||||
*/
|
||||
#define CODEVERSION 20301
|
||||
#define CODEVERSION 20303
|
||||
#define MAGICNUMBER 516114521
|
||||
#define ENGINE_VERSION 201 // Used for binary hydraulics file
|
||||
#define EOFMARK 0x1A // Use 0x04 for UNIX systems
|
||||
|
||||
Reference in New Issue
Block a user