Engee documentation
Notebook

Simulation of a system with partially filled pipes

Engineers often face the challenges of modeling systems where pipes are not completely filled with liquid. This is relevant for water supply systems, sewage systems, fuel lines, and other hydraulic systems. In Engee, it is convenient to use the Partially Filled Pipe (IL) block for such calculations, which allows you to simulate the processes of filling and emptying pipes and reservoirs.

Let's look at how this block works and consider two models: a simple and a complex (Y-shaped configuration).

Description of the model

The block "Partially filled pipe" is a pipe partially filled with liquid. It can be used to model complex, branched systems where the liquid level in each component of the liquid system is important, not just in tanks, cisterns, and reservoirs.

A simple model

The simplest configuration includes one "Partially filled pipe" unit connected to the tank. The model demonstrates:

  • how does the liquid level in the pipe change after emptying the tank,

  • how does the initial liquid level affect the dynamics of the process.

This model can be used to check pipe parameters (diameter, length, angle of inclination) before integration into a more complex system.

image.png

Let's run the model and look at the dynamics of the liquid level in the tank and in the pipe.:

In [ ]:
initial_tank_liquid_level = 1; # м
pReservoir = 0.101325; # МПа

model = engee.open("$(@__DIR__)/PartiallyFilledPipe.engee")
data = engee.run("PartiallyFilledPipe")

plot(
    plot(data["Цистерна"].time, data["Цистерна"].value, title="Уровень воды в цистерне", c=1),
    plot(data["Труба"].time, data["Труба"].value, title="Уровень воды в трубе", c=2),
    layout=(2,1), titlefont = font(11), lw=3, legend=false
)
Out[0]:

We can see that the initial level (1 m) of water flowed out of the tank in about 12.5 seconds, after which the water level in the vertical pipe quickly dropped to zero.

Y-shaped configuration

A more complex option is a system of three "Partially filled pipe" blocks connected in the form of the letter Y. This configuration allows you to simulate:

  • branched pipelines,

  • systems with multiple sources or drains of liquid,

  • Scenarios where liquid is redistributed between multiple tanks.

image.png

Let's run this model and study the dynamics.:

In [ ]:
tank1_inlet_height = 0.1; # м
tank2_inlet_height = 0.1; # м
tank1_initial_liquid_level = 1; # м
tank2_initial_liquid_level = 1; # м
pReservoir = 0.101325; # МПа

model = engee.open("$(@__DIR__)/PartiallyFilledPipeY.engee")
data = engee.run("PartiallyFilledPipeY")

Цистерна_1 = collect(data["Цистерна_1"]); Цистерна_2 = collect(data["Цистерна_2"]);
Труба_1 = collect(data["Труба_1"]); Труба_2 = collect(data["Труба_2"]); Труба_3 = collect(data["Труба_3"]);

plot(
    plot(Цистерна_1.time, [Цистерна_1.value Цистерна_2.value], title="Уровень воды в цистернах", c=[1 2]),
    plot(Труба_1.time, [Труба_1.value Труба_2.value], title="Уровень воды в трубах 1 и 2", c=[3 4]),
    plot(Труба_3.time, Труба_3.value, title="Уровень воды в выпускной трубе 3", c=5),
    layout=(3,1), titlefont = font(11), lw=3, legend=false
)
Out[0]:

The AL port of the partially filled pipe block is responsible for the nature of its operation: if AL<= 0, then the system models the pipe as a reservoir, the liquid from which flows through the port B. If AL > 0, then the equations are used to calculate the filled pipe, which receives liquid from the port A. Accordingly, port A should always be "higher" than port B.

Conclusion

The Partially filled pipe block allows you to test simple scenarios, analyze complex branched systems and calculate their throughput and dynamics.

Try changing tank levels or pipeline parameters and explore the nonlinear effects that can occur with certain combinations of fluid quantity and network capacity.