Sie sind auf Seite 1von 3

Fluid Phase Equilibria 363 (2014) 290–292

Contents lists available at ScienceDirect

Fluid Phase Equilibria


journal homepage: www.elsevier.com/locate/fluid

Short communication

On solving the Rachford-Rice equation with higher order methods


Wei Yan ∗ , Erling H. Stenby
Center for Energy Resources Engineering (CERE), Department of Chemistry, Technical University of Denmark (DTU), DK 2800 Kgs. Lyngby, Denmark

a r t i c l e i n f o a b s t r a c t

Article history: The Rachford-Rice equation calculates the amounts and compositions of two equilibrium phases at con-
Received 30 August 2013 stant K-factors. This single variable equation is a perfect candidate for applying higher order iteration
Received in revised form 4 December 2013 methods because the additional cost for evaluating the derivatives with order higher than two is rela-
Accepted 9 December 2013
tively low. This study compares the performance of Householder’s high order iterations up to order seven.
Available online 17 December 2013
In addition, a method to improve the initial estimate is proposed for the situation where the Rachford-
Rice function shows abrupt change close to the asymptotes and overshooting happens. The proposed
Keywords:
method can largely reduce repeated use of the bisection adjustment in the subsequent iterations. The
Rachford-Rice equation
Higher order methods
comparison shows that the Householder’s iteration with order three or four gives the best performance
Flash on average.
© 2013 Elsevier B.V. All rights reserved.

For a feed of C components, the Rachford-Rice equation calcu- 1. Define the bounds for ˇ: ˇ must be within [0,1] for normal flash,
lates the amounts and compositions of two equilibrium phases at and within (˛1 , ˛C ) for negative flash.
constant equilibrium factors (K-factors). The equation is mainly 2. Set tighter bounds if possible [2]: the left bound is set as the
used in the inner loop of a successive substitution algorithm of maximum of the ˇmin given by Eq. (4) and the left bound given
flash calculation, where the outer loop updates the K-factors with in Step 1
a thermodynamic model that can account for their composition K z − 1
i i
dependency. In terms of the vapor phase fraction ˇ, the equation is ˇmin = max (4)
i:Ki >1 Ki − 1
expressed as
and the right bound is set as the minimum of the ˇmax given by

C
Ki − 1  z
C
Eq. (5) and the right bound given by Step 1
i
f (ˇ) = zi = =0 (1) 1−z 
1 − ˇ + ˇKi ˇ − ˛i
i=1 i=1 i
ˇmax = min (5)
i:Ki <1 1 − Ki
where zi is the mole fraction of component i in the feed, Ki is the
equilibrium factor of component i, and ˛i is the asymptote corre- The initial estimate is set as ˇini = (ˇmin + ˇmax )/2.
sponding to component i: 3. At the current value of ˇ, calculate f(ˇ) and f (ˇ). If f(ˇ) > 0, set
ˇmin = ˇ; otherwise set ˇmax = ˇ. Calculate the Newton correction
1
˛i = − (2) step ˇ and the new ˇ as ˇnew = ˇ + ˇ.
Ki − 1
4. If ˇnew is within (ˇmin , ˇmax ), set ˇ = ˇnew ; otherwise, set ˇ =
For ease of discussion, we assume that the K-factors are strictly (ˇmin + ˇmax )/2.
ordered 5. Repeat Steps 3 and 4 until the tolerance is met.

K1 > K2 > · · · > KC (3)


For normal flash calculation, it can be checked if there is a ˇ-root
It can be shown that for positive feed composition with K1 > 1 within [0,1]. It is also advisable to use the liquid phase fraction as
and KC < 1, we have positive phase compositions only in the inter- the iterative variable if f(0.5) > 0 [1].
val (˛1 , ˛C ). Because f(ˇ) is monotonically decreasing and has a We notice that the derivatives of f(ˇ) at different orders are of
single root in this interval, Newton’s method combined with bisec- similar expressions:
tion is generally efficient enough to solve f(ˇ) = 0. A typical solution  p+1

C
Ki − 1 
C
zi
procedure [1] is as follows: f (p) (ˇ) = (−1)p zi = (−1)p (6)
1 − ˇ + ˇKi p+1
(ˇ − ˛i )
i=1 i=1

∗ Corresponding author. Tel.: +45 45252914. where f(p) (ˇ) stands for the p-th order derivative of f(ˇ) w.r.t. ˇ. For
E-mail address: weya@kemi.dtu.dk (W. Yan). evaluating derivatives with order higher than two, no additional

0378-3812/$ – see front matter © 2013 Elsevier B.V. All rights reserved.
http://dx.doi.org/10.1016/j.fluid.2013.12.006
W. Yan, E.H. Stenby / Fluid Phase Equilibria 363 (2014) 290–292 291

Table 1
List of the examples tested.

Example Description Source

1 8-Component with ˇ < 0 and close to ˛1 Example 1 in Table 1 of [4]


2 8-Component with ˇ < 0 and close to ˛1 Example 2 in Table 1 of [4]
3 6-Component near critical Table 1 in [3]
4 6-Component with ˇ close to ˛C Table 2 in [3]

division is needed. Since division is more expensive than multipli- It is obvious that each term in the summation is greater than
cation and summation, it means that the cost for evaluating higher zero for ˛1 < ˇ < ˛C . Therefore, we always have f (ˇ) > l(ˇ) in this
order derivatives is relatively cheap and we can consider using iter- interval and the root for l(ˇ)
ation schemes with orders higher than two. Extension to higher
order iteration does not require reformulation of the Rachford- ˇ = z1 ˛C + (1 − z1 )˛1 (14)
Rice equation as performed in some recent studies [3,4]. To our provides a left bound for the ˇ-root of the original equation. Simi-
knowledge, the 3rd order method was used as a solution [5] to larly, we can prove that f (ˇ) < h(ˇ) in this interval, and the root of
the Richford-Rice contest organized by Prof. Curtis Whitson of the h(ˇ)
Norwegian University of Science and Technology in the late 90s.
Here we adopt a more general expression for high order iteration ˇ = (1 − zC )˛C + zC ˛1 (15)
proposed by Householder [6]:
 (p−1)
 provides a right bound. We use the bounds given by Eqs. (14) and
(g/f ) (15) as the initial bounds in Step 1. And ˇmin and ˇmax obtained after
ˇn+1 = ˇn + p (7)
(g/f )
(p) Step 2 are likely to give a smaller initial interval. A more important
ˇn
outcome is that the Rachford-Rice function and its derivatives can
where g(ˇ) is analytic in a suitable neighborhood of the root and be evaluated at both ˇmin and ˇmax (not possible at ˛1 and ˛C ), mak-
the subscript n denotes the iteration number. In the particular case ing it possible to use them as new initial estimates for ˇ. Therefore,
of g(ˇ) = 1, the iteration is given by in the case that the initial estimate is not good enough and the iter-
 (p−1)
 ation leads to a ˇ-value lower than ˇmin , we can use ˇmin as the
(1/f ) new estimate; similarly, if the new ˇ is higher than ˇmax , we can
ˇn+1 = ˇn + p (8)
(p)
(1/f ) ˇn use ˇmax as the new estimate. This adjustment is performed only
once during the whole iteration. If subsequent ˇ-values are outside
Both Eqs. (7) and (8) give an iteration step of order p + 1.
(ˇmin , ˇmax ) again, we apply the bisection adjustment.
Obviously, Newton’s method is a special case of Eq. (8) when p = 1.
Four examples (Table 1) given by Li et al. [3] and Gaganis et al.
And Eq. (8) reduces to the 3rd order Halley’s method [7] for p = 2:
[4] were used to test the Householder iteration scheme (Eq. (8))
2f f (1) with order from two to seven. For the third order method, both
ˇn+1 = ˇn − (9)
2 iteration schemes (Eqs. (9) and (10)) were used. The Rachford-Rice
2(f (1) ) − f f (2)
solver was set to solve negative flash here for all the calculations
Another 3rd order formulation often used is because all the examples except Example 4 give a ˇ-root outside
 
f f f (2) [0,1]. The results with and without adjustment of the initial esti-
ˇn+1 = ˇn − 1+ (10) mate are presented in Table 2. The second order method without
f (1) 2(f (1) )
2
adjustment of initial estimate can be taken as the reference. The
which is recommended by Michelsen and Mollerup [1] to solve the calculation was performed on a HP desktop PC an Intel® CoreTM
density roots of cubic equations of state. Using higher order meth- i7-3770 CPU (3.40GHz and 4.00GB RAM). The code was written in
ods instead of Newton’s method is likely to reduce the number of Fortran 90 and compiled by an Intel Fortran Compiler XE 13.0.
iterations and the calculation time. Our first suggestion is there-
fore to replace the Newton correction in Step 3 with a higher order 1. Higher order methods generally reduce the number of iterations.
correction. This is particularly true if there are few bisection adjustments of
There is however another problem to be solved, namely, abrupt the ˇ-value (Example 2). On the other hand, repeated bisection
change in the Rachford-Rice function close to the asymptotes, or steps can ruin the performance of higher order methods (Exam-
existence of “knees” [4], can lead to repeated use of the bisection ple 1). It is also worth noticing that higher order methods seem
adjustment and thus a large number of iterations. This is an initial to tolerate poorer initial estimates and require fewer bisection
estimate issue and we propose the following approach to handle it. steps (Examples 2 and 4). In fact, bisection adjustment is not
For C > 2, we construct two functions used at all for several higher order methods in Examples 2 and
z1 (K1 − 1) (1 − z1 )(KC − 1) z1 1 − z1 4.
l(ˇ) = + = + (11) 2. With adjustment of the initial estimate, the need for subsequent
1 − ˇ + ˇK1 1 − ˇ + ˇKC ˇ − ˛1 ˇ − ˛C
bisection adjustment is almost removed so that we can fully take
(1 − zC )(K1 − 1) zC (KC − 1) 1 − zC zC advantage of the faster convergence of the higher order meth-
h(ˇ) = + = + (12) ods (Examples 1, 3 and 4). For Example 2, the adjustment does
1 − ˇ + ˇK1 1 − ˇ + ˇKC ˇ − ˛1 ˇ − ˛C
not provide a better initial estimate for the second and the third
The difference between f (ˇ) and l(ˇ) is given by order methods. But for the methods with order above three, no
C−1 
  adjustment is actually needed.
Ki − 1 KC − 1 3. Although the number of iterations is reduced for higher orders,
f (ˇ) − l(ˇ) = zi −
1 − ˇ + ˇKi 1 − ˇ + ˇKC the cost for evaluating the derivatives of higher orders increases.
i=2
As a result, the methods with very high orders can give cal-
 
C−1
1 1
 culation time similar to that of the Newton method although
= zi − (13) the number of iterations is fewer. On average, the methods
ˇ − ˛i ˇ − ˛C
i=2 with order three (Eq. (9)) and order four seem to give the best
292 W. Yan, E.H. Stenby / Fluid Phase Equilibria 363 (2014) 290–292

Table 2
Comparison of iterative methods of different orders with and without adjustment of the initial estimate.

Order of the iteration With adjustment Without adjustment

CPU time (␮s) Niter c Nadjust d CPU time (␮s) Niter c Nadjust d

Example 1
2 0.374 8 1 0.584 14 8
3a 0.231 5 1 0.507 11 6
3b 0.296 6 1 0.616 13 8
4 0.253 5 1 0.505 10 5
5 0.238 4 1 0.560 9 5
6 0.274 4 1 0.672 9 4
7 0.323 4 1 0.708 8 4

Example 2
2 0.517 11 1 0.358 8 2
3a 0.320 7 2 0.289 6 1
3b 0.410 8 1 0.303 6 1
4 0.261 5 0 0.272 5 0
5 0.247 4 0 0.252 4 0
6 0.282 4 0 0.286 4 0
7 0.331 4 0 0.329 4 0

Example 3
2 0.182 5 1 0.386 11 6
3a 0.152 4 1 0.271 7 3
3b 0.160 4 1 0.404 10 5
4 0.168 4 1 0.219 5 1
5 0.203 4 1 0.259 5 1
6 0.233 4 0 0.236 4 0
7 0.276 4 0 0.278 4 0

Example 4
2 0.353 9 1 0.402 11 5
3a 0.195 5 1 0.312 8 3
3b 0.293 7 1 0.337 8 2
4 0.221 5 0 0.226 5 0
5 0.258 5 1 0.316 6 1
6 0.304 5 0 0.303 5 0
7 0.353 5 0 0.359 5 0
a
The 3rd order method according to Eq. (9).
b
The 3rd order method according to Eq. (10).
c
Number of iterations.
d
Number of ˇ-value adjustment. For calculation with initial estimate adjustment, the adjustment of initial estimate is also counted.

performance. The average number of iteration is around 5. Com- iterations with the 2nd order Newton method can still be cheap
pared with the reference method, the reduction in simulation as compared with the cost of the more complex correction used in
time is over 40% for Examples 1, 3 and 4, 10% for Example 2 the higher order methods. Our experience shows that the second
using order three (Eq. (9)), and 30% for Example 2 using order and the third order solvers give similar performance and the speed
four. slows down with higher orders.

This study shows that it is possible to improve the speed of the Acknowledgements
Rachford-Rice solver using higher order methods. In the meantime,
we would like to point out that the Rachford-Rice equation is usu- The study was carried out under the project “ADORE—Advanced
ally solved in flash calculation, where a previous iteration can often Oil Recovery Methods” funded by the Danish Council for Technol-
provide a good initial estimate for ˇ. This is particularly true in the ogy and Production Sciences, Maersk Oil, and DONG Energy.
context of simulation. In addition, the cost of solving Rachford-Rice
is low as compared with other costs in flash calculation, e.g., the cost References
of evaluating fugacity coefficients and their derivatives. Therefore,
we should not overstate the importance of the fast solution of the [1] M.L. Michelsen, J.M. Mollerup, Thermodynamic Models, Fundamentals and Com-
putational Aspects, Tie-Line Publications, Holte, Denmark, 2007.
Rachford-Rice equation. Actually, it is possible to solve flash with- [2] C. Leibovici, J. Neoschill, Fluid Phase Equilib. 74 (1992) 303–308.
out a full convergence in the Rachford-Rice equation [8]. The higher [3] Y. Li, R.T. Johns, K. Ahmadi, Fluid Phase Equilib. 316 (2012) 85–97.
order methods employed here can in principle be used for solving [4] V. Gaganis, D. Marinakis, N. Varotsis, Fluid Phase Equilib. 322–323 (2012) 9–18.
[5] M. L. Michelsen, Private communications.
the density roots in equations of state. For cubic equations of state,
[6] A.S. Householder, The Numerical Treatment of a Single Nonlinear Equation,
the higher order derivatives of f are even simpler (many of them McGraw-Hill, New York, 1970.
are zeros). However, since the evaluation of the first order deriva- [7] G.H. Brown Jr., Amer. Math. Monthly 84 (9) (1977) 726–728.
tive is so cheap in the density equation, the cost of several more [8] M.L. Michelsen, W. Yan, E.H. Stenby, SPE J. 18 (5) (2013) 952–959.

Das könnte Ihnen auch gefallen