Sunteți pe pagina 1din 40

Course Contents - Overview

• Overview of Simulation and Flowsheeting

• Mass & Energy Balances / Degrees of freedom


• Aspen Plus Introduction
• Property Methods: General concepts and Exercise 1 in Aspen Plus
• Reactions / Reactors : General concepts and Exercise 2 in Aspen Plus
• Separations / Columns : General concepts and Exercise 3 in Aspen Plus
• Process Simulation and Flowsheeting: General concepts, modes and methods
• Convergence and Debugging in Aspen Plus, Exercise 4 in Aspen Plus
• Connecting Aspen Plus with Excel
• Kinetic Fitting and Exercise 5 in Matlab

Process Simulation and Flowsheeting ICB / ETH Zurich 1

1
Outline of Today’s Lecture - Details

Convergence topics in Aspen Plus®

Debugging in Aspen Plus®

Process Simulation and Flowsheeting ICB / ETH Zurich 2

2
Convergence
Flowsheets with recycle loops, design specifications, or optimizations must be solved
iteratively by Aspen Plus®.

Aspen Plus® can automatically determine tear stream selection, convergence


methods, and calculation sequence used to solve the flowsheet. Or you can supply
part or all of the convergence specifications. Often the automatic sequencing is
satisfactory.

An example showing a few elements of convergence options is given in file


L13_Demo_convergence.bkp .

Process Simulation and Flowsheeting ICB / ETH Zurich 3

3
Convergence Options
To specify Use this Convergence form

Convergence parameters and/or / Conv Options


methods for convergence blocks

Some or all of the tear streams needed / Tear


for system-generated convergence blocks

Some or all of the convergence blocks / Convergence

Convergence order for some or all of / Conv Order


the user-defined convergence blocks

Sequence for all or part of a flowsheet / Sequence

Process Simulation and Flowsheeting ICB / ETH Zurich 4

4
Convergence – Conv Options - Defaults
On this sheet one can specify:
• Tear Convergence parameters such as Tolerance
• Default Methods for tear streams, design specifications, and optimization
problems
• Parameters that affect Sequencing
• Convergence parameters for each method. The specified parameters are used as
defaults for convergence blocks you define and convergence blocks generated by
Aspen Plus®.

Process Simulation and Flowsheeting ICB / ETH Zurich 5

5
Convergence – Conv Options – Methods –
Wegstein
You can control the Wegstein method by specifying (Conv Options / Methods /
Wegstein ):
• Upper and lower limits for acceleration parameter q (Upper Bound and Lower Bound).
• Number of direct substitution iterations before the first acceleration (Wait ).
• Number of direct substitution iterations between acceleration iterations (Consecutive
direct substitution steps ).
• Number of consecutive acceleration iterations (Consecutive acceleration steps ).

Process Simulation and Flowsheeting ICB / ETH Zurich 6

6
Convergence – Conv Options – Methods - Secant
Secant is the secant (linear approximation) method with higher order enhancements.
It has options to automatically switch to bracketing or to an interval halving algorithm if
the function is discontinuous, flat over a region, or possibly non-monotonic.

You can use Secant for converging single design specifications.

Process Simulation and Flowsheeting ICB / ETH Zurich 7

7
Convergence – Conv Options – Methods -
Broyden
Broyden is a modification of Broyden's quasi-Newton method which uses an
approximation of the Jacobian. Use it to converge:
• One or more tears.
• Multiple design specifications.
• Tears and design specifications simultaneously.

Broyden is useful when:


• Design specifications and tears are highly interdependent.
• Recycle loops and design specifications are so interrelated that nesting is impractical.

Process Simulation and Flowsheeting ICB / ETH Zurich 8

8
Convergence – Conv Options – Methods –
Newton
Newton is an implementation of the modified Newton method for simultaneous
nonlinear equations. The implementation allows bounds on the variables, and
includes a line search for improved stability.

Newton is useful when the recycle loops and/or design specifications are highly
interrelated but convergence is not achieved using the Broyden method.

Process Simulation and Flowsheeting ICB / ETH Zurich 9

9
Suitability of Convergence Methods
Tear Streams: Design Specifications:
• Wegstein (default) • Secant (default)
• Direct • Broyden
• Broyden • Newton
• Newton

Tear Streams AND Design Specifications:


• Broyden
• Newton

Process Simulation and Flowsheeting ICB / ETH Zurich 10

10
Convergence – Tolerance
A tear is converged when the following is true for all tear convergence variables:

X new − X old
− Tol ≤ ≤ Tol
X old
where:
Tol = specified tolerance
Xnew = value of variable from current iteration
Xold = value of variable from previous iteration

Plots of error/tolerance vs. iteration-# show the convergence history.

Process Simulation and Flowsheeting ICB / ETH Zurich 11

11
Convergence – Block Tolerance
The default block tolerance is 1e-4. Changing it to 1e-6 often improves tear stream
convergence.

The block tolerance can be changed locally (in the specification of a block) or globally
for flash calculations (Setup / Simulation Options ). The latter option does only change
the tolerance for simple models but not that of e.g. RadFrac .

Process Simulation and Flowsheeting ICB / ETH Zurich 12

12
Convergence – Conv Options - Component
groups
For streams, the default convergence variables are total mole flow, all component
mole flows, pressure, and enthalpy.
Enter a Component group ID (Convergence / Convergence / Block / Tear Streams)
to identify the components to be converged.
You can use a component group when you know that some components have zero
or constant flow rates. A Component group may cause convergence problems if
the unconverged components have significant flow.

Process Simulation and Flowsheeting ICB / ETH Zurich 13

13
Convergence – Conv Options - Sequencing
Design spec nesting (Conv Options / Defaults / Sequencing ) lets you specify a
preference for whether design specifications should be nested inside tear loops, outside
tear loops, or converged simultaneously with tears. Design spec nesting does not
apply to convergence blocks specified in the Conv Order form.

User nesting lets you specify a preference for whether convergence blocks specified on
the Conv Order form should be nested inside or outside other convergence blocks
(user-defined or system-generated). A User nesting setting has precedence over a
Design spec nesting setting.

Process Simulation and Flowsheeting ICB / ETH Zurich 14

14
Sequencing Example

The mass flow of stream REFLUX, the inter-reflux stream from BOTCOL to
TOPCOL, is manipulated to meet a purity specification of component THF
in stream PROD. PROD is a product stream from BOTCOL/COOLER, in
design specification THF. PSPEC is the convergence block defined to
converge THF.

Process Simulation and Flowsheeting ICB / ETH Zurich 15

15
Sequencing Example
The automatic sequencing algorithm determines the following calculation
sequence:

HEATER
$OLVER01 TOPCOL
| PSPEC BOTCOL COOLER
| (RETURN PSPEC)
(RETURN $OLVER01)

$OLVER01 is defined to converge stream REFLUX, with initial data provided.


However, with this sequence the PSPEC and $OLVER01 convergence blocks fail to
converge, because the design specification is nested inside the column recycle loop.
The design specification THF does not converge, because the purity specification is
determined primarily by the inter-reflux between the two columns
(not the top product rate of the BOTCOL alone).

Process Simulation and Flowsheeting ICB / ETH Zurich 16

16
Sequencing Example
The inter-reflux between the columns should be converged before
evaluation of the design specification. The design specification should be
nested outside the column recycle loop. You can alter the nesting order of
the convergence loops by either:

• Specifying Design Spec Nesting as Outside on the Convergence /


ConvOptions / Defaults / Sequencing sheet, or
• Specifying PSPEC on the Convergence / Conv Order / Specifications sheet.

Process Simulation and Flowsheeting ICB / ETH Zurich 17

17
Sequencing Example

Either specification would cause the sequencing algorithm to determine the


following computation sequence, which converges:

HEATER
PSPEC
| $OLVER01 TOPCOL BOTCOL
| (RETURN $OLVER01
| COOLER
(RETURN PSPEC)

Process Simulation and Flowsheeting ICB / ETH Zurich 18

18
Convergence – Tear Form
Use this form to enter preferences for tear streams to be converged by system-
generated convergence blocks, and optionally, to specify the convergence
variables and tolerance for these streams.

If you specify an incomplete tear set for your flowsheet, Aspen Plus® automatically
chooses the remaining set of streams. If you specify a redundant tear set (too
many tear streams), Aspen Plus® may ignore some tears or find an inefficient
sequence.
If possible, choose tear streams so that each possible calculation loop contains one
and only one tear stream.
Example:

Process Simulation and Flowsheeting ICB / ETH Zurich 19

19
Convergence – Initial Guesses for Tears
For many simulations with recycle streams, initial guesses for the tear streams will
help convergence. This is especially true for recycle systems with closed loops or
recirculating solvent loops. You can often provide a reasonable initial guess from
your knowledge of the process or through a simple mass-balance calculation.

Enter initial compositions and flow rates for the tear streams on Stream / Input /
Specification sheets, and run the simulation.

Process Simulation and Flowsheeting ICB / ETH Zurich 20

20
Convergence – Conv Order Form
Use this form to specify a preference for the calculation order of user-defined
convergence blocks.

Enter the convergence blocks in the order in which you prefer the nested loops be
solved.
The first convergence block entered will be converged first, and is therefore
nested most deeply.

To avoid possible convergence problems, the actual sequence generated may not
strictly follow the loop-order preference specified on this form.

Process Simulation and Flowsheeting ICB / ETH Zurich 21

21
Convergence Results
After your simulation has completed or while it is paused, you can view convergence
block results to check the status or diagnose convergence problems.

1 If your simulation is paused, from the Run menu, click Load Results .
2 On the Data menu, point to Convergence , then Convergence .
3 In the Convergence / Object Manager , select the convergence block and click Edit.
For system-generated convergence blocks, (names beginning with $OLVER), the
results sheets are displayed. For user-defined convergence blocks, select Results
on the left pane of the Data Browser window to display the results sheets.

Process Simulation and Flowsheeting ICB / ETH Zurich 22

22
Convergence Results
4 Choose the appropriate sheet:

This sheet Contains the information


Summary Final convergence status, variable value, and Err/Tol
for each variable converged by the block

Tear History Table of maximum Err/Tol versus iteration number.


Variable with maximum error at each iteration. Plots
of Err/Tol versus iteration number can be generated.

Spec History Table of manipulated variable values and design


specification error versus iteration number. You can
generate plots of design specification error versus
iteration number, or design specification error versus
manipulated variable value.

Process Simulation and Flowsheeting ICB / ETH Zurich 23

23
Convergence – Diagnostic Message Levels
The message levels for convergence diagnostics are:

Level Description
0 Only convergence block terminal error messages are listed.
1 + convergence block severe error messages are listed.
2 + convergence block error messages are listed.
3 + convergence block warnings are listed.
4 + brief diagnostic information are listed.
5 + information on unconverged variables at each iteration.
6 + information on every variable at each iteration are listed.
7-8 + additional diagnostics for analyzing convergence are listed.
This varies for each convergence algorithm.

Process Simulation and Flowsheeting ICB / ETH Zurich 24

24
Convergence – Default Diagnostic Level
The default diagnostic level is 4. At this level, a message is created
in the Control Panel every time the convergence block executes.
This message contains the following information:

• Convergence block.
• Convergence method.
• Iteration number.
• What the convergence is trying to converge.
• Number of unconverged variables.
• Maximum error/tolerance for that iteration of the convergence
block.

Process Simulation and Flowsheeting ICB / ETH Zurich 25

25
Strategies for Flowsheet Convergence
Some general guidelines are:

Start small. Make sure that individual blocks and elements of a flowsheet behave as
expected, before slowly combining them into a larger simulation. Sensitivity analysis
might help here.

Start with simple unit operation models. For example, converge the flowsheet with a
DSTWU before switching to RadFrac .

Provide good initial guesses. Make sure the flowsheet starts converging from a
reasonable point. If possible, select a tear stream that remains relatively constant.

Process Simulation and Flowsheeting ICB / ETH Zurich 26

26
Strategies for Flowsheet Convergence

Check physical properties. Make sure they are calculated correctly in the
entire operating range of the simulation.

Check for correctness, variable accessing, spelling, and unit specifications.


When accessing real variables, make sure your variable names do not begin
with I-N (Fortran convention).

Evaluate tear stream choice.

Analyze warnings and error messages.

Process Simulation and Flowsheeting ICB / ETH Zurich 27

27
Diagnostics

The amount of information written to History File and Control Panel can be
specified independently (Setup / Specifications / Diagnostics ).

Diagnostics settings can be specified globally (see above) or locally (in the
specification of a unit operation block).

Simulation sets the diagnostics level for unit operation blocks, while
Convergence sets them for convergence blocks.

Process Simulation and Flowsheeting ICB / ETH Zurich 28

28
Control Panel Messages
Each time the convergence block is executed in a recycle convergence loop,
messages appear with the following format:

> Loop Block Method: WEGSTEIN Iteration 9


Converging tear streams: 3
4 vars not converged, Max Err/Tol 0.18603E+1
where:
Block = Convergence block ID
Max Err/Tol = Maximum error/tolerance for the unconverged variables
> = Symbol indicating nesting level of the convergence loop
> Outside loop, >> Loop nested one deep,
>>> Loop nested two deep, and so on

Process Simulation and Flowsheeting ICB / ETH Zurich 29

29
Control Panel Messages

Each time a convergence block for a design specification is executed in a


convergence loop, messages appear with the following format:

>> Loop Block Method: SECANT Iteration 2


Converging specs: H2RATE
1 vars not converged, Max Err/Tol 0.36525E+03

Convergence is achieved when the value of Max Err/Tol becomes less than
1.0.

Process Simulation and Flowsheeting ICB / ETH Zurich 30

30
Run Settings – Express run

• Turns off flowsheet animation.

• Fortran block write statements to Control Panel are still printed.

• Resets all global Control Panel diagnostics to level 0.

• Turning off Express run resets global Control Panel diagnostics to


level 4.

Process Simulation and Flowsheeting ICB / ETH Zurich 31

31
Run Settings – Interactively load results

• Results are only sent to GUI after a results form is requested.

• Dramatically improves speed.

• Select Load Results from the Run pull-down menu to load all results.

Process Simulation and Flowsheeting ICB / ETH Zurich 32

32
Run Settings – Further Options (Run Menu)

• Stop Points
 Used to halt execution in the middle of a run.
 Allows user to examine intermediate results.
 Can stop before and after any object in sequence.
 Can stop after warning or error.

• Reinitialize
 Used to discard current results.
 Simulation restarts from current input specification.

Process Simulation and Flowsheeting ICB / ETH Zurich 33

33
Debugging Convergence Problems
Specify blocks to be independent of flow rates (e.g. specify fraction instead
of flow rate for Fsplit , or distillate/feed rate instead of distillate rate for
RadFrac ).

Check and confirm or alter calculation sequence.

Process Simulation and Flowsheeting ICB / ETH Zurich 34

34
Debugging Convergence Problems
In case of steady but slow tear convergence the most common problem is
component build-up (consider that each component in the system must have
at least one outlet). Allow for larger acceleration steps (Qmin = -50, Wait =
5, Accelerate = 4).

If Error/Tolerance ratio reduces to about 10 and then fails to progress, then


tighten the convergence of nested/
inner loops or blocks (inner loops should have lower tolerance than outer
loops; this is also valid for block vs. optimization tolerances). Try relaxing
tolerance last.

Process Simulation and Flowsheeting ICB / ETH Zurich 35

35
Debugging Convergence Problems
In case of tear stream problems with the Broyden and Newton methods,
increase Wait parameter to 5, and/or provide better initial guesses.

For Design Spec convergence problems make sure that tolerance and bounds
are reasonable, check specifications for correctness, use Secant Bracket
option for flat response, avoid non-linear specifications (use log if necessary),
and consider to define a maximal step size.

Be suspicious of a Design Spec that converges in one iteration.

Process Simulation and Flowsheeting ICB / ETH Zurich 36

36
Debugging Tear Convergence Problems
In case of steady convergence progress without finally achieving convergence
the number of maximum iterations should be increased (either globally under
Convergence / Conv Options or locally within a certain block).
It might be helpful to disconnect a recycle stream in order to obtain a good
intial estimate and to investigate the sensitivity.

Try Broyden and Newton methods instead of Wegstein.

Reinitialize the simulation when appropriate.

Process Simulation and Flowsheeting ICB / ETH Zurich 37

37
Summary: Resolving Sequence and Convergence
Problems

1 Run the simulation using the default sequence generated by


Aspen Plus®.

2 Examine simulation results, look out for skipped and unconverged unit
operation blocks. Check the Control Panel and results sheets for blocks
that did not complete normally, had errors, or had unexpected results
that might affect recycle convergence.

Process Simulation and Flowsheeting ICB / ETH Zurich 38

38
Summary: Solving Problems
2 cont.
Some common reasons for these problems are:

Problem Action
Incorrect block specifications. Correct them.
Feed conditions too far off. Provide better estimates for tear
streams and/or design variables.
Convergence specifications. Try different specifications, different
algorithm options, or increase the
number of iterations.
Algorithm options. Change options.
Not enough iterations. Increase number of iterations.

Process Simulation and Flowsheeting ICB / ETH Zurich 39

39
Summary: Solving Problems

3 Check whether adjustments in the tolerance values or the algorithm


parameters or a change of the algorithm itself is needed.

4 Check for unconverged design specifications.

5 Alter the calculation sequence, if necessary.

6 If the flowsheet is modified, rerun the simulation and go back to step 2.

Process Simulation and Flowsheeting ICB / ETH Zurich 40

40

S-ar putea să vă placă și