glorialulu / TSNet

Transient simulation in water networks using MOC method.
MIT License
48 stars 20 forks source link

Define new elements (relief valves...) #15

Closed AntoineGEAUX closed 3 years ago

AntoineGEAUX commented 3 years ago

Description

Hello, We currently use a transient simulation software (Allievi) to model some complex networks with a lot of scenarii that can cause water hammers. With a python package like TSNET we could automate the computation of the scenarii. However, some objects present in Allievi are not yet included in TSNET:

Is it possible to program in python new elements like those above, if we know their equations? If so, we will try TSNET next time we have to do transient simulations.

Thanks for your answer, Antoine

glorialulu commented 3 years ago

Hi Antonio,

You are right that TSNet does not support all the objects that are supported by other commercial software. However, it is possible to write your customized methods and functions to deal with specific elements of interest.

The boundary conditions, i.e., valves, pumps, surge tanks, reservoirs, and dead ends, are defined in the source code ./simulation/solver.py , i.e., valve_node() for valves. These boundary conditions are then called in ./simulation/single.py.

Thus, you can write your own methods to define the elements you mentioned if the equations for the boundary conditions are known. Please let me know if you have any further questions.

Best, Lu

schoeller commented 2 months ago

@AntoineGEAUX did you manage to introduce air valves elements similar to available products? I have seen the element type valve_node in the docs, but have not make it work so far.

Ifso would you mind sharing?

Best

Sebastian

AntoineGEAUX commented 2 months ago

I did not attempt it, I used another software (Allievi) instead

schoeller commented 2 months ago

Thx for the quick response. I'll try the suggested way. Concerning TS I would like to attempt tackling a design as sketched below.

grafik

I have noted down that parts 0, 2-3, 6-8 should be treated as per example 1. Part 1 would be treated as in example 2. If somebody could pinpoint me into the direction as how to approach parts 4-5.

Best

Sebastian

schoeller commented 1 month ago

@glorialulu: I would like to add a commercially available element to use with TSNET. The curve characteristics are as per attached screenshot. Values may be digitized as xy-pairs (differential pressure, m3/h). Other characteristics would be

Ideally one could attach the behaviour directly to an existing Epanet node. My question to you is

  1. How would one add this as a boundary condition against atmospheric pressure with tabulated data?
  2. Could one use above for parameters as well to achieve similar?

A code sample is highly appreciated.

Best regards

Seb

Screenshot 2024-09-15 165642