Computer Aided Process Engineering
Lecture 3: Simulation Problem
Solution Approaches
Flowsheet decomposition
Equation ordering
Convergence techniques
Flowsheet for cyclohexane production - What are we solving?
T=330 K P = 34 atm T=322 K P = 31.6 atm Purge gas
C-1
T=422.2 K P = 33.3 atm
Recycle H2
SP-1
Isothermal E-2
reactor
R-1
T=497.2 K
∆ P=1 atm
M-1 E-1
C6 H6 =
100
mixer
E-3 D-1 T=322 K
∆ P=0.5 atm
Other data: R-1 (heat of reaction, conversion,
H2 = 97.5 reference compound), E-1 (U & A), SP-1
CH4=2.5 (purge rate)
Condition: H2/C6H6 in reactor feed=12 Cyclohexane
methane/H2 balance for purge product
Computer Aided Process Engineering - Lecture 3 (R. Gani) 2
The objective is to fill-out all the stream summary table!
Variables Streams
S1 S2 S3 S4 S5 ……. S13
f1
f2
f3
f4
T
P
All stream is defined by NC+2 variables (component flows, T & P)
Computer Aided Process Engineering - Lecture 3 (R. Gani) 3
The objective is to fill-out the stream summary table! Which
stream variables are known? x indicate a specified variable.
Variables Streams
S1 S2 S3 S4 S5 ……. S13
f1 x x
f2 x x
f3 x x
f4 x x
T x x
P x x
Number of equations = 11 (NC+2); number of variables = 13 (NC+2); degree
of freedom = 2 (NC+2)
Computer Aided Process Engineering - Lecture 3 (R. Gani) 4
Steady State Simulation Approaches
variables Solve
x
M-1
x
Ax=b
E-1
x E-2 Equation Oriented
x R-1
equations
x E-3
x represents variables of
x the connecting streams
D-1
x SP-1
Sequential Modular
x C-1
M-1 E-1 E-2 R-1 E-3 D-1 SP-1 C-1
Computer Aided Process Engineering - Lecture 3 (R. Gani) 5
Flowsheet Decomposition
* Identify partitions
* Identify recycle-loops
* Determine tear-streams
* Determine calculation order
Equation Ordering
* Rearrange model equations
* Identify partitions
* Determine sparse pattern
Computer Aided Process Engineering - Lecture 3 (R. Gani) 6
Flowsheet decomposition & equation ordering
variables Convergence procedure
M-1 *
x k+1 = x k - F / J
* E-1
*
E-2 Mathematical model
*
R-1
equations
*
E-3
* represents variables of
*
the connecting streams
D-1
*
SP-1
Calculation order
* C-1
M-1 E-1 E-2 R-1 E-3 D-1 SP-1 C-1
Computer Aided Process Engineering - Lecture 3 (R. Gani) 7
How many partitions ?
How many recycle loops ?
How many tear streams and which are they ?
Flowsheet Decomposition
Computer Aided Process Engineering - Lecture 3 (R. Gani) 8
Flowsheet Decomposition
How many partitions ? 2
How many recycle loops ? 1
How many tear streams and which are they ? 1 ; any stream from 2,3,4,7
Solve, for tear-stream = 2, unit 2, unit 3, unit 4,
unit 1; after convergence,solve unit 5
Computer Aided Process Engineering - Lecture 3 (R. Gani) 9
Modular approach versus equation oriented approach
Sequential Modular Approach Equation Oriented Approach
Simulate one unit model at a time Solve all unit models together
Decompose flowsheet Order equations
Iterate in tear streams Update all unknown variables
simultaneously
Less flexible but more robust More flexible but less robust
Initialization is important Initialization is very important
Storage requirement not high Storage requirement can be very high
Computer Aided Process Engineering - Lecture 3 (R. Gani) 10
Flow-diagram for Sequential Modular Approach
Computer Aided Process Engineering - Lecture 3 (R. Gani) 11
Simultaneous Modular Approach
Generate Solve with
linear model rigorous model
parameters
Generate
new model
parameters
Check results
from inner-loop
with outer-loop
Computer Aided Process Engineering - Lecture 3 (R. Gani) 12
Determination of recycle-loops and partitions
The first step is to determine the existence of recycle loops and partitions (algorithm
of Sargent and Westerberg) –
1) Trace from one unit to the next by following the direction of the unit output
streams, one after the other. Stop when,
a) A unit reappears. In this case, collect all the units traced so far into one group.
b) A unit with no linked output is encountered
2) Count the number of different groups of units. Each group of units represents a
partition.
3) Identify groups with a single unit. Add each of these groups to the list of
partitions.
Computer Aided Process Engineering - Lecture 3 (R. Gani) 13
Tear-stream determination and calculation order
Algorithm2 (Gundersen)
For each partition, performthe following,
1. Remove all streams that are not includedinrecycle loops.
2. Calculate the ratioof number of variables per (output streams) /(input streams).
3. Tear all input streams to the unit (node) which has the largest ratio of number of
variables per (output streams)/(input streams).
4. Repeat fromstep 1until every loop has been torn.
Computer Aided Process Engineering - Lecture 3 (R. Gani) 14
Convergence Techniques (Modular)
Method J
Successive substitution I
i i -1 i i -1
Wegstein D= diag {d}; djj = (yj – yj )/(hj – hj )
i i -1 i i -1
Dominant Eigen-value 1/(1 -λ) I; λ = |(w – w )|/|( y – y )|
Broydon’s rule Full matrix QN– update (see [Link])
i –1
Newton [∂ F ( y )/ ∂ y]
Table 3.1: The formof J that can be used in equations 3.35 –3.36 for different convergence techniques.
Equation for tear-
h (y) = y - w = 0 stream convergence
Update method
y i+l = y – J h (y
i i)
Choice of the method defines J
Computer Aided Process Engineering - Lecture 3 (R. Gani) 15
Convergence Techniques (Equation Oriented)
Method J
Successive substitution I
i i -1 i i -1
Wegstein D= diag {d}; djj = (yj – yj )/(hj – hj )
i i -1 i i -1
Dominant Eigen-value 1/(1 -λ) I; λ = |(w – w )|/|( y – y )|
Broydon’s rule Full matrix QN– update (see [Link])
i –1
Newton [∂ F ( y )/ ∂ y]
Table 3.1: The formof J that can be used in equations 3.35 –3.36 for different convergence techniques.
Mathematical model
F≡Ay-b=0 of process flowsheet
Update method
y i+l = y – J h (y
i i)
Choice of the method defines J
Computer Aided Process Engineering - Lecture 3 (R. Gani) 16