Engee documentation
Notebook

Pipework between two tanks

In this example, we show how to calculate the capacity of a pipe when an incompressible liquid under overpressure passes through it.

Model description

The model of this simple pipework system contains two tanks (block Reservoir), the first of which has an overpressure of 50,000 Pa relative to the second. The reference pressure in both cases is the atmospheric pressure (101 325 Pa), but it does not play a special role here, also because the pipe flows incompressible liquid.

The pipe (Pipe (IL)) is characterised by a length of 10 metres and a diameter of 0.2 m (cross-sectional area pi*(0.1^2) м2).

image.png

Of the "service" blocks - the model contains a fluid parameter setting block Isothermal Liquid Properties (IL) and a block Solver Configuration - both have default settings.

Execution of the model

Let's run this model:

In [ ]:
modelName = "reservoirs_pipe"

if modelName  [m.name for m in engee.get_all_models()] engee.load( "$(@__DIR__)/$modelName.engee"); end;

data = engee.run( modelName )
Out[0]:
Dict{String, DataFrame} with 1 entry:
  "Расход" => 101×2 DataFrame

Let's show the fluid flow rate through this pipe found by the model:

In [ ]:
data["Расход"].value[end]
Out[0]:
269.8851941815642

Thus, the flow capacity of a 0.2 m diameter pipe with a length of 10 m when water is injected into it with an overpressure of 0.05 MPa is 269.9 kg/s.

A similar model built in Simulink shows an identical result: the flow rate through the pipe is 269.9 kg/s.

image.png

If desired, you can run the attached model and double-check the result.

In [ ]:
using MATLAB
mat"cd( '$(@__DIR__)' )"
mat"simout = sim('reservoirs_pipe_2023a.slx')"
mat"disp( simout.G.Data(:,:,end) )"
>> >> >>   269.8856

Conclusion

We created a very simple model and solved the problem of calculating the flow rate through a pipe under certain conditions. The results exactly matched the model created in Simulink.