SMA Detailed Partitioning and Tearing

Download as pdf or txt
Download as pdf or txt
You are on page 1of 67

Sequential Modular

Approach (SMA)
Basic Philosophy of Sequential Modular
Approach
• Given the input stream values and values for
equipment parameters, each unit module is written to
calculate the exit stream values

• Recycle stream values will be the iterated variables


Sequential Modular Approach (Cont’d)

• In SMA, a unit module is self-contained, i.e. independent of other


modules.
• SMA is most efficient for “acyclic” flowsheet: only 1 pass is needed.
Flowsheet with Recycle

• Must “tear” the recycle stream if using the SMA approach


• Tear = Provide an initial guess
• such as total flow, composition, temperature, and pressure.
• Consequence: Multiple-pass calculations and must solve a system of
nonlinear equations to converge the tear stream.
• Advantages of SMA:
1. Conceptual simplicity, Well defined, no ambiguity
2. Correspondence to physical structure
3. Requires little storage and computer memory

• Disadvantage of SMA:
• Can not handle design calculations
• Inefficient, nested loops making it difficult to solve optimization problems and
flowsheet with many recycles
Partitioning and Tearing a Flowsheet
• Most commercial steady-state simulators use the sequential modular
approach (SMA).

• ASPEN.HYSYS is a good example of a sequential modular simulator.

• Two basic problems arise in the SMA.


1. Partitioning a flowsheet
2. Tearing a flowsheet
Partitioning and Tearing a Flowsheet (Cont’d)
• First, consider the following flowsheet to be solved by a sequential
modular simulator:

• Computational sequence is MIXER, REACTOR, HEATX, FLASH.


Partitioning and Tearing a Flowsheet (Cont’d)
• Now, consider a slightly different flowsheet which is a modification to the
previous one.

• S6 is now a recycle stream instead of a process product stream.


• What is the computational sequence for this flowsheet?
Complications with Recycle Streams
• To work around the problem, we must perform trial-and-error.
• The workaround is to tear a stream, say S6.
• “Tear” provide an initial guess x0 for a stream
x0 = stream composition, T, and P
• Convergence block
If x0 (S6) = x1 (S6) within acceptable tolerance, then we are
done.
Otherwise, must update x1 (S6) somehow
Complications with Recycle Streams (Cont’d)
• Convergence block mechanism for updating a tear stream
• Numerical methods mathematical method/algorithm for
updating a tear stream.
• Example of a simple numerical method is Direct Substitution.
• Other numerical methods commonly used are:
1. Wegstein’s method
2. Newton-Raphson’s method
3. Broyden’s method
Complications with Recycle Streams (Cont’d)
• If S6 is the tear stream, the computational sequence of the recycled
flowsheet is:
Tear S6 ---> MIXER ---> REACTOR ---> HEATX ---> FLASH ---> Update S6
• Interestingly, S6 is not the only valid tear stream, i.e. a tear stream is
not unique. Can also tear S3, s4, or S5
• If S3 is the tear stream, what is the computational sequence?
Tear S3 ---> REACTOR ---> HEATX ---> FLASH ---> MIXER ---> Update S3
Complications with Recycle Streams (Cont’d)
• When a model is complex with many recycle streams, it is not
possible to “eyeball” the flowsheet and come up with tear streams.
• So 2 critical issues facing the SMA simulation
1. Minimum number of tear streams and their locations
2. Computational sequence

# of recycle streams = minimum # of tear streams


Complications with Recycle Streams (Cont’d)

• Minimum # of tear streams = 2, namely S6 and S7.


Complications with Recycle Streams (Cont’d)
• What about this one?

• Minimum # of tear streams = ?


• Computational sequence = ?
• In conclusion: # of recycle streams > minimum # of tear streams
A Somewhat Complex Flowsheet
Complications with Recycle Streams (Cont’d)
• Summary:
1. How many tear streams? (necessary because of recycles)
2. Which ones?
3. Convergence method?
4. In which order should one converge (partitioning)?
Another Type of Convergence Problem
• When a feedback controller is present
Called design specification
• Recycle of information because
• guess HX outlet temperature,
• calculate xC1 in S8 if xC1 = 0.01
• stop; otherwise update THX
• Guess Want xC1 = 0.01
• Design specification is a lot easier to converge than tear streams,
because it involves only 1 variable.
Algorithm for Determining Partitions
Partitioning and Precedence Ordering
• Partitioning – Locate within a flowsheet the groups of units which
must be solved together (called irreducible groups), with as fewest
number of units as possible.

• Precedence Ordering – Placing these groups of units in a proper


sequence for computation.
• What is Partitioning?

• What is Precedence ordering?

• Why partitioning?
• Can be used for linear & non-linear equations and flowsheets
Simple Example of Partitioning and
Precedence Ordering

• Partitioning: 3 unit groups, namely ABCD, E, and F


• Precedence Ordering: ABCD, then E, then F
• Actual computational sequence:
• Tear S1 --> C --> D --> A --> B --> Update S1 --> E --> F
Partitioning Algorithm
• Path Tracing algorithm by Sargent and Westerberg (1964)
• A simple algorithm for tracing unit outputs
• Basically, one traces from one unit to the next through the unit output streams,
forming a “string” of units.
This tracing continues until
(a) A unit in the string reappears.
All units between the repeated unit, together with the repeated unit, become a group,
which is collapsed together and treated as a single unit, and the tracing continues from
it.
(b) A unit or group of units with no more outputs is encountered.
The unit or group of units is placed at the top of a list of groups and is deleted entirely
from the problem.
Partitioning Algorithm (Cont’d)
Algorithm:
1. Select a unit/group
2. Trace outputs downstream until
(a) a unit or a group on the path reappears. Go to step 3.
(b) a unit or a group is reached with no external outputs. Go to step 4
3. Label all units into a group. Go to step 2.
4. Delete the unit or group. Record it in a list. Go to step 2.
• Sequence is from bottom to top of list!
Example of S & W’s Partitioning Algorithm

• 1. Start with unit A


List
•A B C M E I J K K
• Delete K and Delete J, since no output J
Example of S & W (Cont’d)

2. Start with unit A again


Example of S & W (Cont’d)
Example of S & W (Cont’d)
Conclusions
1. There are two convergence loops in this flowsheet, and we know
their relative order.
2. But we still don’t know the minimum number of tear streams in
each loop and what their locations are.
3. All we know is that the tear streams in each loop must be
converged simultaneously!
Tearing an Irreducible Group
• Given an irreducible group:
• Must determine the minimum # of tear streams and their locations.
1. Find minimum # of tear streams using
• Barkley and Motard’s (B & M) algorithm
2. Find all loops using
• Loop Finder algorithm
• Pho and Lipadus (Basic Tearing Algorithm)
Barkley & Motard’s Algorithm
• Guarantees the fewest number of tear streams in a flowsheet
• Basic concepts: Treat the flowsheet as a signal flow graph
• Process units = nodes
• Process streams = arcs connecting the nodes
Barkley & Motard’s Algorithm

Transformation:
• Nodes become arcs.
• Arcs become nodes.
• Direction of arc is from input to output.
Note that all process inputs and outputs have been
deleted.
Barkley & Motard’s Algorithm (Cont’d)
1. Graph Reduction
• Merge nodes with single precursor
Precursor: all nodes providing input to a given node are precursors for that node e.g. nodes
2 and 5 are precursors to node 3.
The node with a single precursor is to be represented by that precursor e.g. Node 2 has a
single precursor 1. So erase node 2 and represent it with node 1.
• Merge parallel arcs (same direction)
Barkley & Motard’s Algorithm (Cont’d)
2. Node Elimination (may see funny patterns after graph reductions)
a) Eliminate nodes with self-loops

• b) Process two-way edges or edge pairs by eliminating a node.


Eliminate common node of a joint two-way edge pair.
Barkley & Motard’s Algorithm (Cont’d)

• …. by eliminating common node with the most output edges. If tie,


choose arbitrarily. Return to Step 1 (graph reduction) after each
elimination in (a) or (b). Every elimination is a tear stream.
3. If no progress possible, eliminate node with maximum # of output
edges. In case of tie, choose arbitrarily. Go to step 1.
Barkley & Motard’s Algorithm (Cont’d)
Barkley & Motard’s Algorithm (Cont’d)
Barkley & Motard’s Algorithm (Cont’d)
Barkley & Motard’s Algorithm (Cont’d)
• But node 2 and 5 have the largest number of output streams.
• So eliminate node 2 and delete node 2 from the table.
• Stream 2 is a tear stream.

• so that nodes 3, 6, and 7 have single precursor.


Barkley & Motard’s Algorithm (Cont’d)

• So stream 5 is another tear stream.


• Tear streams are Stream 2 and Stream 5.
• The computational sequence is: C --> D --> E --> A --> B
Assignment (Use BM Method to find
minimum number of TS)
Forder-Hutchison’s Loop Finder Algorithm
• Based on path tracing also, but records both streams and blocks encountered.

• First, some definitions:


• Full string - sequence of units and streams on a path, e.g. A, S1, B, S2, C, S3
• Stream string - full string minus units, e.g. S1, S2, S3
• String loop - a full string that forms a loop, e.g. C, S3, D, S6, C
• Stream loop - string loop minus units, e.g. S3, S6
Loop Finder Algorithm (Cont’d)
• Algorithm:
1. Given a unit , trace outputs downstream until a unit reappears. Record the
string loop found. Go to Step 2.
A, S1, B, S2, C, S3, D, S6, C

2. Return to 2nd to the last unit and resume tracing until another unit is
repeated.
A, S1, B, S2, C, S3, D, S4, A loop
Return to Step 2 and repeat.
Loop Finder Algorithm (Cont’d)
3. If the last unit has no more outputs remaining to be traced, skip to
the next upstream unit and go to Step 2.
A, S1, B, S2, C, S5, A loop
So: C, S3, D, S6, C
A, S1, B, S2, C, S3, D, S4, A
A, S1, B, S2, C, S5, A
Construct a Loop Incidence Matrix:
Loop Finder Algorithm (Cont’d)
• Remarks:
1. The algorithm gives all valid sets of tear streams, not just one.
2. Not all valid sets of tear streams are equally desirable.
Some valid tear sets are:
{S3, S5}will break all the loops:
Computation order = Tear 3,5 --> D --> A --> B --> C -->Update tears
{S2, S6} order = Tear 2,6 --> C --> D --> A --> B --> Update tears
{S2, S3}is a valid tear set too:
But the trouble is we are breaking Loop 2 twice.
order = Tear 2,3 --> D --> C --> A --> B --> C --> Update tears
Loop Finder Algorithm (Cont’d)
• Block C is calculated twice; not desirable because of unnecessary
calculations.
• Define
• Multiplicity of a tear set = maximum # of times a loop is broken by a
tear set.
Multiplicity = 1 for {S3, S5}, {S2,S6} = (1,1,1)
= 2 for {S2,S3} = (1,2,1)
Exclusive tear set = tear set with a multiplicity of 1
Another Example of Loop Finder
Another Example of Loop Finder (Cont’d)
• This flowsheet does not contain any exclusive tear set.
• Some valid tear sets are:
1. {S4, S5, S6, S7} --> (1,1,1,1,1,3); multiplicity = 3
2. {S3, S8, S1, S6} --> (1,1,1,1,2,2); multiplicity = 2
• However, can’t say for sure which set is more desirable because all
the loops are broken 8 times in both tear sets.
Basic Tearing Algorithm
Loop S1 S2 S3 S4 …… Sj
L1 a11 a12 a13 a14 ……. a1j
L2 a21 a22 a23 a11 ……. a2j
L3 a31 a32 a33 a34 ……. a3j
. . . . . ……. …….
. . . . . ……. …….
. . . . . ……. …….
. . . . . ……. …….

Li ai1 ai2 ai3 ai4 ……. aij

𝑎𝑖𝑗 = 1 𝑖𝑓 𝑠𝑡𝑟𝑒𝑎𝑚 𝑗 𝑖𝑠 𝑝𝑎𝑟𝑡 𝑜𝑓 𝑙𝑜𝑜𝑝 𝑖


𝑎𝑖𝑗 = 0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
• Now let, yj be the integer variable for each stream such that ,
yj = 1 if the stream j is a tear stream
= 0 otherwise
To ensure that each recycle loop is broken at least once, we write, the
following constraints for each loop i,
𝑁

𝑎𝑖𝑗 𝑦𝑗 ≥ 1, 𝑖 = 1,2, … . . 𝐿
𝑖=1
Where L is the number of loops and n is the number of streams
• We also formulate the following cost function for tear selection:
𝐿
𝑗=1 𝑤𝑗 𝑦𝑗
• And we assign a weight wj to the cost of tearing stream j. Three
alternative choices for the weights are as follows
• Weight all the streams equal
• Choose 𝑤𝑗 = 𝐿𝑖=1 𝑎𝑖𝑗 . If we sum over the loop constraints, we obtain
coefficients that indicate the number of loops that are broken by a tear
stream j. Breaking a loop more than once causes a delay in the tear variable
iteration
• wj=nj, where nj is the sum of variables in the jth stream
The set covering problem is then given by,

𝑚𝑖𝑛: 𝑤𝑗 𝑦𝑗
𝑗

s.t. 𝑎𝑖𝑗 𝑦𝑗 ≥ 1, 𝑖 = 1,2, … . . 𝐿

𝑦𝑗 = 0,1
𝐿
With 1) 𝑤𝑗 = 𝑖=1 𝑎𝑖𝑗 2) wj=nj 3) wj=1
Reduction Rules for Minimum Number of Tear
Streams
• Let ri be the row vector ‘i‘ of the matrix A (Loop Incidence
Matrix) and cj=column vector ‘j’ of the matrix A.
• If ri has only single non zero element (ri)k,, set yk=1 and chose k as
tear stream.
• If row k dominates row l (all the instances in row l are also present
in row k) , then delete row K (a tear stream for row l automatically
satisfies the condition of breaking row l)
• If column k dominates column j s delete column j.
Basic Tearing Algorithm
Loop Incident Matrix
Reduction Rules
1. Column 2 Dominates Column 3 so delete
column 3
2. Column 1 dominates Column 4, 5, 6, 7
and 8 hence delete columns 4 to 8
1. Row 2 dominates Rows 1, 3 and 4 so delete row 2
2. Row 4 dominates row 3 so delete row 4
1. Row 1 has only single non zero element that is a12 hence
stream 2 is tear stream
2. Row 2 has only single non zero element that is a21 hence
stream 1 is tear stream

You might also like