Module - 1 - Models in Engineering and Equation Forms
Module - 1 - Models in Engineering and Equation Forms
Contents
1 Introduction
. . . . . . .
. . . . . . .
. . . . . . .
(ODE-IVP)
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
5
5
6
9
11
21
4 Summary
28
23
Introduction
A modern chemical plant consists of interconnected units such as heat exchangers, reactors, distillation columns, mixers etc. with high degree of integration to achieve energy
e ciency. Design and operation of such complex plants is a challenging problem. Mathematical modeling and simulation is a cost eective method of designing or understanding
behavior of these chemical plants when compared to study through experiments. Mathematical modeling cannot substitute experimentation, however, it can be eectively used to
plan the experiments or creating scenarios under dierent operating conditions. Thus, best
approach to solving most chemical engineering problems involves judicious combination of
mathematical modeling and carefully planned experiments.
To begin with, let us look at types of problems that can arise in context of modeling and
simulation. Consider a typical small chemical plant consisting of a reactor and a distillation
column, which is used to separate the product as overhead (see Figure 1). The reactants,
which are separated as bottom product of the distillation column, are recycled to the reactor.
We can identify following problems
Process Design problem
Given: Desired product composition, raw material composition and availability.
To Find: Raw material ow rates, reactor volume and operating conditions (temperature, pressure etc.), distillation column conguration (feed locations and product
draws), reboiler,condenser sizes and operating conditions (recycle and reux ows,
steam ow rate, operating temperatures and pressure etc.)
2
2.1
Plant wide or section wide mass balances are carried out at design stage or later during
operation for keeping material audit. These models are typical examples of systems of
simultaneous linear algebraic equations..
Example 1 Recovery of acetone from air -acetone mixture is achieved using an absorber and
a ash separator (Figure 2). A model for this system is developed under following conditions
All acetone is absorbed in water
Air entering the absorber contains no water vapor
Air leaving the absorber contains 3 mass % water vapor
The ash separator acts as a single equilibrium stage such that acetone mass fraction in
vapor and liquid leaving the ash separator is related by relation
(1)
y = 20:5x
where y mass fraction of the acetone in the vapor stream and x mass fraction of the acetone
in the liquid stream. Operating conditions of the process are as follows
Air in ow: 600 lb/hr with 8 mass % acetone
Water ow rate: 500 lb/hr
It is required that the waste water should have acetone content of 3 mass % and we are
required to determine concentration of the acetone in the vapor stream and ow rates of the
product streams.
Mass Balance:
(Air)
0:92Ai = 0:97Ao
(Acetone)
0:08 Ai = 0:03 L + y V
W = 0:03 Ao + (1
y)V + 0:97L
(Water)
(Design requirement)
x = 0:03
(2)
(3)
(4)
(5)
Equilibrium Relation:
(6)
y = 20:5 x
)
y = 20:5
5
0:03 = 0:615
(7)
have
0:92
0:08
500
3
600
7
600 5
(8)
The above model is a typical example of system of linear algebraic equations, which have
to be solved simultaneously. The above equation can be represented in abstract form set of
linear algebraic equations
(9)
Ax = b
where x and b are a (n
2.2
n) matrix.
of the liquid feed at Tf , the liquid will partially vaporize and two phases at the equilibrium
with each other will be present in the ash drum. The equilibrium relationships are
Temperature of the liquid phase = temperature of the vapor phase.
Pressure of the liquid phase = pressure of the vapor phase.
Chemical potential of the i0 th component in the liquid phase = Chemical potential of
the i0 th component in the vapor phase
in liquid phase and yi represent mole fraction of the component i in vapor phase. Model
equations for the ash vaporizer are
Equilibrium relationships
ki = yi =xi
(10)
(i = 1; 2; 3)
F =L+V
Component balance
zi F = xi L + yi V
X
(i = 1; 2; 3)
(12)
(13)
= xi L + ki xi V
(14)
xi = 1
Note that this results in a set of simultaneous 5 nonlinear algebraic equations in 5 unknowns Equations (11-14) can be written in abstract form as follows
f1 (x1 ; x2 ; x3 ; L; V ) = 0
(15)
f2 (x1 ; x2 ; x3 ; L; V ) = 0
(16)
::::::::::::::::::: = 0
(17)
f5 (x1 ; x2 ; x3 ; L; V ) = 0
Using
V
F
(ki
1)
zi
1 + (V =F ) (ki
1)
xi = zi = 1 +
xi = 1;we have
f (V =F ) =
1=0
(19)
(20)
(21)
(22)
where 0 represents n
vector dened as
F (x) =
2.3
(23)
iT
(24)
Variety of modeling and design problems in chemical engineering are formulated as optimization problems.
Example 3 Consider a simple reaction
A!B
modelled using the following reaction rate equation
ra =
E
)
RT
(25)
N
X
i=1
rai
E
ko (Cai ) exp(
)
RTi
(26)
is minimized with respect to {ko ; E; n}. Suppose we use rbai to denote the estimated reaction
rate
E
n
)
(27)
rbai = ko Cai
exp(
R Ti
then, the problem is to choose parameters {ko ; E; n} such that the sum of the square of errors
between the measured and estimated rates is minimum, i.e.
M in
ko ; E; n
(ko ; E; n) =
N
X
i=1
[ rai
( rbai )]2
(28)
2.4
For most of the processing systems of interest to the chemical engineer, there are three
fundamental quantities :mass, energy and momentum. These quantities can be characterized
by variables such as density, concentration, temperature, pressure and ow rate. These
characterizing variables are called as state of the processing system. The equations that
relate the state variables (dependent variables) to the independent variables are derived
from application of conservation principle on the fundamental quantities and are called the
state equations.
Let quantity S denote any one of the fundamental quantities
11
Total mass
Mass of the individual components
Total energy.
Momentum
Then, the principles of the conservation of the quantity S states that:
Accumulation of S within a system
Flow of S in the system Flow of S out of the system
=
Time Period
Time Period
Time Period
Amount of S generated within the system
+
Time Period
Amount of S consumed within the system
Time Period
Figure 6 shows schematic diagram of a general system and its interaction with external
world. Typical dynamic model equations are as follows:
Total Mass Balance
X
d( V )
=
i Fi
dt
i:inlet
j Fj
j:outlet
Caj Fi
rV
(30)
X
d(U + K + P ) X
dH
dE
=
=
Q WS '
i Fi hi
j Fj hj
dt
dt
dt
Variables and parameters appearing in these equations are are described in Table 3.
By convention, a quantity is considered positive if it ows in and negative if it ows out.
The state equations with the associated variables constitute a lumped parameter mathematical modelof a process, which yields the dynamic or static behavior of the process. The
application of the conservation principle stated above will yield a set of dierential equations
with the fundamental quantities as the dependent variables and time as independent variable. The solution of the dierential equations will determine how the state variables change
with time i.e., it will determine the dynamic behavior of the process. The process is said to
be at the steady state if the state variables do not change with time. In this case, the rate
of accumulation of the fundamental quantity S is zero and the resulting balance yields a set
of algebraic equations
12
i
j
V
Fi:
Fj:
na
CA
CAi
CAj
r
hi
hi
U; K; P
Q
WS
inlet
outlet
Density of the material in the system
Density of the material in the ith inlet stream
Density of the material in the jth outlet stream
Total volume of the system
Volumetric ow rate of the ith inlet stream
Volumetric ow rate of the jth outlet stream
Number of moles of the component A in the system
Molal concentration ( moles /volume)of A in the system
Molal concentration ( moles /volume)of A in the ith inlet stream
Molal concentration ( moles /volume)of A in the jth outlet stream
Reaction rate per unit volume of the component A in the system.
Specic enthalpy of the material in the ith inlet stream
Specic enthalpy of the material in the jth outlet stream
Internal, kinetic and potential energies of the system, respectively.
Amount of the heat exchanged between the system and the surroundings per unit time
Shaft work exchanged between the system and its surroundings.
13
Example 5 Stirred Tank Heater System (Figure 7): Total momentum of the system
remains constant and will not be considered. Total mass balance: Total mass in the tank at
any time t = V = Ah where A represents cross sectional area.
d ( Ah)
= Fi
F
dt
Assuming that the density is independent of the temperature,
dh
= Fi F
dt
Now, ow out due to the gravity is also a function of height
p
F =k h
A
(31)
(32)
Thus,
p
dh
+ k h = Fi
dt
Total energy of liquid in the tank is given by
A
E =U +K +P
However, since tank does not move
dK
dP
=
=0;
dt
dt
14
dE
dU
=
dt
dt
(33)
(34)
Tref ) = AhCp (T
(35)
Tref )
Tref represents reference temperature where the specic enthalpy of the liquid is assumed to
be zero. Now, using the energy conservation principle
d ( AhCp (T
dt
Tref ))
= Fi Cp (Ti
Tref )
F Cp (T
Tref ) + Q
(36)
where Q is the amount of heat supplied by the steam per unit time. Assuming Tref = 0, we
have
d(hT )
Q
A
= Fi Ti F T +
(37)
dt
Cp
A
d(hT )
dT
dh
= Ah
+ AT
dt
dt
dt
dT
= Ah
+ T (Fi F )
dt
Q
= Fi Ti F T +
Cp
Or
Ah
dT
= Fi (Ti
dt
T) +
Q
Cp
15
(38)
(39)
(40)
(41)
17
dCA2
= F (CA1 CA2 ) kV2 CA2
dt
dCA3
V3
= F (CA2 CA3 ) kV3 CA3
dt
we can re arrange the above set of equations
32
(k + 1= 1 )
0
0
76
1=
(k + 1= 2 )
0
54
0
1=
(k + 1= 3 )
(43)
V2
Dening
2
CA1
d 6
4 CA2
dt
CA3
= F=V;
3 2
7 6
5=4
(44)
as
3 2
CA1
1=
7 6
CA2 5+4 0
CA3
0
7
5 CA0 (45)
(47)
x = x(0) at t = 0
and generate trajectories x(t) ( i.e. CA1 (t); CA2 (t) and CA3 (t)) over interval [0; tf ]: This is
a typical problem of dynamic simulation of lumped parameter system.
Example 7 Continuous Fermenter: Consider a continuously operated fermenter described by the following set of ODEs
dX
= F1 (X; S; P; D; Sf ) =
dt
dS
= F2 (X; S; P; D; Sf ) = D(Sf
dt
(48)
DX + X
S)
1
YX=S
(49)
dP
= F3 (X; S; P; D; Sf ) = DP + ( + )X
(50)
dt
where X represents e- uent cell-mass or biomass concentration, S represents substrate concentration and P denotes product concentration. It is assumed that product concentration
(S) and the cell-mass concentration (X) are measured process outputs while dilution rate
(D) and the feed substrate concentration (Sf ) are process inputs which can be manipulated.
Model parameter represents the specic growth rate, YX=S represents the cell-mass yield,
and are the yield parameters for the product. The specic growth rate model is allowed to
exhibit both substrate and product inhibition:
P
)S
Pm
=
S2
Km + S +
Ki
m (1
18
(51)
where m represents maximum specic growth rate, Pm represents product saturation constant;
Km substrate saturation constant and the Ki represents substrate inhibition constant: Dening state and input vectors as
x=
X S P
iT
; u=
D Sf
iT
dx
= F (x; u)
dt
(52)
(53)
(54)
x(0) = x0
(55)
In other words, a forced dynamic systems can be looked upon as unforced systems with
variable parameters.
The model we considered above did not contain variation of the variables with respect to
space. Such models are called as Lumped parameter modelsand are described by ordinary
dierential equations of the form
dx1
= f1 (x1 (t); x2 (t); :::; xn (t); u1 (t); u2 (t); :::; um (t))
dt
::::::::::::::::::::::::::::::::::::::::::::::::::::
dxn
= fn (x1 (t); x2 (t); ::::; xn (t); u1 (t); u2 (t); :::; um (t))
dt
x1 (0) = x1 ; ::::; xn (0) = xn (Initial conditions)
19
(56)
(57)
where x1; ::::; xn denote the state (or dependent) variables and u1 (t); ::; un (t) are denote independent inputs (or forcing functions) specied for t
0. Using vector notation, we can
write the above set of ODEs in more compact form
dx
= F (x; u)
dt
x(0) = x0
(58)
(59)
where
x(t) = [x1 (t):::::xn (t)]T 2 Rn
(60)
(61)
(62)
= 0:
F (x; u) = 0
obtained by setting dx=dt = 0 where 0 represents n
1 zero vector.
over interval 0
(64)
(65)
(66)
20
(67)
Another important class of problems that arise in process engineering is a set of coupled
dierential algebraic equations. In this section, we discuss two examples belonging to this
class.
Example 8 The process is a continuously stirred tank reactor, where a feed with unknown
pH is owing into the reactor. We add a basic solution, with known molarity, to the reactor
to maintain the pH at a desired level. The ow-rate of the basic solution is the manipulated
variable. The process is modelled using the following set of DAEs:V dN +
= m Cr (F + m)N +
dt
[H + ]3 + (Ka + N + )[H + ]2 +
(N + Ka
Kw KaU )H +
(68)
(69)
KaKw = 0
where N + is the concentration of the cation of the base in the CSTR and is the dierential
state, while hydrogen ion concentration, (H + ), is the algebraic state. The parameters and
initial conditions are summarized in Table 4.
Example 9 The system presented here models the galvanostatic charge process of a thin
lm nickel hydroxide electrode. The rate of change of the mole fraction of nickel hydroxide
21
is (y1 ) given by
V dy1
j1
=
W dt
F
j1 + j2 iapp = 0
(70)
(71)
where
j1 = io1 [2(1
y1 ) exp(
exp(
0:5F
(y2
RT
0:5F
(y2
RT
eq;1 ))
2y1
(72)
eq;1 ))]
F
F
(y2
exp(
(y2
(73)
eq;2 ))
eq;2 ))]
RT
RT
where y2 is the potential dierence at the solid liquid interface. (70) is the species balance
while (71) denotes the charge balance. j1 and j2 are derived from Butler-Volmer kinetics.
The parameters and initial condition values are summarized in Table 5.
j2 = io2 [exp(
Initial Conditions
Value
96487 C/mol
8.314 J/molK
298.15 K
0.420 V
0.303 V
3.4g/cm3
92.7 g/mol
1 10 5 cm
1 10 5 A=cm2
1 10 4 A=cm2
1 10 8 A=cm2
Initial Value
0.35024
0.4074
0.5322
0.4254
A general nonlinear DAE system of equations, which are often encountered in process
applications, can be described by the following general form of coupled dierential and
22
algebraic equations
dx(t)
= f (x; z; u)
dt
g(x;z; u) = 0
(74)
x 2 Rnd are the dierential states of the process, z 2 Rna are the algebraic states of the
process and u 2 Ru are the input variables. It is important to note that the initial condition,
x(0) = x0 ; in this case has to be consistent with z(0) = z0 ; such that the algebraic constraints
are satised
g(x0 ; z0 ; u(0)) = 0
This class of problems need separate treatment while developing numerical solution schemes.
3.1
Most of the systems encountered in chemical engineering are distributed parameter systems.
Even though behavior of some of these systems can be adequately represented by lumped
parameter models, such simplifying assumptions may fail to provide accurate picture of
system behavior in many situations and variations of variables along time and space have to
be considered while modeling. This typically results in a set of partial dierential equations.
Example 10 Consider the double pipe heat exchanger in which a liquid owing in the inner
tube is heated by steam owing countercurrently around the tube (Figure 10). The temperature
in the pipe changes not only with time but also along the axial direction z. While developing
the model, it is assumed that the temperature does not change along the radius of the pipe.
Consequently , we have only two independent variables, i.e. z and t. To perform the energy
balance,we consider an element of length z as shown in the gure. For this element, over
a period of time t
Cp A z[(T )t+
(T )t ] = Cp V A(T )z t
Cp V A(T )z+
t + Q t( D z)
(75)
A:
cross section area of the inner tube.
V :
average velocity of the liquid(assumed constant).
D:
external diameter of the inner tube.
Dividing both the sides by ( z t) and taking limit as t ! 0 and
Cp A
@T (z; t)
@T (z; t)
=
Cp V A
+ DQ
@t
@z
Q = U [Tst T ]
z ! 0, we have
(76)
(77)
Boundary conditions:
T (t; z = 0) = T1 f ort
Initial condition
(78)
T (t = 0; z) = T0 (0; z)
Steady State Simulation: Find T (z) given T (z = 0) = T1 when @T =@t = 0; i.e. solve for
@T
= DQ = DQU (Tst
@z
T (0) = T1
Cp V A
T)
(79)
(80)
This results in a ODE-IVP, which can be solved to obtain steady state proles T (z) for
specied heat load and liquid velocity.
24
Dynamic Simulation
Cp A
@T
=
@t
@T
+ DQ
@z
(81)
0 : Boundary condition
(82)
Cp V A
with
T (t; 0) = T1 at z = 0 and t
T (0; z) = T0 (z)
(83)
This results in a Partial Dierential Equation (PDE) model for the distributed parameter
system.
Example 11 Now, let us consider the situation where the some hot liquid is used on the
shell side to heat the tube side uid (see Figure 11). The model equations for this case can
be stated as
@Tt (z; t)
@Tt (z; t)
=
+ DQ(z; t)
t Cpt Vt At
@t
@z
@Ts (z; t)
@Ts (z; t)
= s Cps Vs As
DQ(z; t)
s Cpt As
@t
@z
Q(z; t) = U [Ts (z; t) Tt (z; t)]
t Cpt At
(84)
(85)
(86)
where subscript t denotes tube side and subscript s denotes shell side. The initial and boundary conditions become
Tt (t; 0) = Tt0 at z = 0 and t
0 : Boundary condition
: Initial temperature prole
(87)
(88)
0 : Boundary condition
: Initial temperature prole
(89)
(90)
These are coupled PDEs and have to be solved simultaneously to understand the transient
behavior. The steady state problem can be stated as
dTt (z; t)
= DU [Ts (z) Tt (z)]
dz
dTs (z; t)
= DU [Ts (z) Tt (z)]
s Cps Vs As
dz
Tt (0) = Tt0 at z = 0
t Cpt Vt At
Ts (1) = Ts1 at z = 1
(91)
(92)
(93)
(94)
Equations (91-92) represent coupled ordinary dierential equations. The need to compute
steady state proles for the counter-current double pipe heat exchanger results in a boundary
value problem (ODE-BVP) as one variable is specied at z = 0 while the other is specied
at z = 1:
Before we conclude this section, we briey review some terminology associated with
PDEs, which will be used in the later modules.
Denition 12 Order of PDE: Order of a PDE is highest order of derivative occurring in
PDE.
Denition 13 Degree of PDE: Power to which highest order derivative is raised.
Example 14 Consider PDE
(95)
Here, the Oredr = 2 and Degree = n: Solutions of PDEs are sought such that it is
satised in the domain and on the boundaries. A problem is said to be well posed when the
solution is uniquely determined and it is su ciently smooth and dierentiable function of the
independent variables. The boundary conditions have to be consistent with one another in
order for a problem to be well posed. This implies that at the points common to boundaries,
the conditions should not violet each other.
A linear PDE can be classied as:
Homogeneous equations:Dierential equation that does not contain any terms other
than dependent variables and their derivatives.
26
(96)
@ 2 u=@x2 + @ 2 u=@y 2 = 0
Non homogeneous equations: Contain terms other than dependent variables
@u=@t = @ 2 u=@x2 + sin x
(97)
(98)
aij
@2u
= f [@u=@x1 ; :::; @u=@x4 ; ; u; x1 ; ::::; x4 ]
@xi @xj
(99)
aij are assumed to be independent of 0 u0 and its derivative. They can be functions of (xi ).
aij can always be written as aij = aji for i 6= j as
@2u
@2u
=
@xi @xj
@xj @xi
(100)
Thus, aij are elements of a real symmetric matrix A. Obviously A has real eigen values. The
PDE is called
Elliptic: if all eigenvalues are +ve or-ve.
Hyperbolic: if some eigenvalues are +ve and rest are -ve.
Parabolic: if at-least one eigen value is zero.
27
The classication is global if aij are independent of xi , else it is local. Typical partial
dierential equations we come across in engineering applications are of the form
r2 u = a
@2u
@u
+ b 2 + cu + f (x1 ; x2 ; x3 ; t)
@t
@t
(101)
subject to appropriate boundary conditions and initial conditions. This PDE is solved in a
three dimensional region V , which can be bounded or unbounded. The boundary of V is
denoted by S: On the spatial surface S; we have boundary conditions of the form
( (s; t) n
b) :ru + (s; t)u = h(s; t)
(102)
where n
b is the outward normal direction to S and s represents spatial coordinate along S:
We can classify the PDEs as follows
Elliptic: a = b = 0
Parabolic: a 6= 0; b = 0
Hyperbolic: b > 0
Elliptic Problems typically arise while studying steady-state behavior of diusive systems. Parabolic or hyperbolic problems typically arise when studying transient behavior of
diusive systems.
Summary
This module introduces dierent basic forms of equations through examples of steady state
and dynamic models of simple unit operations in chemical processing. The following abstract
equation forms / formulations have been identied
Linear algebraic equations
Nonlinear algebraic equations
Optimization based estimation / formulations
Ordinary Dierential Equations : Initial Value Problem (ODE-IVP)
Dierential Algebraic Equations (DAE)
Ordinary Dierential Equations : Boundary Value Problem (ODE-BVP)
28
29