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

Differences with my epanet from zero model and inp from wntr model #409

Closed
aljdmn opened this issue Mar 7, 2024 · 4 comments
Closed

Differences with my epanet from zero model and inp from wntr model #409

aljdmn opened this issue Mar 7, 2024 · 4 comments
Assignees
Labels

Comments

@aljdmn
Copy link

aljdmn commented Mar 7, 2024

Hi,

Its my first time using the inp files from wntr, in this case i tried to create the same model i used in the past to train with EPANET.

So, i have two files:
FILES.zip

one created in EPANET = "proyecto 1.4. (cambio alturas) The original
one created with wntr code = "lastmodel" ; python original code: "lastmodel"

In theory these two files have to match between them, but if i open both in EPANET and runs the simulation it doesnt work. The problem im seeing is "lastmodel" there´s no way of forcing the flow, being 0,01LPS all the time.

(Units in SI)

In case someone could help me, i attached these two files.

And thank you for the support.

@kbonney
Copy link
Collaborator

kbonney commented Mar 11, 2024

Hi @aljdmn,

I took a look at your files and found that the two networks you are trying to compare do have some differences. For example, the pump curves are slightly different, there is slightly different topology in the bottom right part of the networks, and the pipe lengths do not match either.

If your goal is to get the proyecto 1.4. (cambio alturas).net file into WNTR, I would recommend saving it as a inp file using EPANET and load it into WNTR using wntr.network.WaterNetworkModel("/path/to/inp_file.inp").

@aljdmn
Copy link
Author

aljdmn commented Mar 12, 2024

Indeed my goal is create a python program to create and simulate the same things for example 'proyecto 1.4.' does. 'Proyecto 1.4. is a file to compare with my wntr code in similar parametres.

Yesterday, after reading the answer, i found the problem was the units, in wntr i wrote the units in International System, but creating the .inp file 'lastmodel.inp' from my wntr code, if i open it in Epanet after that, the units change.

I used this code to fix that: wntr.network.io.write_inpfile(wn,"C:\Users\domen\Desktop\lastmodel2.inp",units='SI')

But, if i load it again (for example to make changes) this Error ocurr:
image

image

i dont know how to load the file, thank you.

@kbonney
Copy link
Collaborator

kbonney commented Mar 12, 2024

Using "SI" in write_inp will cause this issue when reading the inp file because "SI" is not an expected unit type for an EPANET inp file. Instead, the unit option needs to take its value from one of the following types listed in the "flow" column on this page in the EPANET documentation. This should probably be checked for when running the write_inp function to avoid confusions like this. Also, keep in mind that the unit option is meant to select the units of the output, not the input. WNTR is always SI so you don't need to specify that.

To match your original model you would want to set units="LPS". I ran the code this way, and the units look correct but the hydraulics are still different. Instead of recreating the model from scratch, which is likely introducing hard to detect errors, I suggest doing the following to create a WNTR model:

  1. Load proyecto 1.4. (cambio alturas).net into EPANET.
  2. Save the network as an inp file (file>export>network)
  3. Load this inp file into WNTR using the following command:
    wn = wntr.network.WaterNetworkModel("/path/to/inp_file.inp")

@kaklise
Copy link
Collaborator

kaklise commented Apr 8, 2024

Closed via #410

@kaklise kaklise closed this as completed Apr 8, 2024
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