WOLFRAM SYSTEM MODELER

ControlledTanks

Demonstrating the controller of a tank filling/emptying system

Diagram

Wolfram Language

In[1]:=
SystemModel["Modelica.Fluid.Examples.ControlledTankSystem.ControlledTanks"]
Out[1]:=

Information

This information is part of the Modelica Standard Library maintained by the Modelica Association.

With this example, the controller of a tank filling/emptying system is demonstrated.

The basic operation is to fill and empty the two tanks:

  1. Valve 1 is opened and tank 1 is filled.
  2. When tank 1 reaches its fill level limit, valve 1 is closed.
  3. After a waiting time, valve 2 is opened and the fluid flows from tank 1 into tank 2.
  4. When tank 1 reaches its minimum level, valve 2 is closed.
  5. After a waiting time, valve 3 is opened and the fluid flows out of tank 2
  6. When tank 2 reaches its minimum level, valve 3 is closed

The above "normal" process can be influenced by three buttons:

  • Button start starts the above process. When this button is pressed after a "stop" or "shut" operation, the process operation continues.
  • Button stop stops the above process by closing all valves. Then, the controller waits for further input (either "start" or "shut" operation).
  • Button shut is used to shutdown the process, by emptying at once both tanks by opening valve 2 and valve 3. When this is achieved, the process goes back to its start configuration where all 3 valves are closed. Clicking on "start", restarts the process.

The demo-run uses the following button presses:

  • Button start pressed at 20 s.
  • Button stop pressed at 220 s
  • Button start pressed at 280 s
  • Button stop pressed at 650 s
  • Button shut pressed at 700 s
  • Simulate for 900 s

This example is based on

Dressler I. (2004):
Code Generation From JGrafchart to Modelica. Master thesis, supervisor: Karl-Erik Årzén, Department of Automatic Control, Lund Institute of Technology, Lund, Sweden, March 30, 2004
 
ControlledTanks.png

Components (14)

tankController

Type: TankController

Description: Controller for tank system

start

Type: RadioButtonSource

Description: Boolean signal source that mimics a radio button

stop

Type: RadioButtonSource

Description: Boolean signal source that mimics a radio button

shut

Type: RadioButtonSource

Description: Boolean signal source that mimics a radio button

valve1

Type: ValveDiscrete

Description: Valve for water/steam flows with linear pressure drop

tank1

Type: OpenTank

Description: Simple tank with inlet/outlet ports

level1

Type: RealExpression

Description: Set output signal to a time varying Real expression

valve2

Type: ValveDiscrete

Description: Valve for water/steam flows with linear pressure drop

valve3

Type: ValveDiscrete

Description: Valve for water/steam flows with linear pressure drop

tank2

Type: OpenTank

Description: Simple tank with inlet/outlet ports

ambient1

Type: Boundary_pT

Description: Boundary with prescribed pressure, temperature, composition and trace substances

level2

Type: RealExpression

Description: Set output signal to a time varying Real expression

source

Type: Boundary_pT

Description: Boundary with prescribed pressure, temperature, composition and trace substances

system

Type: System

Description: System properties and default values (ambient, flow direction, initialization)