You are on page 1of 48

H82CYS - Computer System Intro to Process Simulation 2

Instructor:
Computer flowsheeting (with Aspen HYSYS):
Dr Dominic FOO (CA21; x-8130)
Dr Chung Lim LAW (CA24; x-8169)
Dr Denny NG (CA33; ext-8606)
Process modelling (with Mathlab):
Dr Suyin GAN (CA22; x-8162)
Summary:
Introduction to computational techniques & computing.
To gain experience in computer programming,
engineering databases and steady-state & dynamic
process simulation.
Assessment:
HYSYS coursework 30%; HYSYS test 20%
Matlab coursework 20%; Simulink coursework 10%;
Matlab test 20%
H82CYS - Computer System Intro to Process Simulation 3
Week Content
1 Introduction to computer-aided process simulation
2 Coursework 1
3 Modeling for reaction & separation processes
4 Simulation of recycle streams
5 Other important topics; Coursework 2
6 In class test on HYSYS
7 Introduction to Matlab; mathematical operations,
matrices, types of files
8 Programming; m-files, program flow control, script
and function files
9 Graphics plotting and editing graphs; coursework
10 Debugging, function files
11 Simulink; coursework
12 In-class test on Matlab
H82CYS - Computer System Intro to Process Simulation 5
After completing the part on process
flowsheeting, you will be able to do the
following:
1. Able to carry out computer-aided process
flowsheeting
2. Able to perform steady-state process simulation
using a commercial software (e.g. Aspen
HYSYS)
3. Able to simulate an integrated flowsheet &
converge a recycle loop
4. Able to analyse and verify simulation results
H82CYS - Computer System Intro to Process Simulation 6
Westerberg, A. W., Hutchison, H. P., Motard, R. L., and
Winter, P. (1979). Process Flowsheeting. Cambridge
University Press, Cambridge (Chapter 2).
Turton, R., Bailie, R. C. Whiting, W. B., Shaeiwitz, J. A.
(1998). Analysis, Synthesis and Design of Chemical
Processes. Prentice Hall, New Jersey (Chapter 18; Chapter
11 in 2nd Edition).
Dimian, A. C. (2003). Integrated Design & Simulation of
Chemical Processes. Elsevier Science (Chapters 2 & 3).
Foo, D. C. Y., Manan, Z. A., Selvan, M., and McGuire, M. L.
(2005). Process Synthesis by Onion Model and Process
Simulation, Chemical Engineering Progress. 101(10): 25-29.
Seider, W. D., Seader, J. D. and Lewin, D. R. (2003). Product
and Process Design Principles: Synthesis, Analysis, and
Evaluation. John Wiley, New York (and the CDROM).
H82CYS - Computer System Intro to Process Simulation 7
Simulation a process of designing an
operational model of a system & conducting
experiments with this model for the purpose
either of understanding the behaviour of the
system or of evaluating alternative strategies for
the development or operation of the system
(Thom, 1993).
Process flowsheeting the use of computer
aids to perform steady-state heat and mass
balancing, sizing and costing calculation for a
chemical process (Westerberg et al., 1979).
H82CYS - Computer System Intro to Process Simulation 8
Simulation implies modelling, as well as tuning
of models on experimental data. A simulation
model serves to conduct virtual experiments.

A model should be as simple as possible and no simpler
~ Albert Einstein
H82CYS - Computer System Intro to Process Simulation 9
Simulation flowsheet/
process simulation diagram
Product
D
i
s
t
i
l
l
a
t
i
o
n

Flash
Reactor
Boiler
Fresh
feed
Steam
Light
ends
S1
S2
S3
S4
S9
S8
S6
S7
S5
Process flowsheet/
process flow diagram
?
H82CYS - Computer System Intro to Process Simulation 10
1966 1
st
commercial process simulator started
in Los Angeles by Simulation Science for
simulating distillation column developed
into PROCESS PROII.
1969 ChemShare in Houston released DESIGN
for oil & gas application continue as DESIGN
II for Windows (by WinSim).
1976 The famous ASPEN project launched
jointly by the US Dept. of Energy and MIT.
1979 1
st
important process flowsheeting
textbook was published (Westerberg et al., 1979)
H82CYS - Computer System Intro to Process Simulation 11
Commercial design & simulation softwares
(Dimian, 2003)
Bought over
by ASPEN
SuperPro
Designer
H82CYS - Computer System Intro to Process Simulation 12
Oil, Gas &
Petrochemicals
Specialty Chemicals
Oleo Chemicals
SS Simulation
Optimisation
Sensitivity Analysis
Dynamic simulation
Rating
Physical properties
Batch operation
Pinch analysis
Economics
Sizing & costing
Solid handling
HYSYS
Aspen Plus
PRO/II
SuperPro
Designer
Design II for
Windows
H82CYS - Computer System Intro to Process Simulation 13
H82CYS - Computer System Intro to Process Simulation 14
UniSim Design (the same as HYSYS)
H82CYS - Computer System Intro to Process Simulation 15
H82CYS - Computer System Intro to Process Simulation 16
Latest version
& password
H82CYS - Computer System Intro to Process Simulation 17
H82CYS - Computer System Intro to Process Simulation 18
UNMC subscribes to
the academic license
of DESIGN II
H82CYS - Computer System Intro to Process Simulation 19
H82CYS - Computer System Intro to Process Simulation 20
But thats a lot to
learn from all these
softwares!
The good news is,
once you learn one
of them, you learn
70% of the rest!
H82CYS - Computer System Intro to Process Simulation 21
Process Industries Applications
Oil & Gas

Refining
Petrochemicals
Basic Organic Chemicals
Inorganic Chemicals
Fine Chemicals
Biotechnology
Metallurgy
Polymers
Paper & Wood
Energy
Nuclear industry
Environment
Offshore exploration, Surface treatment, Pipeline
transport, Underground storage, Gas processing
Gasoline and fuels
Hydrocarbon based chemicals, Methanol, Monomers
Intermediates, Solvents, Detergents, Dyes
Ammonia, Sulphuric Acid, Fertilisers
Pharmaceuticals, Cosmetics
Food and bio products
Steel, Aluminium, Copper, etc.
Polyethylene, PVC, Polystyrene, fibres, etc.
Paper pulp
Power plants, Coal gasification
Waste treatment, Safety
Water cleaning, Biomass valorisation
(Dimian, 2003)
H82CYS - Computer System Intro to Process Simulation 22
(Dimian, 2003)
H82CYS - Computer System Intro to Process Simulation 24
Degree of freedom (n
df
) of a system:
n
df
= n
v
n
e
where, n
v
= variables; n
e
= independent eq
If n
df
= 0 (e.g. 3 unknowns & 3 independent
eq), the unknown variables can be
calculated.
If n
df
> 0 (e.g. 5 unknowns & 3 independent
eq n
df
= 2), specify the design variables &
calculate the state variables.
If n
df
< 0 (independent eq > unknowns)
process is over-specified.
(Felder & Rousseau, 2000)
H82CYS - Computer System Intro to Process Simulation 25
Unknown variables for a single unit:
Unknown component amounts / flowrate for all inlet &
outlet streams
Unknown stream T & P
Unknown rate of energy transfer (as heat & power)
Equation to determine these unknowns:
Material balances for each independent species
Energy balance
Phase & chemical equilibrium relations
Additional specified relationship among process
variables
H82CYS - Computer System Intro to Process Simulation 26
Heated mixer
n
2
(kg O
2
)
n
3
(kg N
2
)
25C
n
4
(kg O
2
)
n
5
(kg N
2
)
50C
n
1
(kg O
2
)
40C
Q (kJ)
n
df
analysis:
6 variables (n
1
, , n
5
, Q)
3 eq (2 material balances & 1 energy balances)
= 3 degrees of freedom
Specify 3 design variables & solve the rest.
H82CYS - Computer System Intro to Process Simulation 27
Given the following equations:
x
1
+ 2x
2
x
3
2
= 0
5x
1
x
2
3
+ 4 = 0
i. What is the n
df
for this system?
ii. Which design variable to be chosen for an easier
solution?
Given the following equations:
5x 3y = 7
10x 3y 6z = 14
y = 2z
i. Why cant you solve this equation?
ii. Choose a design variable, specify it & determine the
rest of the state variables.
H82CYS - Computer System Intro to Process Simulation 28
Determine the n
df
for the system
What are the design variables & state variables?
Mixing
n
A3
(mol A/s)
n
B3
(mol B/s)
n
C3
(mol C/s)
n
D3
(mol D/s)
n
E3
(mol E/s)
T
3
(C)
n
A2
(mol A/s)
n
B2
(mol B/s)
n
C2
(mol C/s)
n
D2
(mol D/s)
n
E2
(mol E/s)
T
2
(C)
n
A1
(mol A/s)
n
B1
(mol B/s)
n
C1
(mol C/s)
n
D1
(mol D/s)
n
E1
(mol E/s)
T
1
(C)
S
1
S
2
S
3
(Felder & Rousseau, 2000)
H82CYS - Computer System Intro to Process Simulation 29
Mass balance equations:
n
A3
= n
A1
+ n
A2
n
B3
= n
B1
+ n
B2
n
C3
= n
C1
+ n
C2
n
D3
= n
D1
+ n
D2
n
E3
= n
E1
+ n
E2
Energy balance equation:
DH = Sn
out
H
out
Sn
in
H
in

(assumption: P = 1 atm; temp = T
1
H
1
= 0; no
phase change; constant C
p
)
n
df
= 18 variables (6 on each streams) 6 equations
= 12 degrees of freedom
H82CYS - Computer System Intro to Process Simulation 30
Specify the design variables:
Stream 1:
n
A1
= 23.5 mol A/s
n
B1
= 16.2 mol B/s
n
C1
= 8.5 mol C/s
n
D1
= 5.6 mol D/s
n
E1
= 2.2 mol E/s
T
1
= 135.0C
Stream 2:
n
A2
= 0.0 mol A/s

n
B2
= 57.0 mol B/s

n
C2
= 29.0 mol C/s

n
D2
= 15.6 mol D/s

n
E2
= 0.0 mol E/s
T
2
= 23.0

Other info [constant heat capacity in J/(mol.C)]:
C
pA
= 77.3; C
pB
= 135.0; C
pC
= 159.1; C
pD
= 173.2; C
pE
=
188.7
Determine the component flowrate & T for stream 3.
H82CYS - Computer System Intro to Process Simulation 31
Energy balance equation (cont.):
DH = Sn
out
H
out
Sn
in
H
in
= 0
0 = [ n
A3
C
pA
+ n
B3
C
pB
+ + n
E3
C
pE
] (T
3
T
1
)
[ n
A2
C
pA
+ n
B2
C
pB
+ + n
E2
C
pE
] (T
2
T
1
)
[ n
A1
C
pA
+ n
B1
C
pB
+ + n
E1
C
pE
] (T
1
T
1
)
(reference temperature taken as T
1
)
Rearrange the equation, solving for T
3
:


1 2
3 3 3 3 3
2 2 2 2 2
1 3
T T
C n C n C n C n C n
C n C n C n C n C n
T T
pE E pD D pC C pB B pA A
pE E pD D pC C pB B pA A




= 0
(Felder & Rousseau, 2000)
H82CYS - Computer System Intro to Process Simulation 32
Sequential-modular
Equation-oriented
H82CYS - Computer System Intro to Process Simulation 35
The computation takes place unit-by-unit following a
calculation sequence.
Dominate steady-state simulation softwares
Main advantages:
Modular development of capabilities.
Easy programming and maintenance.
Easy control of convergence, both at the units and flowsheet
level.
Disadvantages:
Need for topological analysis and systematic initialisation of
tear streams.
Difficulty to treat more complex computation sequences, as
nested loops or simultaneous flowsheet & design specification
loops.
Difficulty to treat specifications regarding internal unit (block)
variables.
(Dimian, 2003)
H82CYS - Computer System Intro to Process Simulation 36
Individual equipment blocks may require
iterative solution algorithms
Overall process solution is sequential & not iterative
(Turton et al., 1998)
H82CYS - Computer System Intro to Process Simulation 37
Option 1: Mixer Reactor Tower
Option 2: Mixer + Reactor Tower
Option 3: Mixer + Reactor + Tower
H82CYS - Computer System Intro to Process Simulation 38
Tutorial 2 (continue from Tutorial 1)
Mixing
n
A3
(mol A/s)
n
B3
(mol B/s)
n
C3
(mol C/s)
n
D3
(mol D/s)
n
E3
(mol E/s)
T
3
(C)
n
A2
(mol A/s)
n
B2
(mol B/s)
n
C2
(mol C/s)
n
D2
(mol D/s)
n
E2
(mol E/s)
T
2
(C)
n
A1
(mol A/s)
n
B1
(mol B/s)
n
C1
(mol C/s)
n
D1
(mol D/s)
n
E1
(mol E/s)
T
1
(C)
n
A4
(mol A/s)
n
B4
(mol B/s)
n
C4
(mol C/s)
n
D4
(mol D/s)
n
E4
(mol E/s)
T
4
= ?
S
1
S
2
S
3
S
4
Heater, Q =
100,000 J

H82CYS - Computer System Intro to Process Simulation 40
Solution is obtained by solving simultaneously all
the modelling equations.
Advantages:
Flexible environment for specifications, which may be
inputs, outputs, or internal unit (block) variables.
Better treatment of recycles, and no need for tear streams.
Note that an object oriented modelling approach is well
suited for the EO architecture.
Disadvantages:
More programming effort.
Need of substantial computing resources (but this is less
and less a problem with new PCs).
Difficulties in handling large differential algebraic
equations systems.
Difficult convergence follow-up and debugging.
H82CYS - Computer System Intro to Process Simulation 41
Solve matrix equation: A X = B
where,
A = a known (i x i) coefficient matrix;
B = a know solution vector (i x 1);
X = an unknown vector (i x 1)
Example matrix with i = 3:
A (3x3) X (3x1) = B (3x1) X = A
-1
B
x
y
z
a
1
b
1
c
1
a
2
b
2
c
2
a
3
b
3
c
3
=
d
1
d
2
d
3
x
y
z
=
d
1
d
2
d
3
-1
a
1
b
1
c
1
a
2
b
2
c
2
a
3
b
3
c
3
H82CYS - Computer System Intro to Process Simulation 42
Solve for the following simultaneous
equations:
x + y + z = 1
2x - 2y + 5z = 1
2.5 y + z = 1
Set up matrix equation:
A X = B
x
y
z
1 1 1

2 -2 5

0 2.5 1
=
1

1

1

H82CYS - Computer System Intro to Process Simulation 43
H82CYS - Computer System Intro to Process Simulation 45
C1 C2
35 kg B
50 kg T
15 kg X
n
1
(kg)
0.673 kg B/kg
0.306 kg T/kg
0.021 kg X/kg
n
2
(kg B)
n
3
(kg T)
n
4
(kg X)
n
5
(kg)
0.059 kg B/kg
0.926 kg T/kg
0.015 kg X/kg
n
6
(kg B)
n
7
(kg T): 10% of T in feed to C1
n
8
(kg X): 90% of X in feed to C1
C1: 4 variables (n
1
, , n
5
)
3 material balances
= 1 local n
df
C2: 7 variables (n
1
, , n
5
)
3 material balances
= 4 local n
df
Process: 5 local n
df

3 ties (n
2
, n
3
, n
4
)
2 relations (recovery of T & X in C2 bottoms)
= 0 degrees of freedom
H82CYS - Computer System Intro to Process Simulation 46
C1 C2
35 kg B
50 kg T
15 kg X
n
1
(kg)
0.673 kg B/kg
0.306 kg T/kg
0.021 kg X/kg
n
2
(kg B)
n
3
(kg T)
n
4
(kg X)
n
5
(kg)
0.059 kg B/kg
0.926 kg T/kg
0.015 kg X/kg
n
6
(kg B)
n
7
(kg T): 10% of T in feed to C1
n
8
(kg X): 90% of X in feed to C1
C1 balances:
B: 35 = 0.673n
1
+ n
2
T: 50 = 0.306n
1
+ n
3
X: 15 = 0.021n
1
+ n
4
C2 balances:

B: n
2
= 0.059n
5
+ n
6
T: n
3
= 0.926n
5
+ n
7
X: n
4
= 0.015n
5
+ n
8

10% T recovery: n
7
= 0.1 (50) = 5.0

90% X recovery: n
8
= 0.9 (15) = 13.5

H82CYS - Computer System Intro to Process Simulation 47
Solve the mass balance equation using MS
Excel spreadsheet:
0.673n
1
+ n
2
= 35 (1)
0.306n
1
+ n
3
= 50 (2)
0.021n
1
+ n
4
= 15 (3)
0.059n
5
+ n
6
n
2
= 0 (4)
0.926n
5
+ n
7
n
3
= 0 (5)
0.015n
5
+ n
8
n
4
= 0 (6)
n
7
= 5.0 (7)
n
8
= 13.5 (8)