## 1. Introduction

[2] Gas injection in general, and CO_{2} injection in particular, is a promising option for improved oil recovery (IOR) for both fractured and unfractured reservoirs. Also, sequestration by CO_{2} injection in saline aquifers may be a promising approach to mitigate global warming. Several unique phase behavior properties make CO_{2} especially attractive. Up to 5 mol % of CO_{2} may dissolve in water at pressures encountered in saline aquifers and oil reservoirs, and the solubility in both light and heavy oil may be very high.

[3] Upon dissolution, CO_{2} may *swell* the oil and water phases. CO_{2} dissolution may also *increase the density*, which may start density-driven mixing due to gravity effects [*Simon et al.*, 1978; *Ashcroft and Ben Isa*, 1997; *Ahmed et al.*, 2012]. Under some reservoir conditions, CO_{2} has a higher density than the reservoir oil, making injection from the bottom more efficient. This effect is markedly different from, say, nitrogen injection. These aspects could have a significant impact on CO_{2}sequestration and IOR. Accurate simulation of compositional effects using stability analysis and phase-splitting calculations in two- and three-phase flow is the main goal of this work.

[4] The CO_{2} solubility in the aqueous phase has generally been estimated using Henry's law, which has limitations for a CO_{2}-rich liquid phase in equilibrium with water, due to the strong nonideality of the liquid phase. In three phase, the CO_{2}composition in the aqueous phase is determined by fugacity equality in all three phases. We suggest using the cubic-plus-association-equations of state (CPA EOS) for both two- and three-phase flow when one phase is water and the hydrocarbon (HC) phases are CO_{2}rich. The CPA-EOS can account for association (hydrogen bonding interactions) of water molecules and the cross association (polar-induced-polar interactions) of CO_{2} and water molecules [*Li and Firoozabadi*, 2009]. Reliable predictions by the CPA-EOS have been demonstrated in*Mutoru et al.* [2011] to pressures as high as 3000 bar and temperatures as high as 546 K.

[5] For applications other than steam injection, the mutual solubility of water and HCs is negligible (at K) and the CPA-EOS reduces to the Peng-Robonsin (PR)-EOS for the HC-rich and CO_{2}-rich phases. In this temperature range, we derive highly CPU efficient three-phase stability and flash routines that accurately model the CO_{2}solubility in the aqueous phase. In future work, we plan to account for salinity and extend the formalism to steam injection with full-species transfer by CPA-EOS.

[6] First-order methods have been used to model three-phase compositional flow with an aqueous phase, a CO_{2}-rich (gas) phase and a HC-rich (oil) phase [*Ferrer*, 1977; *Chang et al.*, 1998; *Guler et al.*, 2001; *Varavei and Sepehrnoori*, 2009]. A different approach is to use streamline methods [*Ingebrigtsen et al.*, 1999; *Yan et al.*, 2004; *Cheng et al.*, 2006; *Kozlova et al.*, 2006]. Other three-phase models are restricted to incompressible flow, noncompositional fluids or black oil [*Juanes and Patzek*, 2003; *Geiger et al.*, 2009], no gravity or one-dimensional domains [*Valenti et al.*, 2004]. In hydrology, two- and three-phase applications, such as water-air-NAPL systems, have been modeled by*Helmig et al.* [2012], *Class et al.* [2002], *Helmig and Huber* [1998], *Niessner and Helmig* [2007], *Bastian and Helmig* [1999], and *Unger et al.* [1995]. Those authors use sophisticated discretization schemes and new multiscale techniques but approximate the transfer of species between the phases, where allowed, by relations such as Dalton's, Raoult's, and/or Henry's law.

[7] There have been no attempts in (1) EOS-based three-phase compositional modeling in the finite element framework or (2) to describe the aqueous phase by the CPA-EOS with cross association in modeling three-phase IOR and CO_{2} sequestration.

[8] Recently, *Moortgat and Firoozabadi* [2010]have modeled two-phase compositional flow in anisotropic media, using a powerful combination of high-order finite element methods. Specifically, the mixed hybrid finite element (MHFE) method is used to solve for pressure and fluxes, and mass transport is updated using a bilinear discontinuous Galerkin (DG) approach. The robustness and accuracy of the method, applied to two-phase problems, was demonstrated in earlier work and compared with commercial simulators [*Hoteit and Firoozabadi*, 2005, 2006a, 2006b]. *Wheeler et al.* [2012]recently applied similar finite element methods to single- and two-phase immiscible flow on hexahedral and simplicial grids. In*Moortgat et al.* [2011], we developed the algorithm for the numerical modeling of three-phase flow, based on the combined DG and MHFE methods. The work presents a total flux formulation for three-phase flow and addresses complications with upwinding, but restricts compositional modeling to the nonaqueous phases. Here, we generalize that model to fully compositional three-phase flow. We distinguish two types of problems: (1) the flow of up to three HC phases, with transfer of all species between the three phases, which we model by the PR-EOS with volume translation [*Peng and Robinson*, 1976], based on three-phase-split methods proposed by*Li and Firoozabadi* [2012], and (2) the flow of one or two HC phases and one aqueous phase. We introduce the CPA-EOS with cross association for the description of the aqueous phase.

[9] The MHFE-DG combination of finite element methods is particularly well suited to model heterogeneous and fractured reservoirs, in which the MHFE provides continuous fluxes and pressures throughout the domain, while the DG method allows sharp discontinuities in phase properties at phase boundaries, fracture-matrix interfaces, and jumps in permeability. By using higher-order methods, simulations can be carried out on significantly coarser meshes and at lower CPU cost compared with, for instance, first-order finite difference (FD) methods with single-point upstream weighting. Alternatively, on the same mesh, the MHFE-DG method will exhibit significantly less numerical dispersion and grid orientation effects than such FD methods. More specifically, insection 3.1, we demonstrate that the three-phase bilinear DG mass transport update has twice the convergence rate of an element-wise constant (FD) mass transport update. The mixed finite element method has furthermore proven to exhibit minimal sensitivity to grid orientation [*Darlow et al.*, 1984].

[10] The three-phase modeling is improved by including Fickian diffusion for all three phases. The full matrix of composition-dependent, multicomponent diffusion coefficients in the nonaquoues phases are derived from the work by*Leahy-Dios and Firoozabadi* [2007], and the aqueous phase coefficient by *Mutoru et al.* [2011].

[11] The paper is organized as follows. First, we describe the mathematical model and numerical implementation. We keep the presentation succinct and provide only the governing equations of the higher-order approximation scheme. The main novelty of this work lies in the development of a highly efficient three-phase-splitting implementation in a reservoir simulator, using a new formulation in terms of the CPA-EOS for an aqueous phase and PR-EOS for nonassociating HC phases. The flow of three compositional phases with complex phase behavior exhibits a significantly higher degree of nonlinearity and is considerably more challenging to model than even the three-phase problem with a noncompositional aqueous phase using higher-order methods [*Moortgat et al.*, 2011]. One manifestation of this nonlinearity is the orders of magnitude jumps in composition dependent total compressibility at phase boundaries. We provide expressions for three-phase partial molar volumes and total compressibility and discuss the strong sensitivity of compressibility on the phase-split results. Small errors in compressibility may lead to fluctuations in the pressure field. The fractional flow formulation presented in this work is very robust.

[12] After describing the algorithms, we present five characteristic numerical examples to verify our model: (1) we perform a convergence analysis to demonstrate the superiority of our higher-order finite element method to a traditional FD approach, (2) we compare our CPA predictions to experimental data over a wide range of temperatures and pressures, and contrast the results to a classic Henry's law, (3) we consider carbon sequestration and compare to analytical predictions for onset times and critical wavelengths, (4) we model an example from the literature for the fully compositional flow of three HC phases, and (5) we compare results for viscous fingering during water-alternating-gas (WAG) injection to a commercial simulator. The paper ends with concluding remarks.