Fast and Robust Algorithm For Compositional Modeling: Part I-Stability Analysis Testing
Fast and Robust Algorithm For Compositional Modeling: Part I-Stability Analysis Testing
Fast and Robust Algorithm For Compositional Modeling: Part I-Stability Analysis Testing
冉兺 冊
⭸P)z,T , (⭸L/⭸ni)T,P,ni , and other similar derivatives; L⳱the liquid
c c c 2
phase density, ni⳱the number of moles of component i in the feed,
ni=(ni , . . . , ni−1,ni+1, . . . , nc), and c⳱the number of components. a= 兺兺
i=1 j=1
xi xj ai1 Ⲑ 2aj1 Ⲑ 2 =
i=1
xi ai1 Ⲑ 2 . . . . . . . . . . . . . . . . . . (1)
Depending on the process, sufficient accuracy may require the use
of from 4 to 12 (or more) components. When the nonlinear equa-
As a result, the fugacity coefficient i becomes a function of
tions in flash are performed using the Newton algorithm, the com-
a1/2 and b, where b⳱the covolume parameter of the EOS. The
putational time is proportional to c3. Therefore, there will be an
equilibrium ratio Ki then becomes a function of parameters a1/2
and b of either liquid or gas, and the vapor fraction V. Therefore,
the computations of vapor-liquid equilibria will be related to only
three nonlinear equations. The assumption of zero-interaction co-
Copyright © 2002 Society of Petroleum Engineers
efficients is restrictive for reservoir fluids and may not be com-
This paper (SPE 77299) was revised for publication from paper SPE 63083, first presented pensated by adjustment of parameters such as critical temperature
at the 2000 SPE Annual Technical Conference and Exhibition, Houston, 1–4 October.
Original manuscript received for review 27 November 2000. Revised manuscript received
Tc, critical pressure pc, or acentric factor as will be demonstrated
20 July 2001. Manuscript peer approved 1 August 2001. later. Jensen and Fredenslund9 extended the work of Michelsen to
a= 兺兺 x x a
i=1 j=1
1Ⲑ2 1Ⲑ2
i j i aj 共 1 − ␦ij兲. . . . . . . . . . . . . . . . . . . . . . . . . . (2) Stability Analysis Formulation
The stability of a given phase can be best described by the TPD.6
Let ij⳱(1−␦ij); ⳱the matrix with elements ij. Because  is The TPD is simply the difference between the Gibbs free energies
a symmetric matrix, we can invoke the Spectral theory of linear of a system in a single phase and in two-phase, in which the
algebra5 for diagonalization to express it as amount of the second phase for the two-phase (that is, the trial
phase) is small. Because at constant T and p the more stable state
 = SDS −1 = SDST. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (3) has a lower Gibbs free energy, the single-phase state is stable if the
TPD is positive.
In the above equation, the diagonal matrix is given by
The expression for the TPD for a multicomponent fluid is given by6
冢 冣
1 c
2 0
D= 0 ..
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (4) TPD共y兲 = 兺 y 关 共y兲 − 共z兲兴.
i=1
i i i . . . . . . . . . . . . . . . . . . . . . . . . (18)
c
In Eq. 18, y⳱(y1,y2, . . . , yc) is the composition of the trial
and the orthogonal matrix S is given by phase, and z⳱(z1,z2, . . . , zc) is the composition of the phase for
which its stability is to be determined. An alternative form of Eq.
S = 共q⬘共1兲q⬘共2兲 . . . . . . q⬘共c兲兲. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (5) 18 can be obtained from i(z)⳱fi(z)/(zi p) and i(y)⳱fi(y)/(yi p),
the relation between chemical potential and fugacity,6 and Eq. 18:
In Eq. 4, 1 , . . . , c are the eigenvalues of  and
q⬘(1), . . . , q⬘(c) in Eq. 5 are the corresponding eigenvectors. Each c c
eigenvector q⬘(i) is given by D= 兺 y 关ln 共y兲 − ln 共z兲兴 + 兺 y 共ln y − ln z 兲. . . . . . . . (19)
i=1
i i i
i=1
i i i
共i兲 T
q⬘ = 共q⬘i1 q⬘i2 . . . . . . q⬘ic兲 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (6)
In Eq. 19, the TPD is expressed in dimensionless form, D⳱
In Eqs. 3 and 6, T represents the transpose; in Eq. 3, ST=S−1 (TPD/RT). One can use Eq. 19 to examine the stability of the fluid
because S is an orthogonal matrix. In Eq. 5, q⬘i1, . . . , q⬘ic are the as the liquid phase or the stability of the fluid as the gas phase. If
entries of eigenvector q⬘(i). From Eq. 3, one readily obtains one is interested in testing the stability of the fluid phase with
composition z as a liquid, the trial phase with composition y will
c
be in gas state. On the other hand, when interested to test stability
ij = 共1 − ␦ij兲 = 兺 q⬘ q⬘ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (7)
k=1
k ki kj of the fluid phase with composition z as the gas phase, the trial
phase with composition y will be in liquid state. In the process of
Combining Eqs. 2 and 7 provides testing the stability of a phase with composition z, one may find the
minimum (or minima) of D (the dependent variables of D are y).
c c c
If this minimum is negative, the fluid mixture with composition z
a= 兺 兺
k=1
k
i=1
ai1 Ⲑ 2xi q⬘ki 兺a
j=1
1Ⲑ2
kj .
j xj q⬘ . . . . . . . . . . . . . . . . . . . . (8) is not stable and will split into more than one phase. The above
procedure suggested by Michelsen1 is currently the basis for sta-
Let bility analysis with the conventional variables (that is, mole frac-
tion variables). Its implementation is not a trivial task. The method
qki = ai1 Ⲑ 2q⬘ki . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (9) is complicated because all the minima (say, two) must be found.
D=
i=1
c
兺 y 共ln y − ln z 兲. . . . . . . . . . . . (20)
i=1
i i i
⭸D II
⭸yj
= 兺
M
␣=1
冉 冊冉 冊 兺冉 冊
⭸D II
⭸Q␣V
⭸Q␣V
⭸yj
=
M
␣=1
⭸D II
⭸Q␣V
共q␣i − q␣c兲. . . . . . (31)
Eqs. C-1, 30, and 31 provide the expression for the La-
In Eq. 20, yi denotes the composition of the trial vapor phase.
grange multipliers
For the purpose of finding the minimum of D, we will select the
dependent variables as QV1 , . . . , QVm,bV, and y1, . . . , yc. (We have
this choice: we can also assume D to be a function of QV1 , . . . ,
QVm,bV, only.) These variables have the following constraints:
␣ = 冉 冊⭸D II
⭸D␣V
␣ = 1, . . . , M. . . . . . . . . . . . . . . . . . . . . . . (32)
+
c−1
兺 y 共ln y − ln z 兲 +
i=1
i i i 冉 1−
c−1
兺y
i=1
i 冊冋 冉 ln 1 −
c−1
兺y
i=1
i 冊 册
− ln zc .
Earlier we divided D into DI and DII. We can also divide the
Hessian matrix into the corresponding parts HI and HII given by
HI=⭸2DI/(⭸QV)2 and HII=⭸2DII/(⭸QV)2 . From Eq. 32 and the defi-
. . . . . . . . . . . . . . . . . . . . . . . . . . (24)
nition of HII above,
Eqs. 21, 22, and 23 can be represented by the following constraint:
冉 冊
⭸2 D II ⭸
c−1 c−1 HII = = , . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (38)
共⭸QV兲2 ⭸QV
兺q y +q
i=1
␣i i ␣c 1− 兺y
i=1
i = q␣V ␣ = 1, . . . , M. . . . . . (25)
which can be approximated by
The variables of Eq. 24 are QV1 , . . . , QVm, and yi(i⳱1, . . . , c−
1), which are constrained by Eq. 25. We use the method of ⌬ ≈ H II ⌬QV. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (39)
Lagrange multipliers to minimize D. One may write Combining Eqs. 37 and 39 provides the iterative expression for
ᐉ=D−
M
兺 兺q y +q
␣=1
␣ 冋 c−1
i=1
␣i i ␣c 冉 1−
c−1
兺y
i=1
i 冊 册 − QV␣ , . . . . . (26)
the minimization of the TPD,
共I + HI关HII兴−1兲⌬ =− ⭸D Ⲑ ⭸QV. . . . . . . . . . . . . . . . . . . . . . . . . (40)
where ␣⳱the Lagrange multipliers. The elements of HI, [HII]−I, and the gradient vector ⭸D/⭸QV are
By using ⭸ᐉ/⭸yj⳱0 ( j⳱1, . . . , c−1), one obtains (see Ap- provided in Appendix D.
pendix C) The computational procedure for the calculation of the mini-
冉 兺 冋兺 册冊
mum of the TPD is provided in the following six steps.
c M M
1. All the eigenvalues and the coreesponding eigenvectors of
ln Kj =− ln
l=1
zl exp
␣=1
␣q␣l + 兺 q
␣=1
␣ ␣j the matrix  with the entries (1−␦ij) are first calculated. The non-
zero eigenvalues are selected and are arranged in the order of the
j = 1, . . . , c. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (27) absolute values.
2. The initial equilibrium ratios (that is, Ki) are estimated using
The derivative of ᐉ (from Eq. 26) with respect to ␣ provides the Wilson correlation13 (one may use other correlations).
Q␥V = 兺
c−1
i=1
q␥iyi + q␥c 1 − 冉 兺y
c−1
i=1
i 冊 ␥ = 1, . . . , M. . . . . . (28)
3. The Lagrange multipliers ␣(␣⳱1, . . . , M) are obtained
from Eq. C-1 from the data in Steps 1 and 2 using the linear-least
squares for the first iteration.
4. The equilibrium ratios Ki are obtained from Eq. 27 in sub-
The derivative of the above expression with respect to yj( j⳱
sequent iterations.
1, . . . , c−1) gives
5. Then y are calculated from yi=Kizi, and QV␣(␣=1.…,M) are
c
⭸Q␥V
⭸yj
= q ␥j − q ␥c j = 1, . . . , c − 1; ␥ = 1, . . . , M. . . . . . . (29) calculated from Q␣V = 兺q
j=1
␣ jyj.
Fig. 1—Dimensionless TPD vs. xC1 and xnC10 for the C1/nC10/CO2 system at 350 K and 50 bar: zC1=0.40, znC10=0.30, and zCO2=0.30.
• Billings crude/natural gas mixture.15 ponents/pseudocomponents. The interaction coefficients are ob-
• Kilgrin gas condensate (see Table 1). 16 tained from Katz and Firoozabadi18 and by matching the saturation
The critical properties of all the pseudocomponents are esti- pressure to estimate the interaction coefficient between C1 and the
mated using the Cavett correlations.17 The nonzero binary inter- residue. Table 5 lists the nonzero eigenvalues from the matrix  for
action coefficients are listed in Tables 2 through 4. Tables 3 and all the mixtures. We use stability analysis to calculate the saturation
4 provide the critical properties and the acentric factor of all com- pressure by decreasing the pressure with an increment of 0.1 bar at
Fig. 3—Dimensionless TPD vs. the reduction and conventional variables for the C1/nC5/nC10 system at 300 K and 100 bar: zC1=0.80,
znC5=0.10, and znC10=0.10.
constant temperature until the mixture changes its state from single- in the figure). The figure shows that for m⳱2, with three variables,
phase to two-phase. The results are presented in the following. the stability testing provides a very good approximation for the
entire range; m⳱1, which has two variables in stability testing,
Synthetic Oil (Mixture I). First, the conventional method is used does not give reasonable prediction at temperatures below 540 K.
to calculate the saturation pressure with ten components. Then, the For ␦⳱0, the deviations at low temperatures are greater than for
stability testing from the reduction method is employed. There are m⳱1 in view of the fact that both methods have two variables. The
three nonzero eigenvalues (see Table 5); m⳱3, m⳱2, and m⳱1 adjustment of Tc for nC10 to match the bubblepoint pressure at 322
represent the number of eigenvalues in the descending order; m⳱ K increases the value of Tc from 617.9 to 745 K. The approach
3 represents the use of all three eigenvalues; and for m⳱1, the produces the worst results (see Fig. 6).
largest eigenvalue is used in stability calculations. The stability Table 6 provides the number of iterations at different saturation
testing with zero interaction coefficients is also performed with pressures. The convergence criterion of 1×1.0−6 was used in the
and without the adjustment of the critical temperature of nC10. The calculations (see Step 6 of the computation procedure). The results
measured bubblepoint pressure at 322 K is used to adjust the show that the number of iterations depends mainly on the distance
critical temperature of nC10. from the critical point (CP). The closer to the CP, the greater the
The saturation pressures are plotted in Fig. 6. The results for number of iterations. The number of iterations is two times higher
m⳱3 are identical to those of the conventional method (not shown in the critical region than outside the region.
Fig. 5—Dimensionless TPD vs. the reduction and conventional variables for the C1/nC5/nC10 system at 300 K and 100 bar: zC1=0.998,
znC5=0.00012, and znC10=0.0008.
m⳱3 was used. Because the transformation from Ref. 9 has four B ⳱ defined by Eq. A-3
variables for stability, then the comparison between ours and that c ⳱ number of components
of the Jensen-Fredenslund transformation is on the same basis. We C ⳱ matrix with elements Cjk
found our approach to be more accurate. The results for Mixture II D ⳱ dimensionless TPD
were only used in this comparison. D ⳱ diagonal matrix with diagonal elements
g ⳱ defined by Eqs. B-2 and B-6
Discussion and Concluding Remarks H ⳱ Hessian matrix
The algorithm presented in this paper for stability analysis has K ⳱ equilibrium ratio
several important merits. It is very flexible in terms of speed and m ⳱ number of significant eigenvalues
accuracy. One can truncate after a small eigenvalue; two eigen- M ⳱ m+1
values were used for the synthetic oil and the Billings crude/ p ⳱ pressure
natural gas mixture with good approximations. The zero-
q ⳱ eigenvector elements
interaction coefficient methodology cannot be recommended, as
was demonstrated with three examples. The speed and the conver- R ⳱ gas constant
gence in our procedure is independent of the value of the interac- S ⳱ diagonal matrix
tion coefficients. This experience is different from the work re- T ⳱ temperature
ported in Ref. 12, in which the efficiency of calculations strongly U ⳱ matrix with elements given by Eq. D-4
becomes a function of interaction coefficients. x ⳱ mole fraction
The most important feature of our proposed method for stabil- y ⳱ mole fraction
ity analysis is its robustness. Our numerical experience with the z ⳱ mole fraction
mixtures presented in this paper and a number of other complex Z ⳱ compressibility factor
mixtures reveals that the approach is very robust. After examina- ␥ ⳱ index for reduction variables
tion of Figs.1 through 5, one may conclude that the transformation
⳱ chemical potential
in the reduced space reduces considerably the raggedness of the
TPD surface. This feature, together with the property of only one ⳱ fugacity coefficient
minimum, gives huge advantage to our approach in comparison to ⳱ eigenvalues
the conventional approach. Another important feature of the pro- ⳱ acentric factor
posed approach is that one can include all the interaction coeffi- ␦ ⳱ Kronecker delta, also binary interaction coefficients
cients which are essential, especially for CO2-crude mixtures.
160
Nomenclature
a ⳱ energy parameter of the EOS 140
Measured Data
Conventional Method
TABLE 5—NONZERO EIGENVALUES FOR TEST MIXTURES 80
Reduction Method
No. Mixture I Mixture II Mixture III Mixture IV m =2
60 m =1
1 9.95735 10.7487 10.9783 13.562 δ =0
2 0.0706504 0.220662 0.05008 0.4177 40 δ =0, Tc adjusted
3 –0.0280032 0.0642569 –0.02837 0.07158
20
4 –0.0327679 –0.04311 250 300 350 400 450 500 550 600 650 700
T, K
5 –0.000864411 –0.01329
6 0.005196
Fig. 6—P-T diagram for Mixture I.
Number of Iterations
300 5 5 5 5 Reduction Method
322 5 5 5 5 12 m=2
m=1
339 5 5 5 5
370 5 5 5 5 8
400 6 6 6 5
430 6 6 6 6 4
460 6 6 6 6
490 7 7 7 7
0
520 8 8 7 7 0 50 100 150 200 250 300 350 400
540 8 8 8 8 p, bar
550 9 9 9 9
Fig. 7—Number of Newton’s iterations vs. pressure at 572.5 K
565 11 11 11 11 for Mixture I.
575 12 12 11 11
580 10 10 9 9
the data in Figs. 1 through 5 with remarkable skill. His help is
583* 8 8 much appreciated.
583** 7 7
583.6* 8 8 References
583.6** 7 7 1. Michelsen, M.: “The Isothermal Flash Problem. Part I. Stability,” Fluid
580 6 6 6 6 Phase Equilibria (1982) 9, 1.
575 6 6 6 6 2. Trangenstein, J.A.: “Customized Minimization Techniques for Phase
Equilibrium Computations in Reservoir Simulation,” Chem. Eng. Sci.
Tc = 571.82 K Tc = 571.43 K (1987) 42, 2847.
p c = 79.47 bar p c = 78.23 bar 3. Rachford Jr., H.H. and Rice, J.D.: “Procedure for Use of Electronic
* retrograde dewpoint Digital Computers in Calculating Flash Vaporization Hydrocarbon
** dewpoint Equilibrium,” Trans. Soc. Pet. Eng. (1952) 195, 327.
4. Pan, H. and Firoozabadi, A.: “Fast and Robust Algorithm for Compo-
sitional Modeling: Part II–Two-Phase Flash Computations,” paper SPE
Subscripts 71603 presented at the 2001 SPE Annual Technical Conference and
Exhibition, New Orleans, 30 September–3 October.
i,j,k,l ⳱ component index, also derivative index
5. Strang, G.: Linear Algebra and Its Applications, third edition, Sauders
College Publishing, New York City (1988).
Superscripts
6. Firoozabadi, A.: Thermodynamics of Hydrocarbon Reservoirs, Chap.
L ⳱ liquid phase index 4, McGraw-Hill, New York City (1998).
V ⳱ vapor phase index 7. Michelsen, M.: “Simplified Flash Calculations for Cubic Equations of
State,” Ind. Eng. Chem. Process Des. Dev. (1986) 25, 184.
Acknowledgments 8. Peng, D.Y. and Robinson, D.B.: “A Rigorous Method for Predicting
We thank Dr. Bret Beckner of Mobil Technology Corp. (now with the Critical Properties of Multicomponent Systems From an Equation
ExxonMobil Upstream Research Co.) for providing the opportu- of State,” AIChE J. (1977) 23, 137.
nity to work on this project. We also appreciate many interesting 9. Jensen, B.H. and Fredenslund, A.: “A Simplified Flash Procedure for
discussions and suggestions from Dr. Kenneth M. Brantferger of Multicomponent Mixtures Containing Hydrocarbons and One Non-
Mobil Technology Corp. (now with ExxonMobil Upstream Re-
search Co.). Dr. K. Ghorayeb of RERI performed the plotting of
TABLE 7—NUMBER OF ITERATIONS FOR STABILITY
150 TESTING AT SATURATION PRESSURE FOR MIXTURE II
m =4
m =3
AT 322 K
Reduction
140 Method m =2 CO2% (mole) m=3 m=2 m=1
m =1
δ= 0 0 5 5 5
130 δ= 0, Tc adjusted
20 5 5 5
120 40 6 6 5
p, bar
50 6 6 6
110
Conventional Method 60 6 7 7
100
70 8 9 8
75 9 10 8
90 80 12 15 15
85 13 16 16
80
0 10 20 30 40 50 60 70 80 90 100 90 17 17 15
CO2% (mole) in Mixture 93.3 8 8 8
95 8 8 8
Fig. 8—Saturation pressure vs. CO2 concentration at 322 K for 97.5 7 7 7
Mixture II.
p, bar
900
600
Saturation Pressure, bar
800
700
500 600
500
300 350 400 450 500 550 600
T, K
400
Fig. 10—Saturation pressure vs. temperature for Mixture IV.
冤 冥
m
19. Abhvani, A.S. and Beaumont, D.N.: “Development of an Efficient
Algorithm for the Calculation of Two-Phase Flash Equilibria,” SPERE
AL
2 兺Q Q
k=1
k
L
k
V
k
ZL + 2.414BL
(November 1987) 695, Trans., AIME, 283. − ln . . . . . (B-6)
2公2B
L
L
a ZL − 0.414BL
Appendix A–Z and i With the
Reduction Variables Note that according to Eq. B-6,
The PR-EOS in terms of Z can be written as g L = g L共QV1 , . . . , QcV,bV兲 ≈ g L共QV1 , . . . , QVm,bV兲. . . . . . . . . . (B-7)
Z 3 − 关1 − B兴Z 2 + 关A − 3B2 − 2B兴Z − 关AB − B2 − B3兴 = 0, DII (the second term of the TPD in Eq. 20) is only a function
. . . . . . . . . . . . . . . . . . . . . . . . (A-1) of y. Because Ki=Ki(QV1 , . . . , QVm,bV) (from Ki=Li /Vi ), one
readily finds
where
D II = D II共QV1 , . . . , QVm,bV兲. . . . . . . . . . . . . . . . . . . . . . . . . . . . (B-8)
ap
A= . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (A-2)
共RT兲2
and Appendix C: Expression for K
From ᐉ/yj⳱0 and Eq. 26,
bp
B= . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (A-3) M
共RT兲
Note that according to Eq. A-1, once A and B are provided, Z
ln Kj − ln Kc = 兺 共q
=1
j − q c 兲 j = 1, . . . , c − 1. . . . (C-1)
can be determined: Z⳱Z(A,B). Using Eq. 13, one can then readily The above equation can be also expressed as
derive Eq. 14 of the text.
The expression for fugacity coefficient of component i is given by8
ln i =
bi
共Z − 1兲 − ln共Z − B兲
yj = zj Kc exp 冋兺 M
=1
册
共q j − q c兲 . . . . . . . . . . . . . . . . . . . . . (C-2)
b Kc can be expressed by
冤 冥 冉 冊冒
c
c−1
A
2 兺 xa
j=1
1Ⲑ2 1Ⲑ2
j i aj 共 1 − ij兲
bi Z + 2.414B Kc = 1− 兺y j zc. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (C-3)
j=1
− − ln .
2公2B a b Z − 0.414B
Introducing yj from Eq. C-2 into Eq. C-3,
冋兺 冉 兺 冊册
. . . . . . . . . . . . . . . . . . . . . . . . (A-4) c M M
c
by combining Eqs. 7, 9, and 11. Eqs. A-4 and A-5 establish Eq. 17 ln Kj =− ln
l=1
zl exp
=1
q l + 兺 q
=1
j
of the text.
j = 1, . . . , c − 1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (C-5)
Appendix B: Expressions for DI and DII
Eq. 27 of the text is from Eqs. C-4 and C-5.
The first term of the TPD in Eq. 20 is denoted by DI and is given by
c Appendix D: Hessian Matrix H=HI+HII
D = I
兺 y 关ln
i=1
i iV共y兲 − ln iL共z兲兴. . . . . . . . . . . . . . . . . . . . . . . (B-1) The matrix HI is given by
冤 冥
2 D I 2 D I 2 D I
Let us further subdivide the two terms in Eq. B-1. The first term … …
in Eq. B-1 is denoted by gV and is expressed by 共QV1 兲2 QV1 QV2 QV1 QVM
c ⯗ ⯗ ⯗ ⯗ ⯗
HI = .
gV = 兺i=1
yi ln iV共y兲. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (B-2) ⯗ ⯗ ⯗ ⯗ ⯗
2 D I 2 D I 2 D I
Substitution of Eq. A-4 into Eq. B-2 provides the expression for … …
gV which reads QVM QV1 QVM QV2 共QVM兲2
. . . . . . . . . . . . . . . . . . . . . . . . (D-1)
V V V V
AV ZV + 2.414BV
g = 共Z − 1兲 − ln共Z − B 兲 − ln V . The entries in the above matrix are given by 2gV/Q VQ
V
2公2BV Z − 0.414B
V
( ,
=1, . . . , M) (see Eqs. B-3 and B-4). Note that 2 gL /
. . . . . . . . . . . . . . . . . . . . . . . . . (B-3) QVQ
V⳱0. The PR-EOS can be used to calculate these entries.
兺 ylCkl 冉 Cjl −
c−1
兺C y 冊
冤 冥
2 II 2 II 2 II
D D D jp p
… … l=1 p=1
共QV1 兲2 QV1 QV2 QV1 QVM
j,k = 1, . . . , M. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (D-7)
⯗ ⯗ ⯗ ⯗ ⯗
HII = . The matrix [HII]−1 is symmetric.
⯗ ⯗ ⯗ ⯗ ⯗
Finally, the expression for the gradient vector is given by
冉 冊
2 D II 2 D II 2 D II
… … D g V g L
QVM QV1 QVM QV2 共QVM兲2 = + − = 1, . . . , M. . . . . . . . . . . (D-8)
Q V Q V
QV
. . . . . . . . . . . . . . . . . . . . . . . . (D-2)
Eq. 32 is used in the derivation of the above equation. As was
We take the derivative of Eq. 25 with respect to yj(j⳱1, . . . , pointed out earlier, the second derivative (2gL/Q V
V)⳱0 (see
c−1), and define C j as Eq. B-6).
All the derivations in the paper are based on stability testing of
Q V
C j = = q j − q c = 1, . . . , M; j = 1, . . . , c − 1. liquid phase by examination of the trial gas phase. Similar deri-
yj vations for the stability testing of gas phase are obtained by fol-
. . . . . . . . . . . . . . . . . . . . . . . . (D-3) lowing our procedure.
Let us define matrix C with elements C j. The matrix CT has
elements ln(Kj /Kc)/ (from Eq. C-1).
We take the derivatives of DII with respect to yj and yk, and SI Metric Conversion Factors
define Ujk as bar × 1.0* E+05 ⳱ Pa
2 D II ln共Kj Ⲑ Kc兲 jk 1
Ujk = = = + j,k = 1, . . . , c − 1. Abbas Firoozabadi is a senior scientist and director at the Res-
yjyk yk yk yc ervoir Engineering Research Inst. (RERI) in Palo Alto, California,
. . . . . . . . . . . . . . . . . . . . . . . . (D-4) and a Professor at Imperial College London. e-mail:
[email protected]. His main research activities center on thermo-
Next, we define the matrix U with elements Ujk. One can show dynamics of hydrocarbon reservoirs and production and on
that the elements of U−1 are given by multiphase-multicomponent flow in fractured petroleum reser-
voirs. Firoozabadi holds a BS degree from Abadan Inst. of Tech-
关U兴jk−1 = yj共jk − yk兲. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (D-5) nology, Abadan, Iran, and MS and PhD degrees from the Illi-
From Eq. 38, one obtains nois Inst. of Technology, Chicago, all in gas engineering.
Firoozabadi is the recipient of the 2002 SPE Anthony Lucas
QV QV y lnK Gold Medal. Huanquan Pan is a software developer at Incyte
关HII兴−1 = = = CU−1CT, . . . . . . . . . . . . . (D-6) Genomics in Palo Alto, California. Previously, he was a scientist
y lnK with the Reservoir Engineering Research Inst., where he worked
on the modeling of asphaltene and wax precipitation and the
where lnK⳱(lnK1/Kc,lnK2/Kc, . . . , lnKc−1/Kc). development of efficient phase-equilibrium algorithms for
Combining Eqs. D-5 and D-6 provides the elements of [HII]−1 compositional reservoir simulation. Pan holds a PhD degree in
given by chemical engineering from Zhenjiang U. in Hangzhou, China.