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

A V E V A ™ T R A I N I N G

Workbook
August 2020
US Version

Flowsheet Control and


Optimization

PRODUCT: AVEVA™ PRO/II™ Simulation


INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT NOTICE.

Copyright © 2020 AVEVA Group plc and its subsidiaries. All rights reserved.
Table of Contents 3

Table of Contents
Introduction ................................................................................................................................. 4

Calculator .................................................................................................................................... 6

Flowsheet Control ..................................................................................................................... 11

Reaction Data and Reactors .................................................................................................... 20

Ternary Azeotropes .................................................................................................................. 24

Recycle Convergence and Sequencing .................................................................................. 28

Flowsheet Optimization ............................................................................................................ 49

Index........................................................................................................................................... 65

Flowsheet Control and Optimization


4 Introduction

Introduction
In this course you will learn about some of the advanced flowsheeting tools available in the
software. These tools enable you to do the following:
• Include virtually any specification in your simulation
• Accelerate the convergence of large flowsheets, particularly those containing
recycles
• Explore process alternatives in a straightforward and systematic manner. This allows
you to rapidly generate important flowsheet information without having to run an
inordinately large number of case studies
Many of the advanced features require or allow you to control their operation quite significantly.
You are more likely to use these features wisely if you have some understanding of how they
work. For this reason, this course includes some theory on several topics, including flowsheet
control, sequencing, and optimization.

About This Workbook


This workbook complements the Flowsheet Control and Optimization training course. Since
much of the course time is dedicated to hands-on examples, you will not necessarily go through
the document page by page. The workbook does, however, follow the course sequence and you
may want to jot notes in the margin. We strongly recommend that you read this workbook from
cover to cover once and then use it to refresh your memory later on.

Outline
The specific tools you will use in this workbook are:
• CALCULATOR
• FEEDBACK CONTROLLER
• MULTIVARIABLE CONTROLLER
• OPTIMIZER
These tools are considered to be unit operations, because they appear on the flowsheet, along
with your FLASH drums, HEAT EXCHANGERs, and COLUMNs. Do not confuse the
CONTROLLER unit with the process controllers that appear in the refinery or plant. The
CONTROLLER is a mathematical tool that operates analogously to process controllers.
In addition to these unit operations, you will learn about flowsheet sequencing and recycle
convergence acceleration methods. The class contains several flowsheets for you to solve.
They illustrate how to effectively use these tools, and how to avoid some of the more common
pitfalls associated with them.

Where to Find Additional Help

Documents
User manuals are shipped with your copy of the software. A complete set of documents is
provided online in the form of .PDF files that are most conveniently viewed using Adobe Acrobat
Reader 3.0. If you required additional manuals, contact your sales representative.

AVEVA™ PRO/II™ Simulation Training


Introduction 5

Online Help
The software comes with online Help, a comprehensive online reference tool that accesses
information quickly. In Help, commands, features, and data fields are explained in easy steps.
Answers are available instantly, online, while you work. You can access the electronic contents
for Help by selecting Help | Contents from the Ribbon. Context-sensitive help is accessed
using the <F1> key or the What's This? button by placing the cursor in the area in question.

Technical Support
In conjunction with the most advanced process modeling technologies available to the process
industries, we provide the most thorough service capabilities. AVEVA’s Customer Support helps
organizations achieve performance efficiency from SimSci simulation software, a leader in the
process simulation business since 1966.
Our comprehensive global support network, allied with our multitude of training opportunities, is
aimed solely at making your use of the software the most efficient and effective that it can be,
helping companies achieve a high level of production every day.
For North American hotline support, call 1-800-SIMSCI1.

Flowsheet Control and Optimization


6 Calculator

Calculator
The CALCULATOR retrieves flowsheet quantities and outputs some function of these
quantities. If there is some non-standard task that you desire to perform, try using the
CALCULATOR. The CALCULATOR’s power and versatility comes from its ability to do the
following:
• Access flowsheet data, such as stream and unit operation properties
• Manipulate that data through its FORTRAN-like language
• Transfer its results to flowsheet units and streams via specifications, Define, and
CALCULATOR procedures
The CALCULATOR is commonly used in conjunction with the CONTROLLER and OPTIMIZER.
Later in this course you will use the CALCULATOR to perform the following tasks:
• Compute a FLASH drum pressure from a correlation that relates the pressure drop to
the actual volumetric feed rate. The CALCULATOR retrieves the current volumetric
feed rate and evaluates the correlation. The FLASH then defines its pressure to be
the CALCULATOR result
• Maximize a profit function for a process. The CALCULATOR retrieves the product
flowrates, purities, column duties, and any other factors that contribute to revenue
and expenses. It then evaluates the profit function at the current operating
conditions. An OPTIMIZER unit is instructed to modify the process conditions to
maximize the CALCULATOR’s result
• Enhance the convergence of a flowsheet that contains a purge stream. A
CALCULATOR computes the purge rate that balances a key component, and a
SPLITTER uses the calculated value in its purge rate specification
In addition to these relatively straightforward applications, the CALCULATOR also includes
some very powerful functions which allow you to directly access and modify stream properties.
This is useful when you use a CALCULATOR to simulate a unit operation that is not contained
in the software, such as a proprietary reactor model. The CALCULATOR can retrieve the feed
stream conditions, calculate the product streams based on the reactor model, and copy the
results to another flowsheet stream.
The CALCULATOR has the ability to write results to files, therefore it can be used to generate
specialized output reports. It is also commonly used as a counter to keep track of the number of
times the software has solved a particular unit or passed through a recycle loop.
The CALCULATOR is organized in two sections: The Procedure section which is exposed and
the Data retrieval and setup section which can be found under the Edit/View Declarations
button. There are too many features to discuss here, so we will highlight only some of the more
important ones in this document. The help system and the AVEVA™ PRO/II™ Simulation
Reference Manual contain more detailed descriptions of the CALCULATOR.
The three important tasks related to the calculator are: data retrieval, data manipulation, and
data transfer.
As you would expect, data retrieval occurs primarily in the data retrieval and setup section,
although it is possible to access certain flowsheet quantities from within the procedure section.
Once the necessary flowsheet quantities have been retrieved, the mathematical manipulations
are carried out in the procedure section.
Finally, to be of any use in the flowsheet, the calculated results must be transferred to various
unit operations and streams. This is accomplished via the specification and define features, and
via intrinsic calculator functions.

AVEVA™ PRO/II™ Simulation Training


Calculator 7

Data Retrieval and Setup


In the data retrieval and setup section, you define constants, label results, and copy flowsheet
parameters into working arrays.
The CALCULATOR uses the Define concept to retrieve stream and unit results into a working
storage vector, called the P array. Note that results from other CALCULATORs can also be
retrieved. If the CALCULATOR requires the temperature of stream S1, you would simply define
parameter P(1) to be the temperature of stream S1. Any time you need this value in the
procedure section, you would access it through P(1).
If you need to define constants, use the C array. For example, you might supply the regression
constants for a correlation in this fashion.
Ordinarily, other flowsheet units access CALCULATOR results through the R array. For
example, you can define a FLASH temperature to be result R(3) from CALCULATOR CA1.
Since the name R(3) does not provide any description about this result, the software allows you
to supply meaningful names (e.g. Temp, Net Profit, Purge, etc.) for CALCULATOR results.
Labeling results is optional; however it increases the readability of the CALCULATOR output
reports and decreases the likelihood of your making an error by inadvertently referring to
CALCULATOR result R(4) instead of R(8).
The software gives you the ability to loop through the flowsheet streams. You might do this to
identify all streams whose temperature is greater than a given value. If you use the stream
looping feature, you must declare the sequence that the software should use. You declare the
sequence using the stream sequence feature in the data retrieval and setup section. You must
also declare a stream sequence if you use any of the stream property retrieval and storage
functions. These are discussed later.

Procedure Section
The procedure section starts after the data retrieval and setup section has finished. It contains
the actual CALCULATOR commands, written in a FORTRAN-like language. The language
contains several built in (intrinsic) functions that allow you to retrieve certain component and
stream properties from within the procedure section. The language also provides two
subroutines that can write CALCULATOR values into flowsheet streams: SRXSTR and
SRVSTR. These are discussed later.
The CALCULATOR’s command language is essentially a subset of FORTRAN 77, so you have
great flexibility in defining how the calculator should process the flowsheet variables. Here is a
list of some of the deviations from FORTRAN 77:
• To continue a statement to the next line, put an & at the end of the line
• Comment lines begin with a $, instead of the C or * of FORTRAN
• DO loop counters must be IX0, IX1, ... or IX9
• The FORTRAN WRITE statement is not supported; however, calculated results may
be displayed and written to files with the DISPLAY and OUTPUT statements
In the procedure section you have access to the P (flowsheet parameters) and C (constants)
arrays that you declared in the setup section. You store data in the V (real variables), IX (integer
variables), and R (results) arrays. The default array dimensions can be changed if you need the
extra space. The V and IX arrays are provided for workspace; only the R values are available to
other unit operations in the flowsheet.
The first time the CALCULATOR is run, all entries of the V, IX, and R vectors are initialized to a
very large negative number (roughly -1.5 x 1039).

Flowsheet Control and Optimization


8 Calculator

The V and IX arrays are reset every time the calculator is called; however, the R values are
saved between calculator calls.

Note: By initializing the result vector entries to a large negative number, the software
provides you with a method to test if the CALCULATOR has been called previously. For
example, the following statements use R(1) to count how many times the CALCULATOR
has executed. The first statement initializes the counter’s value to 0; it is executed only the
first time the CALCULATOR is called. The second statement increments the counter each
time the CALCULATOR is called.
IF (R(1) .LT. -1.0e30)
R(1)=0 R(1) = R(1) + 1

Data Transfer
Once the calculator has retrieved the necessary flowsheet data and performed the desired
manipulations, there are two ways to communicate the results back to the flowsheet units and
streams.
• The calculator has two powerful subroutines that allow it to write results directly into
streams. The SRXSTR subroutine writes calculator results, such as temperatures,
rates, pressures, etc. into stream properties. The SRVSTR subroutine writes a vector
of calculator results into a stream’s component molar flowrates. By combining these
two subroutines, you can create streams entirely from calculated results. The stream
is flashed at its new conditions.
• Unit operations in the flowsheet have access to all of the CALCULATOR's R() values
via Define and specifications. The calculator has a passive role in the data transfer; it
does nothing more than load numbers into the R() array. For example, the
SPLITTER specification:
flowrate of stream PURGE / calculator result R(3) = 1.0
sets the flowrate of the stream PURGE equal to the calculator result stored in R(3)

Example
Determine the temperature of the PRODUCT stream shown below. From experiments, you
know that the correlation T* = 260 + 2.1(T-245) + 0.4(T-245)2 + 0.03(T-245)3 is valid when T
is between 240 and 250ºF. This example illustrates some commonly used calculator syntax.

Assume that you have a process, perhaps a reactor, whose product stream temperature is
related to its feed stream temperature. You have carried out a large number of experiments for
feed temperatures between 240º and 250º. By fitting the results to the polynomial series shown

AVEVA™ PRO/II™ Simulation Training


Calculator 9

above, you can accurately predict the PRODUCT temperature for any FEED temperature
between 240º and 250º. For FEED temperatures outside of this range, the polynomial
correlation is inaccurate and alternate correlations must be used to determine the PRODUCT
temperature.
In the data retrieval and setup section, you would store the regression coefficients in the C
array:

C(1) = 260, C(2) = 2.1, C(3) = 0.4, and C(4) = 0.03

To apply the correlation, the calculator needs access to the FEED temperature. There are two
ways to do this. Typically you would retrieve the FEED temperature from within the data
retrieval and setup section by assigning its value to P(1). Instead, we chose to retrieve the feed
temperature from within the procedure section, by using the STEMP intrinsic function. In this
example, there is no reason to prefer one method over the other; we chose to use the intrinsic
function simply to illustrate its usage.
Figure 1 shows the procedure syntax required to implement the polynomial temperature
correlation.

V(6) = STEMP(FEED) - 245.0


IF( ABS(V(6)) .GT. 5.0 ) GOTO 60
R(1) = C(1)
DO 50 IX1 = 1,3
50 R(1) = R(1) + C(IX1+1)*V(6)**IX1
GOTO 99
60 CONTINUE
< alternate correlation omitted >
99 CALL SRXSTR(STEMP, R(1), PRODUCT)
OPEN (FILE=RESULT.CAL, APPEND)
OUTPUT P(1:10), R(1), R(2)

Figure 1: Procedure Syntax

The STEMP(FEED) function call in the first line returns the temperature of the stream named
FEED. The CALCULATOR provides many similar functions that retrieve stream and component
properties. If you use any of these functions, you must first use the CALCULATOR’s sequence
feature to declare which streams you will be accessing. See the AVEVA™ PRO/II™ Simulation
Reference Manual for details.
The IF... statement tests if the polynomial expansion should be used. If the feed temperature
deviates by more than 5º from 245, then the polynomial expansion is bypassed and execution
continues at the statement labeled 60. The alternate correlation statements would appear
between the statements labeled 60 and 99.
The statement R(1)=C(1) initializes R(1) to the first term in the power series. This prevents R(1)
from retaining its current value, which is -1.5 x 1039 on the first calculator call.
The DO 50 loop evaluates the remainder of the power series: C(2)*(T- 245) + C(3)*(T-245)2 +
C(4)*(T-245)3.
The CALL SRXSTR command stores the computed temperature, R(1), in the flowsheet stream
called PRODUCT. The SRXSTR subroutine also has the ability to store stream flowrates and
pressures. If you need to store component flowrates into a stream, use the SRVSTR subroutine.

Flowsheet Control and Optimization


10 Calculator

As with the stream property retrieval functions, these stream storage subroutines can access
only streams that have been declared in a sequence statement.
The OPEN and OUTPUT commands cause the selected CALCULATOR values to be printed to
the file named RESULT.CAL. You may want to use this output file for troubleshooting,
generating plots, or to data transfer to other programs.
Figure 2 illustrates how the CONTROLLER can use the CALCULATOR. A distillation column
must produce an overhead product whose research octane number (RON) is 80. Although the
software has a state of the art RON correlation built in, you wish to use your company’s
proprietary correlation to estimate the overhead RON. To use a CALCULATOR to perform this
function, you would simply program the RON correlation into the CALCULATOR and then use
the CONTROLLER to adjust the column reflux rate specification until the overhead has the
desired RON.

Figure 2: Calculator Example

Note that this problem is a loop. After the column converges, the CALCULATOR is executed.
The CALCULATOR retrieves the necessary properties of stream OVHD, for example, the
gravity, D86 5%, 10%, 90%, and 95% points and stores them in the P array. The
CALCULATOR's procedure section evaluates the RON correlation and stores the result in the
result array-in R(2) for example. This result is now available to the CONTROLLER, which is the
next calculated unit. The CONTROLLER makes the necessary adjustment to the COLUMN's
reflux rate specification. The cycle is repeated with the COLUMN, CALCULATOR, and
CONTROLLER executed until the calculated value of RON is 80.

Define
The Define feature allows the software to pass values between unit operations. For example,
suppose you have an expander and a compressor, which are physically linked by a common
shaft, so that the work available to the compressor is equal to 90% of the work produced by
the expander. To enforce this operating constraint, you simply define the compressor work to be
0.9 times the expander work. After the software calculates the expander, it will pass the now-
known value of work to the compressor.
You will find many uses for the define feature. A common use is to pass values from a calculator
to a unit operation. In the compressor train problem, you use define to pass the aftercooler
pressure from the calculator to the aftercooler. Recall that the calculator was required to
evaluate a pressure drop correlation.

AVEVA™ PRO/II™ Simulation Training


Flowsheet Control 11

Flowsheet Control

Feedback Controller
The software allows you to model a process feedback controller through satisfying a flowsheet
specification by manipulating an upstream parameter. The software normally enforces process
specifications on a particular unit operation by adjusting parameters associated with that unit
operation. For example, if you specify a flash drum’s temperature, the software will attempt to
satisfy this specification by adjusting that flash drum’s duty. If you specify a distillation column’s
product purities, the software will adjust that column’s condenser and reboiler duties until the
specifications are met. You normally enforce process specifications with local manipulations.
There are, however, many circumstances where you wish to enforce a specification in one-unit
operation by manipulating a variable in a distant unit or stream. This is the task of the feedback
controller unit operation.
The feedback controller allows you to automatically vary a flowsheet parameter in order to meet
a downstream flowsheet parameter. In this sense it is analogous to a process feedback
controller.

Piping Network
To illustrate the use of the feedback controller, consider the piping network shown in Figure 3.
Suppose you want to calculate the proportion of the high-pressure steam that flows through
each branch of the network. To do this, you will use your knowledge that, at steady state, the
pressures of the two pipe outlets must match, or backflow will result. One way to calculate the
split ratio is by trial and error. Guess a split ratio and calculate P1 and P2. If they match, you
have guessed the correct split ratio; if they do not, change the split ratio specification and re-run
the simulation. You will have to repeat this procedure until the outlet pressures match. The
figure shows the pressures that arise when the incorrect split ratio of 50% is selected.

Figure 3: Piping Network Flowsheet

The faster way to match P1 and P2 is to use the CONTROLLER unit operation. Simply instruct
the CONTROLLER to vary the SPLITTER specification until P1-P2=0 (or P1/P2=1). The
CONTROLLER quickly determines that this network operates with 77.5% of the steam flowing
through the lower branch.

Flowsheet Control and Optimization


12 Flowsheet Control

To use the CONTROLLER, you first specify a base case split ratio for the SPLITTER, say 50%.
When you input the CONTROLLER unit operation, you instruct it to vary the SPLITTER
specification (i.e., the split ratio) to meet the CONTROLLER specification that P1-P2=0. The
software first solves the flowsheet with the split ratio of 50%. This solution, called the base
solution, would be obtained if the CONTROLLER was absent. The CONTROLLER then starts
adjusting the split ratio from this base solution until P1-P2=0. If your guess for the base case is
poor, the CONTROLLER might not converge, so estimate this value as accurately as you can.
The CONTROLLER can adjust a wide variety variable to meet a wide variety of specifications.
The main restriction is that the variables must be quantities that are fixed in the base case and
the specifications must be calculated in the base case. For example, before the CONTROLLER
was added to the piping network, the split ratio was fixed at 50% and the outlet pressures were
calculated. For this reason, the split ratio was a valid choice for a CONTROLLER variable and
the outlet pressure difference was a valid specification.

Compressor Train
The example shown in Figure 4 involves a compressor train, which feeds natural gas to a
pipeline. The compressors in this flowsheet are modeled using performance curves, which
relate the flowrate to the head.

Figure 4: Compressor Train - No Controllers

The aftercoolers cool down the gas and separate out any liquid that forms during the cooling.
The pressure drops in the aftercoolers are correlated with the flowing volumetric rate of their
feed. Because the aftercooler model that is built into the COMPRESSOR unit does not support
this type of pressure drop correlation, you will have to model the aftercoolers as flash drums.
The COMPRESSOR outlet flowrate and pressure are passed to a CALCULATOR, which
evaluates the correlation to determine the aftercooler pressure drop. This pressure drop is
passed from the CALCULATOR to the FLASH DRUM via the Define feature.
The pipeline is modeled as a dummy MIXER with a pressure drop obtained using yet another
correlation and CALCULATOR.
It is a simple matter to calculate the outlet pressure for a given inlet flowrate. The inverse
problem is more difficult; calculate the flowrate for a given outlet pressure.
The inverse problem is what you must solve. The compressor train must operate so that the
outlet gas pressure matches the pipeline pressure of 1080 psia, so you are interested in
calculating the amount of gas that this compressor train can deliver to the pipeline. For now,
assume that the COMPRESSOR speeds are fixed at their current values. Since the as-yet
unknown feed rate affects the COMPRESSOR and aftercooler performance, this flowsheet
requires a controller to determine the gas flowrate that yields the desired outlet pressure. You
could, of course, perform this calculation manually (i.e., without a CONTROLLER) by repeatedly
guessing a flowrate and calculating the outlet pressure.

AVEVA™ PRO/II™ Simulation Training


Flowsheet Control 13

When using the CONTROLLER, it is important that you understand how the convergence
tolerances affect the results. In this example we have changed the tolerance on the
CONTROLLER specification to 1 psi. This forces the software to continue iterating on the inlet
feed rate until the calculated outlet pressure is within 1 psi of the desired 1080 psia. In relative
terms, this is about 10-3, or one part in a thousand. For the CONTROLLER specification to be
this precise, the unit operations that make up the control loop should be calculated at least this
precisely. In fact, it is good practice to solve the individual units more precisely than the
CONTROLLER. By tightening the COMPRESSOR tolerances, you improve the
CONTROLLER’s performance by reducing the noise level that is sent to it. In this example, the
COMPRESSORs’ tolerances were tightened from 10-3 (default value) to 10-4. Note that errors in
individual unit operations can compound and produce a significantly larger overall error from a
group of units. On running the simulation, you find that 1130 lb-mol/min of gas can be delivered
to the pipeline.

Figure 5: Compressor Train - Feedback Controller

If the CONTROLLER specification error remains small and relatively constant for a few
iterations, the tolerances in the unit operations are probably too loose and should be tightened.
You can also help the control loop to converge by providing upper and lower bounds on the
manipulated variable (the inlet flowrate here). Providing values can stabilize calculations by
preventing the CONTROLLER from trying out very low or high flowrates, which might cause the
compressors to fail to converge.

Control Loop
A conceptual diagram of a control loop appears in Figure 6. The unit operations that comprise
the process are unimportant; consider them to be a black box that transforms an input variable,
V, into a result, f(V). The CONTROLLER manipulates V to produce a desired value of f(V). In
the compressor train example, V was the feed flowrate and f(V) was the compressor train outlet
pressure. In the piping network example, V was the split ratio and f(V) was the pressure
difference between the two sections of pipe.

Flowsheet Control and Optimization


14 Flowsheet Control

Figure 6: Control Loop

If you remove the CONTROLLER, you can supply a value for V, run the simulation, and record
the resulting value of f(V). By repeating this procedure for a range of V, you can construct a
graph that shows the response of the process to your input. An example is shown in the figure
on the right.
This process exhibits a wide range of behavior. When V is low, f(V) remains constant; it is
invariant to changes in V. The local maximum implies that f(V) can both increase and decrease
with increasing V. At the point labeled B, there is a discontinuous change in the response.
These situations cause difficulties for the controller.
The invariant situation is quite common and usually indicates a process that is at some limit. For
example, to control a FLASH DRUM’s vapor fraction you can manipulate its heating duty. As
you increase the heating duty, the vapor fraction increases to 1.0 (all vapor). Any additional duty
superheats the vapor, but the vapor fraction remains constant at 1.0.
The CONTROLLER works best when f(V) is a “nice” function of V. In the figure, any guess
between A and B would lead to a converged result, while if the controller guesses a value
outside of this range, convergence will probably fail. You can restrict the CONTROLLER’s
search by providing lower and upper bounds on the variable. This helps the software solve the
problem by ensuring that the CONTROLLER stays in the well-behaved region.

Multivariable Controller
The MULTIVARIABLE CONTROLLER simultaneously solves several flowsheet specifications
by manipulating an equal number of upstream flowsheet variables. In certain situations, it
should be used in preference to two or more interconnected feedback CONTROLLERs.
Recall that the compressor train of the previous example could deliver about 1110 lb-mol/min of
gas to the pipeline at 1080 psia. Assume that you now wish to deliver 1250 lb-mol/min at 1080
psia. You run a few case studies and conclude that this flowrate cannot be met within the
operating ranges of the existing compressors. To meet this new flowrate specification, you
decide to keep the existing compressors operating at their current conditions and add a fourth
compressor to the train.
Your job is to calculate the inlet feed rate and the new compressor’s speed that enable the
compressor train to deliver 1250 lb-mol/min to the pipeline at 1080 psia. At first glance this
problem seems to be a simple extension of the previous one, where you used a CONTROLLER
to vary the inlet flowrate until the outlet pressure was 1080 psia. You could simply add another

AVEVA™ PRO/II™ Simulation Training


Flowsheet Control 15

controller that varies the compressor speed to meet the required outlet flowrate. This flowsheet
is now solved as follows:

CONTROLLER 1: adjust inlet flowrate to meet pressure specification


CONTROLLER 2: adjust compressor speed to meet outlet flowrate specification

But why should you associate the compressor speed with the outlet flowrate and the inlet
flowrate with the outlet pressure? You would expect the inlet flowrate to have a strong influence
on the outlet flowrate, so it is more logical to use the following control scheme:

CONTROLLER 1: adjust inlet flowrate to meet outlet flowrate specification


CONTROLLER 2: adjust compressor speed to meet pressure specification

The flowsheet has two loops which are almost the same size; each time the outer controller
makes a change, the software must fully converge the inner control loop.

Figure 7: Compressor Chain - Multiple Controllers

In this situation, it would be more efficient to replace the two controllers with a MULTIVARIABLE
CONTROLLER.

Nested Control Scheme


To illustrate the benefits of using the MVC over nested feedback controllers, consider the
simplified process shown in Figure 8.

Flowsheet Control and Optimization


16 Flowsheet Control

Figure 8: Nested Control Scheme

The process produces two quantities (f and g) that you wish to control by adjusting x and y. In
the compressor train example, x and y correspond to the inlet feed rate and compressor speed,
and f and g correspond to the outlet flowrate and pressure. For illustrative purposes, we have
chosen the simple functional relationships shown in the diagram. Assume that we wish our
process to satisfy the specifications:

f(x,y) = 1 and g(x,y) = 1

The feedback controller has a simple graphical interpretation. Make a sketch like the one shown
in the figure on the right. Each point in the x-y plane represents an operating condition. Points
on the g(x,y)=1 curve correspond to operating conditions that satisfy the g specification, and
points on the f(x,y)=1/4 curve satisfy the f specification. The intersection point satisfies both
specifications and is hence the solution you seek.
The current control scheme consists of two feedback controllers that operate as follows:

Cg: Adjust x until g(x,y) = 1 Cf: Adjust y until f(x,y) = 1/4

In this example, the sequence is ((U, Cg) Cf), where U represent all the unit operations in the
process. The parenthesis denotes the calculation loops automatically set up by the controllers.
The simulation will proceed as follows:
1) Solve U with the current guesses of x and y.
2) Execute Cg to generate a new guess for x and return to step 1) until Cg specification is
met.
3) Execute Cf to generate a new guess for y and return to step 1) until Cf specification is
met.
Notice that the inner controller (Cg) is solved completely for every outer controller (Cf) iteration.
In other words, Cg is satisfied every time Cf is executed. Cg will typically be executed many
times for each time Cf is executed.

AVEVA™ PRO/II™ Simulation Training


Flowsheet Control 17

On the graph, solving the inner (Cg) control loop (steps 1 and 2) corresponds to a horizontal
motion from the current estimate to the g(x,y)=1 curve. It is horizontal because Cg does not
change y. After the inner loop is solved, the outer controller (Cf) will attempt to adjust y to meet
its specification. Chances are it will not be able to meet the specification in one iteration, thus
Step 3 corresponds to a vertical motion from the g(x,y)=1 curve towards the f(x,y)=1/4 curve. It
may overshoot, undershoot or exactly satisfy the specification, but each vertical segment
represents only one iteration of the outer controller. By repeating this procedure, you can
graphically simulate the actions of the two controllers. In this sequence, each horizontal
segment represents Cg iterations while each vertical segment represents a single Cf iteration.
Figure 8 shows the fate of two initial guesses started from x=1. The guess with the larger y
value moves closer and closer to the solution and eventually converges. The guess with the
slightly lower y value fails to converge, even though it was almost identical to the successful
initial estimate. Nested controller loops can be sensitive to your initial guesses.

Sequencing
Figure 9 shows how we started from the failed initial guess of the previous case, but changed
the calculation sequence so that Cf is the inner controller and Cg is the outer controller. The
inner loop now corresponds to a vertical motion from the current guess to the f(x,y)=1/4 curve.
Notice that this flowsheet now converges. The calculational sequence you select can have a
strong effect on the convergence behavior.

Figure 9: Sequencing

Spec-Vary Association
In example shown in Figure 10, we have reversed the controller variables; we simply chose to
associate the y variable with the g specification and the x variable with the f specification.

Flowsheet Control and Optimization


18 Flowsheet Control

Figure 10: Spec-Vary Association

The inner control loop (Cg) now corresponds to a vertical motion from the current estimate to the
g(x,y)=1 curve. Each outer loop iteration corresponds to a horizontal motion from the g(x,y)=1
curve towards the f(x,y)=1/4 curve. The figure on the right shows the fate of the successful initial
guess from the previous example. Notice now that as the controllers adjust x and y, each guess
moves farther away from the solution.
The failure is caused by the variables we chose to associate with each specification.
Associating a single variable with a single specification is somewhat unreliable, because both
variables affect both specifications.
This nested-feedback-controller approach works best when each variable has a strong effect on
only a single specification, that is, f(x,y)  f(x) and g(x,y)  g(y).
The graphical representation of the controllers immediately reveals a shortcoming of using
nested controllers. Their search path consists of line segments that are constrained to be
parallel to the coordinate axes (i.e., horizontal and vertical). You would expect better results if
the search path was unconstrained.

MVC Model
We have already alluded to the remedy to the problems associated with nested controllers.
Rather than adjusting the variables sequentially, you should adjust them simultaneously. The
MULTIVARIABLE CONTROLLER (MVC) unit operation does precisely this. The MVC examines
both specifications and then adjusts both variables at each iteration. For this reason, you do not
have to choose specification-variable pairs; you simply provide a list of specifications and a list
of an equal number of variables. The MVC automatically accounts for all specification-variable
interactions.

AVEVA™ PRO/II™ Simulation Training


Flowsheet Control 19

Figure 11: MVC Model

The MVC search path can be much more efficient and reliable than the nested-controller
alternative. As Figure 11 illustrates, the MVC’s search path is not restricted to horizontal and
vertical motions.
The MVC uses an unconstrained minimization algorithm that incorporates any specified variable
boundaries as penalty functions.
For the compressor train example, the MVC solved the flowsheet in the same time as the best-
sequenced nested-controller scheme. The nested controllers worked particularly well because
the outlet flowrate specification is hardly affected by the compressor speed. The specifications
are somewhat decoupled from each other. For this problem, the advantage of using the MVC is
that you do not need to be concerned about the calculational sequence or correctly assigning
specification-variable pairs.
The calculation sequence is now U, MVC, U, MVC, ... whereas before, U represents the
calculation of all the process units.

Flowsheet Control and Optimization


20 Reaction Data and Reactors

Reaction Data and Reactors

Defining Reaction Data


Reactor unit operations use the reaction data capability. Under the Input tab, click
Reaction Data to define the reaction data properties. You assign names to individual
reactions and store groups of reactions in reaction sets for easy organization and
retrieval. The software has two predefined reaction sets, which contain data for the
important Shift and Methanation reactions.
The Reaction Definitions window in Figure 12 show the contents of the user-defined reaction
set, FURNACE_RXNS. The currently defined reactions are named H2BURN and METHBURN.
Most reaction properties are entered through this window. H, E, and K allow you to input heats
of reaction, equilibrium data, and kinetic data.

Figure 12: Reaction Definitions Window

Reaction Stoichiometry
You can enter reaction stoichiometry by clicking on the Definition linked text. A table will
appear that allows you to define your reaction by simply filling in the blanks. The software will
even check your stoichiometry for errors.
You should be aware that the software selects the default reaction rate expressions based on
the stoichiometric coefficients.

AVEVA™ PRO/II™ Simulation Training


Reaction Data and Reactors 21

For example, if you input a reaction as:

2A + B = 2C

The software will generate the following rate expression:

rate1 = K [A]2 [B]

If, however, you enter the same reaction using the stoichiometrically equivalent form:

A + 0.5 B = C

The software will generate the following rate expression:

rate2 = K [A] [B]1/2

Clearly, a given reaction can have only one rate expression. The expression is determined by
the physics of the problem and should be independent of the way the reaction is written. The
software uses power law kinetics with the stoichiometric coefficients as the exponents. It is thus
important that you enter your stoichiometry to reflect the actual reaction mechanism. If, for
example, you know that this reaction exhibits tri-molecular kinetics, then you should enter it as
2A + B = 2C and the software will select the correct rate expression. If you choose not to do
this, you are always free to manually override the expression the software has selected for you.

Heat of Reaction Data


You can specify heat of reaction data by clicking H that appears to the right of each reaction. In
addition to the heat of reaction, you can also input the phase and temperature at which the
measurement was taken. If you do not provide values, the software will calculate the heat of
reaction from heats of formation contained in its libraries.

Reaction Equilibrium Data


Clicking E activates a window that allows you to input reaction equilibrium data. The reaction
equilibrium constant is:

(1)

where the ν's are the coefficients in the stoichiometric expression. By convention, the exponents
are positive for products and negative for reactants. The software expresses liquid activity in
terms of mole fractions and vapor activity in terms of partial pressure. You can provide
temperature dependent K-values by supplying coefficients (A, B, C,...) for the series:

Flowsheet Control and Optimization


22 Reaction Data and Reactors

(2)

Reaction Kinetic Data


You can define the rate expression for the selected reaction by clicking K. The rate expression
has the form:

(3)

The temperature dependence is a corrected Arrhenius model, where:


• A is the pre-exponential factor
• E is the activation energy
• n is the temperature correction exponent
By selecting n=0, the standard Arrhenius form is recovered. Power law kinetics are used, and
order is the reaction order for each component. Click Reaction Order & Activity Phase to
enter the reaction order. If you do not provide component orders, the software will use the
stoichiometric coefficients from the reaction definition you provided.

Reactor Types
The software provides six types of reactor units that use reaction data supplied through the
Reaction Data window. Each requires a different subset of the reaction data and you only need
to enter the required data for the specific reactor. Table 1 indicates which reaction data are
required, "R", and which are optional, "O", for the six reactor types.

Table 1: Reactor Data

Reactor Type Data Type


Stoichiometry H E K
Gibbs O
Conversion R O
Equilibrium R O R*
CSTR or Boiling Pot R O R*
PFR R O R*
Batch R O R*

*These data can be entered through the reactor unit window

The Conversion reactor calculates the outlet composition and temperature based on the
stoichiometry and extent of reaction(s) that you provide. Multiple reactions can be specified.
Each reaction extent is defined in terms of a base component and can be temperature
dependent if you desire.

AVEVA™ PRO/II™ Simulation Training


Reaction Data and Reactors 23

The Equilibrium reactor calculates the outlet composition and temperature of a single reaction
based on equilibrium data that you provide. By default, the reaction is taken to equilibrium,
although you can provide approach-to-equilibrium data that will stop the reaction before
equilibrium is reached.
The Plug Flow reactor (PFR) simulates a tubular reactor without axial mixing. It uses the kinetic
data to calculate the outlet composition and temperature. Multiple reactions can be specified.
For this reactor, you will have to provide the length and diameter of the tubes and can optionally
provide a temperature profile or a heating/cooling jacket. During the PFR calculations, the
software integrates a set of differential equations; the accuracy of these calculations can
depend on a derivative stepsize parameter which you optionally provide. The PFR calculations
require the integration of differential equations and there are step-size parameters that you can
supply to affect accuracy.
The Continuous Stirred Tank reactor (CSTR) simulates a perfectly mixed tank reactor with
optional heating or cooling. Multiple reactions can be specified. Both the reactor volume and
kinetic data are required for CSTR calculations.
The Gibbs reactor does not require any reaction stoichiometry. It effectively considers all
possible reactions by minimizing the Gibbs free energy of the mixture. If you desire, you can
provide stoichiometry in order to constrain the equilibrium.
The Batch reactor allows for the calculation of material production as a result of simultaneous
and/or sequential reactions in the liquid contents of a reactor vessel. Phase-equilibrium analysis
during the reaction process allows for the tracking or removal of vapor-phase products at the
end of the cycle.

Accessing Reaction Data


After you enter your reaction data, you can select the appropriate reaction set from within each
reactor unit window. The two reactions, H2BURN and METHBURN, will be listed in the Extent
of Reaction window, where you can define the order in which the reactions occur and to what
extent.

Flowsheet Control and Optimization


24 Ternary Azeotropes

Ternary Azeotropes
Ternary azeotropes exhibit three phase behaviors with the vapor and combined liquid phases
having identical composition. The separation of azeotropes has commercial importance,
because many industrial chemical reactions produce byproducts that form azeotropes with the
desired product. While these byproducts may not present a problem when dilute, recycle
streams tend to concentrate these components to a point where they do present a problem.

Locating Azeotropes
Process simulators are meant to be an adjunct to the design process, not a replacement for the
thought process. Your first step in a simulation should be an analysis of the system. After you
analyze the process you should understand the process and have some expectations of how it
should operate. This will aid you in generating meaningful specifications and initial estimates as
well as in analyzing the results.
For systems with a small number of components, you can gain a great deal of understanding by
examining the binary VLE using the BVLE (Binary Vapor Liquid Equilibrium) unit operation. For
systems with a larger number of components, you may have to perform a series of VLE or VLLE
flashes. The predictions of the flashes should be compared with experimental data in the region
of the expected operation. If you have two liquid phases and one is being withdrawn then the
LLE must match as well.
As your final design step, evaluate the sensitivity of the simulation to errors in the predicted
VLE, and verify the thermodynamic model (including such options as excluding VLLE
calculations). You will find that simple separations such as the concentrator will be insensitive to
errors in the VLE predictions. Complex separations such as the azeotropic distillation tend to be
more sensitive to errors in the VLLE predictions. In extreme cases, the differences in the
predicted and actual equilibria may cause you to produce an unworkable design.

Using a Multivariable Controller


You can use a MULTIVARIABLE CONTROLLER (MVC) to calculate the ternary azeotrope for a
system of water, sec-butyl-alcohol (SBA), and di- sec-butyl-ether (DSBE) at a fixed pressure of
1.3 ATM.

AVEVA™ PRO/II™ Simulation Training


Ternary Azeotropes 25

Figure 13: Ternary Azeotrope for DSBE, SBA, and Water

The flowsheet shown in Figure 14 shows a simple process that can be used to locate the
azeotrope.

Figure 14: Flowsheet for Locating an Azeotrope

The three feed streams consist of pure DSBE, SBA, and water, and the bubble point flash has a
vapor pseudostream with a nonzero flowrate. The MVC will adjust the feed flowrates until the
VAPOR and BULKLIQ streams have identical composition. Of course, if any two mole fractions
match, the third must also match, because they sum to 1 for each phase. This problem thus has
only two degrees of freedom, and we choose to fix the WATER flowrate at 1 lb-mol/hr and vary
the DSBE and SBA flowrates until the following specifications are met:

Flowsheet Control and Optimization


26 Ternary Azeotropes

XSBA - YSBA = 0
XDSBE - YDSBE = 0

where X refers to the BULKLIQ mole fraction, and Y refers to the VAPOR mole fraction.
If you prefer, you could use the essentially-equivalent specifications:

XSBA / YSBA = 1
XDSBE / YDSBE = 1

It is better to use X - Y = 0 specifications over X/Y = 1 because there is no danger of dividing by


zero.
You can control the MVC’s operation in several ways:
• You can independently adjust the convergence tolerance for each specification. In
this example we are interested in finding a very precise solution, so we lowered the
relative tolerance to 0.0001 for both specifications. You will also need to lower the
Maximum Absolute Error to 10-9.
• You can help the software converge by specifying a range of variable values to
search. In this example we know that water is the dominant component in the ternary
azeotrope, so we instructed the software to consider DSBE and SBA flowrates
between 0.001 and 1 lb-mol/hr (recall that the water rate is fixed at 1 lb-mol/hr).
Ordinarily if a variable steps outside of its allowable range of values, the software will
stop calculation and print a message. You can override this action by instructing the
MVC to allow variables to exceed their bounds.
• You also have some control over how much the software will change the variables at
each step. This problem works fine at the default settings; however sometimes
lowering these parameters can stabilize convergence.
This example converges rapidly, provided your initial guesses are not too far from the solution.
At P=1.3 ATM, the azeotrope occurs at 203.6ºF and Xwater = 0.649, XSBA = 0.018, XDSBE = 0.333.
The DSBE and SBA flowrates are 0.514 and 0.273 lb-mole/hr, respectively.
A more elegant way to locate the azeotrope is to add the specification that the total feed rate is
a constant value, say 1 lb-mol/hr. Add the WATER flowrate to the list of variables to balance the
specifications and variables. The advantage over the previous approach is that you can provide
more definite values for the range of the variables; all must be between 0 and 1.0. Furthermore,
the flowrates of the feeds now correspond to the azeotropic mole fractions.

Using an Optimizer
The optimizer is a very versatile tool. The flowsheet illustrated in Figure 15 is used to calculate a
ternary azeotrope. Recall that a ternary azeotrope has identical vapor and bulk-liquid
compositions.

AVEVA™ PRO/II™ Simulation Training


Ternary Azeotropes 27

Figure 15: Flowsheet for Determining Azeotropes Using an Optimizer

You can find the azeotrope using an MVC with the following specifications:

Xacetone - Yacetone = 0
Xmethanol - Ymethanol = 0
Feed to flash F1, S = 1.0 mol/hr

The variables are the flowrates of the acetone, methanol, and chloroform streams.
To use the optimizer, you must devise a single objective function that is equivalent to these
specifications. There are many possibilities, but minimizing the sum-square of the specifications
often works well:

The flash is a bubble point flash at the desired pressure. X is the mole fraction in stream LIQ
and Y is the mole fraction of the vapor pseudostream, VAP. A, B, and C, are positive weighting
coefficients that you select to tune the objective function so that convergence is accurate and
rapid and to enforce one of the specifications more tightly than the others. For this example, A =
B = C = 1 works well.
F(x) attains its minimum value (zero) when Xacetone = Yacetone, Xmethanol = Ymethanol, and S = 1.
Minimizing this F(x) is equivalent to satisfying all of the MVC specifications. Another strategy is
to enforce S = 1.0 mole/hr through an optimizer specification.

Flowsheet Control and Optimization


28 Recycle Convergence and Sequencing

Recycle Convergence and Sequencing


When the software encounters a recycle in your flowsheet, it performs iterative calculations until
convergence is achieved. This involves repeated solution of all of the units contained in the
recycle loop. In many cases these calculations can be time consuming, and in some cases,
convergence may fail unless you intervene.

Because of these difficulties, the software provides you with a significant degree of control over
recycle-solving strategy. The simplest way you can facilitate convergence is by providing good
guesses on the rate and properties of recycle streams: these might come from a previously
converged run. There are several other techniques that can improve simulation efficiency even
further. For example:
• Picking the best unit calculation sequence
• Selecting a convergence acceleration algorithm
• Grouping units to solve them at the same time.

Recycle Streams
There are two types of recycle streams: compositional and thermal. Compositional recycles
transfer both mass and energy to upstream units, while thermal recycles transfer only energy.
As you will learn, thermal recycles are usually easier to solve than compositional recycles
because the software has tools that enable you to break many thermal recycle loops.

Figure 16: Types of Recycle Streams

The flowsheet shown in Figure 16 is typical of many processes. A light feed is reacted to
produce a heavy product. The conversion is not 100 percent, so a distillation column is used
downstream to separate the products from unreacted feed. The unreacted feed is then recycled
back to the reactor; this stream is a compositional recycle. The column bottoms preheats the
reactor feed; this product stream is a thermal recycle and it occurs commonly in a wide variety
of processes. For highly exothermic reactions, the hot reactor product is also used for feed
preheat.
Notice that a purge stream is used to prevent a build-up of light inert components in the
process. Specifying a purge rate can be dangerous, because in general the flowsheet will solve
over only a very small range of purge rates. For this reason, your simulations will be more

AVEVA™ PRO/II™ Simulation Training


Recycle Convergence and Sequencing 29

reliable if you specify the recycle rate or split ratio than the purge rate. By specifying the split
ratio or recycle rate, you allow the software to calculate the purge rate that balances the inerts.
Later in this presentation, you will learn how to use the CALCULATOR and CONTROLLER to
solve problems involving purge streams even more efficiently.

Main Flow Processing Sequence


The simple task of identifying a flowsheet’s recycle streams is actually dependent on how you
draw the flowsheet. You can think of a flowsheet as a sequence of units that process raw
material streams into product streams. It is therefore logical to draw flowsheets from left to right
with the input streams on the left and the units producing the most important products on the
right. This sequence of units is called the Main Flow Processing Sequence, which we will
abbreviate as Main Sequence. Any branches are also drawn from left to right. The flowsheet in
Figure 17 processes the input stream, S1, to give product stream, S8. The main sequence is
U1, U2, U3, U4, U5, U6.

Figure 17: Main Sequence

This flowsheet has an additional feed stream (S5) and a branch consisting of unit U7, which
leads to a second product (S10). Stream R1, unlike all others, goes from right to left, opposing
the direction of the flow in the main sequence and connecting a unit from the main sequence to
an upstream unit. We call this a Recycle Stream. If the connection involves one or more units,
we simply call it a Recycle.
Depending on your perspective, the flowsheet in Figure 17 has another main processing
sequence. If, instead of S1, you consider S5 to be the main feed stream, you would draw the
flowsheet as depicted in Figure 18.

Flowsheet Control and Optimization


30 Recycle Convergence and Sequencing

Figure 18: Main Sequence – Different Perspective

The units that process stream S5 are now drawn from left to right with a main sequence defined
by U4, U5, U6. Unit U5 is connected to its predecessor unit (U4), through units U2 and U3 and
streams R1, S3, and S4. By simply redefining the main sequence, the flowsheet’s recycle has
been transformed from one stream to two units and three streams. If you asked two people to
describe this flowsheet’s recycles, you could get two correct answers!

Of course, recycles can take on more complicated forms. The recycles shown in Figure 19 have
multiple origination and termination units. Units U4 and U5 are connected to their predecessors,
U2 and U3, through streams S8, S9, S10, S11 and unit U6.

Figure 19: Multiple Origination and Termination Units

Once you have chosen the main sequence, the recycles become apparent. The choice of the
main sequence is subjective for each particular case, and consequently cannot easily be put
into an algorithmic form. Nevertheless, you can generalize the concept of a recycle as follows:
• A Recycle is a sequence of streams and units that connect a unit or a set of units of
the main or branching sequence with one of its upstream predecessors in the main
or branching sequence
• A Recycle Stream is any stream that belongs to a recycle

AVEVA™ PRO/II™ Simulation Training


Recycle Convergence and Sequencing 31

Calculation Sequence
The software is a sequential-modular simulator, which simply means that unit operations are
solved one at a time. A unit can be calculated only when its feeds and operating conditions are
known or estimated. The order in which the units are calculated is called the Calculation
Sequence. This sequence must contain all of the flowsheet’s units. Note that the calculation
sequence is not necessarily the same as the main sequence. In fact, convergence is sometimes
accelerated when you select a different calculation sequence.
As you know, flowsheets that have recycles require iterative calculations. For the flowsheet
shown in Figure 17, assume that you choose as your calculation sequence the main sequence,
followed by the branch. That is, you choose U1, U2, U3, U4, U5, U6, U7 as your calculation
sequence.
Solving U1 is straight forward since its feed and operating conditions are known. This
calculation produces values for stream S2 and the software now continues on to solve unit U2.
This poses a problem because one of its feeds (R1) is not yet known. Assume for now that you
have provided estimates for its flowrate, composition, and thermal condition. The software will
use this estimate and continue on with the calculations. The results calculated for U2 and all
other downstream units will be incorrect because of this inexact feed estimate. When U5 is
calculated the software produces new, and hopefully better, values for stream R1. Since these
values differ from the initial estimate, the software will recalculate the subsequence U2, U3, U4,
U5 using this updated value for R1. This process is repeated until R1 stops changing between
iterations. After the recycle converges, the software solves units U6 and U7.
We use parenthesis () to indicate the portion of the calculation sequence that is solved
iteratively. For this example, the calculation sequence is: U1, (U2, U3, U4, U5), U6, U7.
The iterative strategy discussed earlier is called direct substitution, because the software
substitutes the result calculated from U5 for the feed to U2. You will soon see strategies where
the feed to U2 is approximated as a function of the results calculated from U5 during the last
few iterations.
You may want to choose a different sequence for your flowsheet. Suppose you have information
about stream S3, but know nothing about stream R1. Instead of starting the iterative
calculations with U2, you can start with U3. This is possible because U3’s feed is known; it is
the guess you provided for stream S3.

Recycle Loops
From Figure 20, you can estimate values for streams S3, S4, S6, or R1. The calculation
sequence will change as shown in Table 1. If you ran this flowsheet using each sequence, you
would probably notice that one runs faster than the others. Sometimes choosing the best
calculation sequence can significantly accelerate your flowsheet convergence.

Figure 20: Recycle Loop

Flowsheet Control and Optimization


32 Recycle Convergence and Sequencing

Examine the iterated units (the ones in the parenthesis) listed in Table 1. Although their
sequence changes, the software iterates on the same four units regardless of which stream you
choose to guess. These units constitute a loop.

Table 1: Calculation Sequence

Recycle Stream Calculation Sequence


Guessed
R1 U1, (U2, U3, U4, U5), U6, U7
S3 U1, (U3, U4, U5, U2), U6, U7
S4 U1, (U4, U5, U2, U3), U6, U7
S6 U1, (U5, U2, U3, U4), U6, U7

A loop is the minimum set of units that allows the iterative calculation of a recycle stream. A loop
contains all units that are part of the recycle, plus those units in the main sequence which begin
or terminate the recycle.

Independent Loops
Two loops are independent if they do not share any units. In Figure 21, loop (U2, U3)
corresponds to recycle stream R1, and loop (U5, U6) corresponds to recycle stream R2.

Figure 21: Independent Loops

Consider the following calculational sequences:

Case 1: U1, (U2, U3), U4, (U5, U6), U7


Case 2: U1, (U2, U3, U4, U5, U6), U7

In case 1, you completely solve the (U2, U3) loop before continuing with U4 through U7. This
strategy assures that U4 is calculated only when its feed is correctly known. This is clearly the
better sequence for this flowsheet.
In case 2, you iterate once on U2 and U3 before continuing with U4, U5, and U6. During the
early iterations, the feed to units U4, U5, and U6 are all based on the non-converged stream S4.
Most of the time spent solving these units will be wasted because their feed is incorrect. In a
worst-case scenario, U4 will fail to solve due to inaccuracies in its feed data.

AVEVA™ PRO/II™ Simulation Training


Recycle Convergence and Sequencing 33

Nested Loops
Two loops are nested if one loop is a subset of the other. The units of the inner loop belong to
the outer loop as shown in Figure 22.

Figure 22: Nested Loops

Loop (U3, U4) corresponds to recycle stream R1, and loop (U2, U3, U4, U5, U6) corresponds to
recycle stream R2. One property of nested loops is that the outermost loop corresponds to all of
the recycle streams. In this case loop (U2, U3, U4, U5, U6) corresponds to recycle streams R1
and R2. Later on you will see why this is important. Assume that you have good guesses for the
two recycle streams R1 and R2. There are two logical sequences for this flowsheet:

Case 1: U1, (U2, U3, U4, U5, U6), U7


Case 2: U1, (U2, (U3, U4), U5, U6), U7

The first approach is straightforward; both loops are solved together. For every iteration of R2,
you perform one iteration on R1.
In the second approach, called the inside-out approach, you completely converge the inner loop
at each iteration of the outer loop. This may require many inner loop iterations for each outer
loop iteration. The outer loop is essentially unaware that it contains an inner loop; it sees U3-U4
as a “lumped” unit. This strategy works well when the extra effort required to completely solve
the inner loop leads to more accurate values for S5 and ultimately R2, thus leading to a faster
solution of the outer loop. Use the inside-out approach when the inner loop solves quickly, but
the outer loop contains unit operations that require much more effort, such as columns.

Interconnected Loops
Two loops are interconnected if a subset of one loop is part of the other. In the flowsheet below,
the units U3 and U4 are shared by two loops.

Flowsheet Control and Optimization


34 Recycle Convergence and Sequencing

Figure 23: Interconnected Loops

Loop (U2, U3, U4) corresponds to recycle stream R1, and loop (U3, U4, U5, U6) corresponds to
recycle stream R2. If you consider both recycle streams together, then the corresponding loop is
(U2, U3, U4, U5, U6).
The best approach for solving interconnected loops is usually to treat them as one large loop:
U1, (U2, U3, U4, U5, U6), U7.
An alternative sequence that sometimes works is: U1, ((U2, U3, U4), U5, U6), U7.

Tear Streams
In the examples depicted thus far, you have seen the relationship between the calculation
sequence and the streams you choose to estimate. To formalize these concepts, it is useful to
introduce Tear Streams. A tear stream is any stream whose properties you estimate to “break”
(or “open”) a recycle loop. If you provide an estimate for stream R1 in Figure 24, then you
essentially split it into a feed stream, R1in, and a product stream, R1out. The process is
analogous to physically tearing stream R1 into two pieces.
This “torn” flowsheet no longer contains a recycle and can be solved in the usual sequential-
modular fashion. Of course, the solution is meaningless unless the estimated value of R1 in and
the calculated value of R1out are identical. The software will repeatedly solve units U2, U3, U4,
and U5 until R1out matches R1in. Convergence is tested on the tear stream(s).

Figure 24: Tear Streams

Loops typically have several candidate tear streams. The set of possible tear streams, called
the Tear Stream Candidate Set, is independent of how the flowsheet is laid out. Contrast this
with recycle streams, which are dependent on the flowsheet layout. In the loop (U2, U3, U4, U5)
above, R1, S3, S4, and S6 are possible tear streams. If you repeat this procedure for an
equivalent flowsheet with a different main sequence, you will obtain the same set of candidate

AVEVA™ PRO/II™ Simulation Training


Recycle Convergence and Sequencing 35

tear streams even though these two flowsheets have different recycle streams. Note that
recycle streams are always part of the tear stream candidate set.
For a particular loop, the number of tear streams may vary. Consider the flowsheet shown in
Figure 23. The Tear Candidate set is R1, R2, S3, S4, S5, S6 and there are two loops to “open”.
Table 2 shows the different tear streams and their corresponding calculation sequences.

Table 2: Calculation Sequence

Tear Streams Calculation Sequence


R1, R1 U1, (U2, U3, U4, U5, U6), U7
S3, R2 U1, (U3, U4, U5, U6, U2), U7
S5, R1 U1, (U5, U6, U2, U3, U4), U7
S6, R1 U1, (U6, U2, U3, U4, U5), U7
S3, S5 U1, (U5, U6, U3, U4, U2), U7
S3, S6 U1, (U6, U3, U4, U5, U2), U7
S4 U1, (U4, U5, U6, U2, U3), U7

Keep in mind that the sequence and the tear streams are closely related; knowing one implies
the other. You do not directly specify a flowsheet’s tear streams—you define the sequence. If
you want the software to use certain tear streams, simply select the sequence that corresponds
to those tear streams. In what follows, when we say select S4 as a tear stream, this simply
means select the sequence that results in S4 being a tear stream. In this case, you would select
the sequence: U1, U4, U5, U6, U2, U3, U7.
If you want R1 and R2 to be the tear streams, as shown in the figure, then you would select the
calculation sequence: U1, U2, U3, U4, U5, U6, U7.

Interconnected and Nested Loops


It is quite typical that two or more nested or interconnected loops can be opened with a single
tear stream. The loops in both of the flowsheets shown in Figure 25 are torn by stream S4. The
loop calculation sequence would be U4, U5, U6, U2, U3.

Figure 25: Interconnected and Nested Loops

Flowsheet Control and Optimization


36 Recycle Convergence and Sequencing

If you select S4 as the tear stream, you will need to provide guesses for only one stream, S4. All
other tearing strategies require estimates for two streams. The advantage of using fewer tear
streams is that your flowsheet convergence relies on fewer guessed values. This means less
work for you in providing estimates and less work for the software because it has fewer tear
streams to iterate on. For these reasons, the default behavior is to use the calculational
sequence that minimizes the number of tear streams.
Minimizing tear streams is not always the best strategy; there are many instances where it is
easier to converge a flowsheet by using a sequence that results in more than the minimum
number of tear streams. This is especially true when some tear stream candidates can be
accurately estimated from plant measurements, have a fixed composition or temperature, are at
their bubble point, etc. The latter two qualities make them easy to estimate and may enhance
the overall flowsheet convergence speed.

Solving Flowsheets with Recycles


So far, we have gone into some detail on how the flowsheet sequence and tear streams affect
your flowsheet calculations. In this section, you will learn how to make the software use the
sequence and tear streams that you desire. We will also discuss convergence criteria and the
importance of selecting convergence tolerance values. To control the order of flowsheet
calculations, you can do the following:
1) Select a sequencing algorithm or explicitly define the sequence
2) Provide guesses for tear streams
3) Declare loops if necessary.
By default, the software makes all of the sequencing decisions for you. It uses a sophisticated
algorithm (the SIMSCI sequencer) to automatically determine the sequence that minimizes the
flowsheet’s tear streams. The algorithm will try to choose the sequence so that any streams you
guessed are used as tear streams. There is no guarantee that the guessed streams will be used
as tear streams, and it is entirely possible that your guessed values will be discarded entirely.
For maximum control over the calculations, examine your flowsheet and determine the
sequence you feel is best. If you have particularly accurate measured data for process stream
S4, then you might choose a sequence that has stream S4 is a tear stream. Once you decide
on a sequence, override the default sequencing algorithm and explicitly input the sequence you
desire. For best results, don’t forget to provide the estimates for any tear streams whose
properties you know accurately.
If the sequence you define has more than one possible set of loops, you can let the software
decide how to define the loops, or you can define them yourself. By defining your own loops,
you can experiment with different flowsheet solution strategies. Note that if you decide to define
the flowsheet loops, you must define all of them.
The software offers three sequencing options: SIMSCI, Alternate, and User-Defined. These
options apply to the entire flowsheet and are defined by selecting Input | Calculation
Sequence from the Ribbon. The software determines the tear streams from the sequence.
Both the SIMSCI and Alternate methods determine the flowsheet’s loops and move all
calculations not affected by the recycle streams outside these loops.

SIMSCI Method
This default sequencing method chooses a calculation sequence that has a minimum number of
tear streams. If more than one choice of tear sets is available, the SIMSCI method will pick the
set that contains streams whose properties you estimated. The algorithm is complex and there
is no guarantee that your guessed streams will be used as tear streams. They are treated more

AVEVA™ PRO/II™ Simulation Training


Recycle Convergence and Sequencing 37

as suggestions for tear streams. Remember that if more than one choice exists for a minimal
tear stream set, the software may select a different (but still minimal) one if the flowsheet is
exported and imported.

Alternate Method
This method uses an algorithm that preserves the order in which the units appear in the
keyword input file. Remember that although the Alternate method ordinarily sequences the
flowsheet in the order the units were laid out, this order can change if the flowsheet is exported
and imported.

User-Defined Method
In this method, you tell the software the calculation sequence you want. Because you have total
control over the calculational sequence, you can experiment with sequences to find the one that
most efficiently solves your flowsheet.

Convergence
The software tests several conditions to decide if a loop is sufficiently converged. If the tests are
not passed, it will execute another loop iteration and compare the newly calculated stream
properties with the previous ones.
By default, the convergence tests are applied to all streams in the loop, but you have the option
to test convergence on only the tear streams. This option is handy when a recycle loop comes
close to convergence, but fails because the software exceeded the maximum allowed loop
iterations. You might encounter this problem with purge streams whose trace component
flowrates oscillate slightly. By converging only the tear streams, you force the software to ignore
these small oscillations. You can also achieve this goal by loosening tolerances on that stream.

Convergence Criteria
Convergence is defined as being met when the following tests are passed for two successive
iterations of the recycle streams:

• Component flow convergence (c) test

(4)

• Temperature convergence (T) test

(5)

Flowsheet Control and Optimization


38 Recycle Convergence and Sequencing

• Pressure convergence (P) test

(6)

In all three tests, the n and n-1 superscripts denote the iteration number.
In the component flow test, mi is the flowrate of component i in the recycle streams, and only
components with mole fractions greater than a threshold value (default is 0.001) are considered.
The tolerances have default values of c = 0.001, T = 0.01ºF (0.0055ºC), and P = 0.01.
These tolerances may be redefined globally by selecting Input | Flowsheet Tolerances.
The software also allows you to select either relative or absolute errors for each convergence
test. By default, the component and pressure tests are relative and the temperature test is
absolute.

Note: Exercise care with nested loops; inner loop tolerances should always be as tight or
tighter (i.e., lower valued) than outer loops.

Defining Your Own Loops


Suppose you have some knowledge of R1 and R2 in Figure 26 and would like to use them as
the tear streams. You therefore define the sequence as: U1, U2, U3, U4, U5, U6, U7 through
the Problem Calculation Sequence window. For this flowsheet, and many others, providing the
sequence alone is not enough to uniquely define the calculation order.

Figure 26: User Defined Loops

For example, the following two iterative strategies have the same sequence, and hence the
same tear streams (R1 and R2):

Case 1: U1, (U2, U3, U4, U5, U6), U7 Default


Case 2: U1, (U2, (U3, U4), U5, U6), U7 Inside-out approach

The strategies differ in how the loops are defined. The first strategy uses a single loop, (U2, U3,
U4, U5, U6) while the second uses two loops: (U3, U4) and (U2, U3, U4, U5, U6). The choice of
loops is subjective, and the software allows you to control the flowsheet loop definitions by

AVEVA™ PRO/II™ Simulation Training


Recycle Convergence and Sequencing 39

selecting Input | Recycle Convergence from the Ribbon. Note that the flowsheet’s tear
streams are unaffected by your choice of loops; they are determined from the unit sequence you
enter through the Problem Calculation Sequence window.
In addition to defining your own loops, you can control the convergence tolerances, the
acceleration method, and the number of trials for each loop. These values can be set
independently for each loop. For example, if you select 3 trials for the inner loop (U3, U4) and 5
trials for the outer loop (U2, U3, U4, U5, U6), then the inner loop will be solved no more than
three times (it may converge sooner), for every pass through the outer loop. The outer loop will
be attempted no more than five times.

Thermal Recycles
Thermal recycles are common in heat-integrated processes. Figure 27 comes from a natural
gas plant where the cold vapor product is used to precool the gas feed stream. As their name
implies, thermal recycles involve only the transfer of heat—bulk compositions are unaffected.
This property enables thermal recycles to be calculated more easily than other recycles.

Figure 27: Thermal Recycles

To ensure that the feed entering the unit is at its desired temperature, most thermal recycles
employ some sort of temperature control scheme. The flowsheet above makes use of a trim
cooler (E2) to ensure that the feed to unit F1 is at -20ºF.
If you do not provide any recycle estimates, this flowsheet will converge in exactly three
iterations:
• Iteration one: The recycle stream (e.g. stream 5) has zero rate so E1 is calculated
incorrectly. Unit F1 is calculated correctly because E2 sets its feed temperature to
the correct value
• Iteration two: The recycle stream now has correct values, and the preheater is thus
calculated correctly. The solution has been reached, but the software needs to
perform another iteration to test convergence of the recycle loop
• Iteration three: Results do not change from iteration two. Convergence verified
For Figure 27, streams 3, 4, and 5 are the tear stream candidates. Clearly it is best to use
stream 4 as the tear stream (calculation sequence F1, E1, E2) because all of its properties are
known. Its composition and flowrate are identical to stream 2, its pressure is that of stream 2,
less the known pressure drops across the exchangers, and the trim cooler guarantees that its
temperature is -20ºF. If you entered these values as recycle estimates for stream 4, the
flowsheet would solve in only two iterations (iterations two and three above).
As you will see shortly, by using the reference stream feature, you can actually solve the loop in
a single pass.

Flowsheet Control and Optimization


40 Recycle Convergence and Sequencing

Reference Streams
A reference stream has attributes that are defined in terms of another stream within the
flowsheet. The two streams must have the same composition, but the flowrate, temperature,
and pressure can differ.
Typically, when using this option, you transfer the composition of one stream (the source) to
another (the target) while overriding the molar rate, temperature, and/or pressure. This feature
is especially useful for thermal recycles.
In the recycle of Figure 27, you could provide a recycle estimate for stream 4 by referencing it to
stream 2. You would then change stream 4’s temperature to -20ºF and lower its pressure by 10
psia. As already mentioned, this recycle would converge in two loop iterations. Although you
essentially started with the correct solution, the software does not know this and the second
pass is necessary to verify convergence.

Note: Each time a source stream is updated, the target stream is also updated. For this
reason, you should generally not use reference streams to provide recycle estimates. If the
source and target streams are part of the same or nested recycle loops, the software will
reset the target stream on each pass through the loop. Nonconvergence of the flowsheet is
likely to occur. However, if the source stream is fixed (i.e., an external feed), as is the case
in this flowsheet, using a reference stream as a recycle estimate will not cause convergence
problems.

Breaking Thermal Recycles


The disadvantage of using the previously-mentioned approach is that stream 4 is treated as a
recycle estimate even though the values you provided are the correct properties of stream 4.
The software takes the second pass through the loop to verify that the answer is correct, and
there is no way to avoid these calculations as long as the recycle loop is in place.
To solve this flowsheet in a single iteration, eliminate the loop by detaching stream 4 from the
flash drum and attaching a new feed stream, called 4X here. Then, reference stream 4X to
stream 2, as discussed earlier. Since the feed to F1 is known and this flowsheet has no recycle
loops, calculations will proceed with the sequence: F1, E1, E2. There will be no loop iterations
because the flowsheet no longer has a loop!

Figure 28: Reference Stream

AVEVA™ PRO/II™ Simulation Training


Recycle Convergence and Sequencing 41

Although the savings of one or two loop iterations may seem small, you should keep in mind
that thermal recycle loops very often contain computationally intensive unit operations such as
distillation columns. The time savings in these cases can be significant.
You are encouraged to break thermal recycles using this technique whenever possible. To spot
breakable thermal recycles, look for trim heaters/ coolers or control systems that set a stream’s
thermal condition (e.g., temperature, dew point, bubble point).
Merging Units Certain types of commonly occurring loops can be easily broken. Figure 29
illustrates a controller loop that occurs in the simulation of certain distillation columns.

Figure 29: Controller Loop

The goal of the simulation is to find the furnace duty and various column unknowns that result in
a set of column specifications being met. For the software to calculate the furnace duty to meet
a bottom product specification, for example, you could add a controller to the flowsheet and
provide an initial guess for the furnace duty.
As you know, the software will repeatedly solve the column and adjust the duty until the
controller specification is satisfied. There are several drawbacks to this approach:
• Repeatedly solving a complex column is very time consuming
• The column might fail to solve if your initial duty estimate is too inaccurate
• All of the warnings discussed previously about controller loops still apply
An alternative to using the controller loop is to remove the furnace and add a heater on the feed
tray, as shown on the right side of Figure 29. The models are mathematically identical and will
produce the same value of duty. In the latter approach, the column algorithm calculates the duty
as a part of the column solution and is thus faster and more reliable.
If you need to know the furnace outlet temperature for this example, you could calculate it by
adding a flash drum to the flowsheet. The flash’s feed should be referenced to the column feed
and its duty should be defined to be that of the feed tray heater. After the column solves, the
software will pass the calculated duty to the flash drum and solve it; the flash outlet will be
identical to the furnace outlet.
Side columns ordinarily require recycle calculations; however, the Inside/Out (I/O) column
algorithm has special techniques that eliminate these recycles. If you select the I/O column
algorithm, side columns will automatically be merged into the main column so that the side and
main columns are solved simultaneously rather than iteratively.
Figure 30 is a simplified version of a crude unit. The feed passes through a preheat train and
desalter before being fed to the atmospheric column (left). This column’s bottom product is then
sent to the vacuum column (right) where gas oils and lubricants are produced.

Flowsheet Control and Optimization


42 Recycle Convergence and Sequencing

Figure 30: Simplified Crude Column

At first glance, this simulation looks very difficult because of the large number of recycles and
interdependence of the columns. The pumparounds and sidestrippers are recycles; fortunately,
the Inside/Out column algorithm solves them simultaneously with the main column.
Of greater concern is the preheat train, which uses product streams from both columns to
preheat the crude feed. At first glance, it would seem that the columns have to be solved in a
loop.
Fortunately, the furnace is controlled so that the feed to the crude column is fixed at 600ºF. This
is a classic thermal recycle that can be broken using the reference stream technique previously
discussed. The recycle-savvy engineer will realize that the previous flowsheet can be simulated
with no recycles in the sequential approach shown below.

Figure 31: Sequential Approach to the Crude Column

AVEVA™ PRO/II™ Simulation Training


Recycle Convergence and Sequencing 43

Because the furnace outlet temperature is controlled, the atmospheric column feed is known.
Thus, the atmospheric column should be calculated first, with the pumparound duties fixed at
measured values or calculated to meet the desired specifications.
Upon convergence the crude column’s bottom product is known and the software can proceed
with calculating the vacuum column. The vacuum column’s furnace can be represented as a
heater on the vacuum column feed tray. For even greater accuracy, use the flash zone
modeling capabilities for the feed furnace.
The preheat train is calculated last, after all of the pumparound duties and product rates are
known. You can set up the preheat train as the group of units on the right of Figure 31. The
pumparound duties can be passed to the appropriate heat exchangers using the Define feature.
Where two-sided heat exchanger calculations are needed, you can reference the cold side feed
to the appropriate column product. If you should need to use the pumparound stream in the
preheat train calculations, you can access it through the column’s pseudoproducts option.
What if the pumparounds were used in the preheat train? This configuration would require you
to solve the columns and preheat train in a recycle because the calculated pumparound duties
will have to match the duties predicted by the two-sided heat exchanger calculations (U*A
specifications on the heat exchangers). One strategy would be to solve the columns with fixed
pumparound duties. Then solve the preheat train. If the heat exchanger duties in the preheat
train do not match their corresponding pumparound duties (calculated in the columns), then you
can use a controller to adjust the column’s pumparound duties and repeat the calculations until
the duties match.

Tips for Solving Recycles


This section presents some tips that will help you solve recycle problems more efficiently. Figure
32 illustrates a common cause of loop failure. If your flowsheet specifications are such that a
component is unable to exit the process, convergence will fail.

Figure 32: A Common Cause of Loop Failure

Loops that contain purge and makeup streams are quite common in processes that involve
chemical reactions. You will see that solving these problems is simpler when you use a
CALCULATOR to compute the purge or makeup rate. In addition, these flowsheets tend to
converge very slowly unless you request the software to use special loop acceleration routines.
For certain flowsheets, it is possible to completely eliminate recycle loops by transforming the
flowsheet to an equivalent one that does not contain any recycles. This is easily done for certain
types of thermal recycles. In some cases, it is possible to eliminate recycles by merging unit

Flowsheet Control and Optimization


44 Recycle Convergence and Sequencing

operations so that the recycle streams become internal to a single unit operation, usually a
COLUMN.

Mass Balance
The most common reason for recycle loop failure is material balance problems. The software is
a steady state simulator, and any converged solution for the flowsheet must have a heat and
material balance. Every component in the flowsheet must exit in the product streams if
convergence is to occur.
For some flowsheets, the process conditions may need alteration for solution to occur. The loop
in the flowsheet of Figure 32 failed to converge when the furnace outlet temperature was too
high. An examination of the output report showed that heavy components were building up in
the recycle stream as the loop trials proceeded. By overheating the feed, a significant quantity
of the heavy components was carried up the column and out with the recycle stream. Once in
the recycle stream, the heavy components could not exit with the flash separator overhead
product, thus they returned to the column.
The recycle loop was solved quite easily by lowering the temperature of the column feed, such
that the heavy components did not exit in the column overhead product.
As you learn some of the advanced tips for solving recycle problems, keep in mind that
sometimes problems have simple solutions. In this example, no amount of acceleration,
resequencing, or unit merging will solve this problem, until the specifications are physically
appropriate.

Purge and Makeup Streams


The process shown in Figure 33 reacts hydrogen with benzene to pro- duce cyclohexane. The
recycle stream returns unreacted hydrogen to the reactor. Its rate can be controlled to keep the
ratio of hydrogen to benzene in the reactor feed high, which increases the extent of reaction. A
large recycle rate also serves to dilute the reactor feed, which makes the reactor temperature
easier to control for highly exothermic reactions.
The makeup hydrogen was created in a steam methane reformer, and therefore contains a
small amount of methane that could not be completely removed from the reformer products. The
methane is an inert compound in this cyclohexane reactor process and needs to exit the
process in the same rate as it is fed for steady state to be achieved. Since the separator drum
operates at 120ºF, very little of the methane will exit in the cyclohexane product stream. The
purge gas stream serves as the primary outlet for the methane.

Figure 33: Cyclohexane Reactor Process

AVEVA™ PRO/II™ Simulation Training


Recycle Convergence and Sequencing 45

By trial and error, you could find the purge gas rate that balances methane and thus allows the
flowsheet to converge. The drawback to this approach is that if you decide to change the
process conditions in a future simulation, the purge rate will no longer be correct. For example,
lowering the flash temperature to 80ºF will cause more methane to exit in the cyclohexane
product and a purge rate based on a 120ºF flash will be too high.
Instead of specifying a fixed split rate, it is safer to have a CALCULATOR determine the split
rate that balances methane at the current flowsheet conditions. For this example, you can use:

calculator result R(1) = rate of methane in makeup H2 - rate of methane in Cyclohexane


product

The SPLITTER specification would be:

Purge Gas flowrate of methane / Calculator result R(1) = 1

For more general processes, the purge rate calculation must account for any creation or
removal due to reaction.
In some simulations, the purge rate is fixed and you need to calculate the required makeup rate.
The procedure is totally analogous to calculating a purge rate for a fixed makeup rate. Use a
calculator to balance the key component.

Convergence Acceleration Techniques


Certain types of recycle loops are notorious for slow convergence. The software offers two tools
to accelerate sluggish recycle loops: the Wegstein and Broyden acceleration methods.
There are no guarantees that these acceleration methods will work for a given loop; in some
situations, they significantly accelerate convergence, while in others they can cause
convergence to fail. Fortunately, PROVISION makes it easy to experiment with different
acceleration methods and their control parameters, so you can select the method that works
best for your flowsheet.
Acceleration usually works best when the unaccelerated convergence behavior is asymptotic
and unidirectional as shown in Figure 34. These situations are typical of flowsheets with
reactors and purge or makeup streams. In this graph, the tear stream variable guess refers to
the current guess for a quantity such as a tear stream temperature or component flowrate.

Figure 34: Comparison of Acceleration and Direct Substitution Techniques

Flowsheet Control and Optimization


46 Recycle Convergence and Sequencing

To use either acceleration method, the software must take at least one trial with direct
substitution, although in practice it is best to switch on acceleration only after the convergence
has “settled down” on its sluggish behavior. This may require several loop iterations, especially
if you did not initialize the tear streams. For this reason, the software allows you to specify at
which iteration Wegstein or Broyden acceleration should be enabled. For Wegstein
acceleration, you can even instruct the software how often it should be applied (e.g. every 4
iterations).
By default, both the Wegstein and Broyden methods are applied to all streams in the loop. To
accelerate only a subset of these streams, simply supply a list of streams for acceleration.

Direct Substitution
The default method for converging recycle loops is Direct Substitution. Think of it as the
unaccelerated method. Referring to Figure 35, direct substitution simply uses the most recently
calculated value (y) of the tear stream as the current estimate for the tear stream (x).

Figure 35: Direct Substitution

The update formula is simply:

xn+1 = yn (7)

In the above notation, x and y represent properties of the guessed and calculated parts of the
tear stream. These properties are typically temperature and component flowrates. At
convergence, x and y must be identical, because they are in fact the same stream. The
superscript reflects the loop iteration number.
At the nth iteration, the software starts with an estimate for the tear stream, denoted as xn. It
then calculates the unit operations necessary to produce values for the “other half” of the tear
stream, denoted as yn. In the next iteration, yn will be used as the new guess, xn+1. The software
repeats this procedure until the calculated value of the tear stream (y) matches its guessed
value (x). This simple method works well in most situations.

AVEVA™ PRO/II™ Simulation Training


Recycle Convergence and Sequencing 47

Note that in generating its next guess for the tear stream, direct substitution uses the results
from only the previous iteration. Results from earlier iterations are not used directly.

Acceleration Methods

Wegstein Method
While Direct Substitution updates guesses from information obtained in the previous iteration,
Wegstein acceleration makes use of values calculated in the previous two iterations. Wegstein
does not account for the interaction between multiple recycle loops and may not work well in
these cases.

The update formula is a weighted average (with weight q) of the previous estimate (xn) and the
actual calculated value (yn):

xn+1 = q xn + (1-q) yn (8)

where q is the acceleration factor and is calculated from:

q = w / (w-1) (9)

w = (yn - yn-1) / (xn - xn-1) (10)

The table below shows how q affects convergence. Generally speaking, the more negative the
value of q, the faster the acceleration. Large negative values, however, can lead to oscillation
and divergence. It is therefore always necessary for you to set upper and lower limits on the
value of q. These limits should be set based on the stability of the recycle stream. An upper limit
of 0.0 and a lower limit of about -20 or -50 often work well.

With 0 < q < 1, Wegstein can dampen oscillations that might occur with direct substitution. Try
setting the upper and lower q values at 0.5 to force averaging.

Broyden Method
The Broyden method is a Quasi-Newton method. By approximating the Jacobian inverse, the
Broyden method maintains good computational speed. The specific formulas for the Jacobian
updates are given in the AVEVA™ PRO/II™ Simulation Reference Manual. This method

Flowsheet Control and Optimization


48 Recycle Convergence and Sequencing

accounts for interactions between component rates and temperature of all streams included in
the recycle loop.
The Broyden method works best for cases involving multiple recycle streams which are
interdependent. The software will apply Broyden acceleration to all recycle streams
corresponding to each loop. Caution must be taken when using Broyden acceleration with a
user supplied set of streams to accelerate: if this set does not contain all the tear streams of the
loop or loops it belongs to, the interdependence may not be well represented, and therefore, the
algorithm may behave poorly.

xn+1 = xn + dnΔxn (11)

The damping factor has a default value at every iteration, and it is reset to a smaller value
automatically to prevent the new estimates from becoming negative.
Once started, Broyden acceleration will be applied every trial, without exception.

Troubleshooting and Tips


If you are having trouble converging your flowsheet, try some of the suggestions provided
below.
• Add more recycle trials
• Tighten material balance tolerances
• Change threshold for trace component checking
• Fix purge rates
• Use a CALCULATOR for purge or makeup streams
• Provide better initial estimates
• Adjust process conditions or specifications
• Study your flowsheet and identify all loops
• For maximum control, define your own sequence
• Eliminate recycles whenever possible:
o Reference streams eliminate thermal recycles
o Merging units eliminates compositional recycles
• For nested or interconnected loops, consider if an inside out option will speed up
convergence
• If convergence is slow, try acceleration options
• Simulations start with the last calculated results unless you:
o Double-click on the tear streams to reset them, or
o Select Restore Input Data from the Input tab, or
o Export and import the keyword input file

AVEVA™ PRO/II™ Simulation Training


Flowsheet Optimization 49

Flowsheet Optimization
Flowsheet optimization is the automatic identification of the best design or operating conditions
from a collection of alternatives. Most design and operating decisions are optimization problems
in the sense that you want to select some set of design or operating quantities that minimizes or
maximizes some other quantity. For a distillation column, you can select the feed tray location
that results in the minimum reboiler duty. A more global approach would be to adjust all of your
plant’s operating conditions to maximize the total profit.
Picking the best feed tray location for a column is a relatively simple but tedious task; you could
simply run the simulation, make note of the reboiler duty, change the feed tray location, and re-
run the simulation. After repeating this procedure for all feasible feed tray locations, you would
simply select the one that resulted in the minimum reboiler duty. If the feed composition to the
column changes next month, you would have to repeat this manual search for the optimum feed
tray.
Clearly it would be very difficult to maximize a profit function by manually searching for the best
combination of ten operating conditions. To help you accomplish such tasks, the software
provides an OPTIMIZER unit operation. The OPTIMIZER obtains the solution without evaluating
all possible cases. It performs a very smart search for the best operating conditions.

Optimizer
To use the OPTIMIZER, first define the objective function that you want to minimize or
maximize. This can be as simple as a duty or as complex as a profit function that accounts for
feed and utility costs, product stream values, and even maintenance and depreciation of
process equipment. Complex objective functions, such as profit functions, have to be
constructed with the CALCULATOR unit operation.
In selecting an objective function, include all relevant information. Your optimization results may
be meaningless if you forget to include a cost (e.g. cooling water cost) in your profit function.
Often it is sufficient to consider only utility costs and the value of all feeds and products. Some
costs are hidden. If, for example, a purge stream contains components that, for environmental
reasons, cannot be discharged, you should include the cost of further processing this stream in
your objective function. If the process produces a compound that degrades your catalyst, you
should include the catalyst replacement cost in your model, so it can be balanced against the
costs of removing the compound.
After you define the objective function, your next task is to provide a list of optimization
variables; these are process variables that the software adjusts to either maximize or minimize
the objective function. In addition, you will have to provide upper and lower bounds on these
variables.
If you wish to enforce limits on flowsheet quantities other than the optimization variables, you
can enter process constraints. For example, if a distillation column produces a thermally
sensitive bottom product, you might want to maximize a profit function subject to the constraint
that the bottoms temperature not exceed a certain value.
You should also enter any equipment limitations as constraints. For example, you might
constrain a compressor so that the optimum solution does not correspond to surging or
stonewalling operation.
Like process constraints, process specifications are optional. While process constraints allow
you to impose ranges of acceptable values for certain flowsheet variables, process
specifications allow you to impose specific values on flowsheet variables. For example, you

Flowsheet Control and Optimization


50 Flowsheet Optimization

could optimize a crude column subject to the constraint that the kerosene draw rate be exactly
10000 barrels/day. You can think of process constraints as inequality constraints and process
specifications as equality constraints. In reality, most process specifications, including this
kerosene draw example, can be entered as a unit operation constraint. One advantage to
entering them within the OPTIMIZER, rather than within the unit operation, is that the
OPTIMIZER provides shadow prices, discussed later. Since the optimizer uses a different
convergence algorithm than other unit operations, providing specifications within the
OPTIMIZER allows you to experiment with a different, and possibly faster convergence
algorithm for your unit.
The following sections illustrate the usefulness of the OPTIMIZER and its features.

One Variable Optimization


The flash drum illustrated in Figure 36 produces an overhead stream whose market value is
proportional to the square of its purity (mole fraction) of C1 and C2:

Unit price of OVHD [$/lb-mole] = k (YC1 + YC2)2 (12)

Figure 36: One Variable Optimization Example

The square dependence of the OVHD unit price on the purity indicates that you will be paid an
extra premium for particularly pure streams. The flash currently operates at 10ºF, but you would
like to adjust its temperature (the optimization variable) in order to maximize the revenue
produced by selling the overhead stream.
The first task in setting up this problem is to formulate an objective function. For this flowsheet,
the revenue is the product of the overhead flow- rate and the overhead unit price:

Revenue [$/hr] = OVHD Flowrate * OVHD Value = OVHD * k * (YC1 + YC2)2 (13)

It is a simple task to maximize either the overhead flowrate or the unit price. High temperatures
(i.e., feed dew point and above) maximize the flowrate, and low temperatures (i.e., the feed
bubble point) maximize the purity and hence the unit price. The temperature that maximizes
OVHD * purity2 should therefore lie somewhere between the dew and bubble point
temperatures.

AVEVA™ PRO/II™ Simulation Training


Flowsheet Optimization 51

To solve this flowsheet, set up the flash drum with a temperature of 10ºF. The software will use
this temperature as the starting guess for its search. Add an optimizer unit and enter the
objective function in this equivalent form:

Objective Function = (OVHD flowrate of C1 + C2) * (OVHD mole fraction of C1+C2) (14)

Enter the flash drum temperature as the optimization variable and, for the reasons discussed
above, the bubble and dew temperatures of the feed as the lower and upper bounds on T.
The optimizer can be quite sensitive to its tolerance and to the tolerances of the various unit
operations involved in the optimizer loop. For any flowsheet that contains an optimizer, be sure
to examine the results to see that they make sense. It is a simple matter to lower tolerances and
re-run the flowsheet to ensure that your results are fully converged. You will find the Include
convergence plots print option to be an invaluable debugging tool. For example, if you see that
one of the variables fluctuates back and forth from cycle to cycle, that variable may very well be
the one that is causing the problems.
For this particular problem, the optimizer solved in about four iterations. The best temperature to
operate the flash drum is about 43ºF.
Figure 37 shows how the objective function changes with flash temperature. It was generated
by running the flash for a large number of temperatures; a less detailed version of this plot
appears in the output report if you request Include convergence plots in the print options.

Figure 37: A Function of Flash Temperature

Note that below the bubble point (-120ºF) the flash drum has no vapor product and thus the
objective function is invariant to changes in the flash temperature. The same flat behavior of the
objective function occurs for temperatures above the dew point (165ºF). Invariant functions can
cause failure of the optimizer, because the software believes that the optimization variable has
no effect on the objective function. You can keep guesses outside of the invariant region by
providing meaningful lower and upper bounds on the optimization variable. In this example, you

Flowsheet Control and Optimization


52 Flowsheet Optimization

can use the bubble and dew point temperatures as minimum and maximum values to be
considered for the flash temperature.

Multivariable Optimization
The example shown in Figure 38 is the same as the previous flash drum problem, except that
now you are free to adjust both the flash temperature and pressure in order to maximize the
objective function. Downstream operations limit the lowest flash drum pressure to 5 psia.

Figure 38: Multivariable Optimization Example

This is called multivariable optimization because you have more than one optimization variable.
You still have a single objective function: profit. If you were to do this by trial and error, you
would have to search a range of temperatures and pressures until you found the combination
that gives the maximum profit. As you can see, multivariable optimization problems are much
more difficult than single variable optimization, and manual searches are very tedious. Imagine
the work involved in maximizing an objective function subject to five or ten optimization
variables! Fortunately, the OPTIMIZER supports multivariable optimization.
Figure 39 illustrates how the objective function varies as temperature and pressure are
changed. To generate this graph, you could run the flash drum for all combinations of 20 values
of pressure and 20 values of temperature. Once you have made such a graph, it is simple to
read the maximum off of the graph. Unfortunately, generating this graph requires a total of 400
runs of the flowsheet. Note that the software does not generate surface plots. This plot was
created by exporting the results of the 400 flash calculations to Microsoft Excel.

AVEVA™ PRO/II™ Simulation Training


Flowsheet Optimization 53

Figure 39: A Function of Temperature and Pressure

Since the objective function is now a function of two variables, it appears as a surface. Each
color on the surface represents a range of values of the objective function. The optimum
solution occurs at the lowest allowed pressure, 5 psia, and a temperature of -42ºF. The software
was able to locate this maximum in under 10 iterations—a big improvement over the 400
iterations necessary to generate the graph.

Optimization Constraints
For the example shown in Figure 38, assume that market conditions have changed so that the
OVHD stream’s value [$/lb-mole] is now proportional to its purity of C1 and C2, as opposed to
the previous examples where it was proportional to the square of the purity. Your buyer will not
accept streams that are less than 90 mole percent pure, so these have zero value. The profit
obtained by selling the overhead stream is thus the product of the total flowrate and the purity of
C1 and C2. This is equivalent to maximizing the flowrate of C1+C2 subject to the minimum
purity constraint.

Objective Function = Flowrate of C1+C2 in OVHD = OVHD * (YC1+YC2)

Constraint: Mole fraction of (C1+C2) in OVHD > 0.9 (15)

To maximize this objective function alone (i.e., unconstrained), it is obvious that you should
send all of the feed to the overhead by simply operating the flash at or above the dew point.
Since this strategy violates the minimum purity constraint, it is not a valid solution.
Entering the constraint is very similar to entering specifications for the controller or MVC unit
operations. The difference is that you provide lower and upper bounds on the constraint. In this
example, you only have to provide the 0.9 lower bound; the software will consider all mole
fractions above (or equal to) this value.

Flowsheet Control and Optimization


54 Flowsheet Optimization

This flowsheet converges in about 6 iterations. The final temperature is about -41ºF and the
pressure is at its lower limit, 5 psia. As you may have expected, the purity is also at its lower
bound (90%). This is plausible because the unconstrained objective function is maximized when
purity is as low as possible.

Figure 40: Contour Plot of the Function shown in Figure 39

Figure 40 is a contour plot for the example shown in Figure 39. The colors correspond to ranges
of values of the objective function. The numbers indicate typical values for a given color. The
curve labeled Constraint corresponds to those temperatures and pressures that result in a 90%
pure OVHD stream. Temperatures and pressures to the left of the Constraint curve all yield
purities greater than 90%.
Notice that the optimum solution lies at the lower bounds on both the pressure and the
constraint. For this reason, the output report will contain information on shadow prices.

Optimizer Output

Shadow Prices
Shadow prices measure the effect of changing your specifications, bounds on optimization
variables, and the bounds on constraints. They tell you the possible benefit of relaxing a limit,
specification, or constraint. Formally, they are the derivatives (sensitivity) of the objective
function with respect to constraint or variable bounds. They are meaningful only at the solution.
For the previous example, consider the effect of changing the bounds on the pressure. At the
optimal solution the pressure is at its lower bound, 5 psia. If you allowed the upper bound to
change to say 41 psia, you would still expect the optimal solution to be at 5 psia. Since the
upper bound does not affect the optimum solution for this flowsheet, this shadow price
(derivative of objective function with respect to upper pressure bound) is zero and will not be
printed.
Changing the lower pressure bound does have an effect on the objective function, as indicated
by the negative shadow price (derivative of objective function with respect to lower pressure
bound).

AVEVA™ PRO/II™ Simulation Training


Flowsheet Optimization 55

Shadow prices are meaningful only for constraints or bounds that are at their limits; these are
referred to as active. Non-active constraints or bounds have shadow prices of zero. The
software also reports the shadow price for each constraint. In this example, the shadow price for
the purity constraint is negative, indicating that you can increase the revenue from selling OVHD
if your purchaser is willing to accept purities less than 90%.
The magnitude of the shadow prices indicates how much benefit you will realize from slight
changes in the problem. In this example, the shadow price for pressure is approximately -31, so
if you decrease the lower pressure bound from 5 to 4.5, you would expect the revenue of OVHD
to increase by approximately 15.5 (=-31*-.5). The shadow price for the constraint is
approximately -1410, so decreasing the purity specification from 0.9 to 0.85 (mole fraction) will
increase the revenue of OVHD by approximately 70 (=-1410*-.05). Comparing the shadow
prices, you might be tempted to say, “the composition constraint more strongly impacts profit
than the pressure bound.” This statement is meaningless because the profit function in this
example does not take into account the costs associated with decreasing the pressure or purity
specification. A more sophisticated objective function should be used to truly ascertain the
benefits of relaxing constraints and bounds.

Example 1

An existing process uses a large quantity of steam for heating and stripping. Due to recent
improvements in your plant’s steam generation system, your process now has slightly more
steam available to it. What is the best way to use this additional steam? The obvious answer is
to use it in such a way that results in the greatest profit increase. In other words, look at the
shadow prices for each steam rate (derivative of process profit with respect to each steam rate)
and add the extra steam to the stream that has the largest shadow price.
The only way to get the software to calculate the shadow prices for the steam rates is to enter
the steam rates as an OPTIMIZER specification. This is a good example of why you might want
to enter a process specification through the optimizer rather than through the actual process
itself.

Example 2

You are in charge of a gas cooling process that uses 4 heat exchangers, all of which deliver
slightly less duty than they should, due to fouling. To increase the duty to your process, you
propose to clean the heat exchangers; however, your budget only allows you to clean one of

Flowsheet Control and Optimization


56 Flowsheet Optimization

them at this time. How do you decide which one to clean? A simple way to decide is to look at
the shadow prices for each heat exchanger (derivative of plant profit with respect to HX duty)
and clean the one that has the largest shadow price. Cleaning this heat exchanger will result in
the greatest profit increase.
In past cleaning cycles, you have measured the improvements in each heat exchanger, and
based on these past measurements, you believe cleaning will improve the duty by the amounts
shown in column 3 below. Column 4 shows the calculated shadow prices for each HX duty.

HX Current Duty Duty Improvement Shadow Price (SP) Profit Increase

1 500 10 30 300
2 400 5 30 150
3 600 7 40 280
4 800 5 70 350

Since the shadow price is the derivative of profit with respect to each duty, it follows that the
increase in profit is approximately Δprofit = SP(i) Δq(i). Based on this, you would choose to
clean heat exchanger 4, even though it is the least fouled of the exchangers (it has the smallest
improvement in duty). Its large shadow price indicates that exchanger 4 is costly to operate,
perhaps because it uses an expensive refrigerant, while the others use air or water as their
cooling media.

Output Report
Figure 41 shows part of the data that appears in the optimizer output. The top of the report
displays the “best” objective function and the initial and optimal values of the variables. Below
the summary is a report of the derivatives (not shown here), the shadow prices, and values at
each iteration.

Figure 41: Optimizer Output

AVEVA™ PRO/II™ Simulation Training


Flowsheet Optimization 57

In the example for which the output is shown in Figure 41, variable 1 is the temperature,
variable 2 is the pressure, and the constraint is the at least 90% pure requirement of the OVHD
stream.
• At iteration 1, the variables are at their base-case values, 10ºF and 30 psia. These
were the numbers you entered in the FLASH DRUM
• The value of the objective function at iteration 5 is greater than the optimum value.
The result at iteration 5 was rejected because the constraint was not satisfied to
within tolerance
• The optimum value was calculated at iteration 6. Iterations 7 and 8 were attempts to
improve on the optimum. The software believes result 6 is better than result 8
because the objective function is larger at iteration 6. Notice, however, that the
constraint is more closely met at iteration 8 than at iteration 6 (0.900000 versus
0.899935). If you were to tighten the constraint tolerance, the OPTIMIZER would
reject result 6 and continue iterating. The actual optimum is closer to result 8 than
result 6

Solution Technique
The software uses a successive quadratic programming algorithm (SQP) to solve optimization
problems. This algorithm is described in detail in the AVEVA™ PRO/II™ Simulation Reference
Manual.
Assume that you are trying to maximize or minimize the objective function F(x), where x
represents all of the optimization variables. For simplicity’s sake, assume that the extremum
does not occur where a variable is at its upper or lower bound. Naturally, the software has the
ability to distinguish between minima and maxima, and the algorithm knows how to incorporate
any variable bounds, specifications, and constraints that your problem may have.

Figure 42: Successive Quadratic Programming Algorithm

In Figure 42, the OPTIMIZER seeks the value of x for which dF/dx = 0. This is the criteria for a
local extremum of a function. To find the extremum, the software approximates the objective
function as a quadratic polynomial (parabola). If the current guess is close enough to the actual

Flowsheet Control and Optimization


58 Flowsheet Optimization

extremum, then the extremum of the approximating parabola is an even better estimate of the
solution. To prevent instabilities, the software applies a line search to generate the next guess.
After repeating this procedure several times, the guesses should approach the actual extremum
of F(x).
To generate the fitting parabola, the software calculates the first and second derivatives of F(x)
at the current estimate. The fitting parabola is a second order Taylor expansion about the
current guess. The software calculates the derivatives using finite differences, and as you will
learn shortly, the accuracy of these derivatives has a very strong effect on the OPTIMIZER. This
fact is very important, because the derivative accuracy is determined largely by parameters you
supply.

Convergence
To determine if a run has converged, the software tests 4 conditions at every optimizer cycle:
1) Has the maximum number of iterations been reached (default 19)?
2) Is the Scaled Accuracy below its tolerance (default 10-7)?
3) Have optimization variables stopped changing within their tolerance (default 0.1%
relative)?
4) Has the objective function stopped changing within its tolerance (default 0.005%
relative)?
If the answer to any one of these is yes, and the specifications and constraints (if there are any)
are met to within tolerance, then convergence is signaled. Test 1 is self-explanatory, and Test 2
is well described in the AVEVA™ PRO/II™ Simulation Reference Manual. Tests 3 and 4 can
cause confusion.
When you set up an optimization problem, you want to know the value of the optimization
variable(s) that maximizes or minimizes your objective function. For most well-posed problems,
there is only one “best” value for the optimization variable. If Test 3 is passed, then you know
you have found this best value to within 0.1%. For the function sketched above, passing Test 3
means that the reported optimum temperature will be 100.0 ± 0.1ºC, accurate enough for most
applications. Note that had you used Kelvin as the temperature units, the solution would be
373.15 ± 0.37 K, which is equivalent to 100.0 ± 0.37ºC; the units of measure can affect the
precision of your solution!
The results can be ambiguous if Test 4 alone is passed. In the function given in Figure 43, the
current guess, Tn, corresponds to an objective function of 1000. If the next guess lies anywhere
between 50º and 150º,
Test 3 will be passed and convergence will be signaled. It is thus possible for the software to
report any value between 50º and 150º as the optimum value! This problem arises when the
objective function is weakly dependent on the optimizer variable. In other words, this process
can operate close to the optimum for a large range of temperatures. If convergence is based on
Test 4, then it is good advice to lower this tolerance by an order of magnitude and repeat the
run. If your results change significantly, consider choosing a different optimization variable.

AVEVA™ PRO/II™ Simulation Training


Flowsheet Optimization 59

Figure 43: Convergence Test

Relative Tolerance
In many situations, you can enter a specification in several seemingly
equivalent ways. To illustrate the differences that can arise, consider the
process to the left that separates a feed stream, F, into product streams, V
and L. The process can be a simple flash, or it can be a complex plant,
containing distillation columns, reactors, and recycles. To recover 99% of F
in product stream L you could use the following specification:

L/F = 0.99

Since this is equivalent to recovering 1% of F in product stream V, you could also enforce this
specification as:

V/F = 0.01

If the process consists of a single flash or a column, you would enter the specification as a part
of that unit operation. If the process contains many unit operations, you would enter it as part of
a controller or MVC.
If the software was able to converge exactly (i.e., zero error tolerance), then these specifications
are equivalent and both would produce the correct answer, L=0.99F.
Since the software solves problems only to within prescribed tolerances, the results will, in fact,
differ for these two specifications.
The software enforces recovery-type specifications to within a relative tolerance of ε. It regards
the specification as met if:

| (calc. value of spec - desired value of spec) / desired value of spec | < ε

The software enforces the L/F=0.99 as:

Flowsheet Control and Optimization


60 Flowsheet Optimization

|(L/F - 0.99)/0.99| < ε

Solving this for L shows that the software converges when the calculated value of L is in the
range:

L= 0.99F ± 0.99F ε

Similarly, the V/F=0.01 specification is represented as:

|(V/F - 0.01)/0.01| < ε

Substituting V = F - L and solving for L indicates that the software converges this specification
for a much smaller range of L:

L= 0.99F ± 0.01F ε

Clearly the V/F=0.01 approach is much more accurate for this example; the error bars are two
orders of magnitude smaller than for the L/F=0.99 approach.
The default relative tolerance for this type of specification is ε = 0.01. If F = 1000 for this
problem, then the L/F approach yields:

L= 990 ± 9.9

and the V/F approach yields:

L= 990 ± 0.1

Note that the L/F approach is perfectly acceptable. If ±9.9 is not accurate enough for your
needs, simply tighten the relative tolerance on this specification.

Compounding of Errors
When a loop contains several unit operations, the errors in the individual units can compound to
give unacceptably large errors in the loop output. The discussion that follows is generic and
although we use the CONTROLLER unit as an example, it also applies to the OPTIMIZER.
To illustrate the effect of compounding errors, consider the flowsheet below, which uses chained
flash drums to produce a single liquid product and several vapor products. If L0=640 and each
flash vaporizes half of its feed, what is the liquid flowrate (L5) from the 5th flash. The exact
answer is, of course, L5=20, but because the computer cannot solve the flashes exactly, the
software may not report 20 as the answer.

AVEVA™ PRO/II™ Simulation Training


Flowsheet Optimization 61

If each flash drum meets its specification to within a relative tolerance of ε, then it is simple to
show that, in a worst-case scenario, the relative error in LN will be approximately Nε. Other
flowsheets can compound errors in much more dangerous ways.
The worst case occurs when all of the flash drums are in error by ε in the same direction. In
most cases, the errors in each drum calculation will be lower than ε. In addition, there will be
some cancellation in the errors due to some drums overestimating Ln while others
underestimate it. Nevertheless, it is instructive to be safe and prepare for the worst.
If the flowsheet contains 5 flashes, each solved to 1% relative tolerance, then the calculated
value of L5 can deviate by as much as 5% from the exact solution. The same Nε compounding
error applies to the inverse problem where you want to find the inlet flowrate, L 0, that produces a
liquid outlet flow rate (L5) of 20 mole/hr. To solve this problem, you would use the controller unit
operation. The correct answer would be L0 = 640, but because of the compounding errors, the
calculated result could be anywhere between 608 and 672 (= 640 ±5%). The only way to
calculate L0 to within 1% is to tighten the tolerances on the individual flashes to at least 0.2% (=
1% / 5). Tightening the controller (or optimizer) tolerance without tightening the flash tolerances
is meaningless.

Flowsheet Tolerances
The previous section advised you to lower tolerances of the unit operations contained in
controller loops. This practice is even more advisable for optimizer problems (which are also
loop problems).
To understand why this is the case, you must appreciate that the optimizer makes use of
derivatives in its search for the optimum. Convergence is highly dependent on the accuracy of
the derivatives. The derivative of the objective function, F, with respect to the optimization
variable, x, at the current guess, xn is calculated using the finite difference formula:

dF(xn)/dx = [F(xn+Δx) - F(xn)] / Δx (16)

To calculate the derivative, the software evaluates the objective function at the current guess,
F(xn), changes the optimization variable by a small amount, εx, calculates the new value of the
objective function F(xn+Δx), and applies the above formula. Recall that in your elementary
calculus class, this formula was used as the definition of the derivative in the limit of Δx
approaching 0. In the software, Δx is a parameter that you can choose, and as you will soon
see, it is important that it be neither too large nor too small.
You can control the accuracy of the numerical derivatives by adjusting the derivative stepsize,
Δx, and by adjusting the tolerances of the unit operations. The tighter the unit tolerances, the
less concerned you have to be about choosing Δx too small.

Finite Difference Derivative


Derivative step size is an issue because the objective function always has some uncertainty in
it. This uncertainty is due to the software converging unit operations only to within a prescribed

Flowsheet Control and Optimization


62 Flowsheet Optimization

tolerance. As previously demonstrated, the uncertainty can compound for loops containing
several unit operations.
In Figure 44, we have included error bars on the objective function. The top and bottom of the
error bars indicate the largest and smallest possible values of the objective function at the
current value of x. Because F can take on a range of values at any x, the derivative, calculated
using the finite difference formula, can also take on many values.

Figure 44: Derivative Step Size

Without error bars, there is only one finite difference derivative; it is the slope of the line
connecting the points F(xn) and F(xn+Δx).
With error bars, the largest possible value of the derivative is the slope of the line connecting the
smallest possible value of F(xn) to the largest possible value of F(xn+Δx). Similarly, the
smallest possible value of the derivative is the slope of the line connecting the largest possible
value of F(xn) to the smallest possible value of F(xn+Δx). These concepts are more easily
conveyed graphically.
In the example shown above, the true derivative at xn is positive. Note that both the largest and
smallest possible derivatives are positive, so the derivative calculated by the software will
always be positive, indicating (correctly) that the maximum value of F(x) lies to the right of the
current guess.
Since we desire the finite difference formula to approximate the analytical derivative, we are
tempted to shrink Δx from its current value. This is indeed a good strategy when there is no
error in our evaluation of the objective function. With error bars, however, shrinking Δx too far
can actually result in large inaccuracies in the calculated derivative.

AVEVA™ PRO/II™ Simulation Training


Flowsheet Optimization 63

Figure 45: Smaller Step Size

Figure 45 illustrates the danger of using a small finite difference stepsize with large error
tolerances. The function is the same as in the previous example, but the stepsize, Δx, is
smaller. Shrinking Δx has the effect of moving xn+Δx closer to the xn. Because of the error bars,
both the largest and smallest possible slopes are farther from the true derivative than they were
with the larger stepsize. As indicated above, it is even possible for the software to calculate
negative slopes, indicating that the maximum lies to the left of xn! If you were to shrink Δx even
more, the range of possible derivatives would increase, and the algorithm would be more likely
to fail.
The step size in Figure 46 is the same as in Figure 45, but the error bars are smaller. As you
can see, the finite difference derivative is much better behaved.

Figure 46: Smaller Error Bars

If you were to shrink the error bars to zero, the largest and smallest possible derivatives become
identical. To increase the accuracy of the derivatives, you should tighten the tolerance of the
individual unit operations.
To achieve lower tolerances, the software must take a couple of more iterations on the unit.
While the extra iterations will increase the CPU time for that individual unit operation, the more

Flowsheet Control and Optimization


64 Flowsheet Optimization

accurate representation of the derivatives often results in faster convergence of the optimizer
loop and hence, a reduction in overall CPU time.
As a rule of thumb, the tolerance of unit operations contained in an optimizer loop should be at
least an order of magnitude lower than the optimizer tolerance. With this lower tolerance, you
are much less likely to select a step size that is too small. A relative tolerance of 10 -4 or 10-5 is
usually satisfactory, but due to the inherent precision of the computer, many flowsheets cannot
be converged to relative tolerances below 10-6.
By default, the optimizer selects Δx to be 2% of the distance between the upper and lower
bounds on the optimizer variable: Δx = 0.02 * (xmax-xmin). Because the software scales the finite
difference step size with the bounds on each optimizer variable, the convergence behavior can
be influenced by your choice for xmax and xmin. If you desire, you can change the step size to a
fixed value, i.e., not dependent on the bounds on the optimization variable.
The AVEVA™ PRO/II™ Simulation Reference Manual recommends a stepsize of: Δx = ε1/2
|x*|, where ε is the relative error in the objective function and x* is a typical value for this
variable. It is also possible for the software to suggest an optimum stepsize. See section 2.10 of
the AVEVA™ PRO/II™ Simulation Reference Manual for more information on this feature.

Tips
This section lists some tips that will improve your optimizer calculations.
• Solve base case separately. Doing this gives you a chance to check the results and
to make sure that the simulation goals are on track. It is easier to check for problems
here than after a failed optimizer run.
• Tighten flowsheet tolerances for improved accuracy. This has already been
discussed extensively.
• Carefully select bounds and constraints. By doing this, you can exclude certain
problematic guesses from consideration, thus keeping the optimizer in the region
where the objective function behaves nicely.
• Select appropriate convergence criteria. The optimizer results can be somewhat
dependent on the tolerances you choose for its convergence tests. Be particularly
cautious when convergence is based on the relative change in objective function
test. As you have already seen, the results for slowly varying functions that pass this
convergence test can be highly variable if the tolerance is not sufficiently tight.

AVEVA™ PRO/II™ Simulation Training


Index 65

Index

defining 7, 36, 39
defining your own 36, 39
A
definition 22, 61
Derivative step size 61
applications 6, 58
direct substitution 31, 46, 47
azeotropes 24, 25
DO loop counters 7
documents 4
B

Batch reactor 23
E
Broyden 45, 46, 47, 48
equilibrium data 20, 21, 23
Broyden acceleration method 45
Equilibrium reactor 23
Errors 60
C example 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 21, 26,
27, 28, 31, 38, 39, 41, 44, 45, 49, 50, 51, 52, 53, 54, 55,
Calculator 6, 10, 45
57, 60, 62, 63
Comment lines 7
compressor train 10, 12, 13, 14, 16, 19
constraints 49, 54, 55, 57, 58, 64
F
control 4, 13, 14, 15, 16, 17, 18, 26, 28, 36, 37, 38, 39, 41,
Flowsheet 4, 11, 25, 27, 38, 49, 61
44, 45, 48, 61
control loop 13, 15, 17, 18
Controller 11, 13, 14, 24, 41 G
convergence 4, 6, 13, 14, 17, 26, 27, 28, 31, 36, 37, 38, 39,
40, 43, 44, 45, 46, 47, 48, 50, 51, 58, 64 Gibbs reactor 23
Convergence 28, 34, 37, 39, 45, 58, 59, 61 graphical interpretation 16
Conversion reactor 22
criteria 36, 57, 64
H

D heat of reaction 21
Help 4, 5
data retrieval 6, 7, 9
data transfer 6, 8, 10
I
Define 6, 7, 8, 10, 12, 43
define feature 6, 10
IF... statement 9

Flowsheet Control and Optimization


66 Index

independent 21, 32, 34 purge 6, 28, 37, 43, 44, 45, 48, 49
inside-out approach 33, 38
interconnected 14, 33, 34, 35, 48
R

K Reactors 20
recycle4, 6, 24, 28, 29, 30, 31, 32, 33, 34, 36, 37, 38, 39, 40,
kinetic data 20, 23 41, 42, 43, 44, 45, 46, 47, 48
recycles in 39, 42
reference 5, 39, 40, 42, 43
L
Reference streams 48

limits 47, 49, 55


Loops 31, 32, 33, 34, 35, 38, 43 S

Sequencing 4, 17, 28, 36


M
SIMSCI method 36
SRVSTR 7, 8, 9
makeup 43, 44, 45, 48
statements 7, 8, 9
merging 43, 44
stoichiometry 20, 21, 22, 23
Merging units 48
Streams 28, 34, 35, 40, 44
model 6, 11, 12, 22, 24, 49
subroutines 7, 8, 10
multivariable 52

N T

tear 34, 35, 36, 37, 38, 39, 45, 46, 47, 48
nested 15, 18, 19, 33, 35, 38, 40, 48
tests 9, 37, 38, 58, 64
Thermal recycles 39
O Tips 43, 48, 64
tips for solving 44
online 4, 5
tolerances 13, 37, 38, 39, 48, 51, 59, 61, 63, 64
optimization 4, 49, 50, 51, 52, 53, 54, 57, 58, 61, 64
Troubleshooting 48
optimizer 26, 27, 49, 50, 51, 54, 55, 56, 58, 61, 64
type 12, 59, 60
optimizer calculations 64

U
P
Unit operations 8
piping network 11, 12, 13
uses 6, 7, 10, 19, 21, 23, 36, 37, 38, 42, 46, 47, 50, 55, 56,
procedure 6, 7, 9, 10, 11, 14, 17, 34, 45, 46, 49, 58
57, 60
programming algorithm 57

AVEVA™ PRO/II™ Simulation Training


Index 67

V W

variables 7, 12, 14, 17, 18, 26, 27, 49, 51, 52, 53, 54, 56, 57, Wegstein 45, 46, 47
58

Flowsheet Control and Optimization


Table of Contents 1

Table of Contents
Using the Calculator ................................................................................................................... 2

Using the Controller ................................................................................................................... 5

Optimization ................................................................................................................................ 6

Propane-Propylene Splitter ...................................................................................................... 11

Toluene Hydrodealkylation ...................................................................................................... 17

DME Production ........................................................................................................................ 22

Butane Addition to Fuel Gas .................................................................................................... 27

Flowsheet Control and Optimization


2 Using the Calculator

Using the Calculator

OVERVIEW
The CALCULATOR gives you the ability to calculate almost any quantity you desire. Suppose
that your company has devised a correlation that can predict a stream’s flash point from its D86
10% and initial (1%) points:

(1)

All temperatures in this formula are in degrees Fahrenheit. You want to use this correlation to
determine the flash point of the liquid product of the FLASH DRUM shown in Figure 1. Use the
SRK thermodynamic system. Find the feed stream data.
What is the calculated value for the flash point of the liquid stream?

Figure 1: Flowsheet for Flash Point Calculation

Table 1: D86 Assay Data for Feed

Percent Distilled (%) Temperature (°F)


3 392
10 414
20 420
30 424
40 426
50 430
60 435
70 440
80 448
90 456
98 495
Average API gravity 44.6
Flowrate 22,000 lb/hr
Pressure 20 psia
Bubble Point Liquid

AVEVA™ PRO/II™ Simulation Training


Using the Calculator 3

SOLUTION
Set up the CALCULATOR to determine the flash point of the liquid product:
• Double-click on the CALCULATOR
• Click Edit/View Declarations
• Click Results
• Assign the name Flash point to R(1)

Figure 2: Parameter Selection Window

• Click Parameter
• Enter the parameter numbers and definitions:
o Define parameter P(1) to be the D86 10% point (as shown in Figure 2)
o Define parameter P(2) to be the D86 initial point
• Under the Procedure section, set up the equation to assign the value of the flash
point to R(1)

Figure 3 shows the Calculator with the parameters and procedure defined.

Flowsheet Control and Optimization


4 Using the Calculator

Figure 3: Calculator Window

What is the calculated value for the flash point of the liquid stream?
Answer: 153ºF

AVEVA™ PRO/II™ Simulation Training


Using the Controller 5

Using the Controller

OVERVIEW
You just received a phone call from refinery operations. They have an excess buildup of butane
and would like to dispose of it through the refinery fuel gas system. As this is not a common
operation, the operator needs to know the maximum rate the butane can be injected. The
butane addition is limited by the operating condition that the fuel gas must not contain any liquid.
The fuel gas system is currently operating at 60°F and 100 psig, but the temperature is
expected to drop to 35°F overnight.
What is the maximum rate butane can be injected in BBL/hr?

Note: As bbl/hr is not a common flowrate unit, it is helpful to add a custom Stream Property
Table to the flowsheet.

Table 1: Fuel Gas Composition

Fuel Gas Composition Temperature, F 60


Pressure, psig 100
Flowrate, MMSCFD 49
Composition, mole fraction
CO2 0.0009
CO 0.0077
H2 0.2050
C1 0.5812
C2 0.1380
C3 0.0231
IC4 0.0180
NC4 0.0190
IC5 0.0053
NC5 0.0018
Butane IC4 0.20
NC4 0.80

The flash drum illustrated in Figure 1 of exercise Optimization (Part 1) produces an overhead
stream whose market value is proportional to the square of its purity.

Flowsheet Control and Optimization


6 Optimization

Optimization

PART 1 – Case Study

OVERVIEW
Setup a Case Study to investigate the economics from a flash involving the flowrate and
concentration of methane and ethane.

Unit price of OVHD ($/lb-mol) = Flowrate of (C1 + C2)(yC1 +yC2)2

Figure 1: Flash Drum for Optimization

Table 1: Feed Stream Data

Component lb-mol/hr
H2O 2
C1 1
C2 1
C3 10
iC4 10
nC4 10
iC5 10
nC5 10
nC6 50
Flowrate 104 lb-mol/hr
Temperature -60°F
Pressure 900 psia

Note: The Case Study feature is located under the Input tab.

AVEVA™ PRO/II™ Simulation Training


Optimization 7

Questions
1) In setting up the case study, what range of temperatures should you look at?
2) What is an appropriate delta T?

SOLUTION
• Set up TEMPERATURE as Parameter 1 and REVENUE as Result 1
• Plot your results as a Case Study Plot (located under the Output tab)

Figure 2: Case Study – Plot Definition window

Flowsheet Control and Optimization


8 Optimization

PART 2 – Optimization with Portal

Figure 3: Case Study Results

AVEVA™ PRO/II™ Simulation Training


Optimization 9

PART 3 – Optimizer
Perform the same calculation now with an optimizer.

OPTIMIZER SETUP

Figure 4: Setting up the Optimizer

Flowsheet Control and Optimization


10 Optimization

RESULTS

Figure 5: PFD of complete Optimization exercise

AVEVA™ PRO/II™ Simulation Training


Propane-Propylene Splitter 11

Propane-Propylene Splitter

PART 1 – Base Case Simulation

OVERVIEW
Solve the heat and material balances for the propane-propylene splitter shown in Figure 1.
Table 1 gives the feed stream conditions, and Table 2 contains the column data. Additional
design and simulation specifications are given on the next page.

Figure 1: Flowsheet for Propane-Propylene Splitter

Table 1: Feed Stream Data

Component Mole %
Propane 14.6112
Propylene 85.3888
Flowrate 25550 lb/hr
Temperature 120°F
Pressure 310 psia

Flowsheet Control and Optimization


12 Propane-Propylene Splitter

Table 2: Column Data

CONDENSER
Type Bubble Point
Pressure (psia) 272
PRESSURE PROFILE
Stage Pressure (psia)
2 277
90 290
91 292
172 306
OTHER CONDITIONS
Reboiler Type Kettle
Overhead Estimate 500 lb-mol/hr
Feed Location Stage 105

Simulation Design Specifications


• Use SRK thermodynamics with Costald liquid density
• Use the I/O algorithm with the Conventional initial estimate generator
• Specify the mole fraction of propylene in the overhead stream to be 0.9968
• Specify the recovery of propylene in the bottom stream to be 5% of the propylene in
the feed
• Vary the reboiler and condenser duties to meet these specifications

After running the simulation, select Output | Generate Plot, and plot the Separation Factor.

Questions
1) What does the flat portion of this plot tell you about the current feed tray location?
2) What is the reboiler duty?

SOLUTION
1) What does the flat portion of this plot tell you about the current feed tray location?
Your separation factor plot should look similar to Figure 2. The relatively flat region
between approximately trays 100 and 130 indicates that the feed tray location is not
optimal. The trays in this region are not effectively contributing to the separation of the
two components.

2) What is the reboiler duty?


The reboiler duty is approximately 47.7 x106 BTU/hr.

AVEVA™ PRO/II™ Simulation Training


Propane-Propylene Splitter 13

Figure 2: Separation Factor Plot

Flowsheet Control and Optimization


14 Propane-Propylene Splitter

PART 2 – Optimize the Feed Tray Location

OVERVIEW
In this and succeeding parts of this problem, you will use the OPTIMIZER utility to determine the
feed tray location that minimizes the reboiler duty for the propane-propylene splitter flowsheet.
• Add an OPTIMIZER to the flowsheet you built for Part 1 of this problem
• Define the OPTIMIZER objective function to minimize the reboiler duty
• Set up the OPTIMIZER to search for the best feed tray location between trays 50
and 150

Note: Select Input | Restore Input Data. This prevents the software from starting from the
previous run’s results.

Questions
1) What is the new feed tray location? Is this what you expected based on the separation
factor plot?
2) What is the new reboiler duty?

SOLUTION
1) What is the new feed tray location? Is this what you expected based on the separation
factor plot?
The new feed tray location is tray 129.9 (i.e., the feed is split between trays 129 and
130). The separation factor plot indicated that stage 105 is too high, so tray 130 is an
improvement.

2) What is the new reboiler duty?


44.7x106 BTU/hr

AVEVA™ PRO/II™ Simulation Training


Propane-Propylene Splitter 15

PART 3 – Maximize the Profit

OVERVIEW
Use the CALCULATOR and OPTIMIZER units to evaluate and maximize the profit for the
propane-propylene splitter. Base the profit on the economic data found in Table 3.

Table 3: Economic Data

Utility Cost ($/MM BTU)


LP Steam 3.60
Cooling Water 0.40
Product Value ($/LB)
Propylene 0.174
Propane 0.120

In this part, vary the following parameters:


• Feed tray location between trays 50 and 150
• Recovery of propylene in the bottoms product between 0.01 and 0.1. This
corresponds to COL1SPEC1 or COL1SPEC2 in the OPTIMIZER

Note: Select Input | Restore Input Data. This prevents the software from starting from the
previous run’s results.

Questions
1) What is the new feed tray location?
2) What is the new value for the recovery specification?
3) Are either of the variables at the bounds you provided?
4) Explain why this recovery specification corresponds to the optimum solution in this
exercise?

Flowsheet Control and Optimization


16 Propane-Propylene Splitter

SOLUTION
1) What is the new feed tray location?
Stage 119

2) What is the new value for the recovery specification?


0.01

3) Are either of the variables at the bounds you provided?


The recovery specification is at its lower bound. It is quite common to find the optimum
solution at one or more of the variable bounds.

4) Explain why this recovery specification corresponds to the optimum solution in this
exercise?
The OPTIMIZER guided the COLUMN to the solution that yields the least propylene in
the bottom product. Although this sharp split requires high reboiler and condenser
duties, it frees up more propylene for the high-value overhead product. In this example,
the additional energy costs are more than offset by the increased flowrate of the
propylene stream. If the propane stream had a higher value than the propylene stream,
then the optimizer would guide the column to the maximum allowed propylene recovery
in the bottoms.

AVEVA™ PRO/II™ Simulation Training


Toluene Hydrodealkylation 17

Toluene Hydrodealkylation

OVERVIEW
The hydrodealkylation of toluene (HDA) is a process used to produce benzene. The main
reaction in the process is:

Toluene + H2 → Benzene + CH4

Toluene and hydrogen are converted in a reactor packed with catalyst to produce benzene and
methane. Both hydrogen and toluene are recycled. Typically, the reaction reaches a conversion
of 90%. The reaction is highly exothermic, and the typical operating conditions are 900°F to
1200°F, and 300 to 900 psia. Figure 1 shows the block diagram of the HDA process. The PFD
is illustrated in Figure 2.

Figure 1: Toluene Hydrodealkylation Block Flow Diagram

Thermodynamics
The SRK thermodynamic method is used to calculate the equilibrium and enthalpy data for this
reaction.

Flowsheet Control and Optimization


18 Toluene Hydrodealkylation

Figure 2: Toluene Hydrodealkylation

AVEVA™ PRO/II™ Simulation Training


Toluene Hydrodealkylation 19

Table 1: Unit Feeds

TOLUENE
Flowrate SCFH (Vapor Volume) 90,000
Temperature F 77
Pressure psig 10
HYDROGEN
Flowrate SCFH (Vapor Volume) 250,000
Temperature F 77
Pressure psig 10

Table 2: Unit Operations

F1 – FLASH DRUM
Temperature F 140
Pressure psig 360
E1 - PREHEATER
Outlet Temperature F 330
Delta P psi 5
E2** - FURNACE
Outlet Temperature F 1100
Delta P psi 5
R1 - REACTOR
Type Conversion
Thermal Specification Adiabatic
Reaction Set C7H8 + H2 → C6H6 + CH4
Extent of Reaction 75%
E3 – REACTOR COOLER
Temperature F 100
Delta P psi 20
F2 – HYDROGEN SEPERATOR
Duty Adiabatic
Delta P psi 0
SP1 – RECYCLE SEPERATOR
Spec Stream 11 70% of Feed
C1 – RECYCLE COMPRESSOR
Pressure psig 360
Efficiency % 75

Flowsheet Control and Optimization


20 Toluene Hydrodealkylation

SP2 – REACTOR SPLITTER


Spec Stream 13
Flowrate SCFH 35,000
F3 – OFF GAS SEPARATOR
Temperature F 100
Pressure psig 40
E4 – TRIM HEATER
Temperature F 190
Delta P psi 5
T1 – BENZENE COLUMN
Stages Theoretical 16
Top Tray Pressure psig 30
Delta P Column psi 5
Feed Tray 9
ESTIMATES
Benzene (Tray 1) lb-mol/hr 211
Toluene (Tray 16) lb-mol/hr 975
Reboiler Type Kettle
Condenser Type Partial
SPECIFICATIONS
Stream Toluene Recovery (molar) 99%
Reflux Ratio 8
Temperature Condenser (F) 230
VARIABLES
Stream Benzene Flowrate
Condenser Duty
Reboiler Duty
CN1 – CONTROLLER
Specification Stream 9 Flowrate, SCFH 9.10 e5 ft3/hr
(Vapor Volume)
Variable Splitter SP1 Spec Stream 11

** Note: E2 is a simple heat exchanger with the display changed to resemble a fired
heater. To change the display, right-click on the simple heat exchanger on the PFD, and
select Display, then select Heater.

AVEVA™ PRO/II™ Simulation Training


Toluene Hydrodealkylation 21

RESULTS

Note: By default, the software sequences and defines the recycle loops automatically. IF
you incorporate the Broyden convergence method, you can reduce the computation time by
less than half.

Flowsheet Control and Optimization


22 DME Production

DME Production
DME is used primarily as an aerosol propellant. It is miscible in most organic solvents and has a
high solubility in water. Recently, the use of DME has been investigated as a fuel additive for
diesel engines fuel to its high volatility and high cetane number.

Process Background
The production of DME is a catalytic dehydration process that reacts methanol over an alumina
catalyst treated with silica. The DME reaction is as follows:

Methanol is converted in a reactor packed with acidic catalysts such as zeolites or silica-alumina
to produce DME and water. The unconverted methanol is recycled. Typically, the reaction
reaches a conversion of 80%. The reaction is slightly exothermic, and the typical operating
conditions are 250°C to 380°C, and moderate pressures of 10 to14 bar.

Process Description
The PFD is illustrated in Figure 1 in which 10 metric tons per hour of 99.9 wt.% purity of DME is
produced.
Fresh methanol from Stream 1 is mixed with recycled with unreacted methanol from Stream 13
and pump and vaporized prior being sent to a fixed bed reactor operating between 250°C and
370°C. The reactor effluent (Stream 6) is then cooled in an FE exchanger (E-202) and E-203
prior being sent to the first of two distillation columns (T-201 and T-202). DME is taken
overhead from the first column. The second column water from methanol. The methanol is
recycled back to the front end of the process, and the water is sent to wastewater treatment to
remove the tract organics.

Reaction Kinetics
The kinetics for the reaction of methanol are taken from Berćić and Levec [2] and are given as
Equation (1):

AVEVA™ PRO/II™ Simulation Training


DME Production 23

Where r is in kmol/m3- reactor/h, the energy terms in the exponentials are in kJ/kmol, and Ci
is in kmol/m3. The value of the equilibrium coefficient (K) used in the second term in the
numerator of Equation (2) is:

Thermodynamics
The SRKs thermodynamic method is used to calculate the equilibrium and enthalpy data for this
Process.

Flowsheet Control and Optimization


24 DME Production

DME
Methanol
13
Recycle

2
Methanol 1
3
P-201

10 DME
E-201
4

E-202
7 8 9
V1
E-203
5 Methanol
Recycle

6 T-201
11 12
V2

R-201

T-202
14 Wastewater

Figure 1: Flowsheet for DME Production

AVEVA™ PRO/II™ Simulation Training


DME Production 25

Table 1: Design Parameters and Specifications

HEAT EXCHANGERS

U (W/m2ºC) Pressure drop at design flow

Methanol vaporizer shell = 14 kPa


1000
tube = 35 kPa

Gas-gas exchanger shell = 14 kPa


55
tube = 35 kPa

Liquid product cooler shell = 14 kPa


420
tube = 35 kPa

REACTOR

Catalyst diameter 3 mm

Bulk density of catalyst 1250 kg/m3

Voidage of catalyst bed 0.45

Inlet pressure range 10-14 bar

Bed pressure drop < 0.5 bar (Use Ergun Equation)

Length/Diameter > 4.0

Maximum temperature 390ºC

Single-pass conversion 80%

TOWERS

Condensers Use total condensers

Acceptable flooding range 80%


Internals Use Process.SimpleTray
to 35%
PUMPS

Efficiency 65%

Type Centrifugal

METHANOL FEED VESSEL

Length/Diameter = 3.0

Volume of vessel 20 minutes of liquid flow into vessel

Flowsheet Control and Optimization


26 DME Production

Table 2: Product Specifications

Required
Temperature Pressure Composition Phase
flowrate

99 mole % MEOH
Fresh Methanol 30ºC 130 kPa Liquid ---
Feed 1 mole % water

< 250 ppm weight


Wastewater  45ºC 120 kPa Liquid ---
organic

Determined
DME product  45ºC  99.9 mole % DME Liquid 10 tonne/h
by process

Table 3: Utility Specifications (only these utilities are available)

Temperature Pressure Cost


Utility
(ºC) (bar) ($/GJ)

Refrigerated water supply (rws) (in)1 10 4.0 5.0

Refrigerated water return (rwr) (out)1 20 2.0 ---

Cooling water supply (cws) (in)2 30 4.0 0.5

Cooling water return (cwr) (out)2 40 2.0 ---

Low-pressure steam (lps)3 saturated 7.0 5.0

Medium pressure steam (mps)3 saturated 14.0 6.0

High-pressure steam (hps)3 saturated 51.0 7.0

AVEVA™ PRO/II™ Simulation Training


Butane Addition to Fuel Gas 27

Butane Addition to Fuel Gas


Refinery operations just reached out to you to determine how much butane they can inject into
the fuel gas line in barrels per hour.

Conditions
• The coldest ambient conditions overnight are expected to reach 35°F
• The fuel gas system operates at 100 psig
• No liquid is allowed in the fuel gas system

Table 1: Fuel Gas Composition

Component Rates
Stream Name FUELGAS C-4MU
Description
Phase Vapor Vapor
Temperature F 60.000 Dew Pt.
Pressure PSIG 100.000 100.000
Molecular Weight 17.824 58.123
Component Mole Fractions
CO2 0.0009 ---
CO 0.0077 ---
H2 0.2050 ---
C1 0.5812 ---
C2 0.1380 ---
C3 0.0231 ---
IC4 0.0180 0.2000
NC4 0.0190 0.8000
IC5 0.0053 ---
NC5 0.0018 ---
Total 49 MM SCFD ---

Flowsheet Control and Optimization

You might also like