Modelica Two Tank System

This simulation uses the Modelica modeling language to model two identical tanks connect together by a pipe. The platform used is OpenModelica and the components are from an ‘under development’  library that aims to be a simpler to use alternative to the modelica fluid library.

The tanks are 25 m high and have a radius of 2 m, the pipe is 5 m long and has a radius of 2.5 cm. The OpenModelica diagram of this system is sown in figure 1 below.

TwoTankSystemFigure 1: Two Tank System in OpenModelica

Tank 1 has an initial liquid level of 20 m and Tank 2 has no liquid, a level of 0 m. At t=0 the liquid starts to flow from Tank 1 to Tank 2 through the pipe. The results, presented in the figure 2  below, show that it takes approximately 150 seconds for the tank levels to practically equalise. The level that the tanks equalise to is half the initial height, 10 m, since the tanks are of the same radius or cross sectional area.

TankLevelsFigure 2: Equal Tanks Levels After 300 Seconds

One of the benefits of computer based modeling and simulation is that you can run experiments and try different configurations relatively quickly and inexpensively. For example we can see what heights the tanks will equalise at and how long they take to equalise if Tank 2 had a radius that was a half of the radius of Tank 1. These results are presented in figure 2 below and show that the tanks take approximately 80 seconds to equalise at a height of 16 m.

TankLevels2Figure 3: Smaller Tank 2 Levels After 300 Seconds

Presented was a relatively simple model to demonstrate the power of modelica and the progress with the custom fluid library. Please leave comments, if there are any, and feel free to contact me if you have any questions or concerns.

2 thoughts on “Modelica Two Tank System

    1. Administrator Post author

      Yes Gezim I do actually but I could use some expert help, are you a fluids and piping systems expert?

Comments are closed.