EPANET  2.1
 All Data Structures Files Functions Modules Pages
Hydraulic Analysis

Functions

int DLLEXPORT ENsolveH ()
 Solves the network hydraulics for all time periods. More...
 
int DLLEXPORT ENsaveH ()
 Saves hydraulic results to binary file. More...
 
int DLLEXPORT ENopenH ()
 Sets up data structures for hydraulic analysis. More...
 
int DLLEXPORT ENinitH (int initFlag)
 Initializes hydraulic analysis. More...
 
int DLLEXPORT ENrunH (long *currentTime)
 Run a hydraulic solution period. More...
 
int DLLEXPORT ENnextH (long *tStep)
 Determine time (in seconds) until next hydraulic event.
 

Detailed Description

int errcode;
long t, tstep;
errcode = ENopenH();
if (!errcode)
{
errcode = ENinitH(EN_SAVE);
if (!errcode) do
{
tstep = 0;
ERRCODE(ENrunH(&t));
ERRCODE(ENnextH(&tstep));
}
while (tstep > 0);
}
ENcloseH();

Function Documentation

int DLLEXPORT ENinitH ( int  initFlag)

Initializes hydraulic analysis.

Parameters
flag2-digit flag where 1st (left) digit indicates if link flows should be re-initialized (1) or not (0), and 2nd digit indicates if hydraulic results should be saved to file (1) or not (0).
Returns
Error code
int DLLEXPORT ENopenH ( )

Sets up data structures for hydraulic analysis.

Returns
Error code
int DLLEXPORT ENrunH ( long *  currentTime)

Run a hydraulic solution period.

Parameters
[out]currentTimeThe current simulation time in seconds
Returns
Error or warning code

This function is used in a loop with ENnextH() to run an extended period hydraulic simulation. See ENsolveH() for an example.

See also
ENsolveH
int DLLEXPORT ENsaveH ( )

Saves hydraulic results to binary file.

Returns
Error code

Must be called before ENreport() if no WQ simulation has been made. Should not be called if ENsolveQ() will be used.

int DLLEXPORT ENsolveH ( )

Solves the network hydraulics for all time periods.

Returns
Error code