EPANET  2.1
Water Quality Functions

Functions

int ENsolveQ ()
 Solves for network water quality in all time periods. More...
 
int ENopenQ ()
 Sets up data structures for WQ analysis. More...
 
int ENinitQ (int saveFlag)
 Initializes water quality analysis. More...
 
int ENrunQ (long *currentTime)
 Retrieves hydraulic & WQ results at time t. More...
 
int ENnextQ (long *tStep)
 Advances WQ simulation to next hydraulic event. More...
 
int ENstepQ (long *timeLeft)
 Advances WQ simulation by a single WQ time step. More...
 
int ENcloseQ ()
 Frees data allocated by water quality solver. More...
 

Detailed Description

Function Documentation

int ENcloseQ ( )

Frees data allocated by water quality solver.

Returns
Error code.
int ENinitQ ( int  saveFlag)

Initializes water quality analysis.

Parameters
saveFlagEN_SAVE (1) if results saved to file, EN_NOSAVE (0) if not
Returns
Error code
int ENnextQ ( long *  tStep)

Advances WQ simulation to next hydraulic event.

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

This function is used in a loop with ENrunQ() to run an extended period WQ simulation. See ENsolveQ() for an example.

int ENopenQ ( )

Sets up data structures for WQ analysis.

Returns
Error code
int ENrunQ ( long *  currentTime)

Retrieves hydraulic & WQ results at time t.

Parameters
[out]currentTimeCurrent simulation time, in seconds.
Returns
Error code

This function is used in a loop with ENnextQ() to run an extended period WQ simulation. See ENsolveQ() for an example.

int ENsolveQ ( )

Solves for network water quality in all time periods.

Returns
Error code
int ENstepQ ( long *  timeLeft)

Advances WQ simulation by a single WQ time step.

Parameters
[out]timeLeftTime left in overall simulation (in seconds)
Returns
Error code

This function is used in a loop with ENrunQ() to run an extended period WQ simulation.