Different chlorine distribution results with EPANET2 and OWA EPANET2.2


I built a hydraulic network with EPANET2 (GUI Software) which I now want to use with the OWA EPANET engine. I’m using the python wrapper to code the OWA EPANET. So far everything worked fine except that I get different chlorine distribution results with the OWA EPANET engine compared to the EPANET2 GUI software. Chlorine distributes much slower in the network when run with EPANET2 GUI software.

In the google drive you can find the following 4 relevant files:

  • static-1h-chlorine. net the network built with the EPANET2 GUI
  • static-1h-chlorine.inp the network built with the EPANET2 GUI exported as .inp
  • report-static-1h-chlorine.rpt the report generated by the OWA EPANET engine
  • EPANET2-static-1h-chlorine.rpt the report generated by the EPANET2 GUI software


The following code was used:

import os
from epanet import toolkit as en

f __name__ == '__main__':
# Load our static model from input file
ep = en.createproject()

# Note that the paths to the files have to be absolute paths for some reason
data_root = os.getcwd() + '/data/community/'

#inpname = 'static-1h-chlorine.inp'
inpname = 'Net1.inp'
#reportname = 'report-static-1h-chlorine.rpt'
reportname = 'report-Net1.rpt'

en.open(ep, data_root + inpname, data_root + reportname,
        data_root + 'output.out')

# solve hydraulic

# solve quality

en.setreport(ep, "NODES ALL")
en.setreport(ep, "QUALITY PRECISION 4")
en.setreport(ep, "LINKS ALL")
en.setreport(ep, "STATUS NO")
en.setstatusreport(ep, en.FULL_REPORT)
en.setreport(ep, "SUMMARY YES")
en.setreport(ep, "FLOW YES")

#deletes project

If you compare the two reports you can see that in the EPANET2-static-1h-chlorine.rpt Chlorine reaches J-93 at 0:11 Hrs. In the report-static-1h-chlorine.rpt chlorine reaches J-93 after only 0:01:00 hrs. The time formats are copied from the .rpt files.

Did I miss configure something? Do I misunderstand the time parameters? Did something in the engine change regarding chemical distribution?

There were several changes and bug fixes in the new OWA 2.2 version. I’d suggest that you use the new DLL with the “old” GUI. Just replace the epanet2.dll and rerun the GUI.

The differences in chlorine arrival times you see can be attributed to a change made to version 2.2’s water quality algorithm to improve mass balance results (see the section of the Version 2.2 Release Notes entitled Improved Water Quality Mass Balance). Running your network under v2.2 results in a perfect Mass Balance Ratio of 1.0:

(Initial Stored Mass + Inflow Mass) / (Outflow Mass + Reacted Mass + Final Stored Mass) = 1.0

If you change"STATUS NO" to "STATUS YES" in your code you will see this mass balance result in the report file.

While a similar table is not available in version 2.0, I had a local version of the v2.0 code that was modified to report a Mass Balance Ratio. For this example it showed a value of 0.82 (an 18% error). So the new version 2.2 clearly provides more accurate results for this particular network over the first hour being simulated.

Thanks for your help! I could reproduce the result with the EPANET GUI software by replacing the .dll with 2.2 .dll. It was definitely an issue regarding the version and the improvements made from 2.0 to 2.2.