EPANET  2.1
Hydraulic Analysis

Functions

int ENsolveH ()
 Solves the network hydraulics for all time periods. More...
 
int ENsaveH ()
 Saves hydraulic results to binary file. More...
 
int ENopenH ()
 Sets up data structures for hydraulic analysis. More...
 
int ENinitH (int initFlag)
 Initializes hydraulic analysis. More...
 
int ENrunH (long *currentTime)
 Run a hydraulic solution period. More...
 
int ENnextH (long *tStep)
 Determine time (in seconds) until next hydraulic event. More...
 
int ENcloseH ()
 Frees data allocated by hydraulics solver. More...
 
int ENsavehydfile (char *filename)
 Copies binary hydraulics file to disk. More...
 
int ENusehydfile (char *filename)
 Opens previously saved binary hydraulics file. More...
 
int ENgetstatistic (int code, EN_API_FLOAT_TYPE *value)
 Get hydraulic simulation statistic. More...
 

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);
}
}

Function Documentation

int ENcloseH ( )

Frees data allocated by hydraulics solver.

Returns
Error code
int ENgetstatistic ( int  code,
EN_API_FLOAT_TYPE *  value 
)

Get hydraulic simulation statistic.

Parameters
codeThe type of statistic to get
[out]valueThe value of the statistic
Returns
Error code
int ENinitH ( int  initFlag)

Initializes hydraulic analysis.

Parameters
initFlag2-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 ENnextH ( long *  tStep)

Determine time (in seconds) until next hydraulic event.

Parameters
[out]tStepTime (seconds) until next hydraulic event. 0 marks end of simulation period.
Returns
Error code

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

int ENopenH ( )

Sets up data structures for hydraulic analysis.

Returns
Error code
int ENrunH ( long *  currentTime)

Run a hydraulic solution period.

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

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

int 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 ENsavehydfile ( char *  filename)

Copies binary hydraulics file to disk.

Parameters
filenameName of file to be created
Returns
Error code
int ENsolveH ( )

Solves the network hydraulics for all time periods.

Returns
Error code
int ENusehydfile ( char *  filename)

Opens previously saved binary hydraulics file.

Parameters
filenameName of file to be used
Returns
Error code