OpenWaterAnalytics / epanet-python

python wrapper for epanet library
76 stars 40 forks source link

Negative pressures warning with net6 #48

Closed pshassett closed 5 years ago

pshassett commented 5 years ago

I am getting the Exception: WARNING: System has negative pressures. while running `from epanet.toolkit import toolkit as EN inpfile = 'Networks/Net6.inp' rptfile = 'temp.rpt' binfile = 'temp.bin'

errors = []

ph = EN.proj_create() errors.append(EN.proj_open(ph, inpfile, rptfile, binfile)) errors.append(EN.hydr_solve(ph))`

This inconsistent with EPANET2 behavior with the same .inp file

samhatchett commented 5 years ago

could you please post/link the Net6.inp file so that somebody can reproduce?

Also, are you saying that the simulation does not produce negative pressures under EPANET2, or that EPANET2 does not give an exception when producing negative pressures?

thanks for reporting!

pshassett commented 5 years ago

Hi @samhatchett, thanks for responding! Here is the inp file.

In EPANET2 "Warning: PUMP-3867 open but exceeds maximum flow at 51:44:28 hrs." is produced and comes up again at 76:23:27 and 88:52:22. This could be a difference in how extreme demands are being handled between the two versions. It would be interesting to see how it behaves under PDA demand model.

samhatchett commented 5 years ago

@michaeltryby - it looks like this is a case where 2.2-dev may differ from 2.00.12.

not sure how to address - should we add to the regression tests?

pshassett commented 5 years ago

Running with errors.append(EN.dmnd_setmodel(ph,1,pmin,preq,pexp)) produces "WARNING: Pumps cannot deliver enough flow or head."
It would be nice to know which pump was exceeding flowrate...

pshassett commented 5 years ago

Hey Sam. I'm running on 64 bit windows with python 3.7. Thanks for looking into it Michael.

dly9000 commented 5 years ago

I am getting the same issue with any Warning flag raised when running en.hyd_solve(ph) throwing an Exception and stopping my code from progressing.

import epanet.toolkit.toolkit as en
inpfile = "toy_PDA.inp"
toy = en.proj_create()
en.proj_open(toy,inpfile,"report.rpt","")
en.hydr_solve(tg)
Traceback (most recent call last):
  File "path\epanetSwigTester.py", line 8, in <module>
    errors.append(en.hydr_solve(tg))
  File "C:\Python36\lib\site-packages\epanet\toolkit\toolkit.py", line 367, in hydr_solve
    return _toolkit.hydr_solve(ph)
Exception: WARNING: Valves cannot deliver enough flow.

toy_PDA.txt

I am running Python 3.6 64 bit.

dly9000 commented 5 years ago

@michaeltryby you are correct. It did not occur to me to look in the closed isuses. Thank you for all your work!

pshassett commented 5 years ago

I think this is more of an issue with the Network Model and not necessarily an issue with epanet-python.