You are on page 1of 37

Moi University

School of Engineering
Department of Chemical & Process
Engineering

CHP 445:
PROCESS MODELLING &
SIMULATION

Osembo S Otieno
Office: T 76
Ext.: 496

CHP 445: Process Modelling & Simulation


Course Content

Introduction: definition of a process model, model of a typical system; strategy for model
development; classes of models; procedure for model building. Physico-chemical (functional)
models.
Numerical solution techniques for system of algebraic equations, ordinary differential equations,
and partial differential equations.
Numerical simulation of a process system using one of the programming languages (e.g.
PASCAL, FORTRAN, C++).
Computational simulation of chemical processes using the softwares (e.g. ASPEN PLUS,
FLUENT, PROSIM).

Course Plan
Week 1
Week 2
Week 3
Week 4
Week 5
Week 6
Week 7
Week 8
Week 9
Week 10
Week 11
Week 12
Week 13

Registration
Introduction, classes of models, model of a typical system
Strategy for model development, procedure for model building
Physico-chemical models
CAT I
Numerical solution techniques for algebraic equations and polynomials
Numerical solution techniques for ODE and PDE
CAT II
Computational simulation packages review
Numerical simulation of a process system using programming language
Presentation of assignment
Presentation of assignment
Revision

Assessment:
S/No
1
2
3
4

Item
Semester Exam
CAT I & II
Assignments
Class participation

Mark, %
40
20
20
20

List of Useful Books


1. Process Modeling, Simulation & Control for Chemical Engineers
W.L. Luyben
International Student Edition
McGraw-Hill, London

2. Process Dynamics: Modelling, Analysis & Simulation


B. Wayne Bequette
Prentice Hall PTR, New Jersey 07458, 1998
ISBN 0-13-206889-3
3. Process Modeling
Morton M Denn
Longman, 1986
ISBN 0-582-00556-6
4. Process Modelling & Simulation
R.W. Gaikwad, Dr. Dhirendra
Central Techno Publications, Nagpur, 2003
ISBN 81-87316-71-3
5. Chemical Process Modelling and Computer Simulation
Amiya K. Jana
Prentice-Hall of India Private Ltd, New Delhi, 2008
ISBN 978-81-203-3196-9
6. Problem Solving in Chemical Engineering with Numerical Methods
Michael B. Cutlip, Mordechai Shacham
Prentice Hall PTR, London, 2000
ISBN 0-13-862566-2
7. Numerical Methods for Engineers 3rd Ed.
Steven C. Chapra, Raymond P. Canale
McGraw-Hill, Boston, 1998
ISBN 0-07-010938-9

Chapter One

Introduction
Engineers, particularly process engineers, are symbolic analysts 1. Process engineers use fundamental
scientific principles as a basis for mathematical models that characterise the behaviour of a chemical
process. Symbols are used to represent physical variables, such as pressure temperature or concentration.
Input information is specified and numerical algorithms are used to solve the models (simulating a
physical system). Process engineers analyse the results of these simulations to make decisions or
recommendations regarding the design or operation of a process.
Process engineers are responsible for technical troubleshooting in the day-to-day operations of a
particular chemical process. Some are responsible for designing feed back control systems so that
process variables (such as temperature or pressure) can be maintained at desired values. Others may be
responsible for redesigning a chemical process to provide more profitability. All these require an
understanding of time-dependent (dynamic) behaviour of a chemical process.
Working definition: Process Model
A Process model is a set of equations (including necessary input data to solve the equations) that allows one to
predict the behaviour of a chemical process system.

It is presumed that each variable appearing in the equations of the model can be identified with an entity
associated with the process; each entity must be measurable, at least in principle. A quantity that can
never be measured in principle has no physical meaning.

1.1 Classification of Models


There are three identifiable methodologies used to obtain the equations for a mathematical model. These
can be categorised as follows:
1. Fundamental: Use of fundamental or first principles models, based on known physical-chemical
relationships. This includes the conservation of mass, conservation of energy, reaction kinetics,
transport phenomena, and thermodynamic relationships.
2. Empirical: Use direct observations to develop equations that describe the experiments. An
empirical model is simply an equation that records the relationship between system inputs and
outputs. An empirical model might be used if the process is too complex for fundamental model.
3. Analogy: Use the equations describing a system believed to be analogous, with variables
identified by analogy on one-to-one basis. The essence of modelling by analogy is identifying a
1

Symbolic analysts solve, identify and broker problems by manipulating symbols. They simplify reality into abstract
images that can be rearranged, juggled, experimented with, communicated to other specialists, and then, eventually,
transformed back into reality. The manipulations are done with analytic tools, shaped by experience. The tools may be
mathematical algorithms, legal arguments, financial gimmicks, scientific principles, psychological insights about how to
persuade or amuse, systems of induction or deduction, or any other set of techniques for doing conceptual puzzles. (italics
added for emphasis)

well-understood process that seems to have the essential features of the process of interest. This
form of modelling is too specialised and intuitive.
Generally, the preferred models are those based on fundamental knowledge of chemical-physical
relationships. Fundamental models will generally be accurate over a much larger range of conditions
than empirical models. Empirical models, also known as black box models, may be useful for
interpolation but are generally not used for extrapolation; i.e., an empirical model will only be used
over the range of conditions used for the fit of the data.
As a result focus will be on fundamental models (also known as theoretical models), with particular
attention to the logical structure of model development and simplification (system analysis). However, it
is important to note that elements of empiricism and analogy, in even the most fundamental models, are
found. This presence is a major factor in the process of validation.
In addition to the above classification, models can generally be grouped according to;
Linear/non-linear
Steady state/unsteady state
Lumped parameter/distributed parameter
Continuous/discrete variables
Linear vs nonlinear models. If the output, y, of a subsystem is completely determined by the input, x,
the parameters of the subsystem and the initial and boundary conditions, in general sense can be
represent the subsystem symbolically by

y = H (x )

1.1

where H represents any form of conversion of x into y.


Suppose that two separate inputs are applied simultaneously to the subsystem so that

u = H ( x1 + x 2 ) = H ( x1 ) + H ( x 2 ) = y 1 + y 2

1.2

H is then, by definition a linear operator. Operations involving inverse, square, exponential and natural
logarithm are plotted in Fig. 1.1. It can be seen that all of them are nonlinear operators, especially for
small values of independent variable. Therefore, equations are linear if the independent variables or their
derivatives appear only to the first power otherwise they are nonlinear. A system is termed linear if its
operator H is linear and the model of a linear system, which is represented by linear equations and
boundary conditions, is called linear model. Otherwise the model is nonlinear.

1.200

450

y = x -1
R2 = 1

y = x2
R2 = 1

400

1.000
350
0.800

300
250

0.600
200
0.400

150
100

0.200
50
0.000

0
0

10

15

20

25

10

15

20

25

20

25

3.5

450
x

y=e
R2 = 1

400

350

2.5

300
2
250
200

1.5

150

100

y = Ln(x)
R2 = 1

0.5

50
0

0
0

10

15

Fig. 1.1. Plot of some nonlinear operations (inverse, square, exponential and logarithm)

Steady state vs unsteady state. Steady state means that the accumulation terms in the various balances
of interest are zero. In each balance, if the boundary conditions are time independent, the dependent
variables within the system can gradually reach constant values with respect to time at a given point.
Standard Chemical Engineering design techniques for unit operation, reaction kinetics and so on have
been dealt entirely with steady state operations. When process control began to be extensively
considered, it was found that non steady state operations were of significance. To design a plant on the
basis of steady state information and then to add controls afterwards is now felt to be inadequate; both
the units and control system should be designed together.
A typical example of unsteady state process might be the start-up of a distillation column, which would
eventually reach a steady state set of operating conditions. In fact, when examined in detail, the column
always will prove to be operating in the unsteady state with minor fluctuations in temperature,
composition, etc, taking place all the time, but possibly ranging about average steady state values.
Distributed vs lumped parameter. A lumped parameter representation means that spatial variations are
ignored and the various properties and the state (dependent variables) of the system can be considered
homogeneous throughout the entire system. A distributed parameter on the other hand, takes into
account detailed variations in behaviour from point to point throughout the system. All the real systems
are of course, distributed in that there are some variations throughout them. Many times, however, the
variations are relatively small, so they may be ignored and the system may then be lumped.

It is difficult to decide whether to lump a parameter, but the rule of the thumb is that if the response of
the element is for all practical purposes instantaneous throughout the element, then the element
parameter can be lumped. If the response shows instantaneous differences along the element, then it
should not be. By response is meant the velocity of propagation of the input through the element.
Continuous vs discrete variables. Continuous means that a variable can assume any value within an
interval, discrete means the variable can take only distinct values in the interval.
Modelling can be valuable because it is an abstraction and help avoid repetitive experimentations and
observations. However, the potential cost and time savings must be weighed against the fact that the
model only imitates reality and does not incorporate all features of the real system being modelled.

1.2 How Models are used


Given a set of input data, a model is used to predict the output response. A model is used to solve the
following types of problems:

Synthesis, what process can be used to manufacture a product?


Design, what type and size of equipment is required to produce a product?
Operation, what operating conditions will maximise the yield of a product?
Control, how can a process input be manipulated to maintain a measured process output at a
desired value?
Safety, if an equipment failure occurs, what will be the impact on the operating personnel and
other process equipment?
Environment, how long will it take to biodegrade hazardous waste?
Allocation, if there are several sources of raw materials, and several manufacturing plants, how
can the raw materials be distributed among the plants, and what products can each plant
produce?
Marketing, if the price of a product is increased, how much will the demand decrease?

Many of the models cited above are based on a steady-state analysis. Previously, chemical process
design was based solely on steady-state analysis. However, it is important to consider the dynamic
operability characteristics of a process during the design phase. Also, batch processes that are commonly
used in the pharmaceutical or specialty chemical industries are inherently dynamic and cannot be
simulated with steady-state models.
Mathematical models consist of the following types of equations (including combinations)

Algebraic equations
Ordinary differential equations (ODEs)
Partial differential equations (PDEs)

The ODEs generally result from macroscopic balances around processes, with assumption of a perfectly
mixed system. To find the steady-state solution of a set of ODEs, then a set of algebraic equations has to
be solved. PDE models result from microscopic balances.

Chapter Two

Constructing a Model
2.1 Model Building
Model building can be divided into four phases
Problem definition and formulation
Preliminary and detailed analysis
Evaluation phase
Application

Fig. 2.1. Steps in model building

Problem definition and formulation phase. In this phase the problem to solved must be defined and
important elements that pertain to the problem and its solution identified. The degree of accuracy needed

in the model and the potential uses of the model must be determined. One must also evaluate the
structure and complexity of the model and ascertain
Number of independent variables to be included in the model
Number of independent equations required to describe the system
Number of unknown parameters in the model
The fundamental physical and chemical laws are used in their general form with time derivatives
included in order to study dynamics of the system. Reasonable assumptions are made to simplify the
model without which the model could be too complex that would take a long time to develop and might
be impossible to solve. The assumptions that are made should be carefully considered and listed. They
pose limitations on the model that should always be kept in mind when evaluating its predicted results.
It is usually a good idea to make sure that the number of variables equals the number of equations. This
means that degree of freedom of the system must be zero in order to obtain a solution. Checking to see
that the units of all terms in the equations are consistent is essential particularly the time units of
parameters in dynamic models. A sketch of a logical flow diagram for modelling is shown in Fig. 2.2.

Before carrying out actual modelling work, it is important to evaluate the economical justification for
the effort of modelling and the capacity of the supporting staff for carrying out such a project. The
available solution techniques and tools must be kept in mind as a mathematical model is developed.
Design phase. This phase involves specification of the information content, general description of the
programming logic and algorithms necessary to develop and employ a useful model, formulation of the
mathematical description of such model and simulation of the model.
First define input and output variables and determine the system. Also select the specific mathematical
representation to be used in the model, as well as the assumptions and limitations of the model resulting
from its translation into actual computer code. Specify computer input/output media, develop program
logic and flow-sheets and define program modules and their relationships. Use of existing subroutines
and databases saves a lot of time.
Evaluation phase. This phase is intended as a final check of the model. Testing of individual models
elements should be conducted during the earlier phases. Evaluation of model is carried out according to
the evaluation criteria and test plan established in the problem definition phase. Next carry out
sensitivity testing of model inputs and parameters and determine if the apparent relationships are
physically meaningful. Use actual data in the model when possible. This step is also referred to as
diagnostic checking, and may entail statistical analysis of the fitted parameters.

Model validation consists of three parts


Validation of logic
Validation of model assumptions
Validation of model behaviour

Physical situation

Selection of fundamental
dependent variables

Selection of state dependent


variables

No

Selection of control
volume

Application of
conservation principles

Conservation
principles fully
exploited?

No

Enough
equations?

Yes

Mathematical model

Yes
Constitutive relation
Fig. 2.2. Model development flow diagram

These works involve comparison with historical input-output data, or data in the literature, comparison
with pilot plant performance, and simulation. In general, data used in formulating a model should not be
used to validate it if at all possible, because model evaluation involves multiple criteria, it is helpful to
obtain expert opinion in the verification of models. No single validation process/procedure is appropriate
for all models.

2.2 Variables
In most problems of interest, there is a need to describe system response in space and/or time. These are
independent variables, since arbitrary values (within physically acceptable bounds) can be assigned to
them and it is expected that the model will contain a computational algorithm that will provide the
required outputs. It is helpful to maintain a distinction between these four possible independent

10

variables (time and threes spatial) coordinates and model inputs. The model inputs play a different role
in the analysis of the model response.
Modelling of physical systems will always require the application of one or more of the fundamental
conservation principles: conservation of mass, momentum and energy. These quantities are known as
the fundamental dependent variables.
Apart from mass, the fundamental variables are not measurable, even in principle. Energy is measured
in terms of temperature, pressure, composition, velocity etc. Similarly, the momentum is computed
from measured velocities and masses. It is this larger collection of measurable variables that
characterises the fundamental quantities, and the model equations are written in terms of these
characterising dependent variables. It is necessary to select the minimum set of characterising
variables 2 that uniquely defines the fundamental variables. This set defines the state of the system.

2.3 Constitutive Equations


In modelling the fundamental variables do not provide enough equations in the model to solve for all the
state variables. There are other relationships required so as to make the model completely defined, i.e.
one that has "as many equations as unknowns" 3. These required relationships are known as constitutive
equations.
Constitutive equations are those additional relationships between state variables that are required for a
complete mathematical description. Constitutive equations are usually associated with molecular
phenomena.
Constitutive equations come in most cases from experiment, usually guided by some theory and perhaps
dimensional analysis or other invariance arguments. Many constitutive equations are available in the
form of dimension less engineering correlation e.g. Nu = Nu (Re,Gr , Pr ) . Several examples of
constitutive equation are shown in this section.

2.3.1 Gas Law


Process systems containing a gas will normally need a gas law expression in the model. The ideal gas
law is commonly used to relate molar volume, pressure and temperature:

Pv = RT

2.1

The van der Waals PvT relationship contains two parameters (a and b) that are system specific:

There is no generally accepted terminology called characterising variables. They are often called state variables in control
and systems engineering literature. However, it is important to note that the term state variable has entirely different
meaning in the thermodynamics literature.
3
This is convenient and common shorthand. It is not a rigorous equivalent, as the counter example of finding real solutions
of x and y to the single equation x 2 + y 2 = 0 illustrates.

11

P + 2 (v b ) = RT
v

2.2

For other gas law, see a thermodynamics text.

2.3.2 Chemical Reactions


The rate of reaction per unit volume is usually a function of the concentration of the reacting species.
Consider the reaction A+2B C+3D. If the rate of the reaction of A is first order in both A and B, the
following expression is used:

rA = kc A c B

2.3

The reaction rates are normally expressed in terms of generation of a species. As a result we have

rB = 2 rA = 2 kc A c B
rC = rA = kc A c B
rD = 3rA = 3kc A c B
Usually, the reaction rate coefficient, k, is a function of temperature.
representation is the Arrhenius rate law

k (T ) = Ae E RT

The most commonly used

2.4

The frequency factor (pre-experimental factor) A, and activation energy, E can be estimated from the
date of the reaction constant as a function of reaction temperature.

2.3.3 Equilibrium Relationships


The relationship between the liquid and vapour compositions of component i, when the phases are in
equilibrium, can be represented by:

y i = K i xi

2.5

The equilibrium constant, Ki, is a function of composition and temperature.


To simplify the vapour/liquid equilibrium models, a constant relative volatility assumption is often
made. In a binary system, the relationship between the vapour and liquid phases for the light component
often used is

y=

x
1 + ( 1)x

2.6

12

2.3.4 Heat Transfer


The rate of heat transfer through a vessel wall separating two fluids can be described by
Q = UAT

2.7

The heat transfer coefficient is often estimated from experimental data. At the design stage it can be
estimated from correlations, it is a function of fluid properties and velocities.

2.3.5 Flow-through Valves


The flow-through valves are often described by the following relationships:
F = C v f (x )

Pv

2.8

s .g .

where F = volumetric flow-rate


Cv = valve coefficient
f(x) = flow characteristic (varies from 0 to 1, as a function of fraction of valve opening, x)
Pv = pressure drop across the valve
s.g. = specific gravity of the fluid
Three common valve characteristics are (i) linear (ii) equal-percentage, and (iii) quick-opening
For a linear valve
For an equal-percentage valve
For a quick-opening valve

f (x ) = x

f ( x ) = x 1
f (x ) = x

( = 50 )

For a quick-opening valve, the sensitivity of flow to valve position is high at low openings and low at
high openings, the opposite is true for an equal-percentage valve. The sensitivity of a linear valve does
not change as a function of valve position. The equal percentage valve is commonly used in chemical
processes, because of desirable characteristics when installed in piping systems where a significant
piping pressure drop occurs at high flow rates.

2.4 Control Volume


There is one important restriction on the selection of a control volume. The physical size of the control
volume depends both on spatial distribution of the state variables and on the degree of discrimination of
the measuring probe (or equivalently, the need for discrimination).
The problem objectives defines the spatial discrimination that is sought in the state variables, and hence
the choice of control volume. When spatial variation is not of interest then the system is said to be
lumped or lumped parameter otherwise it is distributed or distributed parameter. Distributed system is

13

generally described by PDEs while lumped systems are usually described by ODEs (or algebraic
equations if changes in time are not of interest).

14

Chapter Three

Process Modelling
3.1 Balance Equations
The dynamic balances material and energy balances are in the form

rate of mass or rate of mass or


rate of mass or
energy accumulation = energy entering energy leaving

a system
a system
in a system

3.1

The rate of mass accumulation in a system has the form dm/dt where m is the total mass in a system.
Similarly the rate of energy accumulation has the form dE/dt where E is the total energy in a system. If
ni is used to represent the moles of component i in a system, then dni/dt represents the rate of
accumulation of component i in the system.
When developing a dynamic model, one of two general viewpoints can be taken. One viewpoint is
based on integral balance while the other is based on instantaneous balance. Integral balances are
particularly useful when developing models for distributed parameter systems, which result in PDEs.
Another viewpoint is the instantaneous balance where the time rate change is written directly.

3.1.1 Integral Balances


An integral balance is developed by viewing a system at two different snapshots in time. Consider a
finite interval, t, and perform the balance over that time interval.

mass or energy mass or energy mass or energy mass or energy


inside system inside system = entering system leaving system 3.2

from t to (t + t ) from t to (t + t )
at t
at (t + t )
The mean-value theorems of integral and differential calculus are then used to reduce the equations to
differential equations.
Example
Consider a tabular reactor where a chemical reaction changes the concentration of the fluid as it moves
down the tube. A volume element V and a time element t is used. The total moles of species A
contained in the V is (V)cA. The amount of species A entering the volume is Fc A V and the amount
of species leaving the volume is Fc A
reaction) is ( kc A )V .

V + V

. The rate of A leaving by reaction (assuming a 1st order

15

The material balance is then

(V )c A

t + t

(V )c A

t + t
t

[Fc

A V

Fc A

V + V

kc A (V )]dt

3.3

The R.H.S. of (3.3) can be written using the mean value theorem of integral calculus, as

[Fc
t+ t

A V

Fc A

kc A (V )]dt = ( Fc A

V + V

Fc A

V + V

kc A (V )) t +t t

3.4

where 0 < < 1 . Eq. 3.3 can now be written:

(V )[c A

t + t

cA

(V )[c A

t + t

cA

] = ( Fc

A V

Fc A

V + V

kc A (V )) t +t t

3.5

Fc A

V + V

kc A (V )) t +t

3.6

dividing by t

] = ( Fc

A V

and using the mean value theorem of differential calculus (0 < < 1) for L.H.S.

(V )[c A

t + t

cA

] = (V ) c

3.7
t + t

Substituting (3.7) into (3.6) and dividing by V yields

c A
t

t +t

Fc A
=

Fc A

V + V

kc A
t +t

3.8

Letting t and V go to zero, gives


c A

(Fc A ) kc A
=
t
V

3.9

Normally, a tube with constant cross-sectional area is used, so dV = Adz and F = Av z , where vz is the
velocity in the z-direction. The equation can be written:
c A

= (v z c A ) kc A
t
z

3.10

Similarly, the overall material balance can be found as:

16

= (v z )
t
z

3.11

If the fluid is a constant density (good assumption for a liquid), then the species balance can be written
as
c A
c
= v z A kc A
t
z

since

3.12

v z
= 0 from (3.11).
z

In deriving the tubular creator equations it is assumed that species A left a volume element only by
convention (bulk flow). In addition, molecules can leave by virtue of a concentration gradient. For
example, the amount entering at V is

dc

Fc A + AD Az A
dz V

3.13

where DAz is the diffusion coefficient. It can be shown that the reaction-diffusion equation is given by

c A
c A
2cA
= v z
+ D Az
kc A
t
z
z 2

3.14

3.1.2 Instantaneous Balances


Here the dynamic balance equation is written directly, based on an instantaneous rate-of-change.
rate of

accumulation rate of mass or rate of mass or

= energy entering energy leaving


of mass or

in
system
in
system



energy in system

3.15

Example
Consider a liquid surge tank with one inlet (flowing from process I) and one outlet stream (flowing to
process II). Assume that that the density is constant. Find how the volume of the tank varies as a
function of time, if the inlet and outlet flow-rates vary. List the state variables. Give necessary
information to complete the quantitative solution to this problem.
The balance equation based on an instantaneous rate-of-change:

17

rate of change of
mass flowrate of mass flowrate of
mass of water in tan k = water int o tan k water out of tan k

3.16

The total mass of water in the tank is V , the rate of change is d (V ) dt , and the density of the outlet
stream is equal to the tank contents:
d
(V ) = F f f F
dt

3.17

d
(V ) = F f F
dt

3.18

Assuming that the density is constant:

State variable is V, Ff and F are input variables. If the density is retained, then it is the parameter of the
system in order to solve this problem the inputs Ff(t) and F(t) and the initial condition V(0) must be
specified.

3.2 Material and Energy Balances


Many chemical processes have important thermal effects so it is necessary to develop material and
energy balance models. One key is that a basis must always be selected when evaluating an intensive
property such as enthalpy.
Proper application of conservation of energy requires the use of some basic thermodynamic concepts.
There is no way that the proper use of thermodynamics can be avoided when dealing with the energy of
a system. There are attempts to bypass rigour and substitute intuition with a result of incorrect
equation.

3.2.1 Thermodynamic Variables


Total energy, E, of a system is the sum of its kinetic, potential and internal energies abbreviated as K.E.,
P.E. and U respectively. Thus:

E = KE + PE + U

3.19

Energy per unit mass will be denoted with an underbar:

E = KE + PE + U

3.20

Quantities per unit mole will be denoted with a double underbar:


E = KE + PE + U

3.21

18

In flowing systems, it is often more convenient to work in terms of enthalpy, H, defined as

H = U + PV

3.22

where V is the volume and P the mean pressure. Enthalpy per unit mass is then

H =U +

3.23

and enthaly per unit mole is

H = U + MW

3.24

where M W is the average molecular weight. For an ideal gas


H = U + RT

3.25

Thermodynamic state is specified by the composition and two of the three characterising variables
(pressure-temperature-volume, PVT). Internal energy is usually defined in terms of the volume and
temperature, while enthalpy is usually defined in terms of pressure and temperature.
The heat capacities at constant pressure are defined to be

cp =
cp =

H
T

P ,composition

H
T

3.26

P ,composition

The heat capacities at constant volume are defined as

cv =
cv =

U
T

,composition

U
T

3.27

,composition

For an ideal gas, U is a function of only T. in this case


c p = cv + R

3.28

19

For liquids at moderate pressures and temperatures, cp and cv are nearly equal.
There is one more thermodynamic quantity required. Let ni be the number of moles of species i
contained in volume V. Partial molar enthalpy is defined as

H=

H
ni

3.29
T ,P ,n j i = cons tan t

From the Gibbs-Duhen equation, it can be deduced that


H = ni H i

3.30

or, equivalently,

H=

c H
i

3.31

where ci is the molar concentration of species i.


In an ideal solution, molecules of species interact with molecules of all other species in the same way as
with their own, thus H i = H i . In a non-ideal solution H i H i and there will be enthalpy changes
associated with the mixing of different species.

3.2.2 Conservation of Mass and Energy


The reaction
A + B + M + N +

3.32

takes place in a well-stirred tank. (There is no loss of generality in taking the stoichiometric coefficient
of A equal to unity). Because of the well-mixed assumption, the entire tank is taken as the control
volume.
Mass is characterized by the density, ; concentrations (in molar units) c A , c B , c M , c N etc of A, B, M,
N, respectively; and liquid volume, V. The volumetric flow-rate is F.
The principle of conservation of mass as applied to total mass in the system is unchanged by the fact of
chemical reaction and is identical to Eq (3.17).
d
(V ) = F f f F
dt

3.17

20

Taking ri to be the net molar rate of formation of species i by chemical reaction per unit volume. The
equation of conservation of mass for species A is therefore
d
(ciV ) = F f c fi Fci + Vri
dt

3.33

If then r is defined as the net rate of disappearance of A by reaction per unit volume, then Eq.(3.33) can
be written as
dn A
dt
dn A
dt
dn M
dt
dn N
dt

d
(c AV ) = F f c fA Fc A Vr
dt
d
= (c BV ) = F f c fB Fc B Vr
dt
d
= (c M V ) = F f c fM Fc M + Vr
dt
d
= (c N V ) = F f c fN Fc N + Vr
dt
=

3.34

r is often referred to as the instrinsic reaction rate.


The principle of conservation of energy applied to this control volume is
d
(U + KE + PE ) = f F f (U f + KE f + PE f ) F (U e + KE e + PE e ) + Q + WT
dt

3.35

The first two terms on R.H.S. are the rates of convective flow of energy in and out respectively. The
subscript "e" denotes the effluent stream despite perfect mixing the energy will be different from that of
the tank. Q is the rate of heat addition through the boundaries typically from a heating or cooling coil or
jacket, WT is the rate at which work is done on the system (i.e. power input).
Work is done on the system when fluid is forced in and is done by the system to expel the effluent
stream; the rate of the former is FfPf while the rate of the latter is FPe where Pf and Pe are the pressures
just prior to the entrance and exit, respectively. It is convenient to separate out these work terms and
refer to the remaining work term as Ws for rate of shaft work. Thus Eq (3.35) is rewritten as

Pf
dU
F U e + Pe
= f F f U f +

dt
f

+ Q + Ws

3.36

KE and PE terms have been dropped since they are usually unimportant if temperature changes of even
a few degrees can occur. From the definitions of enthalpy, Eq (3.23) Eq (3.36) can be written as
dU
= f F f H f F H e + Q + Ws
dt

3.37

21

Writing the U in terms of H and dropping the subscript "e" on H e since the enthalpy per unit mass is
the same everywhere in the tank and will approximately equal the enthalpy of the effluent;
dH d
(PV ) = f F f H f F H + Q + Ws
dt dt

3.38

The term d (PV ) dt is neglected since it is negligible in liquid systems and it is zero if volume and
pressure are constant; thus for liquid systems,
dH
= f F f H f (T f ) F H (T ) + Q + Ws
dt

3.39

Eq. (3.39) is often quoted as the starting point in modelling and referred to as the "enthalpy balance" 4.
Eq (3.39) must now be expressed in terms of state variables, the first step is to refer all enthalpies to the
same temperature, which is most conveniently taken as the tank temperature. From the definition of cp,
(Eq. 3.26).
Tf

H f ( T f ) = H f ( T ) + c pf dT
T

3.40

Approximating cp to be constant and writing the integral as c pf ( T f T ) , Eq 3.39 is now written as


dH
= f F f c pf (T f T ) + f F f H f (T ) F H (T ) + Q + Ws
dt

3.41

H is a function of T, P and the number of moles of all component species {ni }, and thus an implicit
function of time. This it can be written

dH H dT H dP
H dni
=
+
+
dt
T dt P dt
i ni dt

3.42

The term H P can be shown to be negligible in most cases for liquid systems 5, and it is zero for ideal
gases. H T is simply Vc p , from Eq.(3.26), while H ni is the definition of H i . Thus,

There is no such thing as "enthalpy balance" since Eq 3.39 is totally incorrect for gaseous systems. The "enthalpy balance"
is worsen by including a term to account for the "rate of enthalpy-or energy-generation because of chemical reaction".
Systems containing more than one phase cause particular problems for believers in "enthalpy balances".
5
It is shown in thermodynamics textbooks that
H
V
= V T
P T ,n
T P ,n
i

22

dn
dH
dT
= Vc p
+Hi i
dt
dt
dt
i

3.43

With Eq. (3.34), the sum in Eq. (3.43) can be written as

H
i

dni
= F f c fi H i F ci H i + Vr H N + H M H A H B
dt
i
i

3.44

Finally, using Eq. (3.31), the term F ci H i = F H , while F f cif H if = f F f H f ; combination of


i

Eq. (3.41) through (3.44) then becomes 6

dT
= f F f c pf (T f T ) Vr H N + H M H A H B + Q + Ws + F f cif H if H i 3.45
dt
i

Vc p

The last term in R.H.S. of Eq. (3.45) is neglected as it is small in relative to enthalpy term multiplying
Vr and is zero for ideal gases.
The enthalpy term H N + H M H A H B + is the enthalpy change of reaction, often called the
heat of reaction, and denoted H R ; H R is negative for exothermic reaction and positive for
endothermic reaction. Enthalpies of reaction can be calculated from tabulated "heats of formation" and
"heats of combustion". The enthalpies of reaction can be measured in a calorimeter experiment. The
final form of energy equation is therefore;

Vc p

dT
= f F f c pf (T f T ) + H R Vr + Q + Ws
dt

3.46

This equation contains a large number of approximations none of which should be serious for
liquid systems.

F f cif H i F f cif H if
i

[
]
= F c H F c H + Vr [ H + H H H ]+ F c H F c H
= F H F H + Vr [ H + H H H ]+ F c (H H )
dT
+ F H F H + Vr [ H + H H H ]+ F c (H H )
dt
i

dn
i H i dti = Ff i cif H i F i ci H i + Vr H N + H M H A H B + Ff i cif H fi Ff i cif H if
f

if

if

if

if

if

if

if

Vc p

= f F f c pf (T f T ) + f F f H f (T ) F H (T ) + Q + Ws

Vc p

if

if

dT
= f F f c pf (T f T ) Vr H N + H M H A H B + Q + Ws + F f cif H if H i
dt
i

)
23

The rate of heat transfer, Q depends on the configuration used for heating or cooling. The simplest
configuration to assume is that the reactor is jacketed and that the jacket fluid is well mixed liquid.
Using Eq (3.46) 7 and assuming that the jacket fluid is not reactive, then
dT j

jV j c pj

dt

= jf F jf c pjf (T jf T j ) + Q j

3.47

If it is assumed that there is no loss of heat to the surrounding, then Q j = Q . Heat transfer rates vary
linearly with heat transfer area and with the temperature differences so it can be written that;
Q = Q j = hA (T j T )

3.48

A is the area available for heat transfer, and h is the heat transfer coefficient. Many correlations exist for
heat transfer coefficients.
Taking that the liquid volume in the jacket will not change and that cpjf is independent of temperature
and that the density is constant, then Eq (3.47) can be written as
jV j c pj

dT j
dt

= jf F jf c pjf (T jf T j ) + hA(T T j )

3.49

3.3 Batch and Tubular Reactors


The batch reactor is a well-stirred reactor for which F f = F = 0 . Assuming a constant density, implies
that dV dt = 0 and for a single reaction Eq (3.34) becomes

dc A
= r ,
dt
dc M
= r,
dt

dc B
= r
dt
dc N
= r
dt

3.50

Tubular reactors behave like moving batch reactors if axial mixing is not taken into consideration. If the
fluid is marked over a small spatial region z with a tracer, that fluid element will retain its integrity as it
7

Eq. (3.46) is commonly written incorrectly as


d
1.
c p (VT ) = f F f c pf T f Fc pT + H R Vr + Q + Ws
dt
d
2.
(Vc p T ) = f F f c pf (T f T ) + H R Vr + Q + Ws
dt

24

passes through the reactor. Since batch reactor equations do not depend on the size of the control
volume, z here is arbitrary and can be as small as possible.

This Lagrangian description can be converted to Eulerian description or a fixed laboratory coordinate
system by noting that the time required to travel distance dz is vdt , where v is the mean linear velocity
of the reactor, so dt = dz v and Eq. (3.50) becomes

dc A
= r ,
dz

dc B
= r ,
dz

3.51

This assumes that the system is at steady state when viewed from a fixed laboratory frame.

The energy equation for a batch reactor is obtained directly from Eq (3.46) by setting F f = 0 :

Vc p

dT
= H R Vr + Q + Ws
dt

3.52

For tubular reactors, the heat transfer term is first put in an appropriate form. Let a v be the area
available for heat transfer per unit volume of reactor. Thus A = a vV and Eq (3.52) can be written as;

Vc p

dT
= H R Vr + havV (T j T )
dt

3.53

The shaft work is rarely relevant in a tubular reactor. If dt is replaced by dz v , then the equation for a
tubular reactor becomes;

vc p

dT
4h
(T j T )
= H R r +
dz
d

3.54

25

a v = 4 d for a tube of diameter d.

The area per unit volume in the jacket of outer diameter dj is 4 d d 2j d 2 , assuming concentricity and
thin walls. The corresponding equation for the jacket is then

j v j c pj

dT j
dt

4 hd
(T T j )
d d2

2
j

3.55

The flow is taken as counter-current if v and vj have opposite algebraic signs, otherwise it is concurrent.
It should be noted that this derivation of the tubular reactor equations is valid only for steady state, and it
assumes that radial mixing is so rapid that there are no radial concentration or temperature gradients.

3.4 Density of Liquids


The relationship between density and concentration of a liquid system is governed by intermolecular
forces. The density of a liquid mixture of N species is

= c1 + c 2 + + c N

3.56

where {ci } are the concentrations of all species in mass units (e.g. kg/m3). In thermodynamics, the
Gibbs-Duhen equation establishes that the density of a liquid mixture at constant temperature is unique
function of N 1 concentrations.

Consider a large volume V of a liquid, containing nA moles of A and nB moles of B, V is uniquely


determined by nA and nB. At a constant temperature and pressure a differential amount of A is added and
the differential volume change measured; this experiment defines the partial molar volume, V A as

26

VA =

VB

n A T ,P ,n

V
=
n B

3.57

T ,P ,n A

V A and V B are intensive properties and depend only on the molar ratio nB/nA. It is a consequence of
the mathematics of exact differential forms or an equivalent physical argument, that

V = n AV A + nB V B

3.58

It would be convenient to define the partial densities

A =

M WA
VA

B =

M WB

3.59

VB

The partial densities will be functions of the mass concentration ratio cB/cA. Now from Eq (3.56)

n M
n M
= c A + c B = A WA + B WB =
V
V
1

1 + cB

cA
c
+ 1 B
A
B cA

3.60

Eq. (3.60) can be rearranged as

= A + 1 A

c
B B

3.61

27

Since A and B are functions only of cB/cA or equivalently c B , Eq. (3.61) establishes a unique but
implicit relationship between and cB.

3.5 Dimensionless Models


Most models contain a large number of parameters and variables that may differ in value by several
orders of magnitude. It is often desirable, at least for analysis purposes, to develop models composed of
dimensionless parameters and variables.

Just for illustration, consider a constant volume, isothermal CSTR modelled by a simple first-order
reaction

dc A F
= (c Af c A ) kc A
dt
V

Let x = c A c Af 0 ; c Af 0 is nominal ( steady-state) feed concentration of A. Thus

dx F

F
= xf + kx
dt V

Now taking = t t , where t is a scaling parameter, then dt = t d ; this implies that

dx
F

F
= xf + kx
t d V

Natural choice for t appears to be V F , the residence time, so;

28

dx
kV

= x f 1 +
x
d
F

kV F is a dimensionless number known as a Damkholer number in reaction engineering.

Assuming that the feed concentration is constant; x f = 1 and letting = kV F , the

dx
= 1 x x
d

Therefore a single parameter can be used to characterise the behaviour of all first order, isothermal
chemical reactions.

29

4. Numerical Methods
4.1 Introduction
Process modelling leads to a system of complex model equations. It is necessary to solve the equations
in order to investigate the process characteristics. There are two ways of finding solutions, namely,
analytical method and numerical method. Where possible an analytical method produces exact solutions
usually in the form of general mathematical expressions. On the other hand numerical methods produce
approximate solutions in the form of discrete values or numbers.
In order to develop a dynamic process simulator after the mathematical model development it is
imperative to have a good knowledge of numerical methods. Some of these methods will be covered in
this chapter.

4.2 Iterative Convergence Methods


4.2.1 Bisection Method (Interval Halving)
In order to solve
= () = 0

the following steps according to the Bisection method can be followed

4.1

Step 1: Find two guess values of (say 1 and 2 at the 1st iteration), so that one where () < 0
and another where () > 0.
Step 2: Find the midpoint and then evaluate () at that midpoint.
Step 3: Among the two guess values of , one should be replaced by the value of at midpoint.
Replace the bracket limit that has the same sign as the function value at the midpoint,
with the midpoint value.
Step 4: Check for convergence. if not converged, go back to Step 2.
If the interval shrinks below a tolerance level, an approximate value of the root has been found. The
Bisection method is also known as interval halving method since it can be halve the size of the interval
in each iteration.
The Bisection method actually locates a root repeatedly narrowing the distance between the two guesses.
When an interval contains a root, this simple numerical method never fails. However, the main
drawback of the Bisection technique is the slow convergence rate. Also, it is not easily extended to
multivariable systems.
4.2.2 Secant Method
Although this approach is similar to the Bisection method, it is required to construct a secant line and
find its -intercept as the next root estimate.
30

To solve Eq. 4.1, 1 and are assumed as the two approximations to the root. Constructing a straight
line (secant or chord) through points [1 , (1 )] and [ , ( )] gives the slope as
=

( ) (1 )
1

To compute the next approximation +1 , a straight line equation is formed, thus


(+1 ) ( ) = (+1 ) =

For finding its -intercept at (+1 ) = 0. Simplifying gives

Further simplifying results

4.3

1
( )
( ) (1 )

4.4

1 ( ) (1 )
( ) (1 )

4.5

+1 =

+1 =

( ) (1 )
(+1 )
1

4.2

The iteration is done until the guess is sufficiently close to the root. If the approximations are such that
( )(1 ) < 0, then the approach, as represented by Eq. 4.4 or Eq. 4.5, is known as the False
Position, or Regula Falsi method. Note that the main difference between these two convergence
techniques is that the Secant method retains the most recent two estimates, while the False Position
method keeps the most recent estimate and the next recent one which has an opposite sign in the
function value.
4.2.3 Newton-Raphson Method
The Newton-Raphson method is the most common and popular method for solving nonlinear algebraic
equations. It is derived from Taylor series of ():
() 2 () ()2 3 () ()3
( + ) = () +
+
+
+=0
1!
2
2!
3
3!

Neglecting all terms of order two and higher, Eq. 4.6 yields:

That means

( + ) = () +
=

()
()

()
= 0

4.6

4.7
4.8
31

Calculating the guess for at iteration + 1 as a function of the value at iteration by defining
thus Eq. 4.8 becomes

+1 = +1

+1 =

4.9

( )
( )

4.10

( )
( )

4.11

From Eqs. 4.9 and 4.10, the following equation is obtained


+1 =

Eq. 4.11 represents the Newton-Raphson convergence method for a single-variable problem. The
extension of the Newton-Raphson algorithm to multivariable systems is fairly simple and
straightforward. Considering a multivariable system represented by:
() = 0

4.12

1 (1 , 2 , , )
0

2 (1 , 2 , , )

= 0

0
(1 , 2 , , )

4.13

This equation consists of a set of by variables (1 , 2 , , ) as:

The Taylor series gives for each after neglecting the second and higher-order derivative terms as:

( + ) = () +
=1

The above equation yields the following matrix form:

where, the Jacobian matrix

()
= 0

() + = 0
1

1
=

1

1
2

4.14
4.15





32

From Eq. 4.15,


= 1 ()

4.16

Therefore, Newton-Raphson method for multivariable is

+1 = 1
( )

4.17

The Newton-Raphson method is very efficient iterative convergence technique compared to many other
simple methods. However, at each step, this method requires the calculation of the derivative of a
function at the reference point, which is not always easy. It also may sometimes lead to stability
problems particularly if the function is strongly nonlinear and if the initial guess is very poor.
4.2.4 Muller Method
This is an iterative convergence method based on quadratic equation. Consider a polynomial of second
degree:
() = 0 2 + 1 + 2 = 0

4.18

where 0 ( 0), 1 and 2 are three arbitrary parameters. In this convergence approach, three values of
the unknown variable are guessed. Let 2 , 1 and are three approximations to the actual root
of () = 0. To obtain 0 , 1 and 2 the following conditions are used:
2
+ 1 2 + 2
2 = 2 = 0 2
2
1 = 1 = 0 1 + 1 1 + 2
= = 0 2 + 1 + 2

4.19
4.19
4.19

and then substituting 0 , 1 and 2 in Eq. 4.18 gives

( 1 )( )
( 2 )( )
2 +

(2 1 )(2 )
(1 2 )(1 ) 1
( 2 )( 1 )
+
=0
( 2 )( 1 )

() =

Eq. 4.20 can be converted to:

4.20

( + )( + + 1 )
( + )
( + + 1 )
2
1 +
= 0
1 (1 + )
1
( + 1 )

4.21

where, = , = 1 and 1 = 1 2. Further assuming = , =


1 and = 1 + , Eq. 4.21 gets the form:
2 + + = 0

4.22
33

where

= 2 2 2 1 + ( + )
= ( 2 1 + )

Dividing Eq. 4.22 by 2, thus


+ + = 0
2

Solving this quadratic equation for 1, gives


=

(2 4 )

4.23
4.24

The selection of the sign in the denominator in Eq. 4.24 should be such that +1 has the smallest
absolute value. Recalling that = , it implies that

Rearranging

Replacing by +1

+1 =

4.25

= + +1 ( 1 )

4.26

+1 = + +1 ( 1 )

4.27

In this convergence approach, the next approximation +1 is obtained as the zero of the second-degree
curve passing through the points (2 , 2 ), (1 , 1 ) and ( , ).

To obtain the approximate root of a nonlinear equation, the Muller method uses a polynomial of second
degree (quadratic equation), whereas the Newton-Raphson method uses a straight line (linear equation).
Faster rate of convergence is achieved by the Muller method compared to the Newton-Raphson method
when the functions are highly curvilinear.

4.3 Numerical Integration of Ordinary Differential Equations


Numerical methods discussed in this section are used to solve 1st-order ODEs. Any higher-order ODE
can easily be transformed to a set of 1st-order ODEs.
4.3.1 Euler Methods
Consider

34


= (, )

4.28

where (, ) is, in general, a nonlinear function and the initial condition for is as: (0) = 0 at time
= 0. Eq. 4.28 can be solved by employing the Euler method by two different ways, namely, explicit
approach and implicit approach.
Explicit Euler approach
A forward difference approximation of Eq. 4.28 yields
+1
=
= ( , )

The time increment is known as the step size or integration interval. Rearranging Eq. 4.29 gives:
That is,

4.29

+1 = + ( , )

4.30

(,)

4.31

+1 = +

Eq. 4.30 or 4.31 represents the Explicit Euler method. If sufficiently small integration step size is
taken, then estimate +1 will be very close to the correct value. The Euler integration approach is
extremely simple to implement for solving even highly nonlinear multivariable complex systems having
a large number of ODEs.
Implicit Euler approach
This approach uses a backward difference approximation and accordingly, Eq. 4.28 gives:

Rearranging gives:

That is,

+1
= (+1 , +1 )

4.32

+1 = + (+1 , +1 )

4.33

+1 = +
(+1 ,+1 )

4.34

Eq. 4.33 or 4.34 represents the Implicit Euler method. This method in Eq. 4.34 indicates that the
derivative needs to be evaluated at the next step in time +1 . It is simple for a linear system but for
nonlinear system, a resulting algebraic expression is solved using one of nonlinear algebraic solution
technique such as Newton-Raphson method. The implicit method approach is stable for almost any

35

value of and will not oscillate. The Explicit Euler method, on the other hand, may have instability
problem with oscillating outputs for a large step size.
4.3.2 Runge-Kutta Methods
The Runge-Kutta method is commonly chosen as a better explicit integration algorithm than the
standard Explicit Euler method due to:
truncation error per step associated with the Euler method is higher
Explicit Euler technique is prone to numerical instabilities
Note that the Euler integration technique is sometimes called the 1st-order Runge-Kutta method.
2nd-order Runge-Kutta approach
This is also known as the Midpoint Euler method. In this approach, first the Euler technique is employed
to predict at the midpoint of the integration interval (step size = 2). The value of at the end of
the step (step size = ) is estimated as:
+1 = + 2

where

1 , +
2
2
1 = ( , )

4.35

2 = +

This integration technique provides better accuracy than the Explicit Euler method but the Euler
approach runs almost twice faster.
4th-order Runge-Kutta approach
The 4th-order RK method is given by

where

+1 = +

[ + 22 + 23 + 4 ]
6 1

4.36

4 = ( + 3 , + )

3 = + 2 , +
2
2

2 = + 1 , +
2
2
1 = ( , )

Comparing the 2nd-order and 4th-order RK integration approaches, it is easy to observe that the
complexity as well as computational time increases with the increase of the order. To obtain greater
accuracy in estimation, the 4th-order RK method is preferred over the Euler and 2nd-order RK
approaches.

36

4.3.3 Runge-Kutta-Fehlberg (RKF45) Method


Another efficient and popular technique for solving ODEs is the Runge-Kutta-Fehlberg 4th-5th-order
(RKF45) method. This ODE integrator can exert some adaptive control over its own performance by
making frequent changes in its step size. At each step, the RKF45 produces two estimates of a state
variable (+1 and +1 ). Here, a numerical estimate of the error, ((+1 +1 ) , is required to be
computed at each time step. If the estimated error is less than the tolerance level (), the step size ,
+1 , to be used in the next step to generate +2 is increased to speed up the computations and vice
versa. If the value of error is nearly equal to , the two estimates are in close agreement and the value of
step size is accepted without any correction.
In order to solve Eq. 4.28, each RKF step requires the use of the following six values:
1 = ( , )
1

2 = + , +
4
4
3
9
3
2 , +

3 = + 1 +
32
32
8
1932
7200
7296
12
4 = +
1
2 +
3 , +

2197
2197
2197
13
439
3680
845
5 = +
1 82 +
3
, +
216
513
4104 4
8
3544
1859
11

6 =
1 + 22
3 +
4 5 , +
27
2565
4104
40
2

The two estimates can be obtained using the following two equations:
+1 = +
+1 = +

25
1408
2197
1
1 +
3 +
4 5
216
2565
4104
5

16
6656
28561
9
2
1 +
3 +
4 5 + 6
135
12825
56430
50
55

Note that +1 and +1 are obtained using RK method of 4th and 5th order respectively.

The optimal step size , can be determined using:

14

, =

2|+1 +1 |

()

()

()
()
()

()
4.37
4.38

4.39

Even though the calculations involved in this approach are tedious and time consuming, this method
gives more accurate results. The generalization of this method to deal with systems of coupled 1st-order
ODEs is fairly obvious.

37

You might also like