Speeding Up Compositional Reservoir Simulation through an Efficient ...

51 downloads 0 Views 1MB Size Report
This work was carried out under the CompSim project supported by ENI S.p.A. The authors would like to thank Professor. Hamdi A. Tchelepi for allowing us to ...
SPE 163598 Speeding Up Compositional Reservoir Simulation through an Efficient Implementation of Phase Equilibrium Calculation Abdelkrim Belkadi, Wei Yan, Technical University of Denmark; Elsa Moggia, University of Bergen; Michael L. Michelsen, Erling H. Stenby, Technical University of Denmark; Ivar Aavatsmark, University of Bergen; Emanuele Vignati, Alberto Cominelli, Eni

Copyright 2013, Society of Petroleum Engineers This paper was prepared for presentation at the SPE Reservoir Simulation Symposium held in The Woodlands, Texas USA, 18–20 February 2013. This paper was selected for presentation by an SPE program committee following review of information contained in an abstract submitted by the author(s). Contents of the paper have not been reviewed by the Society of Petroleum Engineers and are subject to correction by the author(s). The material does not necessarily reflect any position of the Society of Petroleum Engineers, its officers, or members. Electronic reproduction, distribution, or storage of any part of this paper without the written consent of the Society of Petroleum Engineers is prohibited. Permission to reproduce in print is restricted to an abstract of not more than 300 words; illustrations may not be copied. The abstract must contain conspicuous acknowledgment of SPE copyright.

Abstract Compositional reservoir simulations are widely used to simulate reservoir processes with strong compositional effects, such as gas injection. The equations of state (EoS) based phase equilibrium calculation is a time consuming part in this type of simulations. The phase equilibrium problem can be either decoupled from or coupled with the transport problem. In the former case, flash calculation is required, which consists of stability analysis and subsequent phase split calculation; in the latter case, no explicit phase split calculation is required but efficient stability analysis and optimized coding of the basic thermodynamic subroutines are still crucial to the overall speed. This work tries to provide a comprehensive strategy to increase the speed for compositional simulation. This strategy begins with the coding of the basic thermodynamic properties, including the derivatives of fugacities with respect to molar numbers. Then, in the algorithms for stability analysis and phase split calculation, successive substitution with acceleration and minimization-based second-order methods are combined to gain both robustness and efficiency. For compositional simulations, the results from previous simulation steps provide the possibility to skip stability analysis by the shadow region method in the single phase regions. The approach was implemented in the general purpose research simulator (GPRS) developed by Stanford University. GPRS is a modular, state of the art reservoir simulation and its architecture makes the implementation and evaluation of new ideas and concepts easy. Tests on several 2-D and 3-D gas injection examples indicate that with an efficient implementation of the thermodynamic package and the conventional stability analysis algorithm, the speed can be increased by several folds. Application of the shadow region method to skip stability analysis can further cut the phase equilibrium calculation time.

1. Introduction Compositional reservoir simulators are indispensible tools to get insight into reservoir processes with strong compositional effects such as development of gas condensate or volatile reservoirs and various types of gas injection. Enhanced oil recovery is an important way to meet the increasing oil demands and its importance will increase in the foreseeable future. As a result, the need for simulating processes with more complex physics using compositional reservoir simulations will also increase. Compared to black oil simulations, compositional reservoir simulations provide more realistic description of components exchange between phases at a cost. The EoS based phase equilibrium calculation in compositional simulations is much heavier than the table look-up description in black oil simulations. It is therefore natural that a lot of efforts have been made to reduce the phase equilibrium calculation time in compositional simulation so as to improve the overall simulation efficiency. How to increase the phase equilibrium calculation speed is related to how the compositional simulator is formulated. There exist many formulations for compositional simulations in the literature (Fussel and Fussel, 1979; Coats, 1980; Ngheim, 1981; Acs et al., 1982; Young and Stephenson, 1983; Chien et al., 1985; Mifflin et al., 1991; Collins et al., 1992; Wang et al., 1997). The formulations can be divided into the mass variables based ones and the natural variables based ones. In the former ones, the transport equations are decoupled from the phase equilibrium equations. As a result, the phase equilibrium problem is solved as a standard flash problem, which consists of a stability analysis step and a phase split step. In the latter ones, the transport equations and the phase equilibrium equations are solved in a coupled maner. It requires few phase split

2

SPE 163598

calculations when the mixture in a cell changes from a single phase to two phases. The heaviest part in the whole phase equilibrium calculation becomes stability analysis. Despite the difference between the two types of formulations, the method used for stability analysis and its implementation is computationally relevant, while the specific formulation of thermodynamic property package may give a further computational benefit. Apart from doing efficient flash as a stand-alone phase equilibrium calculation problem (Michelsen, 1982a, 1982b), there are many attempts to speed up flash calculations in a simulation context. By utilizing local linearlization, Wang and Stenby (1994) proposed a non-iterative approach for phase split calculation in reservoir simulation. Reduced variables based methods, which can be traced back to mid 80’s to early 90’s (Michelsen, 1986; Hendricks, 1988; Hendricks and van Bergen, 1992), are also employed to improve the reservoir simulation speed by reducing the original problem to a nearly equivalent problem with fewer independent variables (Pan and Tchelepi, 2011; Okuno et al., 2009). Voskov and Techelepi (2007, 2008a, 2008b) proposed a table look-up approach named compositional space adaptive tabulation (CSAT) to replace rigrous stability analysis in compositional simulation. Inspired by CSAT, Belkadi et al. (2011) proposed the tie-line distance based approximation (TDBA) as an approximation approach to phase split calculations in compositional simulations. Finally, the shadow region concept was proposed by Rasmussen et al. (2006) to skip unnecessary stability analysis in compositional dynamic simulations such as pipeline simulations. Pan and Tchelepi (2011) have combined this stability analysis by passing technique with their reduced variables method. This study focuses on another aspect in speeding up compositional reservoir simulation, namely implementation of phase equilibrium calculation in a compositional simulator. The General Purpose Research Simulator (GPRS) developed by the Stanford University (Cao, 2002) was used as the platform here. Since GPRS is essentially based on natural variables, the phase split calculation is of minor importance. We have therefore only focused on the thermodynamic property package and the stability analysis strategy. For this purpose we used the C++ version of the thermodynamic libray originally implemented in Fortran by Michelsen at Technical University of Denmark. Even though GPRS is already equipped with an implementation of the of Michelsen’s shadow region stability analysis by passing method (Pan and Tchelepi, 2010) we decided to fully exploit the availability of a new thermodynamic property calculation thus coding a new implementation that can be optionally used with GPRS. In the following sections, we first introduce different aspects of a comprehensive strategy for improving phase equilibrium calculation speed in compositional simulation, including optimized coding of thermodynamic properties calculation, efficient and robust stability analysis and phase split, and by passing of stability analysis using the shadow region method. We then describe how the new phase equilibrium calculation code was implemented in GPRS. Finally, we present 2D and 3-D gas injection examples to show the improvement in simulation speed using the new phase equilibrium calculation options.

2. Calculation of thermodynamic properties Thermodynamic properties including fugacity coefficients, their derivatives w.r.t. temperature, pressure and composition form the basis of phase equilibrium calculation in compositional simulation. Among these properties, fugacity coefficients and their composition derivatives are the most frequently used: the former mainly in phase equilibrium constraints and all the first order iterations in stability analysis and phase split, while the latter in all the second order iterations. For cubic equations of state like SRK or PR, expressions for those properties are available in the literature. However, since these quantities are repeatedly evaluated in compositional reservoir simulation, more efficient implementations may provide gains in terms of computational efficiency. Thermodynamic properties in our thermodynamic package are formulated according to the description in Mollerup and Michelsen (1992) and Michelsen and Mollerup (1986), or a more recent description in Michelsen and Mollerup (2007). The derivatives are obtained in a modular approach suitable for not just cubic EoSs but also other thermodynamic models. In brief, let us express the reduced residual Helmholtz energy as

F  F (n, T ,V , B, D)

(1)

where the model parameters B (n, T , V ) and D(n, T , V ) are explicit functions of the temperature, the total volume, and the mole numbers n. Then the differentiation can be performed in two steps. The first step calculates the derivatives of F with respect to T, V, n and all the model parameters, and the second step calculates the derivatives of the model parameters with respect to T, V, n. By breaking the expression into many small terms, this approach seems odd for a simple cubic EoS model. However, the modular approach seems to provide an efficient code in particular when derivatives of fugacity coefficients are required. For a cubic EoS, calculation of the matrix of composition derivatives of the fugacity coefficients requires on average two extra multiplications per element, regardless of the structure of the binary interaction parameter matrix.

SPE 163598

3

3. Stability analysis and phase split calculation The stability analysis based on tangent plane distance suggested by Michelsen (1982a) can be used to perform stand-alone analyses or to provide input for a subsequent phase split calculation (Michelsen 1982b). Michelsen and Mollerup (2007) summarized the formulation and the algorithm for stability analysis and phase split. Recently, Michelsen et al. (2012) proposed several modifications of the flash algorithm. In this study, we have used the the formulation described in Michelsen and Mollerup (2007). The formulation is essentially based on unconstrained minimization. For the stability analysis of a feed with composition z , the objective function to be minimized is the modified tangent plane distance tm: C

tm( W)  1   Wi (ln Wi  ln i ( W)  di  1)

(2)

i 1

where Wi are treated as mole numbers and di is given by

d i  ln zi  ln i (z )

(3)

The gradient vector and the Hessian matrix are given by

gi 

tm  ln Wi  ln i ( W )  di Wi

H ij  It is recommended to use

gi  ln i 1   ij  W j Wi W j

 i  2 Wi gi 

(4)

(5)

as variables and the corresponding gradient and Hessian become

tm  Wi  ln Wi  ln i ( W)  di   i

H ij   ij  WW i j

 ln i 1 gi   ij W j 2 i

(6)

(7)

We can omit the last term on the RHS of Eq. (7) since it vanishes at the solution. For this modified Hessian, it reduces to the identity matrix if the fugacity coefficients are composition independent. Stability analysis can start with successive substitution and switch to a second order method later. In the susccesive substitution step, we can rearrange gi  tm / Wi  0 and obtain

ln Wi k 1  di  ln i ( W k )

(8)

To accelerate convergence, we perform extrapolation using the dominant eigenvalue method (DEM) of Orbach and Crowe (1971) after two steps of successive substitution. The extrapolated results are only accepted if the objective function is reduced. If not, we continue with the second order approach. We perform four cycles of successive substitution, each with two normal steps and one extrapolation step. If it converges or an improper extrapolation happens, the successive substitution is terminated. In the second order step, a restricted step procedure is recommended (Michelsen and Mollerup, 2007). It should be mentioned that the objective function tm is always monitored to ensure that the correction will lead to a decrease in tm, and the cost for evaluating tm is trivial. The objective function in phase split is the reduced Gibbs energy C C C C G  (1   ) xi ln fi l    yi ln fi v   li ln fi l   vi ln f i v RT i 1 i 1 i 1 i 1

where



is the vapor fraction,

(9)

yi and xi are the vapor and liquid phase mole fractions, vi and li are the vapor and liquid

phase mole numbers. The corresponding gradient and Hessian are

gi 

 vi

 G   RT

 v l   ln fi  ln fi 

(10)

4

SPE 163598

gi zi  ln iv  ln il 1 H ij    ij    v j vi li  (1   ) v j l j

(11)

Phase split calculation follows a procedure similar to that for stability analysis, including successive substitution enhanced with the DEM acceleration and a second order step using a restricted step method. A unique step in the phase split calculation is that the Rachford-Rice equation needs to be solved in successive substitution. Phase split calculation is frequently used in mass variables based compositional simulators but not in natural variables based ones like GPRS. We therefore do not elaborate more on its procedure here.

4. Stability analysis by passing using the shadow region method The shadow region method was proposed for skipping stability analysis in compositional dynamical simulations (Rasmussen et al., 2006; Michelsen and Mollerup, 2007). It consists in using the information from previous simulation steps to speed up phase equilibrium calculations. In a more general sense, this includes skipping some stability analysis calculations in single phase regions and speeding up phase split calculations in two phase regions. For natural variables based compositional simulators, where phase split calculations are rarely involved, the speeding up technique refers mainly to stability by passing. A complete version of the shadow region method can be found in Rasmussen et al. (2006) or Michelsen and Mollerup (2007). The shadow region for a given feed composition is defined as the zone in the single phase region where a non-trivial positive minimum of the tangent plane distance exists. The shadow region serves as a buffer between the region far from the two-phase region and the two-phase region. For a mixture with its T and P outside the shadow region, it is very likely to stay in the single phase region after a timestep where the change in T, P and composition are limited. This principle is used to skip stability analysis but precaution must be taken on the region around the critical point where the “buffer” zone is too narrow. Therefore, a quantitative measure must be introduced to describe how close it is to the critical point. Rasmussen et al. (2006) suggested using the minimum eigenvalue, λ1, of the Hessian matrix H used in minimizing tangent plane distance (see Eq. (6)), as such a measure. The larger is λ1, the farther is the current position to the critical point. The final stability skipping procedure is as follows: if the original feed is outside the shadow region, it is judged whether the changes in T, P and composition are small enough using the criteria

zi  zi ,old  0.11 ,

P  Pold  0.1P1 ,

T  Told  101 (K)

(12)

where Told, Pold and zi,old are the temperature, pressure and composition in the old timestep. If yes, it means the point is outside the shadow region and far from the critical region, and it is safe to skip stability analysis; if not, stability analysis must be performed. The constants 0.1 and 10 used in Eq.(12) are some empirical values suggested by Rasmussen et al. (2007). It is possible to adjust them to increase the buffer zone to make the stability skipping safer.

5. Implementation in the GPRS simulator In the GPRS simulator originally developed by Cao (Cao, 2002), the thermodynamic routines related to compositional simulation include those for thermodynamic property calculation, those for stability analysis, and those for phase split calculation. Since phase split calculation plays a minor role in the overall simulation time for GPRS, we simply keep this part as it is. Modifications are made only in thermodynamic property calculation and in stability analysis. The modified code incorporates a C++ version of the two-phase flash code, which was translated by J. Haukås from the original Fortran code implemented by M.L Michelsen at Technical University of Denmark (Haukås, 2006). We compared the original Fortran version with the C++ translation for a nine-component two-phase flash at a near critical condition. The C++ code was compiled with Visual C++ Compiler 6.0 and the Fortran code by Compaq Visual Fortran 6.6a. It turns out that the executable code from C++ is around 45% slower than that from Fortran. Formulation of the thermodynamic property in GPRS follows the expression in Walas’ book (Walas, 1985) and the relevant expressions are summarized in the appendix of Cao’s thesis (Cao, 2002). They differ fromthe modular expressions suggested by Michelsen and Mollerup (2007) mainly in that the original composition derivatives in GPRS are w.r.t. mole fractions instead of mole numbers. There is a reason behind this choice: the natural variables based formulation selects mole fractions as independent variables and calculating their derivatives is convenient for Jacobian construction. However, in the stability analysis and phase split algorithms proposed by Michelsen (Michelsen, 1982a and 1982b), the derivatives w.r.t. mole numbers are always used. Notably, it is possible to convert the derivatives w.r.t. mole fractions to those w.r.t. mole numbers using

  ln  i nT   n j 

   ln  i    T , P , nm j  x j

C    ln  i    xk    T , P , xm j i 1  xk T , P , xmk

(13)

SPE 163598

5

This inevitably introduces additional costs in calculating the composition derivatives in the second order methods. It should also be noted that the derivatives of fugacity coefficients w.r.t. mole numbers have a clearer thermodynamic meaning. They are related to the second order derivatives of the reduced Gibbs energy, and thus form a symmetric matrix where the evaluation cost is halved. In comparison, the derivatives w.r.t. mole fractions do not form a symmetric matrix and all the entries must be calculated. After adding Haukås’ thermodynamic property calculation routines into the GPRS code, a test with 15 components was made. It shows that the new package is around 1.5 times faster if we only calculate fugacities, and around 2.3 times faster if the derivatives are also calculated. Since the two thermodynamic packages do not generate exactly the same output, an extra conversion step was used to convert the results from the new package to those from the original GPRS package. The speed-up factors can be even larger without the conversion step. By combining the new thermodynamic package with the exisiting stability analysis codes in GPRS, including the successive substitution iteration (SSI) code and the second order Newton (NW) code, the computation efficiency is expected to be improved. If we move to the reservoir simulation context, the major improvement comes from the implementation of the stability analysis formulation of Michelsen and Mollerup (2007). Haukås’ code for stability analysis was added to GPRS as a new option for stability analysis. The new code follows the procedure described in Section 3. Compared to the second order Newton option in the original GPRS, the new stability analysis code also starts with successive substitution and switches to Newton iterations later. The major differences in the new code, in addition to a different thermodynamic package, are  the DEM acceleration used in the successive substitution part,  the second order part formulated as a minimization procedure where monotonic decrease in the modified tangent plane distance is checked. The formulation in Michelsen and Mollerup (2007) can be seen as the addition of the DEM acceleration concept to the original successive substituition. On top of the new stability analysis code, we further added a shadow region method to by pass the stability analysis. Therefore, the new GPRS code is equipped with the following options for stability analysis:  SSI1:successive substitution stability analysis with the new thermodynamic property package,  NW1: newton stability analysis with the new thermodynamic property package,  NEW: the new stability analysis code with the new thermodynamic property package,  NEW-bypass: the New option plus stability analysis by passing. Corresponding to SSI1 and NW1, the original options using the old thermodynamic property package are called SSI0 and NW0 hereafter, respectively. In addition to the above modifications, it is also possible to improve the speed for Jacobian construction where fugacities and their derivatives are needed. One problem here is that the current GPRS formulation requires the derivatives w.r.t. mole fractions in its Jacobian construction. There seems to be no way to convert the derivatives w.r.t. mole numbers to those w.r.t. mole fractions. But it can be argued that the derivatives w.r.t. mole fractions do not have a unique expression and those w.r.t. mole numbers are actually one set of many possible expressions for the derivatives w.r.t. mole fractions. Hence, we may use the derivatives w.r.t. mole numbers to replace the derivatives w.r.t. mole fractions directly in the Jacobian construction. It is worth noticing that in GPRS the reduced variables (RV) method was implemented to achive computational benefits during compositional simulation (Pan and Tchelepi, 2010). However, in this study we have not investigated the possibility of improving the computational efficiency of the RV option. Therefore, no comparison was made here with the RV option.

6. Results and discussion Three cases have been simulated in this study, two 2-D gas injection cases and one 3-D gas injection gas. The first 2-D gas injection case is the same as the simulation of Res-1 model with Cond2 fluid in Pan and Tchelepi’s study (2011). The fluid descriptions for Case 2 and Case 3 are shown in Tables 1 and 2, respectively. The PR EoS is used for all the fluids. All the simulations were performed with just one thread on a HP PC with four Intel® CoreTM i5 3.33 GHz CPU. The comparison of the various options is based on two numbers: the CPU-time spent for the whole simulation and the CPU-time spent for the stability analysis, The difference between those two numbers is mostly due to the solution of the linear problem. We may guess that other simulators, where the linear solvers are not as efficient as GPRS for the kind of heterogeneity we considered, may obscure the importance of our approach, Case 1: The reservoir model is taken from the top layer of the SPE 10 problem (Christie and Blunt 2001) with 220x60=13,200 active grid blocks. The Cond2 fluid is a mixture of the Kilgrin gas condensate and 5% mole fraction of hydrogen sulfide (Pan and Tchelepi, 2011). There are one injection well at (1,1,1) and one production well at (220,60,1). BHP controls are applied with 14,700 psia for the injector and 7,000 psia for the producer. The injection gas is a natural gas with 88% methane. According to MMP calculation, the injection gas will form multiple contact miscibility with the initial oil if the pressure is above the bubble point pressure (11446 psia) at the reservoir temperature. The simulation times used for six different stability analysis options are given in Table 3. It can be seen that two SSI simulations are much slower than the

6

SPE 163598

others due to slow convergence in successive substitution without any acceleration. The NW simulations reduce the simulation times effectively. The new thermodynamic property package has an obvious effect on simulation times. It gives around 15% reduction in simulation time for SSI and around 10% for NW if the new package is used. The largest effect is the NEW stability code: with the overall simulation time reduced to 1591 sec, NEW is 2.5 times faster than NW0 and 8.0 times faster than SSI0. NEW also successfully reduces the percentage of stability analysis time in the overall simulation time. The percentage is 66% for NW0 and it reduces to 16% for NEW. By applying the shadow region method, NEW-bypass further cuts the overall simulation time to 1452 secs and the percentage of stability analysis time to merely 8%. Figures 1, 2 and 3 show that the simulation results are essentially the same for the options NW0, NEW, and NEW-bypass. Other options not shown here also give the same simulation results. Case 2: The reservoir model is also derived from the SPE 10 problem. The reservoir spans 22000 x 6000 ft2 area, with a thickness of 10 ft and a constant porosity of 20%. The simulation grid consists of 220 x 60 x 1 with uniform cell width and length, while the values from the 60th layer are used to fill the permeability grid (see Figure 4). The initial oil is a 8component mixture with 43% methane. Its bubble point pressure at the reservoir temperature of 671.67 oR is 3086 psia. The injection gas has 57% methane. The MMP for this gas injection system is 3103 psia. There are 6 injection wells and 10 production wells. All the injection wells are at BHP of 4650 psia and all the production wells at 4520 psia. With the pressure well above the MMP, this injection is a fully miscible process. Due to the small pressure diffence, the injection rate is low for this case. We have deliberately used a long simulation time (36000 days) to inject around 2 pore volume of gas at reservoir condition. The final simulaton times are summarized in Table 4. For this case, the difference between SSI and Newton is not so big. Using the new thermodynamic property package gives obvious improvement in simulation speed again. NEW is much faster than SSI and NW. Compared with NW0, it is 2 times faster in the overall simulation time and 4.5 times faster in the stability analysis time. Accordingly, the percentage of the stability analysis time has reduced from 65% for NW0 to 29% for NEW. Again, switching on the stability analysis by pass option further reduces the simulation time to 1761 secs because the stability analysis time has been greatly reduced from 703 sec to 189 secs, corresponding to merely 11% of the overall simulation time. The simulations results for Case 2 are compared with the Eclipse 300 results in Figures 5 and 6 in terms of the gas saturation at the end of the injection and the field cumulative oil produced. Case 3: The reservoir model is a 3-D rectangular box. There are two high permeability zones as vertical fractures in the reservoir (Figure 7a). The porosity in the reservoir is 0.13 except for two layers with a lower porosity of 0.05 (Figure 7b). The reservoir fluid has 12 components and there is no water present in the reservoir. The initial oil has a bubble point pressure of 6258 psia at the reservoir temperature of 619 R. With the injection gas containing 75% mehane, the MMP for this system is 7426 psia. Four vertical injection wells are evenly distributed at the vertical plane at i=0, with perforations from layer 10 to 20. Four vertical production wells are evenly distributed at the vertical plane at i=25, with perforations from layer 20 to 30. The injection wells are set at BHP of 8700 psia and the production wells at 3626 psia. The simulation is made for 18000 days. Table 5 summarizes the final simulation times. For this case, SSI0 and NW0 perform very similarly, giving 7146 and 6801 sec, respectively. The new thermodynamic package reduces the overall simulation time by around 9% for both SSI and NW. The NEW option reduces the simulation time to 3482 sec. The percentage of stability analysis time is also reduced from 57% for NW0 to 16% for NEW. Using the by-pass option further reduces the simulation time to 3016 sec. This is around 2.0 times faster than NW0. The stability analysis time in NEW-bypass further reduces to 1% of the overall simulation time. Figure 8 shows the gas saturation in the reservoir at 18000 days. Figures 9 and 10 give FOPR and FGPR for different options which again show very similar results. We also tried to use the new thermodynamic package in the Jacobian construction. Replacing the derivatives w.r.t. mole fractions with those w.r.t. mole numbers has not led to any obvious change in the total number of Newton iteration steps. However, since the Jacobian calculation is only around 8% of the overall simulation time for NEW-bypass, using the new thermodynamic package only reduces the overall time to 3006 sec. More significant cuts in simulation time may be expected if the percentage of Jacobian construction is higher, e.g., in simulations where two-phase regions are dominant.

7. Conclusions Phase equilibrium calculation plays an important role in compositional reservoir simulations and we have discussed how to improve the simulation speed by implementing a phase equilibrium calculation that follows the ideas of Michelsen (Michelsen, 1982a; Michelsen and Mollerup, 2007). We present a comprehensive speed-up strategy which includes a coding of the thermodynamic propreties, efficient and robust algorithms for stability analysis (and phase split), and stability bypassing using the shadow region approach. These methods were implemented in the natural variables based GPRS simulator and tested using several 2-D and 3-D gas injection examples.The results suggest that switching to the new thermodynamic property package can reduce the simulation time while the major reduction comes from replacing both the original thermodynamic property package and the original stability analysis code. Simulations with the NEW option are 2 to 2.5 times faster than the baseline Newton option for the tested examples, and even much faster than the successive substitution native option. The proportion of stability analysis time has been lowered to around 15-30% of the overall simulation time with the NEW option. Application of the shadow region method can further reduce the stability analysis time as well as the overall

SPE 163598

7

simulation time, with an overall 10-fold speed-up with respect to the baseline code. The results suggest that the time used in stability analysis can be effectively reduced with the proposed strategy. Nonetheless, the overall benefit is extremely case dependant and it is related to the balance between the time spent in the solution of the linear problems arising along the timestepping and the time spent in local properties computation,

Acknowledgements This work was carried out under the CompSim project supported by ENI S.p.A. The authors would like to thank Professor Hamdi A. Tchelepi for allowing us to use the General Purpose Research Simulator (GPRS) developed by Stanford University.

References Acs, G., Doleschall, S, Farkas, E., 1985. General Purpose Compositional Model. SPEJ, August, 543-553. Belkadi, A., Yan, W., Michelsen, M., Stenby, E.H., 2011. Comparison of Two Methods for Speeding Up Flash Calculations in Compositional Simulations. Paper SPE 142132 presented at the SPE Reservoir Simulation Symposium held in The Woodlands, Texas, USA, 21-23 February 2011. Cao H., 2002. Development of Techniques for General Purpose Simulators, Ph.D. Thesis, Stanford University. Chien, M.C.H., Lee, S.T., Chen, W.H, 1985. A New Fully Implicit Compositional Simulator. Paper SPE 13385 presented at the 1985 (8th) SPE Symposium on Reservoir Simulation, Dallas, TX, 10-13 February 1985. Coats K.H., 1980. An Equation of State Compostional Model. SPE J., 20(5) 363-376. Collins, D.A., Nghiem, L.X., Grabenstetter, J.E., 1992. An Efficient Approach to Adaptive-Implicit Compositional Simulation with an Equation of State. SPE Res. Eng., 259-264 (May 1992) Fussell, L.T. and Fussell, D.D.: “An Iterative Technique for Compositional Reservoir Models” SPE J., August 1979, 211-220 Haukås, J., User Manual for the Compositional Reservoir Simulator XPSIM, Centre for Integrated Petroleum Research, University of Bergen, 2006. Hendriks, E. M. 1988. Reduction Theorem for Phase Equilibria Problems. Industrial & Engineering Chemistry Research 27 (9): 1728-1732. Hendriks, E.M. and van Bergen, A.R.D., 1992. Application of a Reduction Method to Phase Equilibria Calculations. Fluid Phase Equilibria 74: 17-34. Michelsen, M. L. 1982a. The Isothermal Flash Problem. Part I. Stability. Fluid Phase Equilibria 9 (1): 1–19. Michelsen, M. L. 1982b. The Isothermal Flash Problem. Part II. Phase-Split Calculation. Fluid Phase Equilibria 9 (1): 21-40. Michelsen, M.L. 1986. Simplified Flash Calculations for Cubic Equation of State. Industrial & Engineering Chemistry Process Design and Development 25 (1): 184-188. Michelsen, M.L. and Mollerup, M.L., 1986. Derivatives of Thermodynamic Properties. AIChE J. 32(8): 1389-1392. Michelsen, M. L. and Mollerup, J. M. 2007. Thermodynamic Models: Fundamentals and Computational Aspects, Second Edition, Holte, Denmark: Tie-line Publications. Michelsen, M. L., Yan, W., Stenby, E.H., 2012. A Comparative Study of Reduced Variables Based Flash and Conventional Flash. Paper SPE 154477 presented at the SPE Europec held in Copenhagen, Denmark 4-7 June 2012, accepted by SPE J. Mollerup, J.M., Michelsen, M.L., 1992. Calculation of Thermodynamic Equilibrium Properties. Fluid Phase Equilibria 74: 115. Mifflin, R.T., Watts, J.W., Weiser, A., 1991. A Fully Coupled, Fully Implicit Reservoir Simulator For Thermal and Other Complex Reservoir Processes. Paper SPE 21252 presented at the 11th SPE Symposium on Reservoir Simulation,

8

SPE 163598

Anaheim, CA, USA, 17-20 February 1991. Okuno, R., Johns, R.T., Sepehrnoori, K., 2009. Application of a Reduced Method in Compositional Simulation. SPE J, 15(1) 39-49. Rasmussen, C. P., Krejberg, K., Michelsen, M. L., Bjurstrom, K. E. 2006. Increasing the Computational Speed of Flash Calculations with Applications for Compositional Transient Simulations. SPE Reservoir Evaluation & Engineering 9 (1): 32 – 38. Voskov, D. and Tchelepi, H. A. 2007. Compositional Space Parameterization for Flow Simulation. Paper SPE 106029 presented at the SPE Reservoir Simulation Symposium Huston, Texas, USA, 26-28February. Voskov, D. and Tchelepi, H. A. 2008a. Compositional Space Parameterization for Miscible Displacement Simulation. Transport in Porous Media 75 (1): 111-128. Voskov, D.V. and Tchelepi, H.A., 2008b. Compositional Parameterization for Multi-phase Flow in Porous Media. Paper SPE 113492 presented at the 208 SPE/DOE Improved Oil Recovery Symposium, Tulsa, Oklahoma, USA, 19-23 April. Walas, S.M.: “Phase Equilibria in Chemical Engineering", Butterworth Publishers, Boston, MA, 1985 Wang, P., Yotov, I., Wheeler, M., Arbogast, T., Dawson, C., Parashar, M., Sepehrnoori, K., 1997. A New Generation EOS Compositional Reservoir Simulator: Part I—Formulation and Discretization. Paper SPE 37979 presented at the 1997 SPE Reservoir Simulation Symposium, Dallas, Texas, USA, 8-11 June 1997. Young, L.C., Stephenson, R.E., 1983. A Generalized Compositional Approach for Reservoir Simulation. SPE J, October: 727-742.

Table 1. Fluid description for Case 2

C1 C2 C3 C4 C6 GRP1 GRP2 GRP3

zinitial

zinject

Tc (R)

Pc (psia)

ω

MW (g/mol)

zC

sshift

0.4313 0.1237 0.0882 0.0914 0.0248 0.121996429 0.086685562 0.031918009

0.569922988 0.23360963 0.131561278 0.060240203 0.002894044 0.001018612 0.000561205 0.00019204

331.74 549.75 665.64 789.11 913.50 1058.22 1315.49 1655.86

665.95 714.80 615.76 524.70 436.62 359.25 219.82 113.51

0.01328 0.1008 0.1524 0.2142 0.2990 0.4085 0.7406 1.2598

16.17 30.32 44.10 63.45 86.18 126.48 225.57 420.76

0.28471 0.28538 0.27616 0.27481 0.25042 0.26359 0.22884 0.17298

-0.48846061 -0.00367114 -0.00278416 -0.00172047 -0.03627101 -0.02060048 0.2329878 0.592492615

ki,j

C1

C2

C3

C4

C6

GRP1

GRP2

GRP3

C1 C2 C3 C4 C6 GRP1 GRP2 GRP3

0 0.0027825 0.0010434 0.0010434 0.029483 0.033766 0.044894 0.14994

0.0027825 0 0.0017785 0.0017785 0.011601 0.01 0.01 0.01

0.0010434 0.0017785 0 0 0 0.01 0.01 0.01

0.0010434 0.0017785 0 0 0 0 0 0

0.029483 0.011601 0 0 0 0 0 0

0.033766 0.01 0.01 0 0 0 0 0

0.044894 0.01 0.01 0 0 0 0 0

0.14994 0.01 0.01 0 0 0 0 0

SPE 163598

9

Table 2. Fluid description for Case 3

GRP1 GRP2 GRP3 GRP4 GRP5 GRP6 GRP7 GRP8 GRP9 GRPA GRPB GRPC

zinitial

zinject

Tc (R)

Pc (psia)

ω

MW (g/mol)

zC

sshift

0.0499 0.0593 0.5543 0.0676 0.0406 0.026 0.0333 0.0304 0.0372 0.0237 0.025 0.0527

0.054 0.075 0.747 0.086 0.028 0.006 0.003 0.0004 0 0 0 0

672.48 548.46 342.02 549.77 665.64 791.68 912.24 1021.65 1116.13 1210.16 1582.68 1588.28

1296.18 1071.36 666.15 708.34 615.76 572.87 491.79 383.06 346.00 257.77 220.75 163.55

0.1 0.225 0.0132493 0.0986 0.1524 0.1959026 0.2698731 0.3198511 0.44011 0.67816 0.81367 1.1134

34.08 44.01 16.15 30.07 44.10 58.12 79.32 107.93 156.54 219.94 287.01 503.52

0.28194 0.27406 0.28470 0.28462 0.27615 0.28194 0.27406 0.28462 0.27615 0.27663 0.26072 0.256872

-0.10259784 -0.04273034 -0.14414622 -0.10326836 -0.07750138 -0.05666626 -0.02123883 -0.1266931 -0.03141235 -0.00188886 0.000154171 -0.01133897

ki,j

GRP1

GRP2

GRP3

GRP4

GRP5

GRP6

GRP7

GRP8

GRP9

GRPA

GRPB

GRPC

GRP1 GRP2 GRP3 GRP4 GRP5 GRP6 GRP7 GRP8 GRP9 GRPA GRPB GRPC

0.0000 0.0960 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500 0.0500

0.0960 0.0000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000 0.1000

0.0500 0.1000 0.0000 0.0023 0.0067 0.0124 0.0195 0.0323 0.0380 0.0521 0.0661 0.0770

0.0500 0.1000 0.0023 0.0000 0.0012 0.0043 0.0091 0.0191 0.0240 0.0367 0.0502 0.0613

0.0500 0.1000 0.0067 0.0012 0.0000 0.0010 0.0038 0.0113 0.0152 0.0264 0.0390 0.0498

0.0500 0.1000 0.0124 0.0043 0.0010 0.0000 0.0010 0.0059 0.0089 0.0183 0.0296 0.0398

0.0500 0.1000 0.0195 0.0091 0.0038 0.0010 0.0000 0.0022 0.0042 0.0114 0.0211 0.0304

0.0500 0.1000 0.0323 0.0191 0.0113 0.0059 0.0022 0.0000 0.0003 0.0038 0.0105 0.0179

0.0500 0.1000 0.0380 0.0240 0.0152 0.0089 0.0042 0.0003 0.0000 0.0019 0.0072 0.0136

0.0500 0.1000 0.0521 0.0367 0.0264 0.0183 0.0114 0.0038 0.0019 0.0000 0.0018 0.0056

0.0500 0.1000 0.0661 0.0502 0.0390 0.0296 0.0211 0.0105 0.0072 0.0018 0.0000 0.0011

0.0500 0.1000 0.0770 0.0613 0.0498 0.0398 0.0304 0.0179 0.0136 0.0056 0.0011 0.0000

Table 3. Statistics on the simulation times for Case 1

SSI0 SSI1 NW0 NW1 NEW NEW-bypass

Simulation time (sec)

Stability analysis (sec)

13046 11117 3971 3576 1591 1452

11664 9704 2616 2202 248 116

10

SPE 163598

Table 4. Statistics on the simulation times for Case 2

Simulation time (sec)

Stability analysis (sec)

5926 5198 4978 4668 2451 1761

4034 3420 3240 2891 703 189

SSI0 SSI1 NW0 NW1 NEW NEW-bypass

Table 5. Statistics on the simulation times for Case 3

Simulation time (sec)

Stability analysis (sec)

7146 6403 6801 6270 3482 3016

4204 3467 3857 3339 544 39

SSI0 SSI1 NW0 NW1 NEW NEW-bypass

Y

20 40 60

20

40

60

80

100

120

140

160

180

200

220

120

140

160

180

200

220

120

140

160

180

200

220

X

(a) Y

20 40 60 20

40

60

80

100 X

(b) Y

20 40 60 20

40

60

80

100 X

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 (c) Figure 1. Gas saturations at 3200 days for Case 1 using different options: (a) NW0; (b) NEW; (c) NEW-bypass

SPE 163598

11 2500

2000

NW0

FOPR  (STB/D)

NEW NEW+bypass

1500

1000

500

0 0

500

1000

1500

2000

2500

3000

3500

Time (days) Figure 2. FOPR for Case 1 using different options. 25

FGOR  (MSCF/STB)

20

15

10

NW0 NEW NEW+bypass

5

0 0

500

1000

1500

2000

2500

3000

3500

Time (days) Figure 3. FGOR for Case 1 using different options.

Figure 4. Permability field (mD) for Case 2 (P an I label production and injection wells, respectively)

12

SPE 163598

(a)

Y

20 40 60 20

40

60

80

100

120

140

160

180

200

220

0.9

1

X

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

(b)

Y

20 40 60 20

40

60

80

100

120

140

160

180

200

220

0.08

0.1

X

-0.1

-0.08

-0.06

-0.04

-0.02

0

0.02

0.04

0.06

(c) Figure 5. Gas saturation at 36000 days for Case 2: (a) Eclipse; (b) GPRS; (c) saturation difference between GPRS and Eclipse.

6.00E+07

Cumulative Oil prod. (stb)

GPRS Eclipse 5.00E+07

4.00E+07

3.00E+07

2.00E+07

1.00E+07

0.00E+00 0

5000

10000

15000

20000

25000

30000

time (days)

Figure 6. Cumulative oil produced for Case 2.

35000

40000

13

10

10 20 30

Z

Z

SPE 163598

20 30

25

5

20

25

15 10

20

5

5

25

10

Y

X

5

Y

5

20

15

15

10

0

25

10

20

15

X

10

15

20

25

30

35

40

45

0

50

0.02

0.04

0.06

0.08

(a) permeability in x-direction

0.1

0.12

0.14

0.16

0.18

0.2

(b) porosity

Z

10 20 30 25

10 20 30 25

20

0.5

0.6

5

Y

X 0.4

10

5

5

Y

0.3

15

10

10

5

0.2

20

15

15

10

0.1

25

20

15

0

20

25

0.7

0.8

0.9

1

0

0.1

0.2

X 0.3

0.4

(a)

0.5

0.6

0.7

0.8

0.9

(b)

Figure 8. Gas saturation at 18000 days for Case 3 ((b) shows the vertical slices at the locations of the injection wells) 450000 400000 350000

NW0 NEW

300000

FOPR  (STB/D)

Z

Figure 7. Permeability (mD) (a) and porosity (b) field for Case 3 (red lines indicate performations in the injection wells and the blue lines indicate those in the production wells, (b) is rotated 90 degree to show the production wells)

NEW+bypass

250000 200000 150000 100000 50000 0 0

5000

10000

15000

Time (days) Figure 9. FOPR for Case 3 using different options.

20000

1

14

SPE 163598 30

25

NW0

FGOR  (MSCF/STB)

NEW NEW+bypass

20

15

10

5

0 0

5000

10000

15000

20000

Time (days) Figure 10. FGPR for Case 3 using different options.