Date post: | 20-Feb-2018 |
Category: |
Documents |
Upload: | murat-syzdykov |
View: | 212 times |
Download: | 0 times |
of 10
7/24/2019 00008285
1/10
A
Robust Iterative Method
for
Flash Calculations
Using
the
Soave Redlich Kwong or
the
Peng Robinson
quation o
State
L.X. Nghiem,
SPE, Computer Modelling Group
K Aziz,*
SPE, Computer Modelling Group
Y.K. Li,
SPE, Computer Modelling Group
Abstract
A robust algorithm for flash calculations that uses an
equation of state (EOS) is presented. t first uses a
special version
of
the successive substitution (SS)
method and switches
to
Powell s method if poor con
vergence is observed. Criteria are established for an effi
cient switch from one method to the other. Experience
shows that this method converges near the critical point
and also detects the single-phase region without com
puting the saturation pressure. The Soave-Redlich
Kwong
1
(SRK) and the Peng-Robinson
2
(PR) EOS s are
used in this work, but the method is general and applies
to any EOS.
Introduction
The calculation
of
vaporlliquid equilibrium using an
EOS
in
multi component systems yields a system
of
nonlinear equations that must be solved iteratively. The
SS method is commonly used, but it exhibits poor rate of
convergence near the critical point. To overcome con
vergence problems, Newton s method has been used by
Fussell and Yanosik
3
to solve the equations. The
drawback of Newton s method is the necessity
of
com
puting a complicated Jacobian matrix and its inverse at
every iteration. Hence, for systems removed from their
critical point it involves more work to arrive at the solu
tion than the
SS
method. Furthermore, the radius
of
con
vergence of Newton s method is relatively small when
compared to that of the SS method; hence, a good initial
Now with Stanford
u
01977520/83/00068285 00.25
Copyright 1983 Society of Petroleum Engineers of AIME
JUNE 1983
guess is required before convergence can be achieved.
The single-phase region usually
is
determined
by
com
puting the saturation pressure and comparing
it
with the
pressure
of
the system. This requires additional work,
and it is sometimes difficult to decide whether a dew
point or bubblepoint pressure, which involve different
equations, should be computed.
This paper presents a robust iterative method for flash
calculations using either the SRK or the PR EOS, both
of
which have received much interest in recent years. The
proposed method combines SS with Powell s iteration,
which
is
a hybrid algorithm consisting
of
a quasi-Newton
method and a steepest-descent method.
4
The SS method
is
used initially and
is
replaced
by
Powell s method if
it
demonstrates poor convergence, thus taking advantage
of the simplicity of the former method and the robustness
of
the latter. The
SS
method has been modified so that
the single-phase region can be detected without having to
compute the saturation pressure.
The nonlinear equations to be solved by
an
iteration
scheme could behave differently, depending on their
form and the variables for which they are solved. In this
paper three different approaches are considered with
Powell s method. One
of
the three approaches
is
based
on the minimization of the Gibbs free energy.
The convergence properties
of
the proposed schemes
are demonstrated by three example problems.
Equations in Flash Calculations
At a given pressure and temperature, flash calculations
yield the number
of
moles
of
component
in
the liquid
phase, NiL and
in
the vapor phase,
N
w
given that
N
i
=1 nc represents the number of moles of each com-
521
7/24/2019 00008285
2/10
ponent
in
the feed. The thermodynamic criterion
of
vaporlliquid equilibrium is that the Gibbs free energy,
G be minimized, which gives the following necessary
conditions.
aG
aG
--=--=0 i=1...ne ................
1)
aN
iL
aN
iV
Since NiL
+
NiV = N
i
, it easily can be shown
5
that
aG aG
--=---=G
iL
iV
,
i=l.
..
ne
aN
iL
aN
iV
............................. 2)
where iL is the partial molar Gibbs free energy of com
ponent i in the liquid phase. When an EOS is used to
compute_the pa.Itial molar Gibbs free energy, the dif
ference GiL - G V is related to the fugacities fiL and fiV
as follows.
- - fiL.
GiL -GiV=RT In , 1=
1.. .ne ..........
(3)
fiV
The expressions for the fugacities using the SRK and
PR EOS s are given in Appendix A.
The equilibrium conditions of Eq. I yield
InfiL
=0
i=1...nc
.......................
4)
fiV
or
Fi - I =0 i= 1...ne> ....................... (5)
where Fi is the fugacity ratio,fiLlfiV Eq. 5 represents a
system of ne nonlinear equations that must be solved
iteratively for NiL or N
iV
.
Instead of solving directly for NiL or N
iV
,
it
is often
more convenient to solve for mole fractions, which are
combinations
of
N
i
, NiL, and N
iV
.
The definitions of mole fractions are given in Appen
dix B. We also define moles of component
i
in liquid
phase per mole
of
feed as
niL =/LXi
=NiLIN,
........................
6)
and moles of component
i in
vapor phase per mole of
feed as
niV=fvYi
= N/ N
. .........................
7)
Eq. 5 can be solved for one of the following sets of
variables.
/L,x i i= 1...n c - I (LX iteration).
/v,Yi,
i=
1...ne
- I
(VY iteration).
niL, i=1...nc
(NLiteration).
niV,
i=
1...ne
(NV iteration).
It easily can be shown that the variables in each of
these sets are independent and completely define the
system. Later in this paper, we will show how Powell s
method is used to solve Eq. 5 for these sets of variables.
LX or NL iterations will be used for predominantly liq
uid systems.
522
The equilibrium-phase compositions also can be ob
tained by minimizing the Gibbs free energy. It is shown
below how Powell s method readily can be used to ob
tain the solution from this approach.
Since niL =NiLIN and niV=NiVIN, we obtain from
Eqs. 2 and 3:
I aG I aG fiL
- In ......... 8)
NRT an iL NRT an iV fiV
We see from Eq. 8 that In(jiLlfiV) is equal to the gra
dient
of
GINRT with respect to niL and the gradient of
-GINRT with respect to niV. Hence, by applying
Powell s method to solve Eq. 4 instead of Eq. 5, we are
minimizing
GINRT
by using the quasi-Newton method.
However, in doing so, we do not take advantage of the
fact that
In(IiLlfiV), i= 1...n
e
,
form the gradient of
GINRT(-GINRT) with respect to niL(niV), i=1...ne
since we merely were trying to reduce the values of
In(fiLlfiV) to O. Hence, the refinements that could
be
ob
tained from this additional information
6
were not in
troduced. We define the iterations on
niL
and
niV,
i = 1...n e as NLM iteration and NVM iteration, respec
tively. NLM iteration will be used for predominantly
vapor systems and NVM iteration for predominantly liq
uid systems.
In practice, the equilibrium ratios K = Y/x
i= 1...ne> are introduced. The following equations can
be derived.
xi=Z/[I+fv(Ki- l )] , i=1...ne . . . . . . . . . 9)
Yi=Kiz/[I+fv(Ki-l)], i=1...ne
. . . . . .
10)
ne
zi(K
i
-I
g(fv)=
=0. . . . . . . . . . . . . . (11)
i=i
I +fv(K
i
- I
Eq. 5 also can be solved iteratively for K
i
, i=1...ne
Once a set
of
values has been determined,
fv
is
ob
tained by solving Eq. II and x i and Y are obtained
from Eqs. 9 and
10.
The SS method usually
is
used in
this case and is described
in
the next section.
ethod o Successive Substitution
It can be shown that values are related to the fugacity
coefficients iL and iV as follows.
= iL = fiLI(XiP) F . ~
iV fiV1(YiP)
Xi
. . . . . . . . . .
12)
In this solution, estimated
K
values are used to flash
the mixture at the specified pressure and temperature.
The liquid and vapor fugacities then are determined from
the phase compositions, and new estimates for values
are obtained from Eq. 12. The procedure is assumed
converged when
(Fi
_1 2
7/24/2019 00008285
3/10
Solution of
g(fv
= 0
Every time
K
values are determined, Eq.
11
has to be
solved for
Iv(O:5lv:5
1).
g O
is a monotonically
decreasing function of
d g l d ~
L and liquid
otherwise.
Criteria for Switching From
SS
to Powell s Method
The important step of the proposed algorithm is the
switch from
SS
to Powell s method. This should lead to
a decrease in execution time; otherwise the switch is not
necessary. The criteria for an efficient switch from one
method to another were determined using a ternary
system and were then tested on 10- and IS-component
mixtures.
The ternary system used was C0
2
/nC
5
/nC
I6
Fig. 2
shows the calculated phase envelope at 1,500 psia (10.3
523
7/24/2019 00008285
4/10
85
a Calculafed
15
mol nC
1
6
Fig 2 Phase envelope of C0
2
/nC
s
/nC
16
system at 1,500 psia
and 122F. Flash calculations
in
Table 1 are for points
on
Line
A.
MPa) and 122F (SOC). To determine the convergence
behavior
of
the
SS
method for mixtures with different
compositions, a series of flash calculations was per
formed for mixtures containing 88 CO
2
and various
mole percents of nC 5 and nC
16.
These mixtures lie
along Line A in Fig. 2 and for notational convenience
will be referred
to
using only their mole percent of
nC
5.
This line contains mixtures in the fully developed two
phase region (e.g.,
0
nC 5),
mixtures near the critical
point (e.g., 8 nC
5
),
and mixtures in single-phase
region (e.g., 12
nC
s
).
Plots
of
log
~ F i
-1)2 vs. the number of SS iterations
(SSI) for diffelrent mixtures are shown in Fig.
3.
The
following can be observed.
1. The convergence of the SS method deteriorates as
the critical point
is
approached.
2. After a few iterations the slope
of
each curve re
mains almost constant for a l a r ~ e number of iterations.
This implies that the ratio
~ [ F l
)
I F / ~ [ F l k - 1 ) I F
1 1
is also almost constant during that period and can be
used as an indication of the rate
of
convergence
of
the SS
method for a particular mixture.
3. For the
8
nC
s
mixture, ~ F i _1)2 increases after
44 iterations and then d e c r e s e ~ again after S6 iterations
(not shown). This type of behavior of the
SS
method oc
curs frequently in the critical region.
4. For the 11
nC
5 mixture, the single-phase region
is
detected after 2S iterations.
Fig. 4 shows the change of ~ F i _1)2 and
v
with
the number of SSI for a mixturb in the fully developed
524
2
\ 11 nC5
\
0
1
-2
N
..-
I
-3
u..
1- 1 -
5
4
01
.2
-5
-6
-7
-8
_ 9 L L_ _
L L
_ _
L L
_ _L L__L L__
o
5
10
15
20
25 30
35 40 45 50
No. of SST
Fig.
3 Convergence
rate of 55 for different mixtures of
C0
2
/nC
s
/nC
16
at 1,500 psia and 122F.
two-phase region (2 nC
5),
a mixture near the critical
point (8
nC s),
and a single-phase mixture (11
nC 5)
For a two-phase mixture, ~ F i _1)2 decreases, n l
v
1
reaches its ultimate value rapidly. For a mixture near the
critical point, the change
of
~ F i _1)2 and
v is
slow.
1
For a single-phase mixture, the change of v is very
rapid and a value for
v
outside [0,1]
is
obtained after a
few iterations. In this case, we set
v
to either zero or
unity and proceed with the SS method as discussed
earlier.
Based on extensive testing
of
the flash program, the
following criteria are proposed to switch from the SS
method
to
Powell's method.
~ [ F l k ) - I F / ~ [ F l k - 1 ) - I F > E R (lSa)
1 1
Ilv k)
-lv k-1)
i =
fugacity coefficient of component i in liquid
phase
Wi
=
acentric factor
of
component i
JUNE 1983
T BLE 5 FLASH C LCUL TIONS FOR THE RESERVOIR OIL
Pressure
SS Plus Powell
Newton
(psia)
_ _v_
SSI Plus
FE
SSI Plus FE Iterations
4,950 0.0116 22 +
111
2+55
2
4,925 0.1144
21
+ 56
2+53
4
4,900 0.1770 21 + 49
2+30
4
4,875 0.2206
20+
33
2+28 3
4,850 0.2536
20+
30
2+27
3
4,800 0.3016 19+ 28
2+27
4
4,750 0.3358
18+
26
2+25
4
4,700 0.3623
18+
26
2+26
3
4,650 0.3838
17+
25
2+25
3
4,600 0.4019
16+
25
2+24
3
4,550 0.4175
16+
25
2+24 3
4,500 0.4313
15+
25
2+24 3
-2
,{O 4875 psio
1.2
8{ 4875 psio
fIR
-1 t:J
4750
psio
...
4750
PSiO
1.0
-4
C\I
0.8
.,....
6
LL
.-
0.6 t)
c>
-8
0
0.4
-10
0.2
~ 2 ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
16 20 24 28 32 36
No
of
FE
Fig. 5-Convergence characteristics of Powell s method.
Subscripts
c = critical
i,j,k = component number
= subscript
of
largest equilibrium ratio
L =
liquid
r
=
reduced
s = subscript of smallest equilibrium ratio
V
= vapor
Superscripts
k) = iteration level
k
T
=
transpose
- =
results from SS method
cknowledgments
This research is supported
by
the general members of
Computer Modelling Group and the Alberta/Canada
527
7/24/2019 00008285
8/10
Energy Resources Research Fund administered by the
Dept.
of
Energy and Natural Resources of the Province
of Alberta. We thank R.A. Heidemann and P.K.W. Vin
some for their helpful comments on this work. The ver
sions of the SRK and PR equations used are from the
Hyprotech fluid properties program,
HYPROP.
References
1. Soave, G.: Equil ibrium Constants from a Modified Redlich
Kwong Equation of State, Chern Eng Sci. (1972) 27,
1197-1203.
2. Peng, D.Y. and Robinson, D.B.: A New Two-Constant Equa
tion of State, Ind Eng. Chern Fund (1976) 59-64.
3. Fussell, D.D. and Yanosik, J.L.: An Iterative Sequence for
Phase-Equilibria Calculations Incorporating the Redlich-Kwong
Equation of State, Soc Pet. Eng. J (June 1978) 173-82.
4. Powell, M.J.D.: A Hybrid Method for Nonlinear Equations,
Numerical Methods for Nonlinear Algebraic Equations, P.
Rabinowitz (ed.), Gordon and Breach, London (1970).
5. Sandler, S.I.: Chemical and Engineering Thermodynamics, John
Wiley
Sons Inc., New York City (1977) 300-04.
6. Broyden, C.G.: Quasi-Newton Methods and their Application to
Function Minimization,
Math
Compo (1967) 368-81.
7. Wilson, G.: A Modified Redlich-Kwong Equation
of
State, Ap
plication to General Physical Data Calculations, paper 15C
presented at the 1968 AIChE National Meeting, Cleveland, OH,
May
4-7.
8. Jarrat, P.:
A
Review of Methods for Solving Non-linear
Algebraic Equations in One Variable, Numerical Methods for
Nonlinear Algebraic Equations, P. Rabinowitz (ed.), Gordon and
Breach, London (1970).
9. Nghiem, L.X. and Heidemann, R.A.: General Acceleration Pro
cedure for Multiphase Flash Calculation with Application to Oil
Gas-Water System s, paper presented at the 1982 European Sym
posium on Enhanced Oil Recovery, Paris, Nov. 8-10.
10. Michelsen, M.L.:
The
Isothermal Flash Problem, Parts I and
II,
Fluid Phase Equilibria (1982) 1-40.
11. Baker, L.E., Pierce, A.C., and Luks, K.D.: Gibbs Energy
Analysis
of
Phase Equilibria,
Soc Pet. Eng
J (Oct. 1982)
731-42.
12. Broyden, C.G.: A Class
of
Methods for Solving Nonlinear
Simultaneous Equations,
Math Camp.
(1965) 577-93.
13. Peng, D.Y. and Robinson, D.B.: A Rigorous Method for Pre
dicting the Critical Properties of Multicomponent Systems from an
Equation
of State,
AIChE
J
(1977) 23, 137-44.
14. Bergman, D.F.: Predicting the Phase Behavior of Natural Gas in
Pipelines, PhD dissertation, U.
of
Michigan, Ann Arbor (1976).
15. Katz, D.L. and Firoozabadi, A.: Predicting Phase Behavior
of
Condensate/Crude-Oil Systems Using Methane Interaction Coeffi
cients,
J
Pet.
Tech
(Nov. 1978) 1649-55.
16. Young, L.C. and Stephenson, R.E.: A Generalized Composi
tional Approach for Reservoir Simulation, paper SPE 10516
presented at the 1982 SPE Symposium on Reservoir Simulation,
New Orleans, Feb. 1-3.
PPENDIX A
The SRK and PR EOS s
The details of the development of the SRK and PR
EOS's are given in Refs. 1 and 2. The final results are
the following.
SRK
528
RT a T)
P
v-b v v+b)
RTc
b=0.08664-
Pc
and
PR
and
R2T2
a Tc)
=0.42747-_
c
-
Pc
m
=0.480
+1.574w
-0.176w
2
.
RT a T)
p
v-b
v(v+b)+b(v-b)
RTc
b=0.07780-
Pc
R2Tl
a(T
c
=0 . 45724 - -
Pc
m=0.37464+ 1.54226w-0.26992w
2
.
f the compressibility factor, Z =pvIR1), is intro
duced, the following cubic equations are obtained. For
SRK,
Z3 -Z2
+ A -B -B
2
)z-AB=0.
. (A-1a)
For PR,
Z3 _(1-B)Z2
+ A
-3B
2
-2B)z-(AB-B
2
-B3)=0
,
. (A-1b)
where A=apIR
2
T
2
and B=bpIRT.
Eqs. A 1a and A 1b yield one
or
three real roots
depending on the number
of
phases in the system. In the
two-phase region, the largest root
is
the compressibility
factor of the vapor, while the smallest positive root cor
responds to that of the liquid.
For mixtures, the following mixing rules are
recommended.
2
b=
2. >ibi, (A-2)
a= ~ i j a i j
, A-3)
i
and
where 0 j are binary interaction coefficients obtained by
fitting the predicted binary bubblepoint pressures to ex
perimental data.
SOCIETY
OF
PETROLEUM ENGINEERS JOURNAL
7/24/2019 00008285
9/10
The fugacity coefficient of component
k
in a mixture
can be calculated from the following equations.
. . . . . . . . . . . . . . . . . . . . . . (A-5a)
For PR,
b
k
In k=- z - I ) - ln z -B)
b
__
[
2: . Xiaik
~ B a - :kJ
. In Z+2.414B) , (A-5b)
z-0.414B
APPENDIX B
Mole Fractions Definitions
Let
The mole fractions are defined as follows.
Global mole fraction of component i,
i
=N;lN. .
(B-1)
Liquid mole fraction of component
i,
xi=NiLIN
L
.
(B-2)
Vapor mole fraction of component i,
Yi =NiVIN
v
. B-3)
Liquid mole fraction
of
the system,
fL
=N
LIN.
. B-4)
Vapor mole fraction
of
the system,
fv=NvIN. . (B-5)
From these definitions we obtain
i
=fLXi +fVYi, B-6)
fL = f v =
1 , B-7)
JUNE 1983
and
2 :
Z
i=
2:Xi=
2:Yi=1 .
i i
B-8)
APPENDIX C
Powell s Hybrid Method
Consider the problems of finding the root x* of a system
of
n
nonlinear equations in
n
unknowns .
f x)=O
C-l)
given a starting iterate x 0) .
Various methods have been studied and shown to be
quadratically or superlinearly convergent if x 0) is close
enough to x*. For many problems, however, a good in
itial estimate
is
not available and therefore a more robust
algorithm is needed.
Two well-known methods for solving Eq. C-l are
Newton s method and the steepest-descent method .
Newton s method is based on a linear approximation
of f around the kth iterate x k) .
f[X k) +a k)] =f[x k)] +J k)a k) ,
(C-2)
where
(
af ) k)
J k)=
-
ax
is the Jacobian matrix
of
f at
x k).
The Newton s step, a k) =x k +
I)
-x k), is obtained
by setting the left side of Eq. C-2 to 0 and solving for
a k) .
a k)
= - J -I k)f k) ,
(C-3)
where f k) denotes f x
k)]
for convenience. Newton s
method is quadratically convergent if x k) is close to x*.
I f
x k)
is
not close to x*, there
is no
guarantee that
x k+ I)
will be any better than
x
k) and Newton s method
need not converge. A method that guarantees that
is the steepest-descent method where
11 11
denotes the
Euclidian norm.
Consider the functional equation
F x) = z
T
x ) f x). . (C-4)
The steepest-descent direction g is
g= -
\ l F x)
=
-JTf x) .
.
(C-5)
Given the kth iterate x k) , the steepest -descent step
p
k)
=
x k+I)
- x k) is defined by
p k)
=J1. k)g k)
,
C-6)
with J1 k) chosen so that the functional C-4 with f x)
replaced by f k) + J k)p k) is minimized.
5 9
7/24/2019 00008285
10/10
It can be shown that the value of p, k) that minimizes
F[X(k)] =
1 2
[f(k)
+
p, (k) J(k)p(k)] T
. [f(k)
+p,(k)J(k)P(k)]
(C-7)
is given by
. . . . . . . . . . . . . . . . . . . . . C-8)
Although the steepest-descent method avoids
divergence, it converges very slowly near the solution.
Powell's hybrid method is a combination of a Newton
like method and the steepest-descent method. It has the
divergence-avoiding characteristic of steepest-descent
method and the rapidly converging property of the
Newton-like method near the solution.
Powell's algorithm computes a scalar e k), o ~ e k )
1, that is used to define the step (k) =x(k+ 1) - x (k ) as
follows.
where elk)
=
1 corresponds to the Newton-like method
and elk) =0 corresponds to the steepest-descent method.
The Jacobian matrix J and its inverse H are computed
numerically at the beginning of the iteration and updated
at each step using rank-one matrices according to
Broyden.
I2
[
f (k+I) _f k ) _J(k) (k) T(k)
J(k+I) =J(k)
+ .
T(k) (k)
C-IO)
530
H(k+I )
=H(k)
[ (k+
1)
_ H(k)[f(k+ I - f (k )J j
T(k)Hlk)
~ ~ ~ ~ ~
T(k)H(k)[f(k+I) _f lk ) ]
C-ll)
A method using this updating scheme is called quasi
Newton, and the final convergence is superlinear rather
than quadratic .
The computation
of
e
n
Eq. C-9 is given in the follow
ing. Let be the maximum norm of the correction vector
. Therefore, if
I l a k ) I I ~ ~ , ........................... C-12)
e k) is set to unity (a quasi-Newton step). Otherwise a
multiple of p is included in in order to satisfy
I l e a + l - e ) P I I = ~
..................... C-13)
Straightforward algebra gives for j the expression
e ~
2
-IIPI1
2
/[ra-p) Tp + a Tp _ ~ 2 ) 2
+ llaI1
2
_ ~ 2 ) ~ 2
-IIPI12)]'12).
.
.......
C-14)
The = 5 in all examples.
SI
Metric onversion Factors
O OF-32)/1.8
psi x 6.894 757
onversion
factor
is
exact
C
E+OO = kPa
SP J
Original manuscript received in Society of Petroleum Engineers office July 31,1979
Paper accepted for publication Aug. 19, 1982. Revised manuscripl received Feb. 7,
1983. Paper SPE 8285) first presented at the 1979 SPE Annual Technical Can
ference and Exhibition held in Las Vegas, Sept. 23-26.
SOCIETY
OF
PETROLEUM ENGINEERS JOURNAL