lecture 1 - intro to process simulation
DESCRIPTION
IntroTRANSCRIPT
Welcome to H82CYS Computer
Systems
H82CYS - Computer System Intro to Process Simulation 2
About this module 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
Weekly programmeWee
kContent
1 Introduction to computer-aided process simulation
2 Coursework 13 Modeling for reaction & separation processes4 Simulation of recycle streams5 Other important topics; Coursework 26 In class test on HYSYS7 Introduction to Matlab; mathematical
operations, matrices, types of files8 Programming; m-files, program flow control,
script and function files9 Graphics – plotting and editing graphs;
coursework10 Debugging, function files11 Simulink; coursework12 In-class test on Matlab
Introduction to Introduction to process process
flowsheetingflowsheeting
H82CYS - Computer System Intro to Process Simulation 5
Learning outcomesAfter completing the part on process
flowsheeting, you will be able to do the following:1. Able to carry out computer-aided process
flowsheeting2. 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
References (process flowsheeting) 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
A few important jargonsSimulation – 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
A few important jargonsSimulation 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
A few important jargons
Simulation flowsheet/ process simulation
diagramProduct
Dis
tilla
tion
Flash
ReactorBoiler
Fresh feed
Steam
Light ends
S1
S2
S3
S4
S9
S8S6
S7
S5
Process flowsheet/ process flow
diagram
?
H82CYS - Computer System Intro to Process Simulation 10
A historical perspective1966 – 1st 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 – 1st 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
Malaysia context
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 handlingHYSYS
Aspen Plus
PRO/II
SuperPro Designer
Design II for Windows
H82CYS - Computer System Intro to Process Simulation 13
Aspen HYSYS (our main focus)
H82CYS - Computer System Intro to Process Simulation 14
UniSim Design (the same as HYSYS)
H82CYS - Computer System Intro to Process Simulation 15
Aspen Plus
H82CYS - Computer System Intro to Process Simulation 16
DESIGN II for Windows
Latest version & password
H82CYS - Computer System Intro to Process Simulation 17
DESIGN II for Windows
H82CYS - Computer System Intro to Process Simulation 18
DESIGN II for Windows
UNMC subscribes to the academic
license of DESIGN II
H82CYS - Computer System Intro to Process Simulation 19
SuperPro Designer (H8CPS1)
H82CYS - Computer System Intro to Process Simulation 20
But that’s 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
Applications of process simulationProcess Industries ApplicationsOil & Gas
RefiningPetrochemicalsBasic Organic ChemicalsInorganic ChemicalsFine ChemicalsBiotechnologyMetallurgyPolymersPaper & WoodEnergyNuclear industryEnvironment
Offshore exploration, Surface treatment, Pipeline transport, Underground storage, Gas processingGasoline and fuelsHydrocarbon based chemicals, Methanol, MonomersIntermediates, Solvents, Detergents, DyesAmmonia, Sulphuric Acid, FertilisersPharmaceuticals, CosmeticsFood and bio productsSteel, Aluminium, Copper, etc.Polyethylene, PVC, Polystyrene, fibres, etc.Paper pulpPower plants, Coal gasificationWaste treatment, SafetyWater cleaning, Biomass valorisation
(Dimian, 2003)
H82CYS - Computer System Intro to Process Simulation 22
Applications of process simulation
(Dimian, 2003)
Process Process flowsheeting flowsheeting
with with SpreadsheetSpreadsheet
H82CYS - Computer System Intro to Process Simulation 24
Degree of freedom revisitedDegree of freedom (ndf) of a system:
ndf = nv – newhere, nv = variables; ne = independent eq
If ndf = 0 (e.g. 3 unknowns & 3 independent eq), the unknown variables can be calculated.
If ndf > 0 (e.g. 5 unknowns & 3 independent eq ndf = 2), specify the design variables & calculate the state variables.
If ndf < 0 (independent eq > unknowns) process is over-specified.
(Felder & Rousseau, 2000)
H82CYS - Computer System Intro to Process Simulation 25
Degree of freedom revisitedUnknown variables for a single unit:
Unknown component amounts / flowrate for all inlet & outlet streams
Unknown stream T & PUnknown rate of energy transfer (as heat & power)
Equation to determine these unknowns:Material balances for each independent speciesEnergy balancePhase & chemical equilibrium relationsAdditional specified relationship among process
variables
H82CYS - Computer System Intro to Process Simulation 26
Example : A heated mixer
Heated mixern2 (kg O2)n3 (kg N2)
25ºC
n4 (kg O2)n5 (kg N2)
50ºC
n1 (kg O2)40ºC
Q (kJ)ndf analysis:
6 variables (n1, …, n5, 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
Degree of freedom revisited Given the following equations:
x1 + 2x2 – x32 = 0
5x1 – x23 + 4 = 0
i. What is the ndf for this system?ii. Which design variable to be chosen for an easier
solution? Given the following equations:
5x – 3y = 710x – 3y – 6z = 14
y = 2zi. Why can’t 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
Tutorial 1: Mass & energy balances
Determine the ndf for the systemWhat are the design variables & state variables?
Mixing
nA3 (mol A/s)nB3 (mol B/s)nC3 (mol C/s)nD3 (mol D/s)nE3 (mol E/s)
T3 (ºC)
nA2 (mol A/s)nB2 (mol B/s)nC2 (mol C/s)nD2 (mol D/s)nE2 (mol E/s)
T2 (ºC)
nA1 (mol A/s)nB1 (mol B/s)nC1 (mol C/s)nD1 (mol D/s)nE1 (mol E/s)
T1 (ºC)
S1
S2
S3
(Felder & Rousseau, 2000)
H82CYS - Computer System Intro to Process Simulation 29
Tutorial 1: Mass & energy balances Mass balance equations:
nA3 = nA1 + nA2
nB3 = nB1 + nB2
nC3 = nC1 + nC2
nD3 = nD1 + nD2
nE3 = nE1 + nE2 Energy balance equation:
H = noutHout – ninHin (assumption: P = 1 atm; temp = T1 H1 = 0; no phase change; constant Cp)
ndf = 18 variables (6 on each streams) – 6 equations= 12 degrees of freedom
H82CYS - Computer System Intro to Process Simulation 30
Tutorial 1: Mass & energy balances Specify the design variables:Stream 1:
nA1 = 23.5 mol A/snB1 = 16.2 mol B/snC1 = 8.5 mol C/snD1 = 5.6 mol D/snE1 = 2.2 mol E/sT1 = 135.0ºC
Stream 2:nA2 = 0.0 mol A/snB2 = 57.0 mol B/snC2 = 29.0 mol C/snD2 = 15.6 mol D/snE2 = 0.0 mol E/sT2 = 23.0º Other info [constant heat capacity in J/(mol.ºC)]: CpA
= 77.3; CpB = 135.0; CpC = 159.1; CpD = 173.2; CpE = 188.7
Determine the component flowrate & T for stream 3.
H82CYS - Computer System Intro to Process Simulation 31
Tutorial 1: Mass & energy balancesEnergy balance equation (cont.):
H = noutHout – ninHin = 0 0 = [ nA3CpA + nB3CpB + … + nE3CpE ] (T3 – T1)
– [ nA2CpA + nB2CpB + … + nE2CpE ] (T2 – T1) – [ nA1CpA + nB1CpB + … + nE1CpE ] (T1 – T1)
(reference temperature taken as T1)Rearrange the equation, solving for T3:
1233333
2222213 TT
CnCnCnCnCnCnCnCnCnCn
TTpEEpDDpCCpBBpAA
pEEpDDpCCpBBpAA
= 0
(Felder & Rousseau, 2000)
H82CYS - Computer System Intro to Process Simulation 32
Tutorial 1 in spreadsheet solution
Time for Time for exercise…exercise…
Approaches for Approaches for process process
flowsheetingflowsheeting• Sequential-modular• Equation-oriented
H82CYS - Computer System Intro to Process Simulation 35
Sequential-modular (SM) approach 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
Sequential modular approach
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
Sequential modular approach
Option 1: Mixer Reactor TowerOption 2: Mixer + Reactor TowerOption 3: Mixer + Reactor + Tower
H82CYS - Computer System Intro to Process Simulation 38
Tutorial 2 (continue from Tutorial 1)
MixingnA3 (mol A/s)nB3 (mol B/s)nC3 (mol C/s)nD3 (mol D/s)nE3 (mol E/s)
T3 (ºC)
nA2 (mol A/s)nB2 (mol B/s)nC2 (mol C/s)nD2 (mol D/s)nE2 (mol E/s)
T2 (ºC)
nA1 (mol A/s)nB1 (mol B/s)nC1 (mol C/s)nD1 (mol D/s)nE1 (mol E/s)
T1 (ºC)nA4 (mol A/s)nB4 (mol B/s)nC4 (mol C/s)nD4 (mol D/s)nE4 (mol E/s)
T4 = ?
S1
S2
S3 S4
Heater, Q = 100,000 J
Time for Time for exercise…exercise…
H82CYS - Computer System Intro to Process Simulation 40
Equation-oriented (EO) 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
Equation solving by matrixSolve 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
yz
a1 b1 c1a2 b2 c2a3 b3 c3
=d1d2d3
xyz =
d1d2d3
-1a1 b1 c1a2 b2 c2a3 b3 c3
H82CYS - Computer System Intro to Process Simulation 42
Tutorial 3Solve for the following simultaneous
equations: x + y + z = 1
2x - 2y + 5z = 12.5 y + z = 1
Set up matrix equation: A X = B
xyz
1 1 12 -2 50 2.5 1 =
111
H82CYS - Computer System Intro to Process Simulation 43
Matrix solving by Excel spreadsheet
Time for Time for exercise…exercise…
H82CYS - Computer System Intro to Process Simulation 45
Tutorial 4: BTX separation problem
C1 C235 kg B50 kg T15 kg X
n1 (kg)0.673 kg B/kg0.306 kg T/kg0.021 kg X/kg
n2 (kg B)n3 (kg T)n4 (kg X)
n5 (kg)0.059 kg B/kg0.926 kg T/kg0.015 kg X/kg
n6 (kg B)n7 (kg T): 10% of T in feed to C1n8 (kg X): 90% of X in feed to C1
C1: 4 variables (n1, …, n5)– 3 material balances = 1 local ndf
C2: 7 variables (n1, …, n5)– 3 material balances = 4 local ndf
Process: 5 local ndf– 3 ties (n2, n3 , n4) – 2 relations (recovery of T & X in C2 bottoms) = 0 degrees of freedom
H82CYS - Computer System Intro to Process Simulation 46
Tutorial 4: BTX separation problem
C1 C235 kg B50 kg T15 kg X
n1 (kg)0.673 kg B/kg0.306 kg T/kg0.021 kg X/kg
n2 (kg B)n3 (kg T)n4 (kg X)
n5 (kg)0.059 kg B/kg0.926 kg T/kg0.015 kg X/kg
n6 (kg B)n7 (kg T): 10% of T in feed to C1n8 (kg X): 90% of X in feed to C1
C1 balances:B: 35 = 0.673n1 + n2T: 50 = 0.306n1 + n3X: 15 = 0.021n1 + n4
C2 balances:B: n2 = 0.059n5 + n6T: n3 = 0.926n5 + n7X: n4 = 0.015n5 + n810% T recovery: n7 = 0.1 (50) = 5.090% X recovery: n8 = 0.9 (15) = 13.5
H82CYS - Computer System Intro to Process Simulation 47
Tutorial 4: BTX separation problemSolve the mass balance equation using
MS Excel spreadsheet:0.673n1 + n2 = 35 (1)0.306n1 + n3 = 50 (2)0.021n1 + n4 = 15 (3)0.059n5 + n6 – n2 = 0 (4)0.926n5 + n7 – n3 = 0 (5)0.015n5 + n8 – n4 = 0 (6)n7 = 5.0 (7)n8 = 13.5 (8)
Time for Time for exercise…exercise…