EPANET running slow problem in Hydraulic and Quality analyses

Hi there,

I would like to evaluate the water age of a city-level water system. As hydraulic analysis is a prerequisite, I conducted both hydraulic and quality analyses at the same time. It takes me about 30 mins to finish a 24-hour duration simulation. However, when I set the time duration to 3-days, the simulation costs more than a day (in fact, the simulation is not done yet when I post this quetsion). Obviously, the calculation speed of the algorithm is getting slower and slower.

I was wondering if there are any ways to accelarate the algorithm? Should I release the unused memory while runing the simulation since each run of simulation only depends on the results of the last running step, right?

Your advices are very much appreciated! Thank you.


Btw, I am using EPANET Python toolkits.

Hi @yueeeeeli,
You can check the following example:

from epyt import epanet

d = epanet('L-TOWN.inp')

td = 5  # days
hr_in_sec = 3600
ql_step = 300  # 5 min
d.setTimeSimulationDuration(td * 24 * hr_in_sec)

# Set quality type & units
quality_type = 'age'
quality_units = 'hour'
d.setQualityType(quality_type, quality_units)

# initialize all quality+
zeroNodes = [0] * d.getNodeCount()
d.setLinkBulkReactionCoeff([0] * d.getLinkCount())
d.setLinkWallReactionCoeff([0] * d.getLinkCount())

res = d.getComputedTimeSeries()

hour = td * 24
d.plot(node_values=res.NodeQuality[hour, :], link_values=res.LinkQuality[hour, :],
       title=f'Water age at hour {str(hour)}', colorbar_label='Water Age (hours)')