06 Convergence Algorithm and Diagnostics-libre

25
Advanced Distillation with Aspen Plus Algorithm Concepts and Calculation Diagnostics Aspen Technology, Inc. 7 – 1 © 2002 AspenTech. All Rights Reserved. © 2002 AspenTech. All Rights Reserved. Algorithm Concepts and Calculation Diagnostics Advanced Distillation with Aspen Plus © 2002 AspenTech. All Rights Reserved. Lesson Objectives • Understand RadFrac Algorithms

Transcript of 06 Convergence Algorithm and Diagnostics-libre

Page 1: 06 Convergence Algorithm and Diagnostics-libre

Advanced Distillation with Aspen Plus Algorithm Concepts and Calculation Diagnostics

Aspen Technology, Inc.7 – 1© 2002 AspenTech. All Rights Reserved.

© 2002 AspenTech. All Rights Reserved.

Algorithm Concepts and Calculation Diagnostics

Advanced Distillation with Aspen Plus

© 2002 AspenTech. All Rights Reserved.

Lesson Objectives

• Understand RadFrac Algorithms

Page 2: 06 Convergence Algorithm and Diagnostics-libre

Advanced Distillation with Aspen Plus Algorithm Concepts and Calculation Diagnostics

Aspen Technology, Inc.7 – 2© 2002 AspenTech. All Rights Reserved.

© 2002 AspenTech. All Rights Reserved.

Basic Convergence Strategy

RadFrac convergence has two parts:

1.Initialization – Guessing a solution (or at least something good enough to start with)

2.Convergence – Refining that guess until it isn’t changing from iteration to iteration

© 2002 AspenTech. All Rights Reserved.

Built-in Convergence Schemes

Option InitializationStrategy

ConvergenceMethod

Standard Standard Standard

Petroleum/Wide-boiling

Standard Sum-Rates

Strongly non-ideal liquid

Standard Non-ideal

Azeotropic Azeotropic Newton

Cryogenic Cryogenic Standard

Custom Any Any

Page 3: 06 Convergence Algorithm and Diagnostics-libre

Advanced Distillation with Aspen Plus Algorithm Concepts and Calculation Diagnostics

Aspen Technology, Inc.7 – 3© 2002 AspenTech. All Rights Reserved.

© 2002 AspenTech. All Rights Reserved.

Initialization Basics

RadFrac is trying to find T, P, x, y, V and L on every stage. Initialization is the process of guessing some value for all those variables

– RadFrac uses previous results if available.

– Else it uses estimates, if provided.

– Where neither are available, it uses the initialization strategyselected.

© 2002 AspenTech. All Rights Reserved.

RadFrac Default Initialization Strategy

The RadFrac default initialization strategy:

• Performs flash calculations on composite feed to obtain average vapor and liquid compositions.

• Assumes a constant composition profile.

• Estimates temperature profile based on bubble and dew point temperatures of composite feed.

Page 4: 06 Convergence Algorithm and Diagnostics-libre

Advanced Distillation with Aspen Plus Algorithm Concepts and Calculation Diagnostics

Aspen Technology, Inc.7 – 4© 2002 AspenTech. All Rights Reserved.

© 2002 AspenTech. All Rights Reserved.

Initialization Option

Use this strategy For this situation

…………………………………………………………………..

Crude Wide boiling systems with multidraw

columns

…………………………………………………………………..

Chemical Narrow boiling chemical systems

…………………………………………………………………..

Azeotropic Azeotropic distillation columns

…………………………………………………………………..

Cryogenic Cryogenic applications (for example,

air separations)

…………………………………………………………………..

© 2002 AspenTech. All Rights Reserved.

Estimates

• RadFrac does not usually need estimates for temperature, flow or composition profiles.

• RadFrac may benefit from:

– Liquid and/or vapor flow estimates or vapor/liquid estimates forabsorbers

– Composition estimates for highly non-ideal, extremely wide-boiling (for example, hydrogen-rich), azeotropic distillation or three-phase systems

• Estimates can be generated from column results.

– In 10.1, automatically through the GUI

– In earlier releases, through input language

Page 5: 06 Convergence Algorithm and Diagnostics-libre

Advanced Distillation with Aspen Plus Algorithm Concepts and Calculation Diagnostics

Aspen Technology, Inc.7 – 5© 2002 AspenTech. All Rights Reserved.

© 2002 AspenTech. All Rights Reserved.

Estimates for Wide-Boiling Systems

The following example illustrates the need for composition estimates in a wide-boiling point system:

H2-Rich Feed

to stage 2

Main Feed

The default initialization scheme

will have hydrogen on every tray, though there should be very little H2 below the feed.

© 2002 AspenTech. All Rights Reserved.

Giving Composition Estimates

Page 6: 06 Convergence Algorithm and Diagnostics-libre

Advanced Distillation with Aspen Plus Algorithm Concepts and Calculation Diagnostics

Aspen Technology, Inc.7 – 6© 2002 AspenTech. All Rights Reserved.

© 2002 AspenTech. All Rights Reserved.

Providing Estimates

When providing estimates:

• Provide estimates that are consistent with the initial values of manipulated variables.

• Poor estimates may hinder convergence.

• Remember that estimates are ignored if there are previous results available, even if for an unconvergedrun. Reinitialize!

© 2002 AspenTech. All Rights Reserved.

The Equilibrium Stage

Fn

Vn+1 Ln

L n-1Vn

Qn

Page 7: 06 Convergence Algorithm and Diagnostics-libre

Advanced Distillation with Aspen Plus Algorithm Concepts and Calculation Diagnostics

Aspen Technology, Inc.7 – 7© 2002 AspenTech. All Rights Reserved.

© 2002 AspenTech. All Rights Reserved.

Model Describing Equations (1)

Phase Equilibrium:

Component Mass Balance:

Constitutive:

0,,,

=−ninini

xky

0,1,,,1,

=−−++− +− nininininifvvll

1

1

,

,

=

=

∑∑

ni

ni

x

y

© 2002 AspenTech. All Rights Reserved.

Model Describing Equations (2)

Total Mass Balance:

Enthalpy Balance:

011

=−−++− +− nnnnnFVVLL

0111 =−−−++− +−− n

F

nn

V

nn

V

nn

L

nn

L

n QHFHVHLHLH

Page 8: 06 Convergence Algorithm and Diagnostics-libre

Advanced Distillation with Aspen Plus Algorithm Concepts and Calculation Diagnostics

Aspen Technology, Inc.7 – 8© 2002 AspenTech. All Rights Reserved.

© 2002 AspenTech. All Rights Reserved.

Distillation Convergence Approaches

Historically, two basic strategies were used:

– Equation decoupling approach

– Simultaneous correction approach

© 2002 AspenTech. All Rights Reserved.

Equation Decoupling Approach (1)

• Solves component mass balance equations (CMB) component by component.

• Uses T and L (or V) as iteration variables.

• Methods differ in how CMB equations are solved and how T and L (or V) are corrected.

• The choice of method depends on characteristics of the boiling range of the mixture.

• Sum-rates algorithm for wide-boiling systems (absorbers and strippers).

• Wang-Henke algorithm for narrow-boiling systems (distillation).

Page 9: 06 Convergence Algorithm and Diagnostics-libre

Advanced Distillation with Aspen Plus Algorithm Concepts and Calculation Diagnostics

Aspen Technology, Inc.7 – 9© 2002 AspenTech. All Rights Reserved.

© 2002 AspenTech. All Rights Reserved.

Equation Decoupling Approach (2)

• Advantages of equation decoupling algorithms include:

– Speed

– Ease of implementation

• Disadvantages of these algorithms include:

– A boiling range problem

– A composition lag (difficulties with highly non-ideal problems)

– They cannot handle generalized design specifications easily

– They do not handle property calculations efficiently

© 2002 AspenTech. All Rights Reserved.

Simultaneous Correction Approach (1)

• Solves all describing equations simultaneously for T, l, and V using the Newton-Raphson technique.

• Uses specialized methods to decompose the large sparse matrix.

• Includes methods to stabilize convergence.

Examples:

– Napthali-Sanholm algorithm for problems with many stages and few components (for example, chemical applications)

– Goldstein-Stanfield algorithm for problems with many components and few stages (for example, petroleum refining applications)

Page 10: 06 Convergence Algorithm and Diagnostics-libre

Advanced Distillation with Aspen Plus Algorithm Concepts and Calculation Diagnostics

Aspen Technology, Inc.7 – 10© 2002 AspenTech. All Rights Reserved.

© 2002 AspenTech. All Rights Reserved.

Simultaneous Correction Approach (2)

• Advantages of simultaneous correction algorithms include:

– Can handle extremely non-ideal problems

– Excellent convergence behavior in vicinity of the solution

– Can handle generalized design specifications effectively

© 2002 AspenTech. All Rights Reserved.

Simultaneous Correction Approach (3)

• Disadvantages of simultaneous correction algorithms include:

– Large memory requirement

– Slow for large problems

– More sensitive to initial estimates, therefore they require a good initialization procedure

– Require derivatives of properties with respect to composition

– Inconvenient to apply in a general-purpose simulation environment

– Does not handle property calculations efficiently

Page 11: 06 Convergence Algorithm and Diagnostics-libre

Advanced Distillation with Aspen Plus Algorithm Concepts and Calculation Diagnostics

Aspen Technology, Inc.7 – 11© 2002 AspenTech. All Rights Reserved.

© 2002 AspenTech. All Rights Reserved.

Inside-Out Algorithms

The inside-out algorithms were introduced to overcome theselimitations.

• Advantages of inside-out algorithms include:

– Speed

– Efficient handling of physical properties, so that very few rigorous property calculations are required

– Convenient to implement in a general-purpose simulation environment

– Do not require precise initialization

– Can handle wide/narrow boiling, non-ideal, three-phase, reactive and multicolumn problems

– Can handle generalized design specifications

© 2002 AspenTech. All Rights Reserved.

Inside-Out Convergence Scheme

Outside Loop

A, B, C, D, E, F, α

Inside Loop

S = KB V/L

Equations:

Phase Equilibrium

Component Mass Balance

Total Mass Balance

Enthalpy Balance

Constitutive

S T, X, Y

A, B, C, D, E, F, α

Page 12: 06 Convergence Algorithm and Diagnostics-libre

Advanced Distillation with Aspen Plus Algorithm Concepts and Calculation Diagnostics

Aspen Technology, Inc.7 – 12© 2002 AspenTech. All Rights Reserved.

© 2002 AspenTech. All Rights Reserved.

Simple Physical Property Models

( )

)(

)(

/1/1

REF

L

LlGL

REF

V

VlGV

REFB

iBl

TTFEH

HHH

TTDCH

HHH

TTBAKLN

KK

−+=∆

∆+=

−+=∆∆+=

−+== α

© 2002 AspenTech. All Rights Reserved.

Inside Loop Solution Procedure (1)

(CMBAL)

Component Mass Balance

phase equilibrium

constitutive

(EMBAL)Total Mass Balance

Enthalpy Balance

S

KB, T, l, v, x, y

L, V S

Absorber=No

Page 13: 06 Convergence Algorithm and Diagnostics-libre

Advanced Distillation with Aspen Plus Algorithm Concepts and Calculation Diagnostics

Aspen Technology, Inc.7 – 13© 2002 AspenTech. All Rights Reserved.

© 2002 AspenTech. All Rights Reserved.

Inside Loop Solution Procedure (2)

This inside loop procedure (ABSORBER equals YES) is good for wide boiling mixtures.

(CMBAL)

Component Mass Balance

phase equilibrium

constitutive

(EMBAL)Enthalpy Balance

S

l, v, x, y

L = Σ l; V = Σ v

T KB S

Absorber=Yes

© 2002 AspenTech. All Rights Reserved.

Sum-Rates Algorithm

(CMBAL)

Component Mass Balance

phase equilibrium

constitutive

Error Function Calculations:

Enthalpy Balance Error

Column Specification Error

Design Specification Error

Inside-loop

Page 14: 06 Convergence Algorithm and Diagnostics-libre

Advanced Distillation with Aspen Plus Algorithm Concepts and Calculation Diagnostics

Aspen Technology, Inc.7 – 14© 2002 AspenTech. All Rights Reserved.

© 2002 AspenTech. All Rights Reserved.

Non-Ideal Algorithm (1)

For non-ideal systems, composition effects need to be included in the simple K value model:

G becomes another iteration variable in the outside loop.

Solving component mass balance/phase equilibrium equations is difficult. RadFrac solves them using ahomotopy-continuation method.

2)1()ln( ii

iiBi

XG

KK

−=

=

γ

γα

© 2002 AspenTech. All Rights Reserved.

Non-Ideal Algorithm (2)Original problem:

f(x) = 0

Modified problem:

H=g(x,η) - ηf(x) = 0

Where:

x* = initial guess of x and

g(x,1) = f(x*)

g(X,0) = f(x)

η = 1 x = x*

η = 0 x = desired solution

Page 15: 06 Convergence Algorithm and Diagnostics-libre

Advanced Distillation with Aspen Plus Algorithm Concepts and Calculation Diagnostics

Aspen Technology, Inc.7 – 15© 2002 AspenTech. All Rights Reserved.

© 2002 AspenTech. All Rights Reserved.

Non-Ideal Algorithm (3)

For example:

g(x, η) = (1 - η) f(x) + η f(x*)

H(x, η) = (1 - η) f(x) + η f(x*) - η f(x)

at η = 1

H (x,1) = f(x*) -f(x)

at η = 0

H (x,0) = f(x)

© 2002 AspenTech. All Rights Reserved.

Outside Loop Convergence

In outside loop convergence, the number of variables is large:

(3 + NC) * NS

Where:

NC = Number of components

NS = Number of stages

The algorithm:

– Uses a combination of Broyden and Bounded Wegstein (damped direct substitution) methods for outside loop convergence

– Uses the Broyden method for selected variables based on convergence history.

Page 16: 06 Convergence Algorithm and Diagnostics-libre

Advanced Distillation with Aspen Plus Algorithm Concepts and Calculation Diagnostics

Aspen Technology, Inc.7 – 16© 2002 AspenTech. All Rights Reserved.

© 2002 AspenTech. All Rights Reserved.

Newton Algorithm

The Newton method:

• Is a classic implementation of the Newton algorithm.

• Solves all column describing equations simultaneously.

• Uses the dogleg strategy of Powell to stabilize convergence.

• Provides an option for solving design specifications simultaneously or in an outer loop.

• Handles non-ideality effectively.

• Shows excellent convergence behavior in the vicinity of the solution.

© 2002 AspenTech. All Rights Reserved.

Three-Phase Calculations

The three-phase option includes the following features:

• Addition of the liquid-liquid phase equilibrium equations. These are

now solved with component mass balance and vapor-liquid equilibrium equations.

• A strategy to include/exclude liquid-liquid equilibrium equations.

• Options for liquid-liquid stability calculations:

– LL-METH = GIBBS, based on minimization of Gibbs energies

– LL-METH - EQ-SOLVE, based on equating fugacities

– LL-METH = Hybrid (best of the above)

– FREE-WATER = YES, based on assuming the water phase is pure water, and using water solubility

Page 17: 06 Convergence Algorithm and Diagnostics-libre

Advanced Distillation with Aspen Plus Algorithm Concepts and Calculation Diagnostics

Aspen Technology, Inc.7 – 17© 2002 AspenTech. All Rights Reserved.

© 2002 AspenTech. All Rights Reserved.

Three-Phase Algorithms

RadFrac provides these algorithms for three-phase applications:

• Standard algorithm

– Inside-out approach

– Equation decoupling for inside loop

• Non-ideal

– Inside-out approach

– Composition dependent local K-value model

– Simultaneous inside loop solution

• Newton algorithm

– Simultaneous solution using Newton’s method

© 2002 AspenTech. All Rights Reserved.

Reactive Distillation

The reactive distillation algorithm:

• Includes additional generation terms in component and total mass balance equations.

• May give rise to additional describing equations and variables (extent of reactions) for chemical reactions.

• Makes enthalpy balance equations highly dependent on composition and reaction extent.

• Solves all describing equations simultaneously in the inside loop using Newton’s method. (It uses the dogleg strategy to stabilize the convergence.)

• Increases storage requirements.

Page 18: 06 Convergence Algorithm and Diagnostics-libre

Advanced Distillation with Aspen Plus Algorithm Concepts and Calculation Diagnostics

Aspen Technology, Inc.7 – 18© 2002 AspenTech. All Rights Reserved.

© 2002 AspenTech. All Rights Reserved.

Design Specification Convergence

• RadFrac provides two approaches for design specification convergence:

– Nested or middle loop approach

– Simultaneous solution with all column-describing equations

• The Sum-Rates and Newton algorithm use the simultaneous solution (in the inside loop).

• All other algorithms use the nested (middle loop) approach.

• You can use the nested approach with the Newton algorithm by entering Nested in the Dsmeth field.

© 2002 AspenTech. All Rights Reserved.

RadFrac With Design Specification

Outside LoopConverges physical property parameters usinga combination of Wegstein and Broyden

Middle LoopMinimizes design specification objective function using Quadratic Program

Inside LoopSolves describing equations for T, X, Y, L, Vusing either Broyden, Wegstein, or Newton

Page 19: 06 Convergence Algorithm and Diagnostics-libre

Advanced Distillation with Aspen Plus Algorithm Concepts and Calculation Diagnostics

Aspen Technology, Inc.7 – 19© 2002 AspenTech. All Rights Reserved.

© 2002 AspenTech. All Rights Reserved.

Middle Loop Convergence

This approach:

• Generates an objective function:

Use this Equation For

…………………………………………………………………………………………………………………………………………………………………..

All specs except basis-FRAC and basis-RECOV

…………………………………………………………………………………………………………………………………………………………………..

Basis-FRAC and basis-RECOV

…………………………………………………………………………………………………………………………………………………………………..

• Uses the quadratic programming algorithm to minimize the

objective function

2

−≡

i

speccalc

iS

GGw iiφ

2

ln∑

spec

calc

iG

Gwφ

© 2002 AspenTech. All Rights Reserved.

Diagnostics

The control panel displays the most fundamental diagnostic message, Err/Tol, every time a RadFrac block is executed.

– The Err is a normalized RMS error for all the variables the column is iterating on.

– Tol is the convergence tolerance set for the block.

– Radfrac is considered converged when Err/Tol < 1.

The following slides show convergence histories with the default diagnostic level of 4.

Page 20: 06 Convergence Algorithm and Diagnostics-libre

Advanced Distillation with Aspen Plus Algorithm Concepts and Calculation Diagnostics

Aspen Technology, Inc.7 – 20© 2002 AspenTech. All Rights Reserved.

© 2002 AspenTech. All Rights Reserved.

Diagnostic Messages (1)

For Standard or Non-Ideal Algorithm, these are convergence messages displayed on Control Panel:

© 2002 AspenTech. All Rights Reserved.

Diagnostic Messages (2)

These are the messages for Sum-Rates and Newton

Sum-Rates: Newton:

Page 21: 06 Convergence Algorithm and Diagnostics-libre

Advanced Distillation with Aspen Plus Algorithm Concepts and Calculation Diagnostics

Aspen Technology, Inc.7 – 21© 2002 AspenTech. All Rights Reserved.

© 2002 AspenTech. All Rights Reserved.

Adjusting RadFrac Diagnostic Levels

• Use the On Screen and Simulation profiles fields of theRadFrac Block Options Diagnostics sheet to control the amount of diagnostic messages generated.

© 2002 AspenTech. All Rights Reserved.

Iteration History (1)

After turning up diagnostic level Standard or Non-Ideal Algorithm:

Page 22: 06 Convergence Algorithm and Diagnostics-libre

Advanced Distillation with Aspen Plus Algorithm Concepts and Calculation Diagnostics

Aspen Technology, Inc.7 – 22© 2002 AspenTech. All Rights Reserved.

© 2002 AspenTech. All Rights Reserved.

Iteration History (2)

After turning up diagnostic levelfor Newton:

© 2002 AspenTech. All Rights Reserved.

Description of Variables in History File (1)

Variable Description…………………………………………………………………………………………………………………………………………………………………..

ERRML Middle loop design specification error…………………………………………………………………………………………………………………………………………………………………..

F Feed flow rate…………………………………………………………………………………………………………………………………………………………………..

HL Stage liquid enthalpy…………………………………………………………………………………………………………………………………………………………………..

HL1 Stage liquid1 enthalpy…………………………………………………………………………………………………………………………………………………………………..

HL2 Stage liquid2 enthalpy…………………………………………………………………………………………………………………………………………………………………..

HV Stage vapor enthalpy…………………………………………………………………………………………………………………………………………………………………..

ITER Newton iteration counter…………………………………………………………………………………………………………………………………………………………………..

L Stage liquid flow rate…………………………………………………………………………………………………………………………………………………………………..

Page 23: 06 Convergence Algorithm and Diagnostics-libre

Advanced Distillation with Aspen Plus Algorithm Concepts and Calculation Diagnostics

Aspen Technology, Inc.7 – 23© 2002 AspenTech. All Rights Reserved.

© 2002 AspenTech. All Rights Reserved.

Description of Variables (2)

Variable Description…………………………………………………………………………………………………………………………………………………………………..

L1 Stage liquid1 flow rate…………………………………………………………………………………………………………………………………………………………………..

L2 Stage liquid2 flow rate…………………………………………………………………………………………………………………………………………………………………..

NIL Inside loop iteration counter…………………………………………………………………………………………………………………………………………………………………..

NILC Cumulative number of inside loops in a given

outside loop…………………………………………………………………………………………………………………………………………………………………..

NML Middle loop iteration counter…………………………………………………………………………………………………………………………………………………………………..

NOL Outside loop iteration counter…………………………………………………………………………………………………………………………………………………………………..

P Stage pressure…………………………………………………………………………………………………………………………………………………………………..

© 2002 AspenTech. All Rights Reserved.

Description of Variables (3)

Variable Description…………………………………………………………………………………………………………………………………………………………………..

Q Stage heat duty…………………………………………………………………………………………………………………………………………………………………..

RMSCOL Column describing equation root mean square error for Newton algorithm

…………………………………………………………………………………………………………………………………………………………………..

RMSIL Inside loop root mean square error…………………………………………………………………………………………………………………………………………………………………..

RMSOL Outside loop root mean square error…………………………………………………………………………………………………………………………………………………………………..

T Stage temperature…………………………………………………………………………………………………………………………………………………………………..

UF Feed enthalpy…………………………………………………………………………………………………………………………………………………………………..

V Stage vapor flow rate…………………………………………………………………………………………………………………………………………………………………..

Page 24: 06 Convergence Algorithm and Diagnostics-libre

Advanced Distillation with Aspen Plus Algorithm Concepts and Calculation Diagnostics

Aspen Technology, Inc.7 – 24© 2002 AspenTech. All Rights Reserved.

© 2002 AspenTech. All Rights Reserved.

Description of Variables (4)

Variable Description…………………………………………………………………………………………………………………………………………………………..

WL Stage liquid sidedraw flow rate…………………………………………………………………………………………………………………………………………………………..

WV Stage vapor sidedraw flow rate…………………………………………………………………………………………………………………………………………………………..

X Stage liquid composition…………………………………………………………………………………………………………………………………………………………..

Y Stage vapor composition…………………………………………………………………………………………………………………………………………………………..

© 2002 AspenTech. All Rights Reserved.

Introduction to Convergence Workshops

• The workshops from now on all start with backup files.

• The files either do not run or they do not converge to the right answer.

• Your mission: converge these files.

• Almost every workshop has more than one solution.

• Only one workshop requires you change the physical problem.

• Treat these as puzzles to solve.

Page 25: 06 Convergence Algorithm and Diagnostics-libre

Advanced Distillation with Aspen Plus Algorithm Concepts and Calculation Diagnostics

Aspen Technology, Inc.7 – 25© 2002 AspenTech. All Rights Reserved.

© 2002 AspenTech. All Rights Reserved.

Workshop 6A: Water/Hydrocarbon System

COLUMN

FEED

TOP

BOT

Temperature = 60 C

Pressure = 1.0 bar

NC4 10 kmol/hr

NC6 10 kmol/hr

H2O 2 kmol/hr

START WITH: WS6A-H2OHC.BKP

Distillate rate = 12 kmol/hr

Boilup rate = 50 kmol/hr

Pressure = 1.0 bar

8

1

5

© 2002 AspenTech. All Rights Reserved.

Workshop 6B: Hydrocarbon System

Temperature = 400 C

Pressure = 2 kg/sqcm

Phase=vapor

C3 100 kmol/hr

C4 100 kmol/hr

C10 200 kmol/hr

Distillate rate = 200 kmol/hr

Reflux rate = 436 kmol/hr

START WITH: WS6B-HYDROC.BKP

COLUMN

FEED

DIST

BOTTOMS10

9

1.03 kg/sqcm

1.2 kg/sqcm

1.5 kg/sqcm