Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

epanet 2.2 vs wntr PDD #210

Open
kaigaon opened this issue May 18, 2021 · 1 comment
Open

epanet 2.2 vs wntr PDD #210

kaigaon opened this issue May 18, 2021 · 1 comment
Assignees
Labels

Comments

@kaigaon
Copy link

kaigaon commented May 18, 2021

I am new to wntr and python and have been trying to read the documents related to learning wntr. I also tried some examples specifically the criticality analysis which I tried running wntr PDD and epanet 2.2 PDD. This resulted to giving me different values as shown on the graph below. The orange line represents the result of pressure at node 161 of Net3 network using wntr pdd while the blue line represents the result using epanet 2.2 pdd. I have also attached the code here for your reference. Could you please help me check if the code is correct, and if it is better to use wntr or epanet2.2 for criticality analysis?

epanet_vs_wntr

import wntr
import numpy as np

create a water network model

inp_file = 'Net3.inp' #'TLNv1.01.inp'#
wn = wntr.network.WaterNetworkModel(inp_file)

adjust simulation options for criticality analysis

analysis_end_time = 168 *3600
wn.options.time.duration = analysis_end_time
wn.options.hydraulic.demand_model = 'PDD'
wn.options.hydraulic.required_pressure = 18
wn.options.hydraulic.minimum_pressure = 0

add controls

pipe_name = '177'#'8'#
pipe = wn.get_link(pipe_name)
act = wntr.network.controls.ControlAction(pipe, 'status', wntr.network.LinkStatus.Closed)
cond = wntr.network.controls.SimTimeCondition(wn, '=', '48:00:00')
ctrl = wntr.network.controls.Control(cond, act)
wn.add_control('close pipe ' + pipe_name, ctrl)

sim = wntr.sim.WNTRSimulator(wn)
results = sim.run_sim()
sim = wntr.sim.EpanetSimulator(wn)
results = sim.run_sim(version=2.2)

pressure = results.node['pressure']
pressure_node7 = pressure.loc[:,'161']
print(pressure_node7.min())
ax = pressure_node7.plot()
text = ax.set_xlabel("Time (s)")
text = ax.set_ylabel("Pressure (m)")

@kaklise
Copy link
Collaborator

kaklise commented May 19, 2021

We recently ran across this same issue. It seems that the EPANET simulation continues to supply water from drained tanks, which elevates pressures in the system. An issue was posted on the OpenWaterAnalytics GitHub site (OpenWaterAnalytics/EPANET#623) and a software update has been merged. We'll check in with the OpenWaterAnalytics group to see when they plan to tag a new release of EPANET. We hope to get the updated EPANET dlls into WNTR soon.

@kaklise kaklise added the epanet label Jun 1, 2022
@kaklise kaklise assigned kaklise and terrahaxton and unassigned kaklise Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants