OWA-EPANET Toolkit  2.2
Examples

Here are several examples of how the Toolkit can be used for different types of network analyses.

EN_PIPE
Pipe.
Definition: epanet2_enums.h:187
EN_getnodeindex
int EN_getnodeindex(EN_Project ph, char *id, int *out_index)
Gets the index of a node given its ID name.
EN_nextQ
int EN_nextQ(EN_Project ph, long *out_tStep)
Advances a water quality simulation over the time until the next hydraulic event.
EN_runQ
int EN_runQ(EN_Project ph, long *out_currentTime)
Makes hydraulic and water quality results at the start of the current time period available to a proj...
EN_runH
int EN_runH(EN_Project ph, long *out_currentTime)
Computes a hydraulic solution for the current point in time.
EN_QUALITY
Current computed quality (read only)
Definition: epanet2_enums.h:51
EN_ELEVATION
Elevation.
Definition: epanet2_enums.h:39
EN_addcurve
int EN_addcurve(EN_Project ph, char *id)
Adds a new data curve to a project.
EN_closeH
int EN_closeH(EN_Project ph)
Closes the hydraulic solver freeing all of its allocated memory.
EN_open
int EN_open(EN_Project ph, const char *inpFile, const char *rptFile, const char *outFile)
Opens an EPANET input file & reads in network data.
EN_setjuncdata
int EN_setjuncdata(EN_Project ph, int index, double elev, double dmnd, char *dmndpat)
Sets a group of properties for a junction node.
EN_saveinpfile
int EN_saveinpfile(EN_Project ph, const char *filename)
Saves a project's data to an EPANET-formatted text file.
EN_RESERVOIR
Reservoir node.
Definition: epanet2_enums.h:177
EN_getnodevalue
int EN_getnodevalue(EN_Project ph, int index, int property, double *out_value)
Retrieves a property value for a node.
EN_PUMP_HCURVE
Pump head v. flow curve index.
Definition: epanet2_enums.h:95
EN_setnodevalue
int EN_setnodevalue(EN_Project ph, int index, int property, double value)
Sets a property value for a node.
EN_PUMP
Pump.
Definition: epanet2_enums.h:188
EN_GPM
Gallons per minute.
Definition: epanet2_enums.h:268
EN_Project
struct Project * EN_Project
The EPANET Project wrapper object.
Definition: epanet2_2.h:49
EN_solveH
int EN_solveH(EN_Project ph)
Runs a complete hydraulic simulation with results for all time periods written to a temporary hydraul...
EN_setcurvevalue
int EN_setcurvevalue(EN_Project ph, int curveIndex, int pointIndex, double x, double y)
Sets the value of a single data point for a curve.
EN_addnode
int EN_addnode(EN_Project ph, char *id, int nodeType, int *out_index)
Adds a new node to a project.
EN_BASEDEMAND
Primary demand baseline value.
Definition: epanet2_enums.h:40
EN_createproject
int EN_createproject(EN_Project *ph)
Creates an EPANET project.
EN_closeQ
int EN_closeQ(EN_Project ph)
Closes the water quality solver, freeing all of its allocated memory.
EN_TANK
Storage tank node.
Definition: epanet2_enums.h:178
EN_initQ
int EN_initQ(EN_Project ph, int saveFlag)
Initializes a network prior to running a water quality analysis.
EN_init
int EN_init(EN_Project ph, const char *rptFile, const char *outFile, int unitsType, int headLossType)
Initializes an EPANET project.
EN_runproject
int EN_runproject(EN_Project ph, const char *inpFile, const char *rptFile, const char *outFile, void(*pviewprog)(char *))
Runs a complete EPANET simulation.
EN_CHEM
Chemical fate and transport.
Definition: epanet2_enums.h:229
EN_PRESSURE
Current computed pressure (read only)
Definition: epanet2_enums.h:50
EN_openH
int EN_openH(EN_Project ph)
Opens a project's hydraulic solver.
EN_NODECOUNT
Number of nodes (junctions + tanks + reservoirs)
Definition: epanet2_enums.h:162
EN_SOURCEQUAL
Quality source strength.
Definition: epanet2_enums.h:44
EN_HW
Hazen-Williams.
Definition: epanet2_enums.h:254
EN_setqualtype
int EN_setqualtype(EN_Project ph, int qualType, char *chemName, char *chemUnits, char *traceNode)
Sets the type of water quality analysis to run.
EN_settankdata
int EN_settankdata(EN_Project ph, int index, double elev, double initlvl, double minlvl, double maxlvl, double diam, double minvol, char *volcurve)
Sets a group of properties for a tank node.
EN_deleteproject
int EN_deleteproject(EN_Project ph)
Deletes a currently opened EPANET project.
EN_openQ
int EN_openQ(EN_Project ph)
Opens a project's water quality solver.
EN_initH
int EN_initH(EN_Project ph, int initFlag)
Initializes a network prior to running a hydraulic analysis.
epanet2_2.h
EN_getcount
int EN_getcount(EN_Project ph, int object, int *out_count)
Retrieves the number of objects of a given type in a project.
EN_JUNCTION
Junction node.
Definition: epanet2_enums.h:176