# A Numerical Algorithm to Solve the Two-Phase Flow in Porous Media Including Foam Displacement

- 1 Citations
- 908 Downloads

## Abstract

This work is dedicated to simulating the Enhanced Oil Recovery (EOR) process of foam injection in a fully saturated reservoir. The presence of foam in the gas-water mixture acts in controlling the mobility of the gas phase, contributing to reduce the effects of fingering and gravity override. A fractional flow formulation based on global pressure is used, resulting in a system of Partial Differential Equations (PDEs) that describe two coupled problems of distinct kinds: elliptic and hyperbolic. The numerical methodology is based on splitting the system of equations into two sub-systems that group equations of the same kind and on applying a hybrid finite element method to solve the elliptic problem and a high-order finite volume method to solve the hyperbolic equations. Numerical results show good efficiency of the algorithm, as well as the remarkable ability of the foam to increase reservoir sweep efficiency by reducing gravity override and fingering effects.

## Keywords

EOR Hybrid mixed methods Finite volume methods Foam injection Mobility reduction## 1 Introduction

The enhanced oil recovery by injection of gas is a technique that is used since the 1930’s [14]. The sweep efficiency of gas, however, can be affected by gravity (by the *gravity override* phenomenon, that occurs when the injected gas accumulates in the upper layers of the reservoir) and by the development of preferential paths (*viscous fingering*), due to gas lower density and viscosity. These obstacles can be surpassed by the creation of foam, that can be defined as the agglomeration of gas bubbles separated by thin liquid films (lamellae), since foam apparent viscosity is much higher than the viscosity of gas [11, 12, 23]. The usage of foam in oil recovery is mainly motivated by the reduction of the gas phase mobility [15].

*A*. The dynamic foam net generation is given by a first-order approach, introduced in [24] and later related to the local-equilibrium bubble texture in [2], with a time constant \(1/K_\text {c} \), as follows:

The numerical approach for solving this system of PDEs should be capable of handling several complexities due to discontinuity, non-linearity, stiffness, natural instabilities, among others. The numerical methods should also preserve important properties, such as local conservation of mass, shock capture, non-oscillatory solutions, accurate approximations, and reduced numerical diffusion effects.

To the extent of our knowledge, this problem is usually solved using explicit-in-time finite difference schemes [1, 16, 21, 25]. Also, the use of commercial software is prevalent in the literature [7, 20, and references within]. The most common approach in commercial software is to represent the effect of foam by a factor that reduces the mobility of the gas phase; therefore, bubble creation and destruction are not represented explicitly [9, 21].

An effective numerical scheme to solve this kind of model and to address its inherent complexities is based on rewriting the problem in terms of global pressure, as in [4]. In this scheme, one has two distinct coupled problems: an elliptic problem and a degenerate hyperbolic problem. The next step is to decouple the system of PDEs into two subsystems of equations, each one of a different nature. In doing so, each subsystem can be solved by specialized methods, such as finite element and finite volume methods, according to their mathematical properties and the relation between precision and computational efficiency required in the resolution of each step. In this sense, for the spatial discretization of the hyperbolic problems we can employ the finite volume method, for instance; for time discretization, a common choice is a finite difference method, while a hybrid finite element method can be applied to the elliptic equations.

In this context, we develop a staggered algorithm to decouple the hydrodynamics from the hyperbolic system, resulting in a scheme that uses a locally conservative hybrid mixed finite element method to approximate the velocity and pressure fields and a high-order finite volume scheme to solve the hyperbolic equations. The two problems are solved in different time scales. Thus, the proposed staggered algorithm is employed to simulate two-phase (water and gas) flow in a heterogeneous porous medium. We compare pure gas-water injection with the gas-water-foam flow. The results show a reduction of gravity override and viscous fingering effects when the foam is present.

This work is organized as follows: in Sect. 2, we define a fractional flow formulation for Eqs. (4)–(6) using the concept of global pressure; in Sect. 3, we present an algorithm to solve the problem using a hybrid mixed finite element method for the elliptic problem and a high-order finite volume method methodology to solve the hyperbolic equations; numerical results are shown in Sect. 4. Finally, in Sect. 5, we present some concluding remarks.

## 2 Model Problem

*p*, the water saturation \(S_\text {w}\), and the foam texture \(n_\text {D}\) satisfy, in \(\varOmega \times (0,T]\), the following system of equations:

*i*denotes a spatial direction, andand boundary and initial conditions

## 3 Numerical Method

In this section, we introduce the sequential algorithm that combines two kinds of numerical methods to solve (9)–(11).

The hydrodynamics (9)–(10) is approximated using a naturally stable mixed finite element method introduced in [22]. This method is locally conservative, relying on the strong imposition of the continuity of normal fluxes and on a discontinuous pressure field. The combination of a hybrid formulation with a static condensation technique reduces the number of degrees of freedom in the global problem.

The transport system (11) is solved using the KNP method, a conservative, high-order, central-upwind finite volume scheme introduced in [18] that shows reduced numerical diffusion effects. The KNP scheme is an extension of the KT method [19] that generalizes the numerical flux using more precise information about the local propagation velocities. At the same time, the KNP scheme has an upwind nature, since it respects the directions of wave propagation by measuring the one-sided local velocities. KNP is a semi-discrete method based on the REA (Reconstruct Evolve Average) algorithm of Godunov [8]. Furthermore, the KNP scheme allows for using small steps in time without requiring an excessive refinement of the spatial mesh, since the numerical diffusion does not depend on the time step. After discretization in space, the resulting system of ODEs is integrated in time using a BDF (Backward Differentiation Formula), an implicit, multi-step method that is especially indicated to solve stiff equations [5].

### 3.1 The Sequential Algorithm

In the following sections we comment on the methods employed to solve each problem.

### 3.2 Hybrid Mixed Finite Element Method for Darcy Flow

When a mixed finite element formulation is used to approximate the Darcy system (13), it is necessary to simultaneously fulfill the compatibility condition between spaces and to impose the continuity of the normal vector across interelement edges. In addition, the resulting linear system is indefinite, which can restrict the numerical solvers that could be applied. By using a hybrid formulation, the continuity requirement is imposed via Lagrange multipliers, defined on the interelement edges. Furthermore, if the local problems are solvable, it is possible to eliminate all degrees of freedom related to local problems using a static condensation technique, resulting in a considerable reduction of the computational cost, since the global system involves only the degrees of freedom of the Lagrange multiplier. Also, in this case, the global problem is positive-definite. Once the approximation for the Lagrange multipliers is found, the original degrees of freedom (associated with velocity and pressure) can be computed in local, independent problems.

We first introduce some notations and definitions, for simplicity restricting ourselves to \(\varOmega \subset \mathbb {R}^2\). The three-dimensional case follows directly. Let \(L^2(\varOmega )\) denote the Hilbert space of square-integrable functions in \(\varOmega \), with the usual inner product \((\cdot ,\cdot )_\varOmega \), and let \(H(\text {div},\varOmega )\) be the space of vector functions having each component and divergence in \(L^2(\varOmega )\).

Assuming \(\varOmega \) is a polygon, we define a partition \(\mathcal {T}_h\) of \(\varOmega \) composed of quadrilaterals and use *K* to denote an arbitrary element of the partition. The set of edges of *K* is denoted by \(\partial K\), the set of edges in \(\mathcal {T}_h\) is denoted by \(\mathcal {E}_h\), and \(\mathcal {E}^{\partial }_h\) denotes the set of all boundary edges, i.e., those with all points in \(\varGamma \). Finally, the set of interior edges is denoted by \(\mathcal {E}_h^0 = \mathcal {E}_h\setminus \mathcal {E}^{\partial }_h\). For every element \(K\in {\mathcal {T}_h}\), there exists \(c>0\) such that \(h\le c h_e\), where \(h_e\) is the diameter of the edge \(e \in \partial K\) and *h*, the mesh parameter, is the element diameter. For each edge of an element *K* we associate a unit outward normal vector \(\mathbf {n}_K\).

*k*[22] are here denoted by \(\mathcal {U}_h^k\times \mathcal {P}_h^k\). We define the following sets of functions on the mesh skeleton:

*k*on

*e*.

From these definitions, we can write the following hybrid mixed formulation for the hydrodynamics problem (13):

*Given*\(S_\text {w}^{n}\)

*and*\(n_\text {D}^n\),

*find the pair*\([{\varvec{u}}_h,p_h] \in \mathcal {U}_h^k \times \mathcal {P}_h^k\)

*and the Lagrange multiplier*\(\lambda _h \in \mathcal {M}_h^k\)

*such that, for all*\([{\varvec{v}}_h, q_h, \mu _h] \in \mathcal {U}_h^k \times \mathcal {P}_h^k \times \bar{\mathcal {M}}_h^k\),

To solve the hybrid formulation (18)–(19) we apply the static condensation technique that consists in a set of algebraic operations, done at the element level, to eliminate all degrees of freedom corresponding to the variables \({\varvec{u}}_h\) and \(p_h\), leading to a global system with the degrees of freedom associated with the multipliers only.

We can observe that static condensation causes a major reduction in the size of the global problem, which is now rewritten in terms of the multiplier only. Also, the new system of equations is positive-definite, allowing for using simpler and more robust solvers. In the end, a hybrid formulation associated with static condensation leads to a great reduction of the computational cost required to solve the global problem. In this work, the deal.II library [3] is used to solve this hydrodynamics problem.

### 3.3 High Order Central-Upwind Scheme for the Transport Problem

The numerical methodology used to approximate the water saturation and bubble texture Eqs. (14) and (15) is a high-order non-oscillatory central-upwind finite volume method proposed in [18] and here referred to as KNP. Like many other finite volume methods, the KNP scheme is based on a grid of control volumes (or cells).

*i*and a cell of index

*l*, where \(l+1/2\) is the right (resp. top) face and \(j-1/2\) is the left (resp. bottom) face of a cell, \({\varvec{S}}^{-}_{l\pm 1/2,i}\) is the local reconstruction of \({\varvec{S}}\) at the left (resp. bottom) side of a face, and \({\varvec{S}}^{+}_{l\pm 1/2,i}\) is the local reconstruction of \({\varvec{S}}\) at the right (resp. top) side of a face; \(\varLambda _{{\varvec{X}}}^{\text {max}}\) and \(\varLambda _{{\varvec{X}}}^{\text {min}}\) are the maximum and minimum eigenvalues, respectively, of the Jacobian \(\partial {\varvec{f}}_i/\partial {\varvec{S}}\) at \({\varvec{S}}={\varvec{X}}\). The result of spatial discretization using KNP is the system of ODEs in conservative form:

*i*-th direction, with the convective numerical fluxes given by

Various numerical methods can be used to solve the system of ODEs (21). In this work, a variable order, adaptive step Backward Differentiation Formula (BDF) was chosen. This stable, implicit scheme allows for taking larger time steps than an explicit method would require, which reduces computational cost. In our numerical simulations we used the implementation of the BDF scheme from the CVode package, available in the SUNDIALS library [10].

## 4 Numerical Results

^{1}, rotated to the

*xy*plane. The right boundary is chosen to be the Dirichlet type (\(\varGamma _{D}\)) with \(\bar{p} = 0\), while left, top and bottom boundaries are set to Neumann condition (\(\varGamma _{N}\)) with \(\bar{u} < 0\) for the left boundary and \(\bar{u} = 0\) for the top and bottom boundaries. Coefficients and numerical parameters used in the simulations are shown in Table 1.

Simulation parameters.

Parameter | Value | Parameter | Value |
---|---|---|---|

Water viscosity Open image in new window [Pa s] | Porosity | ||

Gas viscosity Open image in new window [Pa s] |
| ||

Water residual saturation Open image in new window | \(K_\text {c} \) [1/ | ||

Gas residual saturation Open image in new window | Dimensions [m] | ||

Critical water saturation Open image in new window | Final time [s] | ||

Max foam texture Open image in new window [\(m^{-3}\)] | \(\Delta t_{\text {u}} [s]\) | ||

Injection velocity Open image in new window [\(\text {m s}^{-1}\)] | Number of cells | \(220\times 60\) | |

Initial water saturation Open image in new window | Minmod parameter \(\left( \theta \right) \) | ||

Injected water saturation Open image in new window | Absolute tolerance | ||

Initial foam texture (Open image in new window) | Relative tolerance | ||

Injected foam texture (Open image in new window) | \({\mathcal {RT}}\) index ( | 0 |

## 5 Conclusions and Remarks

In this work, we presented a locally conservative numerical algorithm to solve the gas-water flow including foam injection. The system of PDEs that models this phenomenon was derived considering a fractional flow formulation based on the global pressure. The numerical staggered approach proposed combines a high-order central upwind finite volume method for the hyperbolic equations adopting BDF time integrations with a hybrid finite element method to solve the Darcy’s problem employing Raviart-Thomas spaces.

The proposed methodology was applied to simulate regimes with pure gas-water injection and gas-water-foam flow. In this context, we have established a comparison between these two regimes considering two layers of SPE10 project with different heterogeneous permeability fields. The results, based on the model proposed in [2], point to the foam’s ability to reduce the gravity override and viscous fingering even in cases of porous media with rather pronounced preferential channels.

## Footnotes

## Notes

### Acknowledgements

The authors are thankful to Professor Pacelli P. L. Zitha for fruitful preliminary discussions.

## References

- 1.Afsharpoor, A.: Mechanistic foam modeling and simulations: gas injection during surfactant-alternating-gas processes using foam-catastrophe theory. Ph.D. thesis, Louisiana State University (2009)Google Scholar
- 2.Ashoori, E., Marchesin, D., Rossen, W.R.: Roles of transient and local equilibrium foam behavior in porous media: traveling wave. Colloids Surf. A Phys. Chemical Eng. Asp.
**377**, 228–242 (2011). https://doi.org/10.1016/j.colsurfa.2010.12.042CrossRefGoogle Scholar - 3.Bangerth, W., Hartmann, R., Kanschat, G.: deal.II - a general-purpose object-oriented finite element library. ACM Trans. Math. Softw.
**33**(4) (2007). https://doi.org/10.1145/1268776.1268779 - 4.Chavent, G., Jaffré, J.: Mathematical Models and Finite Elements for Reservoir Simulation: Single Phase, Multiphase and Multicomponent Flows Through Porous Media, vol. 17. North-Holland, Amsterdam (1986)zbMATHGoogle Scholar
- 5.Curtiss, C.F., Hirschfelder, J.O.: Integration of stiff equations. Proc. Natl. Acad. Sci. U. S. A.
**38**(3), 235 (1952)MathSciNetCrossRefGoogle Scholar - 6.Falls, A.H., Hirasaki, G.J., Patzek, T.W., Gauglitz, D.A., Miller, D.D., Ratoulowski, T.: Development of a mechanistic foam simulator: the population balance and generation by snap-off. SPE Reserv. Eng.
**3**, 884–892 (1988). https://doi.org/10.2118/14961-PACrossRefGoogle Scholar - 7.Farajzadeh, R., Lotfollahi, M., Eftekhari, A.A., Rossen, W.R., Hirasaki, G.J.: Effect of permeability on implicit-texture foam model parameters and the limiting capillary pressure. Energy Fuels
**29**(5), 3011–3018 (2015). https://doi.org/10.1021/acs.energyfuels.5b00248CrossRefGoogle Scholar - 8.Godunov, S.K.: A difference method for numerical calculation of discontinuous solutions of the equations of hydrodynamics. Mat. Sb.
**89**(3), 271–306 (1959)MathSciNetzbMATHGoogle Scholar - 9.Hematpur, H., Mahmood, S.M., Nasr, N.H., Elraies, K.A.: Foam flow in porous media: concepts, models and challenges. J. Nat. Gas Sci. Eng.
**53**, 163–180 (2018). https://doi.org/10.1016/j.jngse.2018.02.017CrossRefGoogle Scholar - 10.Hindmarsh, A.C., et al.: SUNDIALS: suite of nonlinear and differential/algebraic equation solvers. ACM Trans. Math. Softw.
**31**(3), 363–396 (2005)MathSciNetCrossRefGoogle Scholar - 11.Hirasaki, G.J.: A review of the steam foam process mechanisms (1989). SPE 19518Google Scholar
- 12.Hirasaki, G.J.: The steam-foam process. J. Pet. Technol.
**41**(5), 449–456 (1989). https://doi.org/10.2118/19505-PACrossRefGoogle Scholar - 13.Hirasaki, G.J., Lawson, J.B.: Mechanisms of foam flow in porous media: apparent viscosity in smooth capillaries. SPE J.
**25**(02), 176–190 (1985)Google Scholar - 14.Jones, S.A., Getrouw, N., Vincent-Bonnieu, S.: Foam flow in a model porous medium: I. The effect of foam coarsening. Soft Matter
**14**, 3490–3496 (2018). https://doi.org/10.1039/C7SM01903C - 15.Kam, S.I.: Improved mechanistic foam simulation with foam catastrophe theory. Colloids Surf. A Physicochem. Eng. Asp.
**318**(1), 62–77 (2008). https://doi.org/10.1016/j.colsurfa.2007.12.017CrossRefGoogle Scholar - 16.Kam, S.I., Nguyen, Q.P., Li, Q., Rossen, W.R.: Dynamic simulations with an improved model for foam generation. In: SPE Annual Technical Conference and Exhibition. Society of Petroleum Engineers (2004)Google Scholar
- 17.Kovscek, A.R., Patzek, T.W., Radke, C.J.: A mechanistic population balance model for transient and steady-state foam flow in boise sandstone. Chem. Eng. Sci.
**50**(23), 3783–3799 (1995). https://doi.org/10.1016/0009-2509(95)00199-FCrossRefGoogle Scholar - 18.Kurganov, A., Noelle, S., Petrova, G.: Semidiscrete central-upwind schemes for hyperbolic conservation laws and Hamilton-Jacobi equations. SIAM J. Sci. Comput.
**23**(3), 707–740 (2001). https://doi.org/10.1137/S1064827500373413MathSciNetCrossRefzbMATHGoogle Scholar - 19.Kurganov, A., Tadmor, E.: New high-resolution central schemes for nonlinear conservation laws and convection-diffusion equations. J. Comput. Phys.
**160**(1), 241–282 (2000). https://doi.org/10.1006/jcph.2000.6459MathSciNetCrossRefzbMATHGoogle Scholar - 20.Ma, K., Farajzadeh, R., Lopez-Salinas, J.L., Miller, C.A., Biswal, S.L., Hirasaki, G.J.: Non-uniqueness, numerical artifacts, and parameter sensitivity in simulating steady-state and transient foam flow through porous media. Transp. Porous Media
**102**(3), 325–348 (2014). https://doi.org/10.1007/s11242-014-0276-9CrossRefGoogle Scholar - 21.Ma, K., Ren, G., Mateen, K., Morel, D., Cordelier, P.: Modeling techniques for foam flow in porous media. SPE J.
**20**(3), 453–470 (2015)CrossRefGoogle Scholar - 22.Raviart, P.A., Thomas, J.M.: A mixed finite element method for 2-nd order elliptic problems. In: Galligani, I., Magenes, E. (eds.) Mathematical Aspects of Finite Element Methods. LNM, vol. 606, pp. 292–315. Springer, Heidelberg (1977). https://doi.org/10.1007/BFb0064470CrossRefGoogle Scholar
- 23.Smith, D.H. (ed.): Surfactant-Based Mobility Control. No. 373 in ACS Symp. Ser., Am. Chem. Soc., Washington, D.C. (1988)Google Scholar
- 24.Zitha, P.L.J.: A new stochastic bubble population model for foam in porous media. In: SPE/DOE Symposium on Improved Oil Recovery. Society of Petroleum Engineers (2006)Google Scholar
- 25.Zitha, P.L.J., Du, D.X., Uijttenhout, M., Nguyen, Q.P.: Numerical analysis of a new stochastic bubble population foam model. In: SPE/DOE Symposium on Improved Oil Recovery. Society of Petroleum Engineers (2006)Google Scholar