Вы находитесь на странице: 1из 16

Simulation Practice and Theory 7 (1999) 515±530


Use of MATLAB and 20-sim to simulate a ¯ash

Marisol Delgado *, Cesar Pichardo
Departamento de Procesos y Sistemas, Universidad Sim
on Bolõvar, Apartado Postal 89000, Caracas 1081-A,
Received 1 December 1998; received in revised form 5 July 1999

This work presents the simulation of a two-phase ¯ash separator, one of the processes of an
industrial natural gas liquefaction plant. The model simulated was developed using the bond
graph methodology, and MATLAB and 20-sim software were used to obtain the dynamic be-
havior of the ¯ash. MATLAB was used to determine the input conditions of the separator as
they were not provided by the plant information, and 20-sim was used to simulate the bond
graph model. The simulation results were validated using real operating conditions of the
plant. The paper shows how this two widely used computer programs can help in the under-
standing of the behavior of real process. Ó 1999 Elsevier Science B.V. All rights reserved.

Keywords: Bond graph modeling; Flash separator; Simulation

1. Introduction

A fundamental step in the design and optimization of a system is the generation of

a mathematical model that describes the system in an adequate way. However, it is
also very important to select the computational tool that allows the simulation of
this model. It is the task of the designer to select suitable software that adapts to
his necessities.
To obtain reliable answers to the problems of simulation, the designer has di€er-
ent levels of computation on hand, starting from solutions obtained by simple in-
spection up to fast and analytical computational solutions. Sophisticated and
specialized programming languages in the solution of mathematical equations and

Corresponding author. Tel.:+58-2-906-33-26; fax: +58-2-906-33-26.
E-mail address: marisol@usb.ve (M. Delgado)

0928-4869/99/$ - see front matter Ó 1999 Elsevier Science B.V. All rights reserved.
PII: S 0 9 2 8 - 4 8 6 9 ( 9 9 ) 0 0 0 1 6 - 6
516 M. Delgado, C. Pichardo / Simulation Practice and Theory 7 (1999) 515±530

in numerical calculus have been used. FORTRAN language represents one of the pi-
oneers in this ®eld and in the ®eld of simulation languages, MIMIC and CSMP are
also pioneers. Nowadays, the simulation ®eld is strongly represented by tools as
powerful as the program MATLAB for WINDOWS [1] or as versatile and user-
friendly as 20-sim 2.0 version [2].
Flash separators are characterized by the complexity in their highly non-linear
models. These complex models must be implemented in computational software that
provides a good processing of the model and facilities to interpret the results. The
objective of this work is to present the use of MATLAB and 20-sim in the simulation
of an industrial separator and to allow the observation of characteristics such as tem-
perature, pressure, output ¯ows and liquid level inside the separator. The motivation
for doing the simulation of the ¯ash is to be able to design its control.
This paper is organized as follows. In Section 2 the description of the system and
its model are presented. Section 3 shows the numerical values of the process that al-
lowed the simulation. In Section 4 we present how we used MATLAB to determine
the input conditions for the simulation. Section 5 presents the use of 20-sim to sim-
ulate the system, and Section 6 shows the simulation results. The conclusions of the
work are summarized in Section 7.

2. The separator and its model

The ¯ash separator under study is part of the demethanizing and cooling section
of the natural gas liquefaction processes taking place in the San Joaquõn extraction
plant. This plant is part of the Cryogenic Complex of the eastern part of Venezuela
This ¯ash separator is a cylindrical tank of known dimensions to which propane is
introduced at known pressure and temperature in thermodynamic equilibrium. The
entering propane reaches this equilibrium by means of an expansion caused by a
valve placed just before the tank. This equilibrium allows the separation of the pro-
pane in two phases, and the liquid in equilibrium is extracted from the bottom while
the vapor is extracted from the top. In accordance with this, the input ¯ow, the out-
put vapor ¯ow, the output liquid ¯ow, and the propane inside the tank all have the
same temperature and pressure conditions. Fig. 1 shows the physical model of the
The model of the ¯ash separator was developed using the bond graph methodol-
ogy [4]. It corresponds to a multi-pseudo bond graph where hydraulic and thermal
variables are represented explicitly. It is a multi bond graph since several variables
of di€erent domains exist in the same bond, and it is a pseudo bond graph because
the product of the variables in the bonds does not represent power. The e€ort vari-
ables are pressure and temperature, and the ¯ow variables are mass ¯ow and enth-
alpy ¯ow. Fig. 2 shows the pseudo bond graph of the separator. A complete
description of this model is shown in [5].
The equations that represent the elements of the pseudo bond graph shown in
Fig. 2 are shown in Table 1. These equations were deduced using mass and energy
M. Delgado, C. Pichardo / Simulation Practice and Theory 7 (1999) 515±530 517

Fig. 1. Physical model of the ¯ash separator.

balance, equations of the vertical velocity of gas and liquid at the point of maximum
transversal section of the separator, the equation of ideal gases, the modi®ed Rackett
equation, the Froude number, the Antoine equation, the Clasius±Clapeyron expres-
sion and RaoultÕs law. The deduction of these equations is shown in detail in [6].

3. Numerical values for the simulation

In order to simulate the ¯ash the numerical values of the dimensions and opera-
tion conditions of the separator were obtained from plant operation conditions [3]
and the properties of propane from the literature [7]. Tables 2 and 3 show this infor-

4. Use of MATLAB to determine the input conditions

The input conditions of the ¯ash were ®xed with MATLAB because they were not
provided by the plant information. These conditions are the saturation properties of
the system and its residual enthalpy. MATLAB was used to declare a function that
allowed this calculation. The function implements the cubical Peng Robinson equa-
tion [7]. Maxwell criterion was then used [8] to obtain the saturation pressure
518 M. Delgado, C. Pichardo / Simulation Practice and Theory 7 (1999) 515±530

Fig. 2. Pseudo bond graph of the separator.

through an iterative process. In this way, given a value of the input temperature, the
input enthalpy is calculated supposing saturated liquid is entering the ¯ash. This val-
ue is used in turn as the value of the enthalpy ¯ow.
Peng Robinson cubic equation establishes the following relation between pres-
sure, temperature and speci®c volume of a given system:
RT aa
Pˆ ÿ 2 ; …1†
v ÿ b v ‡ 2bv ÿ b2
a ˆ 0:45724R2 Tc2 =Pc ; …2†

b ˆ 0:07780RTc =Pc ; …3†

a ˆ ‰1 ‡ …0:37464 ‡ 1:54226w ÿ 0:26992w2 †…1 ÿ Tr0:5 †Š2 : …4†

Maxwell criteria establishes the following relation from the area formed by the
curve of a cubic equation in the saturation zone of a pressure vs. speci®c volume di-
agram (P ±v):
 Z vg 
P dv ˆ Psat …vg ÿ vf †; …5†
vf state equation
M. Delgado, C. Pichardo / Simulation Practice and Theory 7 (1999) 515±530 519

Table 1
Non-linear parameters of the pseudo bond graph
Parameter Expression
P ˆ exp A1 ÿ A3A‡T
h i
EL ˆ mL Cp …T ÿ Tref † ÿ …A A‡T
RT 2

…VT ÿ VL †PCp ÿ REV
T ˆ
R Tref Cp

…VL ÿ VT †Tref PCp

mV ˆ
REV ‡ …VL ÿ VT †PCp
R5;12 u ÿ…1‡…1ÿ…T =Tc ††2=7 † 2
pD2 u
t …Pc =RTc †Zra ÿ …P =RT † 4VL
m_ Lo ˆ K1 gD
4 …P =RT †Zra
ÿ…1‡…1ÿ…T =Tc ††2=7 † p D3
c c

Pc ÿ…1‡…1ÿ…T =Tc ††2=7 †

RTc ra
u ÿ…1‡…1ÿ…T =Tc ††2=7 † 2
pD2 u
t …Pc =RTc †Zra ÿ …P =RT † 4VL
H_ Lo ˆ K1 gD
4 …Pc =RTc †Zra
ÿ…1‡…1ÿ…T =Tc ††2=7 † pD3
" #
Pc ÿ…1‡…1ÿ…T =Tc ††2=7 † A2
 Z Cp …T ÿ Tref † ÿ RT 2
RTc ra …A3 ‡ T †2
2 Pc ÿ…1‡…1ÿ…T =Tc ††2=7 †
R7;14 m_ Vo ˆ K2 pD4 Z
RTc ra
ÿ RT P P

pD2 Pc ÿ…1‡…1ÿ…T =Tc ††2=7 † P P
H_ Vo ˆ K2 Zra ÿ Cp …T ÿ Tref †

Table 2
Dimensions of the separator and operation conditions
Parameter Value
VT 34.447 m3
FqF 30.113 kg/s
VqV 5.538 kg/s
LqL 24.575 kg/s
TF 266.483 K
PF 379.21 kPa
T 233.15 K
P 110.32 kPa
Tref 200 K
D 2.445 m
hL 0.1388 m
K1 0.5726
K2 0.0309
520 M. Delgado, C. Pichardo / Simulation Practice and Theory 7 (1999) 515±530

Table 3
Properties of propane
Parameter Value
Pc 4245.5175 kPa
Tc 369.8 K
w 0.152
PM 44.09
A1 5.353418
A2 1872.248
A3 ÿ25.1011
Cp 1.6794
Zra 0.2763
R 0.1886 kJ/kg K

where vg and vf are the speci®c volumes of the saturated vapor and saturated liquid,
The solution of this equation allows to obtain the work achieved (area under the
curve, determined by the integral) and the liquid volume and vapor volume from a
cubic equation.
The application of Maxwell criteria to obtain the saturation pressure implies an
iterative procedure described as follows:
1. For a given temperature, pressure is assumed. A pressure to start the iteration
could be the pressure obtained from AntoineÕs equation at a given temperature;
2. Eq. (5) is veri®ed;
3. If that is not true, another pressure is assumed that can be calculated by expres-
sion (5) as
R vg
P dv
Psat ˆ f : …6†
…vg ÿ vf †

Knowing the values of vf and vg from the procedure just explained, we could cal-
culate the compressibility factor in each phase, zf and zg .
zˆ : …7†
Then, knowing the state de®ned by the Maxwell criteria, the residual enthalpy can
be calculated from Peng Robinson equation as
" r# " p #
DH 0 aa Tr z ‡ …1 ‡ 2†B
ˆ …1 ÿ z† ‡ p 1‡m ln p ; …8†
RT 2 2RTb a z ‡ …1 ÿ 2†B
m ˆ 0:37464 ‡ 1:5422w ÿ 0:2699w2 ; …9†

B ˆ 0:07780Pr =Tr : …10†

M. Delgado, C. Pichardo / Simulation Practice and Theory 7 (1999) 515±530 521

The previous procedure was implemented in MATLAB by declaring the function:

522 M. Delgado, C. Pichardo / Simulation Practice and Theory 7 (1999) 515±530

5. Use of 20-sim to simulate the ¯ash

The bond graph model of the separator shown in Fig. 2 was implemented in 20-
SIM program. This software allows to construct the model graphically, that is, the
graph is drawn by means of a simple manage of the mouse of the computer. The pro-
gram has the typical linear elements of a true bond graph and it also allows the con-
struction of new elements with non-linear relations. The pseudo bond graph
implemented in 20-sim is shown in Fig. 3.
In Fig. 3 the special elements are shown encircled. These elements are sfe1, msfe1,
cam1, cam2, campor1 and campor2. These are not predetermined elements in the
bond graph module of 20-SIM and it was necessary to create them. The equations
that describe these elements correspond to the equations shown in Table 1. These
equations were introduced with the editor of equations of the program that allows
to de®ne them in a straightforward way. In the following, the code that describes
each element is presented.
Elements sfe1 represents a ¯ow source that has a port and also an output. Because
of this output, a special source was created with the program. The code used to des-
cribe this elements is

Fig. 3. Graph of the model implemented in the graphical editor of 20-sim.

M. Delgado, C. Pichardo / Simulation Practice and Theory 7 (1999) 515±530 523
524 M. Delgado, C. Pichardo / Simulation Practice and Theory 7 (1999) 515±530
M. Delgado, C. Pichardo / Simulation Practice and Theory 7 (1999) 515±530 525
526 M. Delgado, C. Pichardo / Simulation Practice and Theory 7 (1999) 515±530

Once the model was implemented, the simulation was done using the command
SIMULATION. The parameters of the simulation were then ®xed including the ini-
tial conditions, the simulation time, the simulation variables and the integration
method used to solve the equations.
Four types of simulations were carried out with di€erent ¯ash separators belong-
ing to the liquefaction plant. The pseudo bond graph used in all the simulations was
the same but the parameters varied depending on the operating conditions. The ®rst
type of simulation concerned the behavior of each ¯ash at start-up conditions of the
plant. The second type of simulation concerned alterations of the ¯ow and temper-
ature at the inlet of the ¯ash at start-up conditions. The third type concerned alter-
ation of the ¯ow and temperature of the inlet of the ¯ash at steady state conditions
di€erent from start-up. The fourth type of simulation concerned di€erent initial con-
ditions for the temperature and level inside the ¯ash. Only the ®rst type of simulation
is shown in this work.

6. Simulation results and analysis of results

Figs. 4±8 show the values of liquid level, temperature, pressure, exit ¯ow of steam
and exit ¯ow of liquid of the separator for the ®rst type of simulation: start-up con-

Fig. 4. Liquid level vs. time.

Fig. 5. Temperature vs. time.

M. Delgado, C. Pichardo / Simulation Practice and Theory 7 (1999) 515±530 527

Fig. 6. Pressure vs. time.

Fig. 7. Mass ¯ow of steam vs. time.

Fig. 8. Mass ¯ow of liquid vs. time.

The steady-state values obtained by simulation were compared with real opera-
tion data of the separator given by PEQUIVEN [3]. These results are shown in
Table 4.
It can be seen that the steady-state values of the simulation results correspond to
the operation real data. The variable that has greater deviation is pressure. This is a
direct consequence of the equation used to relate pressure to temperature, this is,
AntoineÕs equation. This equation is an exponential function of the temperature
528 M. Delgado, C. Pichardo / Simulation Practice and Theory 7 (1999) 515±530

Table 4
Steady-state values of the separator
Variable Simulation Operation Deviation (%)
Temperature 238.79 K 233.15 K 2.42
Pressure 140.55 kPa 110.32 kPa 27.40
Steam ¯ow 6.12 kg/s 5.54 kg/s 10.50
Liquid ¯ow 23.99 kg/s 24.58 kg/s 2.36
Liquid height 0.138 m 0.139 m 0.52

and consequently very sensible to its changes. This temperature dependency of pres-
sure explains the fact that pressure is the last variable to stabilize.

7. Conclusions

A pseudo bond graph model of a ¯ash separator was simulated and validated. It
was demonstrated that for start-up conditions, the model represented the system in
an adequate way. The validation of the model in this case was done using real plant
operation data.
The determination of the input conditions for the simulation were correctly ob-
tained with the use of MATLAB.
The simulation of the bond graph model with 20-sim was easy since we did not
have to describe the equations by means of complex diagrams. The bond graph
was drawn in the computer and the implementation of the elements was done de®n-
ing new functions in the program.
The use of MATLAB and 20-sim was very helpful in the generation of the dynam-
ic behavior of the ¯ash under study, Both programs used in conjoint constitute a
powerful tool in the study in any real process.

A cross-sectional area of the ¯ash (m2 )
A1 ; A2 ; A 3 constant of AntoineÕs equation
C4;11 ®eld C that represents the accumulation in liquid phase
C16;13 ®eld C that represents the accumulation in vapor phase
Cp propaneÕs heat capacity (kJ/kg K)
D ¯ashÕs diameter (m)
E accumulated energy within the tank (kJ)
EL accumulated energy within the tank associated to the liquid phase (kJ)
EV energy accumulated inside the tank associated to the vapor phase (kJ)
F volumetric input ¯ow to the ¯ash (m3 /seg)
g gravity acceleration (9.8 m/seg2 )
hL liquid level inside the tank (m)
hT total height of the tank (m)
HF enthalpy of the input ¯ow to the ¯ash (kJ/kg)
M. Delgado, C. Pichardo / Simulation Practice and Theory 7 (1999) 515±530 529

HL speci®c enthalpy of the liquid in the ¯ash (kJ/kg)

HT total enthalpy inside the tank (kJ/kg)
HV speci®c enthalpy of the vapor in ¯ash (kJ/kg)
H_ enthalpy ¯ow (kJ/s)
H_ L enthalpy ¯ow of the liquid phase (kJ/s)
H_ V enthalpy ¯ow of the vapor phase (kJ/s)
K1 constant for the calculus of the output liquid ¯ow
K2 constant for the calculus of the output vapor ¯ow
L output liquid volumetric ¯ow of the ¯ash (m3 /seg)
m mass (kg)
m_ mass ¯ow (kg/s)
MSf controlled ¯ow source
NFr adimensional Froude number
P pressure of the system ˆ vapor pressure ˆ liquid pressure ˆ balance
pressure (kPa)
Pc critical pressure (kPa)
PF pressure of the input ¯ow to the ¯ash (kPa)
PM molecular weight (kg/kmol)
Psat saturation pressure (kPa)
R ideal gas constant ˆ 8.3144 kJ/kmol K
R5;12 ®eld R that represents the output ¯ow in liquid phase
R7;14 ®eld R that represents the output ¯ow in vapor phase
Sf ¯ow source
t time (s)
T temperature of the system (K)
Tc critical temperature (K)
TF temperature of the input ¯ow to the ¯ash (K)
Tref reference temperature (K)
V output vapor volumetric ¯ow of the ¯ash (m3 /seg)
VL volume of the liquid inside the ¯ash (m3 )
VT total volume of the ¯ash (m3 )
VV volume of the vapor within ¯ash (m3 )
Zra constant of the Rackett equation
Greek letters
q density (kg/m3 )
qF density of the input ¯ow from the ¯ash (kg/m3 )
qL density of the liquid in the ¯ash (kg/m3 )
qV density of the vapor in the ¯ash (kg/m3 )
F input ¯ow to the ¯ash
V vapor
L liquid
Vo vapor output
Lo liquid output
530 M. Delgado, C. Pichardo / Simulation Practice and Theory 7 (1999) 515±530


This work was sponsored by Decanato de Investigaciones of Universidad Sim



[1] Controllab Products, 20-sim for Microsoft Windows version 2.0, http://www.rt.el.utwente.nl/20sim/.
[2] Mathworks, MATLAB 4.2 for Microsoft Windows version 4.00.950, Copyright 1990±1995 (1993).
[3] PEQUIVEN, Manuales de Stanford correspondientes a los procesos de gas natural licuado (NGL
process), Centro de Infromaci
on de PEQUIVEN, 1976.
[4] D. Karnopp, D. Margolis, R. Rosenberg, System Dynamics: A Uni®ed Approach, Wiley, New York,
[5] C. Pichardo, M. Delgado, Modeling and simulation of an industrial ¯ash separator using pseudo bond
graphs, in: Proceedings of Computational Engineering in Systems Application, vol. 1, 1998, pp. 552±
[6] C. Pichardo, M. Delgado, Pseudo Bond Graph Model and Simulation of an Industrial Flash
Separator, in preparation.
[7] R. Perry, Chemical Engineering Manual, Mc Graw-Hill, New York, 1993, pp. 13±23.
[8] H. Guerrero, Problemario de Termodin amica II y III, Universidad Sim on Bolõvar, 4ta edici
Venezuela, 1994.