The Output file is an unformatted binary file used to store both hydraulic and water quality results at uniform reporting intervals. It is the third file name supplied to the EN_open function (or second name to EN_init). If an empty string ("") is used as its name then a scratch temporary file will be used. Otherwise the Output file will be saved after the EN_close function is called. Saving this file is useful if further post-processing of the output results are needed.
The function EN_saveH will transfer hydraulic results to the Output file if no water quality analysis will be made. Using EN_solveQ to run a water quality analysis automatically saves both hydraulic and water quality results to this file. If the EN_initQ - EN_runQ - EN_nextQ set of functions is used to perform a water quality analysis, then results will be saved only if the saveflag argument of EN_initQ is set to EN_SAVE
. Again, the need to save results to the Output file is application-dependent. If a formatted output report is to be generated using EN_report, then results must first be saved to the Output file.
The data written to the file is either 4-byte integers, 4-byte floats, or fixed-size strings whose size is a multiple of 4 bytes. This allows the file to be divided conveniently into 4-byte records. The file consists of four sections of the following sizes in bytes:
Section | Size in Bytes |
---|---|
Prolog | 884 + 36*Nnodes + 52*Nlinks + 8*Ntanks |
Energy Usage | 28*Npumps + 4 |
Dynamic Results | (16*Nnodes + 32*Nlinks)*Nperiods |
Epilog | 28 |
where:
All of these counts are themselves written to the file's Prolog or Epilog sections.
The Prolog section of an EPANET binary output file contains the following data:
Item | Type | # Bytes |
---|---|---|
Magic Number = 516114521 | Integer | 4 |
Version (= 200) | Integer | 4 |
Number of Nodes | Integer | 4 |
Number of Reservoirs & Tanks | Integer | 4 |
Number of Links | Integer | 4 |
Number of Pumps | Integer | 4 |
Number of Valves | Integer | 4 |
Water Quality Option - see EN_QualityType | Integer | 4 |
Traced Node Index | Integer | 4 |
Flow Units Option | Integer | 4 |
Pressure Units Option: 0 = psi 1 = meters 2 = kPa | Integer | 4 |
Report Statistic Type - see EN_StatisticType | Integer | 4 |
Reporting Start Time (sec) | Integer | 4 |
Reporting Time Step (sec) | Integer | 4 |
Simulation Duration (sec) | Integer | 4 |
Project Title (1st line) | Char | 80 |
Project Title (2nd line) | Char | 80 |
Project Title (3rd line) | Char | 80 |
Name of Input File | Char | 260 |
Name of Report File | Char | 260 |
Name of Quality Chemical | Char | 32 |
Chemical Concentration Units | Char | 32 |
ID String of Each Node | Char | 32*Nnodes |
ID String of Each Link | Char | 32*Nlinks |
Index of Head Node of Each Link | Integer | 4*Nlinks |
Index of Tail Node of Each Link | Integer | 4*Nlinks |
Type Code of Each Link (see EN_LinkType) | Integer | 4*Nlinks |
Node Index of Each Tank | Integer | 4*Ntanks |
Surface Area of Each Tank | Float | 4*Ntanks |
Elevation of Each Node | Float | 4*Nnodes |
Length of Each Link | Float | 4*Nlinks |
Diameter of Each Link | Float | 4*Nlinks |
The Energy Usage section of an EPANET binary output file contains the following data:
Item (Repeated for Each Pump) | Type | # Bytes |
---|---|---|
Pump Index in list of links | Integer | 4 |
Pump Utilization (%) | Float | 4 |
Average Efficiency (%) | Float | 4 |
Average kW/MGal (or kW/m^3) | Float | 4 |
Average kW | Float | 4 |
Peak kW | Float | 4 |
Average Cost per Day | Float | 4 |
These data are followed by a single 4-byte Float containing the overall Demand Charge for peak energy usage.
The Dynamic Results section of an EPANET binary output file contains the following set of data for each reporting period (the reporting time step is written to the Output File's Prolog Section and the number of such steps is written to the Epilog Section):
Item | Type | # Bytes |
---|---|---|
Demand at Each Node | Float | 4*Nnodes |
Head (Grade) at Each Node | Float | 4*Nnodes |
Pressure at Each Node | Float | 4*Nnodes |
Water Quality at Each Node | Float | 4*Nnodes |
Flow in Each Link (negative for reverse flow) | Float | 4*Nlinks |
Velocity in Each Link | Float | 4*Nlinks |
Head Loss per 1000 Units of Length for Each Link (total head for pumps and head loss for valves) | Float | 4*Nlinks |
Average Water Quality in Each Link | Float | 4*Nlinks |
Status Code for Each Link: 0 = closed (pump shutoff head exceeded) 1 = temporarily closed 2 = closed 3 = open 4 = active (partially open) 5 = open (pump max. flow exceeded) 6 = open (FCV can't supply flow) 7 = open (PRV/PSV can't supply pressure) | Float | 4*Nlinks |
Setting for Each Link | Float | 4*Nlinks |
Reaction Rate for Each Link (mass/L/day) | Float | 4*Nlinks |
Friction Factor for Each Link | Float | 4*Nlinks |
The Epilog section of an EPANET binary output file contains the following data:
Item | Type | # Bytes |
---|---|---|
Average bulk reaction rate (mass/hr) | Float | 4 |
Average wall reaction rate (mass/hr) | Float | 4 |
Average tank reaction rate (mass/hr) | Float | 4 |
Average source inflow rate (mass/hr) | Float | 4 |
Number of Reporting Periods | Integer | 4 |
Warning Flag: 0 = no warnings 1 = warnings were generated | Integer | 4 |
Magic Number = 516114521 | Integer | 4 |