INTRODUCTION COURSE
Model User II
Power to take Control!
Mobatec Modeller Intro Course – Model User II
1. Simulation of the closed circulating flow loop
1.1 Introduction
This is the second exercise of Mobatec Modeller Introduction Course and will teach you how to
build and run a model using predefined library units. The Introduction Course further consists of
several constructive and easy to follow exercises that will teach you how to build (develop) your
own models in Mobatec Modeller.
1.2 Objectives
By the end of this exercise, you will know
• How to build a flow-sheet from the library Unit-Models
• How to input parameter values, initial variable values & initialise the System’s
• How to add variable displays
• How to run a real time dynamic simulation in Mobatec Modeller
1.3 Model description
We want to model a real time dynamic simulation of a closed circulating flow loop.
Process P&ID:
Figure 1 Closed circulating flow loop
Page 1 of 12
Mobatec Modeller Simulation Environment:
Figure 2 Mobatec Modeller Simulation Environment
The Model consists of 2 open (atmospheric) tanks (B101 & B102), 1 pressurized vessel (B103) & a
pump. Model also has material SOURCE, SINK, HEAT SOURCE and 8 liquid “buffers” - stream lines
junction elements (2 inside the Pump Unit).
1.4 Assumptions
• Atmospheric tanks and pressurised vessel are well-stirred
• The cross-section area is constant along the heights of the units
• Model has single phase definition (liquid phase)
• Liquid phase is containing single component (i.e. H2O)
• Process is non-isothermal
Page 2 of 12
2. Things to do
1. Create a New Model
Open a new model, by clicking on a “New Model” button, or click on File/New Model. A new
model called “Universe” will open. Save your model with a different name by clicking on a
save as icon “ ”, or click File/Save Model as, choose appropriate location for your model.
Do NOT save you model in the Program Files directory as Windows might not give you proper
rights to save, change or run your model.
2. Inserting systems/connections from the library
Open the “Property Browser”, by clicking on the icon “ ” in the toolbar, or by clicking on
Tools/Show Property Browser (CTRL+ F10). Select “Insert Objects” tree folder and select the
library used for this exercise: Click Browse and find and select “Closed Circulating Flow Loop”
- Library. All the systems needed to build the process will be listed.
Figure 3 Chose "Closed Circulating Flow Loop" Library
By clicking on the desired library unit model (e.g. Boundaries, Mix and Split Points, Pumps,
Vessels, Switches) and clicking anywhere on the work surface of Mobatec Modeller modelling
environment you will insert the selected model object. Do so for all the needed model parts
one by one looking at the process (Figure 2).
After inserting all needed systems give all the tanks model objects their names accordingly
B101, B102 & B103. Select any tank, press “F2” keyboard button, rename dialog box will
appear (same as in windows) where you can enter desired name. You can also give/change
any model object name through the Physical Topology tab of the selected model object.
Page 3 of 12
3. Reconnecting model parts – Making mass connections
There are 2 types of connections available. Liquid line with no valve & liquid line with valve.
Look at Figure 2 and check which connection type to use where. To connect two model-units
select appropriate mass connection in the library, then click on the connection origin system
and make second click on the target system.
If you make the second click on the empty working surface you will get connection loose end.
By clicking double click on the loose end of a connection (“green circle”) or using shortcuts
(previously select the connection active point) “o” for reconnect origin & “t” for reconnect
target of selected connection and clicking on the origin or target system you will make a
physical connection. Connect all the systems as illustrated in Figure 1/Figure 2.
4. Adding Species to your Model
Click anywhere on the working environment and go to Property Browser/General/ Plant
Species & Reactions (or click “Plant Species & Reactions” icon “ ” in the toolbar) and click
“Define Plant Species” button. In the selected database drop down menu chose “Default
Database”(contains 2000+ different species). Now you can find (filter ➔ type H2O) the
species that you need, select desired species and click “Add” button, i.e. add H2O, then click
OK. Now H2O is available species to be added (injected) to any system of your model.
Figure 4 Chose Default Database
To inject species to a system, select the liquid source battery limit system, (go to Property
Browser/Selected Objects/ Systems/Species Topology) and select “Set Injected Species”
button, previously added plant available species, i.e. H2O will be available. Select H2O and click
“Add” button, then click OK.
Figure 5 Injecting H2O to Liquid Source battery limit system
Page 4 of 12
It is enough to add a species to only one system (source system) because the species will
propagate throughout the mass connections over the model and will appear in all mass
connection connected systems as in reality.
5. Adding (flow [kg/min]) displays to the process streams
Displays are used to show a “current” calculated value of any variable or parameter given
value in simulation environment. In modelling environment, the displays will show defined
upper bound value by default. Displays are not necessary part of the model, they are used to
provide overview of desired variables & parameter values and direct interaction with
parameter values in simulation environment.
Mass Flow display
showing current value of
specified variable
Figure 6 Value display(s) in SIMULATION environment
To add a display, go to Property Browser/Insert Objects/Objects. Here you can choose between
2 types of value displays. “Value Access Object” used for valve position (parameter value)
change while running dynamic simulation, which is already attached to the “liquid line with
valve” model library mass connection, and “Value Display Object”.
Select “Value Display Object” and simply click on the MM work surface to add a display.
Display will appear where clicked. This display is used to show digit values of variables which
we need as we want to display mass flow.
Figure 7 Chose "Value Display Object"
As we want to add display for the mass flow (kg/s), it is easier to add just one display, define
that display, and then just copy it, paste it and re-link it to desired mass connection.
Page 5 of 12
Type exact variable
symbol “Fm”
Linking display to
model object
Figure 8 Defining Mass Flow value display object
Use information provided in Figure 8 to correctly define the mass flow display. To link the
display with the desired variable, click on “Select” button next to “Linked Object” box. The list
of available systems & connections will appear. You can either search by name within this list
or simply click on the object directly in the MM work environment, (click on the connection
active point). After making selection click “OK”.
Click directly to stream
active point (valve), to
set the linked object
... ...
Figure 9 Linking value display to desired model object
Page 6 of 12
To check which display is connected to which line, just click on the display while in modelling
environment and the active point of the linked object will indicate a green “circle” around its
active point. The same indication appears around the systems when clicked on the displays
linked to systems.
Figure 10 Linked object indication (green circle)
To set the units, in ”Engineering Unit String” text-box type the desired unit, in this case type
“kg/min” unit and check “Auto-Update Factors” check-box next to it. This will set the “Display
Value Multiplication Factor” automatically as in MM, all variables have SI basic units (kg/s in
this case, so multiplication factor will be automatically set to 60). Set max and min of your
display, for minimum set “-10” and for maximum set “10”, you can also adjust the colour of
the font & the background, etc. Once finished with all the settings click “Apply” button.
(Now you can copy the defined display, paste it where desired. Click on a display, the
properties tab will open, there just change the linked object by using the same procedure as
previously explained.)
6. Initializing the System’s
Systems B101, B102 (atmospheric tanks) and system B103 (pressurised tank) needs to be
initialised separately. Insert given parameters values for B101, B102 & B103 according to Table
1 blow (most of the parameter values are identical for all three tank systems). Select system
B101, then go to Property Browser/Selected Objects/ Systems/ Parameters and enter the
parameter values. Do the same for the tanks B102 & B103. Pressurised vessel B103 is
modelled to have fix amount of air inside “n_Air”. (Note: Air is not introduced as real
species, but just described through the “Pg”- ideal gas equation)
After entering the parameters values to all three tanks you need to insert the initial values (of
certain variables) of the tanks systems to be able to initialize each of the systems.
Mobatec identifier Value Units
D_B101/D_B102/D_B103 0.095 [m]
Dm_B101/ Dm_B102/ Dm_B103 998.1 [kg/m3]
Eh_B101/ Eh_B102/ Eh_B103 1.0/2.0/2.2 [m]
g_B101/ g_B102/ g_B103 9.81 [m/s2]
Vtot_B103 6.4 [l]
Pg_B101/ Pg_B102 1.013 [bar]
n_Air 0.1 [mols]
Vmin_B101/ Vmin_B102/ Vmin_B103 0.1 [l]
Table 1 B101/B102/B103 parameters values table
How many Initial conditions do you need for each System?
When you want to perform a dynamic simulation run of your model, you need a certain start
condition, the so-called initial values for all defined variables. In order for the solver to find a
correct solution, you need to provide a consistent set of initial values.
The variables of an object (either a system or a connection) are related to each other via the
defined algebraic equations of the object. Therefore, their values can, in principle, not be
chosen independently. All (initial) values are actually related to the fundamental state
variables (component mass n[] (or m[]) and enthalpy H) of the defined capacities.
Page 7 of 12
So, providing values for the component hold-up (i.e. component mass) and enthalpy would, in
principle, be enough to let the computer compute (i.e. calculate) a consistent set of initial
values, using the defined algebraic relations.
In general, however, a model developer has no direct knowledge about the component mass
and enthalpy in a system. Usually, he does have some information about, for example,
component fraction, pressure and temperature in systems. Therefore, it is also possible with
Mobatec Modeller to select a set of variables (in a system) from which first the values of the
fundamental state variables can be calculated. From these values, the other values will then
be computed to get a consistent initial value set (for this system). Optionally, you can press the
Show Init Sorting button to check if the equation sorting, for performing the initial value
calculation, is correct and that all variables can be calculated from the current selection (there
should be no variables listed in the Selectable List-box of the dialog window that appears).
The initial values of connection objects are, in most cases, (indirectly) coupled to the
fundamental state variables of the interconnected systems. The values of these variables are
treated as “known” values for the connection object, which makes the initial value calculation
for connection objects a trivial operation.
Initialization of “Atmospheric tank” Unit is shown in Figure 11 below.
Figure 11 Initialization Example
Select tank B101 Go to Property Browser/Selected Objects/ Systems/Initial Values. Check “I”
checkbox to set the initial conditions as shown in Figure 11. Once you have stated the initial
conditions click on the button Calculate Initial Values at the left bottom of the tab. If your
Page 8 of 12
initial conditions are correct (consistent) and the system of equations is well posed, Mobatec
Modeller will calculate the initial values of all variables of the system. Use the same initial
conditions for tanks B102 & B103.
To initialize liquid streams joints (liquid buffers) and the pump, use the “Initialization Aid” tab
located under the System directory. In example below, a pump model initialization routine is
presented. Select the pump model, go to “Initialization Aid” tab and fill in the initial vales of
defined variables as shown in Figure 12 below and press “Initialize” button at the bottom.
Figure 12 Pump Initialization Aid
Do the same for all liquid buffers present in the model (Initial values: P = 1 bar, T = 20 ᵒC) using
“Initialization Aid” tab available in the buffer system as well.
Page 9 of 12
7. Initializing connections
All the line parameters are already present within liquid lines library models. Mass
connections initialisation is a trivial operation. You can now initialise all mass connections and
liquid joints elements by making no selection and clicking “ ” button in the tool bar.
Warning message that no selection is made causing initialisation of entire model will appear,
click OK. You can also select each model object separately one by one and initialise it via Initial
Values tab, or by using upper mentioned button in the tool bar.
8. Running a Real Time Dynamic Simulation in Mobatec Modeller
To Compile the model, press the “Compile Model and Switch to Simulation Environment”
icon in the toolbar “ ” (shortcut - F12), or go to Property Browser/General/Basic Commands
and press “Compile Model and Switch to Simulation Environment” button.
When your Model is compiled you will get a message from Mobatec Modeller that compilation
was successful!
Go to Property Browser/General/Basic Commands in Simulation environment and select
“Dynamic” under the simulation type. Under integration method select “Fix Step Size” and
enter “1” (sec), under “Calculation Delay (in ms)” enter “1000”. Click the “Start Calculation”
button” ” and run a real time (real seconds) dynamic simulation of the process.
If there are no errors your model should be running the simulation of the process and you are
able to follow the “Simulation time” in seconds on the Basic Commands tab, or at the left
bottom corner of the screen.
Start interacting with the model by turning the pump ON and opening the valves of the
stream lines.
After completing all the modelling steps, Mobatec Modeller is ready to generate a code file
with consistent set of model equations. Since this code consists of mathematical equations, an
interface to any problem-solving package could, in principle, be established. Several
Differential Algebraic Equation (DAE) solvers are currently supported by Mobatec Modeller
(e.g. Mobatec LauTrane Solver, Process Studio’s e-Modeler, Aspen Custom Modeller,
Matlab,…). Check your license ([Tools][License Settings]) to see which solvers are available to
you.
Select the Model Generation tab in the Property Browser and click on the Show Code button
to display the code that is generated by Mobatec Modeller. This code is compiled by the
Mobatec Compiler. The compiled code can be used for doing dynamic simulation runs for
testing and tuning. A (tuned and tested) model can be easily connected to other software and,
for example, form the basis for an Operator Training Simulator.)
9. Changing systems ground elevation & relative stream lines connection points
All physical systems are affected by gravity. Therefore, we have gravity flow due to hydrostatic
pressure difference caused by different elevations of the origin and the target system. In this
model you can change systems elevation height parameter “Eh” value (set to 0 by default) and
stream lines relative connection elevation points of origin system “hOr” and the target system
“hTar” (also set to 0 by default). By doing so you will directly affect the behaviour of the entire
model. Look at Figure 13 on next page illustrating these parameters and their relation in space.
Play with different values of these parameters to check different behaviours of the process.
Page 10 of 12
hOr =0.8 m ; hTar = 1.0 m hOr = 0 m ; hTar = 1.0 m
Eh = 3.2m
hTar = 0.4 m hOr=0.4 m ; hTar = 0.8 m
Eh = 2.2 m
hTar = 0 m hTar = 1.0 m
hOr = 0 m
Eh = 2 m
hTar = 0.4 m
Eh = 1.2 m
hTar = 0.2 m
Eh = 0.8 m Eh = 1.0 m
Eh = 0.4 m
Eh = 0.0 m
m
Figure 13 Systems & Connection elevation parameters relation
Parameters (Eh,hOr & hTar) can be changed in Modelling environment in systems and
connections. In that case complete model initialisation and compilation is needed before
running the simulation with new parameter values. Note, all “hOr” parameter values for
connections Or-iginating from liquid “buffers” are equal to “0 m”.
It is of course, also possible to change parameter values while the dynamic simulation is
running through value access object displays (same as used for valve positions displays).
Figure 14 “Eh” parameter access value display definition
Page 11 of 12
3. Appendix 1 – Used Parameters
1. Parameters - Atmospheric & Pressurised tanks
Symbol Description Units Mobatec identifier
ρ Density [kg/m3] Dm_”tankname”
D Diameter [m] D_”tankname”
Pg Gas Phase Pressure [bar] Pg_”tankname”
Vmin Minimal Liquid Volume [m3] Vmin_”tankname”
Eh Elevation height [m] Eh_”tankname”
Table 2 Atmospheric Tanks parameters
2. Parameters – Pump
Symbol Description Units Mobatec identifier
Q Operating flow [m3/s] F0_M
H Pump head [m] Head0_M
α Flow resistance [m4/s] Alpha_M
Ƭ Pump response delay [s] Tau_M
Wdis Pump work [W] Wdis0_M
Sw Pump switch On/Off Sw_M
Table 3 Pump parameters
3. Parameters – Liquid buffer(s)
Symbol Description Units Mobatec identifier
Po Referent pressure [bar] P0_”buffername”
Vo Referent liquid volume [m3] V0_”buffername”
Vmin Minimal liquid volume [m3] Vmin_”buffername”
Eh Elevation height [m] Eh_”buffername”
L Liquid level [m] L_”tankname”
Table 4 Liquid Buffer parameters
5. Parameters – Liquid lines
Symbol Description Units Mobatec identifier
Cv Valve resistance [-] Cvmanf_”linename”
D Diameter [m] D_”linename”
ff Flow resistance [m4/s] ff_”linename”
h Line vertical coordinate [s] h_”linename”
L Length [W] L_”linename”
Zv Valve position [%] Zv_”linename”
hOr Relative Elev. height [m] hOr_” linename”
hTar Relative Elev. height [m] hTar_” linename”
Table 5 Liquid Lines parameters
6. Parameters – Switches, Indicators & Alarms
Symbol Description Units Mobatec identifier
Lmin Minimal level [m] Lmin_ Lmin_/L_max”indicator/switchname”
Fm_min Minimal mass flow [kg/s] FmMin_”indicator/switchname”
offset offset [-] offsetP_”indicator/switchname”
range range [-] rangeP_”indicator/switchname”
Table 6 Switches, Indicators & Alarms parameters
Page 12 of 12