Three tanks are connected with two pipes. Each tank is initially filled to a different level. A valve in each pipe opens, and the liquid levels gradually reach equilibrium. Here, we model the system in MapleSim (including the influence of flow inertia), and also derive and solve the analytical equations in Maple.
Liquid inertia is significant for high liquid densities, high flowrates, and large pipe diameters. This will affect the flow dynamics in the coupled tank system, and can result in oscillating flow as liquid sloshes back and forth between the tanks.
Section 2 demonstrates the modelling approach in MapleSim, while Section 3 derives the analytical system equations. Section 4 offers download links for a Maple worksheet (which solves the analytical equations) and a MapleSim model of the system.
2 Modeling the Coupled Tank System in MapleSim
MapleSim’s Circular Pipe simulates frictional pressure drop with Darcy’s equation, but only applies to equilibrium flow. Flow inertia results in an additional pressure drop.
Consider one of the connecting pipes. The net force ΔF acting on the liquid in the pipe is given by Newton’s Second Law.
These additional relationships also apply.
ΔP is the pressure drop across the pipe, A and L are the cross-sectional area and length of the pipe, ρ is the liquid density, and Q is the volumetric flowrate.
Substituting equations 2.2, 2.3 and 2.4 into 2.1 gives the following equation for the pressure drop across the pipe due to fluid inertia.
This is the equation used in MapleSim’s Fluid Inertia block. This block will be used to model the inertial effects of flow in the coupled tank system.
A pipeline with resistive and inertial properties can be modelled by connecting the Circular Pipe and Fluid Inertia components together, as demonstrated in Figure 3.
The total pressure drop is hence the sum of the frictional pressure drop and inertial pressure drop.
MapleSim does not have a tank component, but a simple model can be developed. The pressure at the bottom of the tank and the height of liquid in the tank are given by these equations
where g is the gravitational constant. Figure 4 demonstrates how equations 2.6 and 2.7 are implemented in a Custom Component.
The simple tank equations allow the liquid height to fall below 0 or rise indefinitely. A more complex model would limit the minimum and maximum liquid heights.
This is the completed tank component in MapleSim.
The top connector outputs the liquid height as a signal. The connector on the bottom right is a hydraulic connector, and has pressure and flowrate mapped to it.
The entire model can now be assembled in MapleSim like so.
3 Theoretical Analysis of Coupled Tank System
Consider the pipe connecting tanks 1 and 2. The pressure drop across the pipe is
where P1(t) and P2 (t) are the pressures at the bottom of tanks 1 and 2, V12(t) is the liquid velocity, f is the friction factor, ρ is the liquid density, Lp is the length of the pipe, and Dp is the pipe diameter. The term associated with f is the pressure loss due to friction.
At the pipe inlet at the bottom of tank 1, the pressure is
At the pipe inlet at the bottom of tank 2, the pressure is
Substituting equations 3.2 and 3.3 into equation 3.1 gives
If the mass of liquid in the pipe is m, the net force on the liquid in the pipe is
The force and the mass are also given by
Substituting equations 3.6 and 3.7 into equation 3.5 gives
Substituting equation 3.8 into equation 3.4 gives
Recasting equation 3.9 in terms of the volumetric flowrate gives
The cross-sectional area of the pipe is
Substituting 3.11 into 3.10 gives
Note the term associated with the frictional pressure loss. This should act in the opposing direction to flow. To model this, the equation is rewritten
A similar analysis gives the following equation for the flow between tanks 2 and 3.
The rates of change of liquid height in each tank are given by
where the cross-sectional area of each tank is A1, A2 and A3, and the liquid height in each tank is h1(t), h2(t) and h3(t).
Given a suitable set of initial conditions and parameter values, equations 3.13, 3.14, 3.15, 3.16 and 3.17 can be solved with Maple.
A correlation for f is needed; MapleSim uses the Haaland correlation.
4 MapleSim Model and Maple Worksheet of Coupled Tank System
Here are download links for a Maple worksheet and MapleSim model of the coupled tank system, each with the same parameters values. Both approaches give the same results.
Download Maple worksheet for the coupled tank system
Download MapleSim modelfor the coupled tank system
Coupled Tank System.msim