Hamdi Tchelepi (Principal advisor)

Similar documents
TIE-SIMPLEX METHOD FOR THERMAL-COMPOSITIONAL SIMULATION

COMPOSITIONAL SPACE PARAMETERIZATION METHODS FOR THERMAL-COMPOSITIONAL SIMULATION

TIE-LINE BASED PARAMETERIZATION FOR THERMAL COMPOSITIONAL RESERVOIR SIMULATION

On Two Flash Methods for Compositional Reservoir Simulations: Table Look-up and Reduced Variables

ELEMENT-BASED FORMULATIONS FOR COUPLED FLOW, TRANSPORT, AND CHEMICAL REACTIONS

PVTpetro: A COMPUTATIONAL TOOL FOR ISOTHERM TWO- PHASE PT-FLASH CALCULATION IN OIL-GAS SYSTEMS

Fluid Phase Equilibria

PORE-SCALE PHASE FIELD MODEL OF TWO-PHASE FLOW IN POROUS MEDIUM

18 a 21 de novembro de 2014, Caldas Novas - Goiás THERMODYNAMIC MODELING OF VAPOR-LIQUID EQUILIBRIUM FOR PETROLEUM FLUIDS

A Geothermal Reservoir Simulator with AD-GPRS

WETTABILITY CHANGE TO GAS-WETNESS IN POROUS MEDIA

UNIVERSITY OF CALGARY. Development of a Four-Phase Compositional Simulator Using Equations of State. Yizheng Wei A THESIS

Applications of Partial Differential Equations in Reservoir Simulation

Mo P057 Operator-based Linearization for Non-isothermal Multiphase Compositional Flow in Porous Media

Machine Learning Applied to 3-D Reservoir Simulation

Chapter Seven. For ideal gases, the ideal gas law provides a precise relationship between density and pressure:

dynamics of f luids in porous media

Enhanced Oil Recovery with CO2 Injection

Correlation Between Resistivity Index, Capillary Pressure and Relative Permeability

Fracture relative permeability revisited

Effect of Sorption/Curved Interface Thermodynamics on Pressure transient

Project 4: Navier-Stokes Solution to Driven Cavity and Channel Flow Conditions

A BENCHMARK CALCULATION OF 3D HORIZONTAL WELL SIMULATIONS

CYDAR User Manual Two-phase flow module with chemical EOR

Complexity of Two-Phase Flow in Porous Media

The role of capillary pressure curves in reservoir simulation studies.

MULTIPHASE EQUILIBRIUM CALCULATIONS WITH GAS SOLUBILITY IN WATER FOR ENHANCED OIL RECOVERY

Hydrocarbon Reservoirs and Production: Thermodynamics and Rheology

Ability of Darcy s Law for Extension in Two- Phase Flow for Sedimentary Medium in Capillary Non-equilibrium Situations

B024 RESERVOIR STREAMLINE SIMULATION ACCOUNTING

CHARACTERIZATION OF FRACTURES IN GEOTHERMAL RESERVOIRS USING RESISTIVITY

DECOUPLED AND MULTIPHYSICS MODELS FOR NON-ISOTHERMAL COMPOSITIONAL TWO-PHASE FLOW IN POROUS MEDIA

A Geothermal Reservoir Simulator in AD-GPRS

GENERALIZED PSEUDOPRESSURE WELL TREATMENT

Pore-Level Bénard Marangoni Convection in Microgravity

Petroleum reservoir simulation using EbFVM: the negative transmissibility issue

INFERRING RELATIVE PERMEABILITY FROM RESISTIVITY WELL LOGGING

Inlet Grid Block! Standard Grid Blocks Outlet Grid Point r Center of Rotation Equilibrium Grid Point Outlet Grid Block Figure 1 The Finite Dierence Gr

I. Borsi. EMS SCHOOL ON INDUSTRIAL MATHEMATICS Bedlewo, October 11 18, 2010

Simulation of T-junction using LBM and VOF ENERGY 224 Final Project Yifan Wang,

DETERMINING WETTABILITY FROM IN SITU PRESSURE AND SATURATION MEASUREMENTS

This paper was prepared for presentation at the Unconventional Resources Technology Conference held in Denver, Colorado, USA, August 2014.

arxiv: v1 [physics.comp-ph] 27 Jan 2019

A FRONT-TRACKING METHOD FOR HYPERBOLIC THREE-PHASE MODELS

The effect of heterogeneity on unsteady-state displacements

AN EXPERIMENTAL INVESTIGATION OF BOILING HEAT CONVECTION WITH RADIAL FLOW IN A FRACTURE

Local Time Step for a Finite Volume Scheme I.Faille F.Nataf*, F.Willien, S.Wolf**

Modeling and numerical approximation of multi-component anisothermal flows in porous media

PREDICTION OF INTRINSIC PERMEABILITIES WITH LATTICE BOLTZMANN METHOD

ROLE OF PORE-SCALE HETEROGENEITY ON REACTIVE FLOWS IN POROUS MATERIALS: VALIDITY OF THE CONTINUUM REPRESENTATION OF REACTIVE TRANSPORT

Analysis of a drainage efficiency in stratified porous media

Oil Field Production using Machine Learning. CS 229 Project Report

Investigation of Compositional Grading in Petroleum Reservoirs

A posteriori error estimates, stopping criteria, and adaptivity for multiphase compositional Darcy flows in porous media

This section develops numerically and analytically the geometric optimisation of

COMPARING DIFFERENT METHODS FOR CAPILLARY PRESSURE MEASUREMENTS

Effects of Viscous Dissipation on Unsteady Free Convection in a Fluid past a Vertical Plate Immersed in a Porous Medium

Comparison of the Effects of k-ϵ, k-ω, and Zero Equation Models on Characterization of Turbulent Permeability of Porous Media

CALCULATION OF THE COMPRESSIBILITY FACTOR AND FUGACITY IN OIL-GAS SYSTEMS USING CUBIC EQUATIONS OF STATE

THERMAL ADAPTIVE IMPLICIT RESERVOIR SIMULATION

EFFECT OF NON-EQUILIBRIUM MASS TRANSFER IN MISCIBLE GAS RECOVERY PROCESSES

Simulation of Imbibition Phenomena in Fluid Flow through Fractured Heterogeneous Porous Media with Different Porous Materials

A New Method for Calculating Oil-Water Relative Permeabilities with Consideration of Capillary Pressure

MEASUREMENT OF CAPILLARY PRESSURE BY DIRECT VISUALIZATION OF A CENTRIFUGE EXPERIMENT

TOUGH2 Flow Simulator Used to Simulate an Electric Field of a Reservoir With a Conductive Tracer for Fracture Characterization

Introduction to Chemical Engineering Computing, 2 nd edition, Bruce A. Finlayson, Wiley (2012)

2D-IMAGING OF THE EFFECTS FROM FRACTURES ON OIL RECOVERY IN LARGER BLOCKS OF CHALK

MODELING ASPHALTENE DEPOSITION RELATED DAMAGES THROUGH CORE FLOODING TESTS

Modeling seismic wave propagation during fluid injection in a fractured network: Effects of pore fluid pressure on time-lapse seismic signatures

CONVECTION HEAT TRANSFER

P1: IML/FFX P2: IML/FFX QC: IML/FFX T1: IML AT029-FM AT029-Manual AT029-Manual-v8.cls December 11, :59. Contents

ORDERING-BASED NONLINEAR SOLVER WITH ADAPTIVE COUPLING FOR MULTIPHASE FLOW AND TRANSPORT

Numerical Simulation of Viscous Fingering Phenomenon in Immiscible Displacement of Two Fluids in Porous Media Using Lattice Boltzmann Method

Numerical methods for the Navier- Stokes equations

INTERNAL FLOW IN A Y-JET ATOMISER ---NUMERICAL MODELLING---

DETERMINING THE DISTRIBUTION TEMPERATURE FIELD AROUND THE STEAM INJECTING WELLS BY USING THE ECLIPSE TM SIMULATOR

Evaluation of Petrophysical Properties of an Oil Field and their effects on production after gas injection

NONLINEARITY, SCALE, AND SENSITIVITY FOR PARAMETER ESTIMATION PROBLEMS: SOME IMPLICATIONS FOR ESTIMATION ALGORITHMS

THEORETICAL AND EXPERIMENTAL STUDY OF THE POSITIVE IMBIBITION CAPILLARY PRESSURE CURVES OBTAINED FROM CENTRIFUGE DATA.

VISUALIZING FLUID FLOW WITH MRI IN OIL-WET FRACTURED CARBONATE ROCK

FIELD SCALE RESERVOIR SIMULATION THROUGH A LATTICE BOLTZMANN FRAMEWORK. A Dissertation ZACHARY ROSS BENAMRAM

PORE-SCALE SIMULATION OF MASS TRANSFER ACROSS IMMISCIBLE INTERFACES

Equation of State. This chapter explores how to get the pressure given information from the governing conservation equations.

This paper was prepared for presentation at the International Symposium of the Society of Core Analysts held in Toronto, Canada, August 2005

Daniel C. Reda and Roger R. Eaton Sandia National Laboratories Albuquerque, New Mexico

TABLE OF CONTENTS CHAPTER TITLE PAGE

Diffusion and Reaction in Fe-Based Catalyst for Fischer- Tropsch Synthesis Using Micro Kinetic Rate Expressions

Lattice Boltzmann Method

Soft Bodies. Good approximation for hard ones. approximation breaks when objects break, or deform. Generalization: soft (deformable) bodies

Using LBM to Investigate the Effects of Solid-Porous Block in Channel

Mathematical Modeling of Oil Shale Pyrolysis

Application of the immersed boundary method to simulate flows inside and outside the nozzles

PETE 310 Lectures # 36 to 37

Pore-Scale Analysis of Interfacial Instabilities and Impact of Heterogeneity on Relative Permeability by Lattice Boltzmann Method

Fracture-Matrix Flow Partitioning and Cross Flow: Numerical Modeling of Laboratory Fractured Core Flood

THE SIGNIFICANCE OF WETTABILITY AND FRACTURE PROPERTIES ON OIL RECOVERY EFFICIENCY IN FRACTURED CARBONATES

Phenomenological Modeling of Critical Condensate Saturation and Relative Permeabilities in Gas/ Condensate Systems

Curriculum Vitae. Kjetil Braathen Haugen PO Box New Haven, CT USA

A Generalized Numerical Approach for Modeling Multiphase Flow and Transport in Fractured Porous Media

PHYSICS OF FLUID SPREADING ON ROUGH SURFACES

Transcription:

THERMODYNAMIC EQUILIBRIUM COMPUTATION OF SYSTEMS WITH AN ARBITRARY NUMBER OF PHASES FLOW MODELING WITH LATTICE BOLTZMANN METHODS: APPLICATION FOR RESERVOIR SIMULATION A REPORT SUBMITTED TO THE DEPARTMENT OF ENERGY RESOURCES ENGINEERING OF STANFORD UNIVERSITY IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER OF SCIENCE By Cédric Fracès Gasmi August 2010

I certify that I have read this report and that in my opinion it is fully adequate, in scope and in quality, as partial fulfillment of the degree of Master of Science in Energy Resources Engineering. Hamdi Tchelepi (Principal advisor) ii

Abstract Reservoir recovery processes involve complex mass and heat transfer between the injected fluid and the resident rock-fluid system. Thermal-compositional reservoir simulators can be used to plan such displacement processes, in which the phase behavior is computed with an Equation of State (EoS). These thermodynamic-equilibrium computations include phase-stability tests and flash calculations, and can consume a significant fraction of the total simulation time, especially for highly detailed reservoir models and a large number of components. Here, we propose a general Compositional Space Parameterization (CSP) method for complex mixtures, especially those where more than two fluid phases can coexist in parts of the parameter space. For a given pressure (P), temperature (T) and overall composition, a unique tie-simplex (tie-line for two phases, tie-triangle for three phases, etc.) can be defined. For a particular composition at P and T, the tie-simplex provides the necessary phase equilibrium information (i.e., phase state and phase compositions). For compositional flow simulation, a set of tie-simplexes can be calculated in a preprocessing step, or adaptively constructed during the simulation. The tie-simplex representation can be used to replace standard phase-equilibrium calculations completely, or it can be used as an initial guess for standard EoS calculations. Challenging examples with two and three phases are presented to validate this tie-simplex CSP approach. Standard EoS methods, which are widely used in industrial compositional simulators, are compared with CSP-based simulations for problems with large numbers of components and complex two- and three-phase behaviors spanning wide ranges of pressure and temperature. The numerical experiments indicate that our multi-dimensional tie-simplex representation combined with linear pressure and temperature interpolation in tie-simplex iii

space, which is implemented as an adaptive tabulation strategy, leads to highly robust and efficient computations of the phase behavior associated with compositional flow simulation. The characterization of reservoir models requires information such as porosity, permeability, relative permeability, and capillary pressure. Various techniques are used to describe the pore-scale details and model the flow dynamics. This knowledge is then used to estimate the macroscopic (Darcy-scale) properties and solve the macroscopic equations governing flow and transport in very large domains. We survey different pore-scale simulators based on Lattice Boltzman methods. We present qualitative and quantitative results obtained from available simulators, as well as, our own implementation of existing algorithms. We document and test different approaches and give an overview of the advantages and the challenges that remain to be resolved. iv

Acknowledgments I would like to express my sincere gratitude to my adviser Prof. Hamdi Tchelepi for his time, confidence, support and guidance. None of this would have been possible without him. I also wish to thank Dr. Denis Voskov for his trust, valuable comments and help. I wish to thank Lisette Quettier and Arthur Moncorge (Total) who gave me the opportunity to come to Stanford and initiated this adventure. I would also like to thank the Stanford University Petroleum Research Institute (SUPRI-B), and its affiliates for their financial support. I am very grateful to the staff of the Department of Petroleum Engineering who has contributed in creating an ideal environment for the development of research projects. I thank Youngseuk Kheem, Ratnanabha Sain and Tapan Mukerji for use of their Lattice Boltzmann Simulation code. I would like to thank warmheartedly my classmates, friends and beloved officemates, whose help and friendship made my stay at Stanford a wonderful experience. Special thanks to Guillaume Moog, Antoine Bertoncello, Mathieu Rousset, Sebastien Matringe, Bruno Dujardin, Danny Rojas, Mehrdad Honarkhah, Markus Buchgraber, Mohammad Al Dossary, Ekin Ozdogan, Israel Reyna, Mohammad Shahvali, Obi Isebor, Alejandro Leiva. Finally, I thank my family for their constant support and belief in me. v

Contents Abstract Acknowledgments Table of Contents List of Tables List of Figures iii v vi ix x 1 Thermodynamic Equilibrium: Arbitrary Number of Phases 1 1.1 Introduction................................ 1 1.2 Compositional space parametrization for systems with arbitrary numbers of phases............................... 3 1.2.1 General Thermodynamic Parameterization........... 3 1.2.2 Tie-simplex computation..................... 5 1.2.3 Interpolation in parameterized space.............. 7 1.3 CSP preconditioning for phase behavior computation......... 8 1.3.1 Negative flash........................... 8 1.3.2 CSP preconditioning, two-phase system............. 11 1.3.3 CSP preconditioning, three-phase systems........... 14 1.4 Simulation results............................. 17 1.4.1 Simulation results......................... 18 1.4.2 EoS-free approach......................... 20 vi

1.5 Conclusions................................ 22 2 Lattice Boltzmann Methods 26 2.1 Introduction to Lattice Boltzmann Method............... 26 2.1.1 Background............................ 27 2.1.2 Framework and Equations.................... 28 2.2 Single Component Single Phase, SCSP................. 33 2.2.1 Open Channel........................... 34 2.2.2 More complex Boundary conditions............... 35 2.3 Single Component Multiple Phases, SCMP............... 37 2.3.1 Interparticles Forces and interactions.............. 37 2.3.2 Equation of state......................... 38 2.3.3 Results............................... 38 2.3.4 LBM with surfaces, capillary dominated flow.......... 46 2.3.5 Contact Angles.......................... 46 2.3.6 Capillary Rise........................... 47 2.3.7 Hysteresis, wetting and non wetting phase........... 49 2.4 C apillary and viscous effects...................... 51 2.4.1 The physical network simulator................. 51 2.4.2 Phase diagram.......................... 53 2.5 LBM simulation of multi-component, multiphase flows........ 55 2.5.1 Phase separation......................... 58 2.5.2 MCMP LBM with surfaces.................... 59 2.5.3 Flow in porous media, permeability computation....... 60 2.6 Conclusion................................. 68 2.7 Acknowledgment............................. 73 A SSI and Newton for three phase system 74 A.0.1 Successive substitution iterations................ 74 A.0.2 Newton algorithm......................... 76 vii

B Workflow and Algorithms layout 78 B.1 Algorithms designs for CSP....................... 78 B.1.1 Tie simplex calculation...................... 78 B.1.2 Methods comparisons....................... 78 C Appendix Lattice Boltzmann Methods 81 C.1 Integration of Lattice Boltzmann laws to recover the Navier-Stokes equations................................. 81 viii

List of Tables 1.1 Numerical experiments for two-phase systems.............. 13 1.2 Numerical experiments for three-phase systems............. 16 ix

List of Figures 1.1 Two dimensional representation of two to six order simplex...... 4 1.2 Representation of tie-lines for a four components system {CO 2, C 1, C 4, C 10 } at T = 345 K and P = 50 bars (a) and tie-triangles for system {CO 2, N 2, C 1, H 2 S} at T = 130 K and P = 100 bar (b).................... 6 1.3 Ternary diagram for system {CO 2, C 1, C 16 } at p = 100 bars and T = 323 K................................. 10 1.4 Representation of tie-triangle, intersecting composition at two different pressures for a four components system {CO 2, N 2, C 1, H 2 S}...... 11 1.5 Sensitivity of the methods to the shift parameter............ 14 1.6 Phase diagram for {C 1, C 10, CO 2, H 2 O} at P = 50 bar (left) and 100 bar (right) T = 280K........................... 15 1.7 Phase diagram for {C 1, N 2, CO 2, H 2 S} at P = 100 bars T = 80 K (left) and 140 K (right)............................. 16 1.8 Degeneration of tie triangle into tie line for {C 1, C 10, CO 2, H 2 O} at p = 150 bars, T = 373 K.......................... 17 1.9 Representation of composition distributions for four components systems {C 1, C 10, CO 2, H 2 O} at t = 10 days and Projection in the compositional space with tie triangles at P = 40 bar(b).......... 18 1.10 Representation of the initial guess selection for two phases...... 19 1.11 Representation of simulation results and projections within the CS for {C 1, C 10, CO 2, H 2 O} system at t = 10 days............... 21 1.12 Representation of simulation results for {C 1, C 10, CO 2, H 2 O} system at t = 10 days................................. 21 x

1.13 Composition distributions for a 6 components systems {C 1, C 10, CO 2, NC 5, H 2 S, H 2 O} at t = 10 days............................... 22 2.1 (a) D2Q9 lattice, definition of lattice unit, and discrete velocities; (b) example of direction specific density distribution function f. Source [29]. 30 2.2 Illustration of mid-plane bounce-back movement of direction specific densities f i. The effective wall location is halfway between the fluid and solid nodes. Source [29]........................ 32 2.3 Flow in an open Channel......................... 35 2.4 Flow around a cylinder.......................... 36 2.5 Flow in a porous media.......................... 37 2.6 Representation of the pressure-density according to Eq. 2.19. ψ 0 = 4 and ρ 0 = 200. Two phases system for interaction amplitude G > 92.4..................................... 38 2.7 Phase separation in a open system with periodic boundary conditions. The liquid phase is defined arbitrarily and corresponds to a value larger than a given threshold.......................... 39 2.8 Density distribution over time in a porous media. Capillary effects are here neglected and no boundaries are accounted for at the edges.... 41 2.9 Representation of the D3Q19 lattice used for the three dimensional extension of the code........................... 42 2.10 Gravity segregation in a 3D system with closed boundary at the bottom. 43 2.11 Velocity field in a three dimensional channel at different time steps.. 44 2.12 Flow around an obstacle in a three dimensional case.......... 45 2.13 Simulation of the contact angle for Gads=-200 and G=-120...... 47 2.14 Simulation of a capillary rise for a 300 300 system for g = -0.000002 G ads = 250 and ρ = 523......................... 48 2.15 Young Laplace linear correlation between radius and pressure drop.. 49 2.16 Simulation of a drainage process in the abscence of gravity ρ in = 100 and ρ w = 523................................ 50 xi

2.17 Simulation of a drainage process in the presence of gravity ρ in = 100 and ρ w = 523................................ 51 2.18 100 x 100 simulations a t various viscosity ratio and capillary numbers: (a)logm = -4.7, from viscous fingering to capillary fingering: ( b ) logm = 1.9, from stable displacement to capillary fingering: (c) logc = 0, from viscous fingering to stable displacement (Source:[18])....... 54 2.19 Simulation of an equilibrium between two fluids represented by different components ρ 1 = 1ρ 2 = 0, G = 0.1.................. 58 2.20 Crossed density in order to decide surface position........... 59 2.21 Elements in the execution of the code. On the left, the input file and the pore structure. The program execution (middle) leads to the two phase flow simulation in the porous medium as well as the permeability computation................................ 61 2.22 Process of setting up the problem s geometry. Only the cells located inside the buffer region and associated to pore space are considered.. 62 2.23 Lattice structure and indexing chosen in the code............ 63 2.24 Invasion of a nonwetting fluid (blue) into a porous media saturated with a wetting fluid (transparent). The system has (125 125 125) nodes.................................... 66 2.25 Pore structure for the Fontainbleau sandstone sample.......... 66 2.26 Imbibition process. The wetting fluid (blue) invades the porous media characterizing a Fontainbleau sandstone................. 67 2.27 Drainage process. The non-wetting fluid (blue) invades the porous media characterizing a Fontainbleau sandstone............. 67 2.28 Imbibition process. Following the drainage presented in Fig. 2.27, the wetting fluid (transparent) invades the porous media already saturated with non wetting fluid (blue)....................... 68 B.1 Representation of the tie triangle calculation functions......... 79 B.2 Representation of the procedure handling the comparison between different methods............................... 80 xii

Section 1 Thermodynamic Equilibrium: Arbitrary Number of Phases 1.1 Introduction Enhanced oil recovery (EOR) of heavy hydrocarbons usually involve thermal processes that are described using a thermal-compositional model [3]. The equations that describe the flow, transport and thermodynamic behavior include mass and energy conservation and thermodynamic-equilibrium relations. The accurate description of the phase behavior of the multi-component multiphase mixtures as a function of pressure and temperature is a major challenge in compositional flow simulation. A thermodynamic approach using an Equations of State (EoS) is usually employed to describe the phase behavior. It is possible to determine the state of a mixture (phases) based only on the overall component compositions, pressure, and temperature. The use of an EoS based approach makes the simulation process time consuming. The thermodynamic-equilibrium equations are usually solved iteratively for each computational gridblock at every Newton iteration during a time step. Accurate and efficient integration of thermodynamic computations in compositional simulation has been the subject of several recent books [1], [8]. One of the widely used simplifications is the assumption of constant K-values, [4]. In this approach, the component equilibrium ratios between are taken to be a function 1

SECTION 1. THERMODYNAMIC EQUILIBRIUM: ARBITRARY NUMBER OF PHASES2 of pressure and temperature only, and this reduces the complexity of dealing with the nonlinear behaviors due to compositional dependence of the phase equilibrium equations. Extensions for this K-value approach have been proposed, [11], in which the equilibrium ratios are assumed to depend on the overall fraction of one of the components. However, this approximation is accurate only for low temperatures and can lead to difficulties in representing the phase behavior in the near-critical region. The determination of the phase state of the mixture is necessary to solve the system of conservation laws that describes multi-component, multi-phase transport in porous media. Once the phase state of a given gridblock is determined for the current nonlinear (Newton) iteration, the solution for the next iteration can be computed. The phase-state definition is an important aspect of compositional simulation. One needs to track the appearance and disappearance of the various phases. The disappearance of a phase is detected based on the saturation. When a phase saturation becomes negative, the phase is assumed to have disappeared. Phase appearance is usually treated using a phase stability analysis [9]. In this case, we need to determine the equilibrium state by computing the tangent plane distance (TPD) of the Gibbs energy function. This procedure must be performed for every single-phase cell at every nonlinear iteration of the flow computation process. It can be time consuming, especially when the numbers of phases and components are large. Michelsen et al. [6] presented a method to speed up the phase behavior computations for compositional mixtures in pipe flow. They proposed criteria for avoiding the phase stability test in single-phase fluids. This approach is very efficient for transient simulation where the compositions change slowly. Since most nonlinear solvers for reservoir simulation include limits on the compositional changes during an iteration, this method can be applied to gas injection processes as well. However, it is difficult to extend this method to systems with more than two phases, or for more sophisticated nonlinear solvers, in which significant changes in the mixture composition in gridblock can take place. While two-phase EoS computations associated with compositional flow simulation are becoming quite robust and efficient, reliable methods for handling multicomponent fluids with more than two phases are generally lacking. The purpose of

SECTION 1. THERMODYNAMIC EQUILIBRIUM: ARBITRARY NUMBER OF PHASES3 this work is to provide an alternative method for phase-behavior computations in flow simulation for systems with an arbitrary number of phases. Specifically, we propose a negative-flash based strategy within a compositional space parametrization (CSP) framework. Comparisons with standard EoS based approaches are used to demonstrate the effectiveness of our method. 1.2 Compositional space parametrization for systems with arbitrary numbers of phases We summarize the compositional space parameterization (CSP) framework, which serves as the basis of our approach. The details of the CSP framework are presented in [16]. 1.2.1 General Thermodynamic Parameterization The overall mole fraction of a component, z i, is usually used in thermodynamic equilibrium calculations. The independent mole fractions form a subset of R nc, where n c is the number of components, and can be expressed as follows: nc 1 = {(z 1... z nc ) R n c zi = 1, z i 0, i}. (1.1) This relation defines an (n c 1)-dimensional simplex in R nc. Geometrically, this means we can represent the compositional space using a line for two components, a triangle for three component ( 2 ), a tetrahedron for four components ( 3 ), and so on. Fig. 1.2.1 shows the projection in two dimension of a few simplexes. For higher dimensions, the visualization is more complex. In a multi-component multi-phase system, the state of thermodynamic equilibrium is defined by the volume fractions of the phases, ν j, and can be represented using an (n p 1)-dimensional tie-simplex defined as np 1 = {(ν 1... ν np ) R np νj = 1, ν j 0 j}. (1.2)

SECTION 1. THERMODYNAMIC EQUILIBRIUM: ARBITRARY NUMBER OF PHASES4 Figure 1.1: Two dimensional representation of two to six order simplex. where n p is the number of phases. Thus, we have a tie-line for two phases, a tietriangle for three phases, etc. The tie-simplex can be represented by the n p vertices that correspond to the equilibrium fractions, namely, V 1 = x i,1, V 2 = x i,2,... V np = x i,np, (1.3) where x i,j is the mole fraction of component i in phase j. The relationship between the overall mole fraction, z i, and the phase equilibrium fractions is given by n p z i = x i,j ν j. (1.4) j=1 Notice that there are only n c 1 independent z i because of the constraint that phase fractions must add up to unity. Combining this equation with the linear constraint for ν j, we have n p x i,j ν j = z i, i = 1,..., n c 1 (1.5) j=1 n p ν j = 1 (1.6) j=1 Now, consider the subspace J of {i = 1,..., n c 1} with dimension n p 1. Then, we can represent the vector ν as the solution of the equation where e = [ 1,..., 1 x J e ν = z J 1, (1.7) ] is the unit vector. Substitution of this solution in the other equations, I = {i = 1,..., n c 1}/J, we finally get a system that parameterizes the

SECTION 1. THERMODYNAMIC EQUILIBRIUM: ARBITRARY NUMBER OF PHASES5 compositional space, in terms of tie-simplexes as follows: z I = x I ν = x I x J e 1 z J 1, (1.8) or in more familiar form z I = Az J + b, (1.9) where A is a matrix whose dimensions are [(n c n p ) (n p 1)] and b is a vector with [n c n p ] entries. Equation (1.8) defines a complete parametrization for multicomponent systems with an arbitrary number of phases. 1.2.2 Tie-simplex computation We extend the tie-line approach for the representation of the two-phase compositional space (i.e., two hydrocarbon phases) with a predefined density, [5]. The method is extended for any number of phases, and we use a tie-simplex for the representation of the multi-phase (more than two phases) thermodynamic equilibrium of mixtures with large numbers of components. We start with a definition of the initial face of a tie simplex. For a system with n p -phases, this face represents an n p -dimensional subspace of the n c -dimensional compositional space. For two-phase systems, we need to start from the edge that represents the longest tie-line; for three phases, we start from the face (triangle) that encloses the largest tie-triangle, and for four phases, one starts from the tetrahedral cell that contains the largest tie-tetrahedron, etc. From the initial face, a negative-flash procedure is performed in order to find the first tie-simplex. This simplex is defined by the phase fraction vector, x. Starting from the center of the simplex z = j x j 1 n p. (1.10) An orthogonal shift with length D in the direction of one of the secondary components, i can be made; the corresponding coordinates for the shift in the primary components

SECTION 1. THERMODYNAMIC EQUILIBRIUM: ARBITRARY NUMBER OF PHASES6 J are defined based on the normal vector d j = det(x j J), where X j J is a square matrix X J with column j replaced by 1. The shift correction, z, orthogonal to tie-simplex face is given by z J = D d j d j, z i = D. (1.11) The negative-flash procedure is performed starting from the shifted point z + z in order to calculate the next tie-simplex. Notice that the previous fractions, x, can be used as an initial guess for this step. The tie-simplex calculations are repeated recursively for all directions from I until any z fractions becomes negative, or a critical (degenerate) tie-simplex is encountered. The result yields a set of tie-simplexes that parameterize the n p -phase region completely. In Fig. 1.2, you can see the endpoints of tie-lines that fully parameterize the two-phase region for a four-component system. Fig. 1.2,b represents the parameterization of the three-phase region for a four-component system. (a) (b) Figure 1.2: Representation of tie-lines for a four components system {CO 2, C 1, C 4, C 10 } at T = 345 K and P = 50 bars (a) and tie-triangles for system {CO 2, N 2, C 1, H 2 S} at T = 130 K and P = 100 bar (b). The tie-simplex calculation method is a reasonable approach if the number of equilibrium phases is close to the number of components. For systems with large numbers of components, the level of recursion in order to calculate all directions from

SECTION 1. THERMODYNAMIC EQUILIBRIUM: ARBITRARY NUMBER OF PHASES7 I is equal to n c n p can be prohibitive. For practical general-purpose simulation, adaptive tabulation of the tie-simplexes is recommended. 1.2.3 Interpolation in parameterized space The tie-line interpolation procedure presented in [15] is extended to general multicomponent systems, in which an arbitrary number of phases can coexist at equilibrium. Interpolation in tie-simplex space is possible from observations of the smoothness of the solution space associated with flash computations when analyzed in terms of the tie-simplex, γ, parameter, [5]. Interpolation among tie-simplexes as a function of the γ-parameter is performed using the natural-neighbor interpolation method, [12], where the n c n p -dimensional tie-simplex space is triangulated. For any tessellation of scattered data, interpolation of any point inside a hyper-triangle is performed, namely, n λ i = a i,k γ k + b i, i = 1,..., n + 1, (1.12) k=1 where the λ i denote the barycenter coordinates of each neighbor (n + 1 neighbors for n-dimensional space), γ k is the coordinate of the interpolated point in the k direction. In order to find the coefficients a i,k and b i, we use the barycenter coordinates, which serve as a basis vector for each vertex. Thus, we can write a system of equations for each vertex as e i = Γa i + b i, i 1,..., n + 1 (1.13) Here, Γ is a matrix of the coordinates of all the neighbors ((n + 1) n), and e i is a unit vector (e 1 = [1, 0,..., 0], e 2 = [0, 1, 0,..., 0], etc.). In order to find coefficients a i and b i, we solve Eq. 1.13 for each e i. That is, we compute the inverse of the matrix [Γ 1]. For a given z, the tie-simplex that intersects this composition must be computed. Inside a hyper-triangle, linear interpolation is used. For this purpose, the exact solution of the following problem: ν = α t z J + β t, t, (1.14)

SECTION 1. THERMODYNAMIC EQUILIBRIUM: ARBITRARY NUMBER OF PHASES8 f i = j x t i,jν j z i = 0, i I. (1.15) is computed. For the compositional space, the dimension n from Eq. 1.12 is equal to n c n p. Using Eq. 1.12, we can write the following linear system faγ = fb. (1.16) The solution of this system, γ, provides the barycenter coordinates for tie-simplex interpolation. 1.3 CSP preconditioning for phase behavior computation In this section, we describe how to use the CSP framework to deal with phasebehavior computations of multi-phase, multi-component systems. First, a general preconditioning strategy based on the negative-flash procedure is presented. Then, computational results for two and three-phase computations are reported. 1.3.1 Negative flash The main purpose of this work is to demonstrate that the tie-simplex parameterization of the compositional space combined with a negative-flash procedure provides a general method to solve phase behavior problems of multi-phase systems. The essence of the negative-flash strategy and challenges related to standard EoS methods are described first. The phase behavior of multi-phase, multi-component systems is usually defined by thermodynamical-equilibrium relations. In compositional flow simulation, the first step is the phase-stability test, which helps to determine the number of stable phases for the mixture at prevailing p and T. Usually, this phase-stability test is performed using a minimization of Gibbs free energy [8], or the tangents plane distance (TPD) criterion [9].

SECTION 1. THERMODYNAMIC EQUILIBRIUM: ARBITRARY NUMBER OF PHASES9 Once the number of stable phases is determined, one must compute the component mole fractions of each phase. This is usually performed using a flash calculation, [10]. The system that describes the flash problem can be written as: f i,j (p, T, x i,j ) f i,k (p, T, x i,k ) = 0, j k {1,..., n p }, i [1,... n c ], (1.17) n p z i ν j x i,j = 0, i [1,... n c ], (1.18) n c j=1 n p j=1 ν j 1 = 0, (1.19) (x i,j x i,k ) = 0, j k {1,..., n p }. (1.20) i=1 Here p, T, and z i denote pressure, temperature, and overall mole fraction of component i, respectively; x i,j and ν p represent phase mole fractions. We assume that p, T, and z i are known, and that the f i,j are governed by a nonlinear function. The objective is to find x i,j and ν p. This nonlinear system is usually solved by a combination of Successive Substitution Iterations (SSI) and Newton s method. Instead of using this two-stage approach of phase-stability and flash computations, a negative-flash procedure ([7]) can be used. It is similar to the standard flash except for allowing the phase fractions, ν j, to be negative, or exceed unity. It is shown, [17], that ν j is bounded by ν min and ν max, which are the asymptotic values of the Rachford- Rice equation. The mole fractions obtained from the negative flash procedure define a tie-simplex, and the overall composition belongs to a sub-space defined by this simplex. An example of a two-phase system and associated tie-lines is shown in Fig. 1.3. There are several challenges associated with the standard negative-flash procedure. The first is related to the initial guess used to start the iteration process. Convergence of the negative-flash procedure is quite sensitive to the quality of this initial guess. For two-phase systems, one can use Wilson s correlation, [18]. Unfortunately, that correlation is not applicable for systems with more than two phases. Another problem is the convergence difficulties in the near-critical region (see Fig. 1.3), where the K- values are very close to unity.

SECTION 1. THERMODYNAMIC EQUILIBRIUM: ARBITRARY NUMBER OF PHASES10 Figure 1.3: Ternary diagram for system {CO 2, C 1, C 16 } at p = 100 bars and T = 323 K. The CSP approach can be used to avoid most of these difficulties. The closest parameterized tie-simplex that intersects the given overall composition can be obtained using criteria based on equations (1.7)-(1.8). Specifically, ν = z J 1 x J e 1 (1.21) z I x I ν < ε. (1.22) This is a weak statement of the criterion that the length of a projection from a given composition to the supporting tie-simplex is limited by ε. If the closest tie-simplex is the critical one (as defined by the multi-dimensional volume of the tie-simplex), the composition belongs to the near-critical region. If the closest tie-simplex is different from the critical one, we can use this tie-simplex as an initial guess for negative-flash computations. Interpolation among the set of neighboring tie-simplexes usually leads to better quality of the initial guess for the negative-flash procedure.

SECTION 1. THERMODYNAMIC EQUILIBRIUM: ARBITRARY NUMBER OF PHASES11 For the sub-critical region, the obtained tie-simplex can be used as a preconditioner for negative-flash computations. In previous work, we demonstrate the efficiency of phase-behavior computations based on interpolation of the tie-lines as a function of pressure, [15] and [13]. Here we implement a similar idea to using the tie-simplex set generated for a fixed number of discrete pressures in the interval of interest. For any given pressure and overall composition, we find the intersecting tie-simplex from the phase diagrams of the two closest pressures. An example of a three-phase system is shown in Fig. 1.4. Using linear interpolation, the resulting tie-simplex is computed. This tie-simplex represents the result of the phase split for the given pressure and composition. (a) (b) Figure 1.4: Representation of tie-triangle, intersecting composition at two different pressures for a four components system {CO 2, N 2, C 1, H 2 S}. 1.3.2 CSP preconditioning, two-phase system Here, we employ negative-flash based CSP approach for two-phase systems. A tieline set is generated and used to improve the standard negative-flash method. As discussed in [13], we can find the closest tie-line and determine if the composition belongs to the critical or sub-critical (below critical tie-line surface) regions. If the closest tie-line is critical (based on the tie-line length), then the mixture belongs to

SECTION 1. THERMODYNAMIC EQUILIBRIUM: ARBITRARY NUMBER OF PHASES12 the near-critical region. One possible approach for the determination of the critical single-phase state can be the use of the projection point, which appears to be more accurate than other approaches used in simulation, [14]. In this work we use the computed tie-line to precondition the negative-flash procedure. Linear interpolation among the neighboring tie-lines can be used to improve the computational efficiency, especially for cases with a low density (smaller number) of tie-lines. Based on the supporting tie-lines, we can judge when a composition is far enough from the two-phase envelope boundary, and this can help to avoid performing a negative-flash. Such a strategy is similar to the CSAT approach, [15]; the only difference is that in the CSAT method, tie-lines are generated only for a limited number of compositions along the solution route. To investigate the numerical performance of the negative-flash CSP based approach, we use four test cases: Case 1: 3 {C 4, C 1, C 10 }, shift = 0.01. Case 2: 4 {CO 2, C 4, C 1, C 10 }, shift = 0.01. Case 3: 5 {CO 2, C 1, C 3, NC 5, C 10 }, shift = 0.03. Case 4: 6 ({CO 2, C 4, C 1, C 6, C 7 C 10 }, shift = 0.05. The shift parameter is a measure of the density of the initial tie-lines that are preprocessed (pre-computed) in the CSP method. The smaller the shift, the higher the tie-line density. For each case, the temperature is fixed and three different pressures are used. One thousand randomly generated overall molar fractions, z i, are used as input for negative-flash computations starting from different initial guesses. The first (standard) type of initial guess is the Wilson formula. Two additional initial-guess strategies are used: the closest tie-line (CSP closest), and interpolation among neighboring tie-lines (CSP interpolation). The last method (boundary limit) is a modification of the first strategy, where phase-equilibrium calculations are bypassed when the projection of the overall composition to the closest tie-line is far from the boundary of the two-phase envelope (case where the system is clearly in a one phase equilibrium).

SECTION 1. THERMODYNAMIC EQUILIBRIUM: ARBITRARY NUMBER OF PHASES13 Table 1.1: Numerical experiments for two-phase systems. Iterations (average) Case Pressure Temperature Standard CSP CSP Boundary (bar) (K) closest interpolation limit 70 289 5.0 3.3 3.0 2.9 1 100 289 5.4 3.6 3.2 2.3 140 289 6.3 4.0 3.7 1.1 70 289 5.1 3.9 3.5 3.4 2 100 289 6.3 4.5 3.2 2.2 140 289 8.4 5.1 4.6 1.6 70 289 5.2 4.3 3.4 3.2 3 100 289 7.3 5.3 3.9 2.1 140 289 9.1 6.0 5.2 1.1 50 345 5.0 3.8 3.4 3.8 4 70 345 5.1 4.1 3.9 3.6 100 345 6.1 4.2 4.1 2.4 Table 1.2 presents the results of the numerical experiments, in terms of the average number of iterations required by each method to reach a converged solution. The results indicate that preconditioning of the negative-flash procedure improves the efficiency quite significantly. Since Wilson s formula provides a good approximation for low pressures, preconditioning leads to more significant efficiency gains for high pressure values. Avoiding phase-behavior computations based on the closest supporting tie-line leads to the best results for higher pressures, since the two-phase region is rather small. The shift parameter determines the density of the initial set of tie-lines used for CSP. A larger shift leads to fewer tie-lines, but lower quality initial guesses. Fig. 1.5 shows the performance of the negative-flash with three different initial guesses as the shift parameter is varied. As expected, increasing the shift parameter leads to more iterations to achieve convergence. However, even for a relatively large shift, the negative-flash combined with CSP preconditioning outperforms the standard flash procedure preconditioned by Wilson s correlation.

SECTION 1. THERMODYNAMIC EQUILIBRIUM: ARBITRARY NUMBER OF PHASES14 Figure 1.5: Sensitivity of the methods to the shift parameter. 1.3.3 CSP preconditioning, three-phase systems We apply our general tie-simplex preconditioning strategy, and we demonstrate the approach for three-phase systems, such as CO 2, water (steam) and hydrocarbons, or mixtures of sour-gas and hydrocarbons. In order to solve the system of Eq. 1.17-1.20 for arbitrary numbers of phases, we use the negative-flash method. A combination of SSI and Newton s method is used in a manner similar to the two-phase approach. Since there is no standard method for the computation of an initial guess for multi-phase flash calculations with an arbitrary number of phases, we refer to using the largest tie-simplex in the system at a given pressure for the initial guess as the standard method. Obviously, this tiesimplex belongs to a (hyper) plane that connects the compositions with the largest n p K-values in the system (see plane {C 1, C 10, H 2 O} e.g., Fig. 1.6). In Figs. 1.6 and 1.7, one can see the three-phase, four-component system with parameterized tie-triangles, which we are going to study. For a given set of parameters (pressure and temperature), this system has a fully extendable three-phase region,

SECTION 1. THERMODYNAMIC EQUILIBRIUM: ARBITRARY NUMBER OF PHASES15 Figure 1.6: Phase diagram for {C 1, C 10, CO 2, H 2 O} at P = 50 bar (left) and 100 bar (right) T = 280K. and no critical tie-triangles are present. However, one can see that at higher values of the parameters, there are a few tie-triangles that are close to degeneration (see plane {C 1, CO 2, H 2 O} in Fig. 1.6,b or {C 1, CO 2, N 2 } in Fig. 1.7,b). Numerical tests were performed for the following mixtures: Case 1: 4 components with water C 1, C 10, CO 2, H 2 O, shift = 0.01. Case 2: 4 components with sour gas C 1, N 2, CO 2, H 2 S, shift = 0.01. Case 3: 5 components with water C 1, C 10, CO 2, H 2 S, H 2 O, shift = 0.03. Case 4: 6 components with water C 1, C 10, CO 2, NC 5, H 2 S, H 2 O, shift = 0.03. The testing procedure is similar to the one described for the two-phase systems. We compare the results for three different initial guess strategies: standard, closest tietriangle, and tie-triangle interpolation. The last method bypasses the negative-flash procedure, if a composition is far from the boundary of the three-phase region. The results of these comparisons are similar to the two-phase results. CSP preconditioning greatly improves the efficiency of the negative-flash computations, especially at high pressures. The limitation is that negative-flash computations are especially effective far from the boundary of a three-phase region (defined based on projection to the

SECTION 1. THERMODYNAMIC EQUILIBRIUM: ARBITRARY NUMBER OF PHASES16 Figure 1.7: Phase diagram for {C 1, N 2, CO 2, H 2 S} at P = 100 bars T = 80 K (left) and 140 K (right). Table 1.2: Numerical experiments for three-phase systems. Iterations (%) Case Pressure (bar) Temperature (K) Standard CSP CSP Boundary closest interpolation limit 100 80 10.4 9.8 9.7 9.7 1 100 110 13 12.6 12.2 11.3 100 140 37.2 12.2 11.1 9.6 10 289 6.2 5.8 5.7 5.8 2 50 289 9.1 7.6 7.3 6.5 100 289 10.4 9.05 7.2 5.7 100 289 10.1 9.5 8.2 6.3 3 125 289 15.3 10 9.7 3.25 150 289 37.5 15.2 11.1 4.3 10 289 6.6 5.9 5.7 5.9 4 50 289 7.5 6.4 6.1 5.5 100 289 15.7 11.9 10.9 2.13

SECTION 1. THERMODYNAMIC EQUILIBRIUM: ARBITRARY NUMBER OF PHASES17 supporting tie-triangle), and that makes CSP preconditioning a very efficient method for high-pressure systems. All of the results presented here correspond to thermodynamical systems without tie-simplex degeneration. However, the criteria used to determine if a composition belongs to the near-critical region can be extended to an arbitrary number of phases. In Fig. 1.8, one can see a degenerate tie-triangle and the corresponding critical plane. Here, the tie-lines of the three-component system {C 1, CO 2, C 10 } reach the critical Figure 1.8: Degeneration of tie triangle into tie line for {C 1, C 10, CO 2, H 2 O} at p = 150 bars, T = 373 K. point, which corresponds to the critical tie-triangle for the four-component (including water) system. The identification of the mixture state, similar to two-phase systems, can be implemented for mixtures with an arbitrary numbers of phases. If the closest tie-simplex is the critical one (as determined by the (multi-dimensional) volume of the tie-simplex), then the composition belongs to the near-critical region. 1.4 Simulation results In this section, we study the applicability of the CSP-based approach for reservoir flow simulation. First, the CSP preconditioning is tested versus a standard method.

SECTION 1. THERMODYNAMIC EQUILIBRIUM: ARBITRARY NUMBER OF PHASES18 (a) (b) Figure 1.9: Representation of composition distributions for four components systems {C 1, C 10, CO 2, H 2 O} at t = 10 days and Projection in the compositional space with tie triangles at P = 40 bar(b) Then, an EoS-free approach based on tie-triangle interpolation is presented. 1.4.1 Simulation results To study the CSP-based phase behavior computations, we used a Matlab-based research simulator built for testing thermal adaptive implicit formulations [2]. The original phase behavior computations are based on minimization of Gibbs energy, [8] and use a Quasi-Newton method. This approach, while rigorous, can be relatively costly when the number of components and phases increase. To test the CSP-based approach, the negative-flash procedure was used with different types of preconditioning as described in the previous section. The test case is a reservoir described by a 50 1 1 grid with injection of a mixture composed of {C 1 (10%), C 10 (10%), CO 2 (40%), H 2 O(40%)} at 289 K. The pressures range from 70 to 1 bar (flow-rate injection specification). Fig. 1.9 shows a comparison between the original Matlab compositional simulator and our CSP-based simulation. The compositional profiles and projection of both solutions into the compositional space are shown in the figure. The initial guess for CSP-based simulation was determined by the

SECTION 1. THERMODYNAMIC EQUILIBRIUM: ARBITRARY NUMBER OF PHASES19 Figure 1.10: Representation of the initial guess selection for two phases closest tie-simplex. The number of iterations is about the same for both approaches, but the negative-flash iterations are usually much less expensive than for the method based on minimization of Gibbs energy. As you can see, the simulation results of the two methods are nearly identical. Several challenges remain with respect of implementing our negative-flash CSP method into a general-purpose reservoir simulator. One challenge is the transition between the N p -phase region and any lower-dimensional space. In the three-phase case, this corresponds to solving a two-phase problem from the three-phase envelope extension (Fig. 1.10). When the mixture switches to two phases, a two-phase flash is required to determine the fractions and compositions of the remaining phases, and an initial guess is required. We solve this problem by picking one edge of the tie-triangle as the initial tie-line. Since tie-line based computations of two-phase systems have been demonstrated convincingly. This would mean computing tie lines for regions (1) and (2) shown

SECTION 1. THERMODYNAMIC EQUILIBRIUM: ARBITRARY NUMBER OF PHASES20 in Fig. 1.10. However, Fig. 1.10 represents a ternary diagram with constant K- values. In real cases, super-critical effects may appear and the two-phase envelope may degenerate into a point (see Fig. 1.3). 1.4.2 EoS-free approach One of the advantages of the CSP approach is the possibility to avoid EoS related computations during a simulation run, since the pre-computed tie-simplex set provides a parameterization of the compositional space. Tie-simplex interpolation provides a continuous description of the entire compositional space, not only as a function of pressure, but also as a function of the tie-simplex parameter, γ. Even when the density of the tie-simplex set is small, the precision of linear interpolation among the tie-simplexes is usually quite good. In previous work, [15], the efficiency of the EoSfree approach was demonstrated for tie-line parameterization; here we demonstrate it for tie-triangles. We run the same type of simulation for standard phase-behavior computations that include negative-flash and EoS-free calculations based on interpolation of the tie-simplexes. Fig. 1.11 shows a comparison of these two strategies for the system {C 1, C 10, CO 2, H 2 O}. The solution displays the same patterns as for the standard EoS computation case, especially for the components characterizing the liquid phase. The next example is a slight modification of the previous system. In Fig. 1.12, one can see that the results obtained by the two methods, namely, standard EoS simulation and EoS-free tie-simplex interpolation, are quite comparable. We now show an example with more components: the reservoir is now injected with a mixture of {C 1 (15%), C 10 (20%), CO 2 (30%), NC 5 (5%), H 2 S(5%), H 2 O(55%)} at 289 K. It is difficult to represent the compositional path in such a high-dimensional space, but the results obtained (see Fig. 1.13) confirm the excellent behavior of the EOS-free method vs. a negative-flash based approach.

SECTION 1. THERMODYNAMIC EQUILIBRIUM: ARBITRARY NUMBER OF PHASES21 (a) (b) Figure 1.11: Representation of simulation results and projections within the CS for {C 1, C 10, CO 2, H 2 O} system at t = 10 days. (a) (b) Figure 1.12: Representation of simulation results for {C 1, C 10, CO 2, H 2 O} system at t = 10 days.

SECTION 1. THERMODYNAMIC EQUILIBRIUM: ARBITRARY NUMBER OF PHASES22 Figure 1.13: Composition distributions for a 6 components systems {C 1, C 10, CO 2, NC 5, H 2 S, H 2 O} at t = 10 days. 1.5 Conclusions In this section of the report, we proposed a new approach to precondition negativeflash calculations using tie-simplex compositional space parameterization. The approach is shown to outperform standard methods, in terms of stability and robustness. The EoS-free procedure was found to be very promising in terms of speeding up compositional reservoir simulation. Although we limited the scope of this work to the presentation of the methodology and initial validation examples, further testing involving detailed reservoir models with large numbers of components and fluid phases is under investigation.

Bibliography [1] Firoozabadi A. Thermodynamics of Hydrocarbon Reservoirs. New York, NY: McGraw-Hill, 1999. [2] Tchelepi H. Agarwal A., Moncorge A. Criteria for the thermal adaptive implicit method. SPE Annual Technical Conference and Exhibition, (SPE 103060), September 2006. held in San Antonio, Texas. [3] K. Aziz and A. Settari. Petroleum Reservoir Simulation. Applied Science Publishers, 1979. [4] K. Aziz and T.W. Wong. Considerations in the development of multipurpose reservoir simulation models. Proceedings of the 1st and 2nd International Forum on Reservoir Simulation, September 1988-1989. [5] Voskov D.V. Entov V.M., Turetskaya F.D. On approximation of phase equilibria of multicomponent hydrocarbon mixtures and prediction of oil displacement by gas injection. 8th European Conference on the Mathematics of Oil Recovery, Freiburg, Germany, September 2001. [6] Rasmussen C.P. Krejbjerg K. Michelsen M.L. Bjurstrom K.E. Increasing of computational speed of flash calculations with applications for compositional, transient simulations. SPE REE, February 2006. [7] Y.K. Li and L.X. Nghiem. The development of a general phase envelope construction algorithm for reservoir fluid studies. 57th Annual Fall Technical Conference and Exhibition, New Orleans, (SPE Paper 11198), September 1982. 23

BIBLIOGRAPHY 24 [8] M.L. Michelsen and J.M. Mollerup. Thermodynamic Models: Fundamentals and Computational Aspects. Tie-Line Press, Holte, Denmark, 2004. [9] Michelsen M.L. The isothermal flash problem: Part i. stability. Fluid Phase Equilibria, 9:1 19, 1982. [10] Michelsen M.L. The isothermal flash problem: Part ii. phase-split calculation. Fluid Phase Equilibria, 9:21 40, 1982. [11] L.X. Nghiem and Y.K Li. Phase-equilibrium calculations for reservoir engineering and compositional simulation. Second International Forum on Reservoir Simulation, Alpbach, Austria, September 1988. [12] Sibson R. Interpreting Multivariate Data. In Vic Barnet, editor, Chichester, 1981. A Brief Description of Natural Neighbor Interpolation. [13] Tchelepi H. Voskov D. Compositional space parameterization for miscible displacement simulation, transport in porous media. (DOI: 10.1007/s11242-008- 9212-1), March 2008. [14] Tchelepi H. Voskov D. Compositional space parameterization: Multi-contact miscible displacements and extension to multiple phases. SPE Journal, (113492), April 2008. presented at 2008 SPE/DOE Symposium on Improved Oil Recovery, Tulsa, Oklahoma. [15] Tchelepi H. Voskov D. Compositional space parameterization: Theoretical background and application for immiscible displacements. SPE Journal, (106029), February 2008. presented at 2007 SPE Reservoir Simulation Symposium, Woodlands, TX. [16] Tchelepi H. Voskov D. Mathematical framework for general multi-phase thermodynamical equilibrium computation. September 2008. Proc: 11th European Conference on the Mathematics of Oil Recovery, Bergen, Norway. [17] C.H. Whitson and M.L. Michelsen. The negative flash, fluid phase equilibria. Fluid Phase Equilibria, 53:51 71, 1989.

BIBLIOGRAPHY 25 [18] G. M. Wilson. A modified redlich-kwong equation of state, application to general physical data calculations. National A.I.Ch.E Meeting, 65(15C), 1969.

Section 2 Lattice Boltzmann Methods 2.1 Introduction to Lattice Boltzmann Method When simulating the fluid dynamics of a system, one traditionally thinks about the continuity of mass and momentum (Navier Stokes equations, Eq. 2.1) and 2.2. ρ t ρu t + (ρu) = 0............................... (2.1) + (ρuu) = p........................... (2.2) The density of the fluid at a given location is modified under the effect of convective and diffusive forces. In order to properly simulate these equations, we need to discretize the derivatives using finite-difference or finite-element methods. This process conserves mass and momentum up to a certain degree of approximation depending on the discretization schemes used. In reservoir simulation, the governing equations are formulated at a macroscopic, in which Darcy s law is used to describe the relation between the flux and the pressure gradient. However, this approach relies on knowledge of the permeability field. At this scale, the transport properties of rocks have been estimated experimentally in laboratories or through the use of empirical relations (Karman Cozeny, porosity correlations). The Lattice Boltzmann Method (LBM) has been used to model the fluid dynamics at the pore scale. 26

SECTION 2. LATTICE BOLTZMANN METHODS 27 A conventional Darcy-scale representation fails to represent certain porous-media problems, such as immiscible flow and transport in the presence of large contrasts in the density and viscosity of the two fluid phases [25]. For such cases, only the rigorous solution of the fluid dynamics at the pore scale can capture the complexity of the flow. In this section, we give an overview of Lattice Boltzmann methods for single and two phase fluids with one and two components. We present some preliminary results for two and three dimensional test cases that can be of interest for many reservoir simulation problems. 2.1.1 Background The lattice gas method (LGM) was proposed in seventies [13]. In this model, particles could move on a discrete lattice, propagate and collide like they would at the microscopic scale. The basic idea is to employ rules for transport using a discrete (Lattice) model to model the behavior at macroscopic scales, including the pore and Darcy [19]. LGM typically gives noisy results, is very difficult to interpret, and is difficult to formulate in three space dimensions. It has been found that if we replace the discrete particles with a density distribution, we can efficiently eliminate the noise and describe the dynamics in three dimensions more accurately [2]. These ideas have evolved into the Lattice Boltzmann Method (LBM). LBM is particulary useful for modeling complicated boundary conditions and interface problems. Recent extensions of this method include simulation of flow in porous media, multiphase, multicomponent systems, and turbulent flows [3]. The basic idea of LBM is to construct simplified kinetic models that incorporate the essential physics of microscopic, or mesoscopic, processes such that they represent the behaviors at the macroscopic scale of interest. The advantages of LBM are: Provide a clear physical picture. The implementation of boundary conditions is made easier. The algorithms can be fully parallelized. The kinetic nature of LBM introduces three important features:

SECTION 2. LATTICE BOLTZMANN METHODS 28 The convection operator (streaming process) is linear, while the convection term in macroscopic descriptions are usually nonlinear. In some limit cases, LBM has been shown to honor the Navier-Stokes (NS) equations. The problem is solved on a lattice, where the velocity and density are linear combinations of elementary functions. The macroscopic density and velocity are then obtained by a simple arithmetic summation. 2.1.2 Framework and Equations The Fermi-Dirac local equilibrium distribution is used, which uses the fact that no more than one particle can be present at a particular location (node) and time. Based on this assumption, the distribution of particles depends on the density and the local velocity at a given time. Two sequential sub-steps (streaming and collision) are used to evolve the problem to the next equilibrium state. More stages may be necessary if fluid-fluid and fluid-solid interactions are considered. Streaming Each particle is associated with a density distribution function f (i) (x (i), p (i), t) where i [1, N] is the index referring to one of the N nodes of the lattice (there are as many nodes as particles). The distribution f (1) (x, p, t) gives the probability of finding a particle with a given position and momentum; the positions and momenta of the (N 1) particles can remain unspecified. f (1) is adequate for describing gas properties that do not depend on the relative positions of the particles, such as a dilute gas with long mean free path. Doolen and Chen, [3] and Sukop et al., [20] provide rigorous derivations of the Lattice Boltzmann equations (LBE) from the Lattice Gas Automata (LGA) theory. Both derivations are quite similar although [3] is more general in the treatment of the collision operator. Eq. 2.3 describes the streaming process (no collision). The probable density distribution of particles in the range

SECTION 2. LATTICE BOLTZMANN METHODS 29 x + dx with momentum p + dp is f (1) (x, p, t)dxdp f (1) (x + dx, p + dp, t + dt) = f (1) (x, p, t)dxdp (2.3) The linearization of the streaming step is quite straightforward, since the probability density distribution at a given time depends only on the state of the system at the previous time. The introduction of collisions makes the problem nonlinear and more difficult to solve. Collision Let Γ ( ) dxdpdt be the number of molecules (particles) that do not reach the expected portion of the phase space (x, p) due to collisions, and Γ (+) dxdpdt be the number of molecules that start from somewhere other than (x, p) and arrive in that portion of space due to collisions. f (1) (x + dx, p + dp, t + dt)dxdp = f (1) (x, p, t)dxdp + [ Γ (+) Γ ( )] dxdpdt (2.4) Boltzmann s equation is derived from a first-order Taylor series expansion of Eq. 2.4. f (1) (x + dx, p + dp, t + dt) = ( ) f f (1) (x, p, t) + dx. x f (1) + dp. p f (1) (1) + dt +... (2.5) t We replace the left member in Eq. 2.4. We obtain Boltzmann s equation, Eq. 2.6 [ ( ) ] f f (1) (x, p, t) + dx. x f (1) + dp. p f (1) (1) + dt +... dxdp = t f (1) (x, p, t)dxdp + [ Γ (+) Γ ( )] dxdpdt (2.6) We approximately solve Eq. 2.6. We first introduce the discretized mesh that is used to solve the system. Macroscopic scale Particle positions are confined to the nodes of the lattice. Eight directions, three magnitudes, and one particle mass define what is called the D2Q9 lattice [29]. Fig. 2.1

SECTION 2. LATTICE BOLTZMANN METHODS 30 Figure 2.1: (a) D2Q9 lattice, definition of lattice unit, and discrete velocities; (b) example of direction specific density distribution function f. Source [29]. shows a node of the lattice and the microscopic information associated with it. The requirement for using the nine-velocity model, instead of the simpler five-velocity square lattice, comes from the consideration of lattice symmetry. The Lattice Boltzmann Equation (LBE) cannot recover the correct Navier-Stokes equations unless symmetry is captured reasonably well by the lattice. Other configurations with a smaller number of connections (directions) have been proposed [12]. The distribution function can conveniently be thought of as a typical histogram representing a frequency of occurrence. It allows calculation of some continuous properties, such as the macroscopic fluid density: 8 ρ = f i.................................... (2.7) i=0 The macroscopic velocity u is a weighted average of microscopic velocities e a, namely, u = 1 8 f i e i................................. (2.8) ρ i=0 Collision operator, BGK A simple linearized version of the collision operator makes use of a relaxation time toward local equilibrium using a single time relaxation. The relaxation term is known

SECTION 2. LATTICE BOLTZMANN METHODS 31 as the Bhatnagar-Gross-Krook (BGK) collision operator,[11], and has been independently suggested by several authors [12], [3], [15]. Eq. 2.9 shows how it is formulated. f i (x + e i t, t + t) = f i (x, t) f i(x, t) f eq i (x, t) τ (2.9) In this lattice BGK (LBGK) model, the local equilibrium distribution f eq is chosen to recover the Navier-Stokes macroscopic equations [3]. The use of the lattice BGK model makes the computations more efficient. The linearization of the collision operator remains a key part of the implementation of LBM and turns out to be a bottleneck for problems involving multiple phases. Many new formulations have been proposed for such problems [28], [10], [7]. Appendix B.1 provides a detailed demonstration of the linearization of the collision operator and the integration of Navier-Stokes equations. Note that the Navier-Stokes equation has a second-order nonlinearity. The general form of the equilibrium distribution function can be written up to O(u 2 ), where u is the local velocity. f eq i = ρ[a + b(e i.u) + c(e i.u) 2 + du 2 ]................... (2.10) where a b c and d are lattice constants. This expansion is valid only for small velocities, or small Mach numbers u/c s, where C s is the speed of sound. If we use the constraint in Eq. 2.8, we obtain the coefficients of Eq. 2.10. [ f eq i (x) = w i ρ(x) 1 + 3 e i.u + 9 (e i.u) 2 3 u 2 ] c 2 2 c 4 2 c 2............ (2.11) Where the weights w i are 4/9 for particle (i = 0), 1/9 for i = 1, 2, 3, 4 and 1/36 for i = 5, 6, 7, 8. Here, c is the basic celerity of the lattice. Bounce-back boundaries LBM s ability to solve flow problems for any type of boundary condition provides a clear advantage over other discretization approaches. This is due to the inherently local character of LBM based descriptions. Interactions between fluid and solid are resolved at the boundary and involve the set of particles that are directly in contact with the walls in the system. We separate the solid into two types: boundary solids

SECTION 2. LATTICE BOLTZMANN METHODS 32 that lie at the solid-fluid interface and isolated solids that do not contact the fluid. With this division it is possible to eliminate unnecessary computations at inactive nodes. Indeed, the volume occupied by immobile particles do not need to be included in the calculation. More complex schemes such as mid-plane bounce-back scheme in which the densities are temporarily stored inside the solid and reemerge at the next time step have been proposed. Friction and slip effects can be incorporated as linear transformations of the velocity field. Figure 2.2: Illustration of mid-plane bounce-back movement of direction specific densities f i. The effective wall location is halfway between the fluid and solid nodes. Source [29]. For Neumann boundary conditions, we impose a velocity u 0 at the boundary and

SECTION 2. LATTICE BOLTZMANN METHODS 33 use equations 2.8. Fig. 2.2 shows the decomposition of a bounce-back collision. Here, we solve the system ρ 0 = f 1 + f 2 + f 3 + f 4 + f 5 + f 6 + f 7 + f 8 0 = f 1 f 3 + f 5 f 6 f 7 + f 8 ρ 0 v = f 2 f 4 + f 6 f 7 f 8 f 4 f eq 4 = f 2 f eq 2 (2.12) in order to find the remaining density distribution functions. For Dirichlet boundary conditions, we use an Equation of State (EoS) of type P = RT ρ to relate the density and pressure. Then, we use the same equation to find the velocity, and then calculate the macroscopic variables. Chapter 4.4 and 4.5 of Sukop [20] give a detailed description of the system of equations 2.12. 2.2 Single Component Single Phase, SCSP We begin with a single phase fluid featuring only one component. This scenario is the starting point of several publications, [29], [21], [12]. We implemented many of these methods in Matlab simulator in order to study various flow settings and better understand the jump from a particle based representation to newtonian fluid properties. One important element concerns the boundary condition. The pressure needs to decrease along the flow direction; otherwise, unphysical results may be obtained. Then the pressure and density are related via an EoS of the type P = Cs 2 ρ = ρ/3 (Fig. 2.6). This transition is essential in order to relate microscopic, statistical data (particles velocities, probability distribution) to a macroscopic description of the fluid (density, velocity). One starts with a non-dimensional head gradient, convert to a real world pure pressure gradient, compute the Reynolds number and define an equivalent LBM system. We rarely mention the Reynolds number in flow in natural porousmedia. Here, it is reintroduced since it gives information about the size of particles in comparison with the characteristic length of the system via the global velocity. As mentioned previously, we do not solve a real microscopic problem since the number of particles to consider would be prohibitively large. Instead, we solve the problem

SECTION 2. LATTICE BOLTZMANN METHODS 34 using particles of intermediate size (mesoscopic). The gap between these scales has to be bridged through assumptions on the collision operator. Cases with too few particles result in high Reynolds numbers that cannot be dealt with easily. Some rules of thumb concerning an appropriate number of particles are drawn from heuristic considerations [26]. The LBM algorithm for single-phase flow is as follows: 1. Calculate the local density, momentum and stress using Eq. 2.7, 2.8. 2. Calculate the post-collision distribution (collision step). 3. Apply a force according to the pressure gradient P. 4. Move the distribution to the neighboring nodes (propagation step). 5. Repeat (1)-(4) until a steady state is reached. An external force (gravity) is implemented as a perturbation of the density distribution after collision. The no-slip boundary condition is implemented using the bounceback scheme. There is a no-flow boundary condition perpendicular to the pressure gradient. Periodic boundary conditions are imposed at the inlet and outlet. 2.2.1 Open Channel We test the code on a simple open channel case with a no-flow boundary condition parallel to the flow direction. We plot the velocity field after equilibrium is reached. The no-flow condition at the boundaries slows down the particles close to the boundary, and this leads to the parabolic profile characteristic of Poiseuille flow. This case, which is described by Sokup [20], has the following parameters: u max < 0.1 lu.ts 1 Re = 4.4 = 2au/ν where ν is the kinematic viscosity, Eq. 2.13 with τ = 1, ν = 1/6 lu 2 ts 1 We find 2a based on these assumptions and calculate the pressure gradient G, Eq. 2.14

SECTION 2. LATTICE BOLTZMANN METHODS 35 Figure 2.3: Flow in an open Channel τ = ν dp dx.................................... (2.13) G = 3u aveµ a 2.................................. (2.14) Gravity can be thought of as a flow potential. Replacing G with ρg and µ with νρ, we get g = 3u aveν a 2................................... (2.15) 2.2.2 More complex Boundary conditions Bounce-back allows for considering flow in a wide range of geometric arrangements. Some constraints concerning the relative dimensions of the system to the particles are needed. For example, 4 or 5 lattice units in an open flow channel are a minimum for the simulation of realistic hydrodynamics [20]. The Matlab code for a single-component single-phase model has been successfully implemented and tested for several types of geometry.

SECTION 2. LATTICE BOLTZMANN METHODS 36 Flow around a Cylinder We test our model on an open Channel with an obstacle (cylinder placed perpendicularly for instance), and we observe the velocity field. Figure 2.4: Flow around a cylinder Flow in a porous media An interesting application of the method is the simulation of flow in porous media. We generate a random set of solid boundaries within the flow domain in order to emulate a porous medium. Fig. 2.5 shows the velocity field at convergence. This test shows the potential applicability of LBM to flow in porous media. The use of LBM in single component single phase cases is rather well understood and several comparisons with experiments have been used to validate the method. There were, however, many attempts to describe accurately multi-phase transport in the presence of viscous and capillary effects.

SECTION 2. LATTICE BOLTZMANN METHODS 37 Figure 2.5: Flow in a porous media 2.3 Single Component Multiple Phases, SCMP Liquid-Vapor behavior in partially saturated porous media involving surface tension, evaporation, condensation and cavitation can theoretically be simulated with LBM. Darcy s law based relative permeability concept can be investigated using LBM. The principal distinguishing characteristic of single phase LBM is the incorporation of an attractive force between fluid particles (Van der Waals EoS). 2.3.1 Interparticles Forces and interactions So far, we have only presented a system where particles are subjected to streaming and collision. To simulate multi-phase fluid flow, we need to capture long range interactions between the various fluid particles. The density distribution f is suitable for this purpose. We introduce a force F between the nearest neighbors for D2Q9: 8 F(x, t) = Gψ(x, t) w i ψ(x + e i t, t)e i................ (2.16) i=1

SECTION 2. LATTICE BOLTZMANN METHODS 38 Where G is the interaction strength, w i is 1/9 for i = {1, 2, 3, 4} and 1/36 for i = {5, 6, 7, 8} ψ(ρ) = ψ 0 exp( ρ o ρ )............................. (2.17) 2.3.2 Equation of state We use an extended version of the ideal gas law where the value of RT set to 1/3. P = ρrt + GRT [ψ(ρ)] 2.......................... (2.18) 2 becomes P = ρ 3 + G 6 [ψ(ρ)]2.............................. (2.19) This implementation suffers from the absence of a repulsive force and can lead to nonphysical results (e.g., a liquid phase is more compressible than the vapor phase). The reduction in pressure (G < 0) leads to an attractive force between molecules. Figure 2.6: Representation of the pressure-density according to Eq. 2.19. ψ 0 = 4 and ρ 0 = 200. Two phases system for interaction amplitude G > 92.4. 2.3.3 Results We present simulation scenarios, in which the two-phase LBM simulator is tested.

SECTION 2. LATTICE BOLTZMANN METHODS 39 Phase separation The separation between different phases is extensively documented. In this first approach, it appears as the result of interactions between particles other than collisions. Fig. 2.7 shows the different steps of the segregation of the fluid and the formation of a drop-like configuration. (a) (b) (c) (d) (e) (f) (g) (h) Figure 2.7: Phase separation in a open system with periodic boundary conditions. The liquid phase is defined arbitrarily and corresponds to a value larger than a given threshold

SECTION 2. LATTICE BOLTZMANN METHODS 40 Porous media Flow without capillary effects The boundary-condition treatment raises several questions. In the code implementation used here, our attempts to introduce a particle-solid interaction were not successful. The introduction of a surface tension requires the computation of an interface. The position of this interface depends on the force balance, which is a function of the surface tension. This nonlinear problem may be overcome by modifying the collision operator. However, the literature on this topic does not point in one overall direction, and a reference method has not been clearly established yet. We were able to simulate some effects, such as the apparition of contact angles and curved interfaces. However, the convergence in a case where we clearly define an interface between two fluids was not achieved. The reason for this is associated with a time-scale constraint. The flow problem considered here is doubly transient. The first transient period relates to the statistical nature of the microscopic information and the fact that the information is propagated locally from one node to its direct neighbors. As a consequence, the system needs time to reach a steady state in the Boltzmann sense. There is also a second transient period due to the dynamics of the system at the macroscale (e.g., compressibility). This results in a time constraint comparable to a CFL number. When the two characteristic times are of the same order, such as in regions close to an interface where the density gradient induces an acceleration of particles, the system becomes unstable. This effect has been reported by several authors, [9], [21] and reveals one of the limitations of the single relaxation-time proposed by the Bhatnagar-Gross-Krook (Eq. 2.9) model. As a consequence, no capillary effects are accounted for in this code. It is still possible to observe the invasion of viscous dominated flow in a porous medium (without trapping) (Fig.2.8). Another LB code written by Dr. Daniel Thorne and Dr. Michael Sukop was used to treat cases that are capillary dominated. This failure to describe flows where capillary and viscous forces are present is reported widely in the literature. Another method called Pore Network Simulation [18], [1] had been proposed. This approach is summarized in the next chapter, and we also explain why it is not suitable for the type of problem of interest here.

SECTION 2. LATTICE BOLTZMANN METHODS 41 (a) (b) (c) (d) Figure 2.8: Density distribution over time in a porous media. Capillary effects are here neglected and no boundaries are accounted for at the edges. Gravity Gravity appears as the third driving mechanism. As a volumetric force, it applies to every particle in a uniform fashion. The acceleration resulting from gravitation is included as an update of the velocity field: F = ma = m du............................... (2.20) dt u = τf ρ................................... (2.21) Where u is the change in velocity and τ is the relaxation time. u eq = u + u = u + τf ρ.......................... (2.22) Note that u eq is used in the computation of f eq. Gravity segregation in a 3D case The code was extended to 3D. Instead of a 9 points lattice (D2Q9) we have a 19- points lattice (D3Q19). Fig. 2.9 shows the three-dimensional lattice associated with

SECTION 2. LATTICE BOLTZMANN METHODS 42 each node. The implementation of a force such as gravity proceeds in the same way Figure 2.9: Representation of the D3Q19 lattice used for the three dimensional extension of the code. as interactions between particles except that its magnitude is constant over the whole domain. We show in Fig. 2.10 the results of a gravity segregation case. The 3D systems seemed to converge toward a stable state an order of magnitude faster than the 2D. The larger number of interactions between particles causes the system to reach a steady state (in Boltzmann sense) more rapidly. Three dimensional flow We simulate extended versions of the two dimensional cases presented above (Fig. 2.4 and 2.8). We present the results obtained for a 12 12 12 cube traversed by a channel with no-flow boundary conditions at the bottom and a constant inlet flow applied at x = 0 (Fig. 2.11). We plot the velocity field at different time steps. We then extend to a case with a solid obstacle, Fig. 2.12. This approach allows us to study flow in porous media. The representation of the pore space is quite

SECTION 2. LATTICE BOLTZMANN METHODS 43 (a) (b) (c) (d) (e) (f) (g) (h) Figure 2.10: Gravity segregation in a 3D system with closed boundary at the bottom.

SECTION 2. LATTICE BOLTZMANN METHODS 44 (a) (b) (c) (d) (e) (f) Figure 2.11: Velocity field in a three dimensional channel at different time steps. complex, it is left to the reader to imagine the three dimensional extension of what is represented in Fig. 2.8.

SECTION 2. LATTICE BOLTZMANN METHODS 45 (a) (b) (c) (d) (e) (f) Figure 2.12: Flow around an obstacle in a three dimensional case.

SECTION 2. LATTICE BOLTZMANN METHODS 46 2.3.4 LBM with surfaces, capillary dominated flow Contrary to gravity, capillary forces are not volume forces. They act upon a surface, and their influence is localized, non-uniform and often very nonlinear. In order to model these forces, it is essential to localize the interfaces between fluids. This has raised many questions about the ability of LBM to model sharp transitions between phases of different densities and viscosities. The results we show in the following chapter are obtained with a code developed by Dr. Daniel Thorne and Dr. Michael Sukop, LB2D Prime. This code treats the surface problem based on a phenomenological approach of type Gunstensen [10] and Shan and Chen, [27]. We include an adhesive interaction between fluid particles and surfaces [19]. Instead of summing the ψ functions of neighboring nodes, we sum an indicator variable denoting the solid. The strength of the force contribution is specified by an adsorption coefficient G ads, Eq. 2.23. 8 F ads (x, t) = G ads ψ(x, t) w i s(x + e i t, t)e i............. (2.23) i=1 Where s is one if the site at x + e i t is a solid and zero otherwise. 2.3.5 Contact Angles Varying the G ads parameter corresponds to a modification of the contact angle. We can do so by balancing the cohesive and adhesive forces. Assume that we are at points of pure liquid, or pure vapor. All neighbors have the same density. From Eq. 2.16, we can write: 8 F(x, t) = Gψ 2 (x, t) w i e i........................ (2.24) i=1 the ψ s are equal and can be combined. For the vapor and liquid phases, respectively, we have 8 F v (x, t) = Gψv(x, 2 t) w i e i....................... (2.25) and F l (x, t) = Gψl 2 (x, t) i=1 8 w i e i....................... (2.26) i=1

SECTION 2. LATTICE BOLTZMANN METHODS 47 A similar approach is used for interaction with the solid 8 F v ads(x, t) = G ads ψ v (x, t) w i e i..................... (2.27) i=1 and 8 F l ads(x, t) = G ads ψ l (x, t) w i e i..................... (2.28) i=1 We consider the forces at points that have the average ψ value to represent the interface between liquid and vapor. On a surface that is completely wetted by the liquid (contact angle of zero ), the adhesive force is equal to the cohesive force. We can take liquid as an example, then Eq. 2.26 and Eq. 2.28 give: G ads = Gψ l.................................. (2.29) One result obtained with the LB2D Prime code from Sukop and Thorne is shown in Fig. 2.13. (a) (b) (c) Figure 2.13: Simulation of the contact angle for Gads=-200 and G=-120. 2.3.6 Capillary Rise The Bond number Bo relates capillarity and gravity. We use the Young-Laplace equation to determine the pressure across a curved (2-D) interface: P = σ r.................................... (2.30)

SECTION 2. LATTICE BOLTZMANN METHODS 48 We equate this to the hydrostatic pressure equation: P = ρgh................................... (2.31) and finally obtain: h = σ rρg.................................... (2.32) The simulation of a capillary rise is represented in Fig. 2.14 (a) (b) (c) Figure 2.14: Simulation of a capillary rise for a 300 300 system for g = -0.000002 G ads = 250 and ρ = 523. Surface interaction, Laplace Young We correlate the numerical results provided by a Lattice Boltzmann simulation with with analytical representations, such as the Laplace-Young equation. The linear correlation between the radius of a drops and the pressure difference across the interface allows for the calculation of the surface-tension coefficient σ. We run some simple phase separation problems for different values of the interaction coefficient amplitude G. We obtain drops (or bubbles) of different radii and with different densities. Pressure is calculated as a function of density (EoS). Fig. 2.15 shows the pressure difference P as a function of the inverse radius 1/r. We observe a quasi linear correlation between the pressure drop at the interface and the radius of the drop as would be predicted by Young s law (Eq. 2.30).

SECTION 2. LATTICE BOLTZMANN METHODS 49 Figure 2.15: Young Laplace linear correlation between radius and pressure drop. 2.3.7 Hysteresis, wetting and non wetting phase Displacement of two phases in a porous medium can lead to many different behaviors depending on the properties of the system [18]. Immiscible displacements in porous media can be ranked based on their capillary number, C a, and the mobility ratio, M, which is the ratio of the viscosities of the displacing and displaced fluids. Depending on the values of these dimensionless numbers, the system is said to be capillary dominated or viscous dominated. These types of behavior have been widely observed experimentally. Some simulations using simple pore network models were presented, [18], [15]. The capillary number, Eq. 2.33 gives the relative magnitude of viscous and capillary forces. Ca = uµ φσcosθ................................. (2.33) with u the inlet velocity, µ the viscosity of injected fluid, φ the porosity, σ the surface tension, θ the contact angle. The mobility ratio, Eq. 2.34. M = µ inj µ disp................................... (2.34)

SECTION 2. LATTICE BOLTZMANN METHODS 50 The viscosity is written as: ν = 1 12f(1 f) 3 1 8 ν = 1 3 (τ 1 2 ).................... (2.35) If we replace the viscosity by its expression in LBM, we obtain Eq.2.36 M = C 2 3 C 2 3 (τ t 2 )ρ inj (τ t 2 )ρ disp = ρ inj ρ disp....................... (2.36) The mobility ratio is entirely controlled by the densities. It is possible to use an EoS parameter to increase the density contrast (although this leads to instabilities), or increase the variation of the τ parameter as a function of density. We present in Fig. 2.16 the results of a simulation in the absence of gravity and in Fig. 2.17 the same simulation in a case where gravity is accounted for. (a) (b) (c) Figure 2.16: Simulation of a drainage process in the abscence of gravity ρ in = 100 and ρ w = 523. Gravity has a stabilizing impact on the flow as we see in the examples. The capillary fingering observed in Fig. 2.16 disappears when gravity is applied. All the cases presented below involve one component only. It may for example be the invasion of vapor into a liquid soaked medium. For oil and gas purposes, it is necessary to consider more than one component.

SECTION 2. LATTICE BOLTZMANN METHODS 51 (a) (b) (c) Figure 2.17: Simulation of a drainage process in the presence of gravity ρ in = 100 and ρ w = 523. 2.4 C apillary and viscous effects Immiscible displacement in porous media with both capillary and viscous effects can be characterized by the capillary number and the mobility ratio. Depending on the dominant force, the displacement takes a specific form viscous fingering capillary fingering stable displacement Several authors, [18], [6], [15] used theoretical analysis, pore networks models, and comparisons with experiment to undertand the different flow regimes. 2.4.1 The physical network simulator This methods is based on the simulation of flow within large networks of pores following simple rules of flow in pores and throats. The idea is to model the porous medium by a network of randomly sized pores joined by randomly sized throats. If the fluids are Newtonian, and if the capillary effects are neglected this approach leads to a linear system of equations in which the unknowns are the fluid pressures at the

SECTION 2. LATTICE BOLTZMANN METHODS 52 nodes. When the capillary effect is taken into account, in a drainage case for example, the non-wetting fluid cannot enter a throat as long as the available pressure gradient is greater than the P c value associated with the interface given by Laplaces law (Eq. 2.37: P c = 2σcosθ r.................................. (2.37) where r is the radius of the throat, σ the interfacial tension and θ the contact angle. The system of equations used to solve the pressures at each node requires knowledge of which throat will be invaded next by the meniscus, and this knowledge itself requires the value of the pressure at each node. This nonlinear problem can be treated in different ways. The usual approach ([18], [6]) is to directly solve an approximation of the nonlinear problem instead of solving a large number of linear problems. The network is represented by a series of circular pores connected by cylindrical throats with uniform length. The pressure drops essentially happens in the throats. Each element (pore and throat) is only characterized by its radius. The radii are randomly selected (uniform law). In each pore, we assume a sharp interface separates the two fluids (no diffusion, or mixing), even when the interfacial tension is very low. Consequently, a pore has to be completely filled with the invading fluid before this fluid can reach an adjacent pore. For each pore i, a coefficient α i gives the percentage of fluid 2 contained in the pore. The interfacial tension only enters into account when the meniscus is inside a throat (i.e., when the two adjacent pores are entirely filled with one fluid each. A Poiseuille flow is assumed in each throat. If i and j are two adjacent pores, the flow rate q ij between them is given by: q ij = πr4 ij 8aµ ij (p i p j )............................. (2.38) The effective viscosity µ ij takes into account the saturations: µ ij = 0.5µ 2 (α i + α j ) + 0.5µ 1 (2 α i α j )................ (2.39) In the presence of capillarity, Eq. 2.38 becomes: q ij = πr4 ij 8aµ ij max[(p i p j P ij ), 0]..................... (2.40)

SECTION 2. LATTICE BOLTZMANN METHODS 53 This means that there is no flow between i and j as long as the pressure difference is lower than the pressure necessary for the invasion of the pore (Eq. 2.37). The flow between two interfacial nodes no longer depends linearly on the pressure difference: the flow is zero up to a threshold value. The solution of this nonlinear problem is approached through a relaxation technique. At each time step, the network is swept several times, updating the pressure at each node from the pressure of its neighbors through the flow-conservation equation (the flow is taken to be zero between two interfacial nodes as long as the pressure threshold is not reached). Once the computations arrive at a stable numerical state, the simulation stops. At this stage, the total flow rate and the contents of each pore are known. The time step is then calculated as the time required to completely fill one pore. This means that the interface is moved in all the pores until it reaches a throat. 2.4.2 Phase diagram The three modes of displacement are compared based on two numbers: the mobility ratio M and the capillary number C. The regimes are: 1. Stable displacement: the principal force is due to the viscosity of the injected fluid; capillary effects and pressure drop in the displaced fluid are negligible, Fig. 2.18 (b) logc = 0.9. 2. Viscous fingering: the principal force is due to the viscosity of the displaced fluid; capillary effects and pressure drop in the displacing fluid are negligible. The tree-like fingers have no loops. They spread across the whole network and they grow towards the exit, Fig. 2.18 (a) logc = 5.7 3. Capillary fingering: at low capillary number, the viscous forces are negligible in both fluids and the principal force is due to capillarity. The fingers also spread across the network but the pattern is different from the previous case and the final saturation is larger. At all scales, the fingers grow in all directions, even backward (toward the entrance). They form loops which trap the displaced

SECTION 2. LATTICE BOLTZMANN METHODS 54 (a) (b) (c) Figure 2.18: 100 x 100 simulations a t various viscosity ratio and capillary numbers: (a)logm = -4.7, from viscous fingering to capillary fingering: ( b ) logm = 1.9, from stable displacement to capillary fingering: (c) logc = 0, from viscous fingering to stable displacement (Source:[18]).

SECTION 2. LATTICE BOLTZMANN METHODS 55 fluid. The size of the trapped clusters range from the pore size to macroscopic scales, of the order of the network size, Fig. 2.18 (a), logc = 10.7. 2.5 LBM simulation of multi-component, multiphase flows Lattice-gas models of phase separation have been reviewed by several authors, [26], [3]. Three main implementations have been proposed over the past fifteen years. These are the Gunstensen [10], Shan and Chen [27], and the Free Energy [24], [23] models. In these methods, various schemes are used to identify the interface and compute a collision operator that can model phase separations in cases where different types of particles are interacting. In the method of Gunstensen et al. [10], [7], [8], red and blue particle distribution functions f r i (x, t) and f b i (x, t) are introduced to represent the two different fluids. The total particle distribution function (or the color-blind particle distribution function) is defined as: f i = f r i (x, t) + f b i (x, t). The LBM equation is written for each phase: f k i (x + e i, t + t) = f k i (x, t) + Ω k i (x, t).................. (2.41) With the collision operator given by: Ω k i = (Ω k i ) 1 + (Ω k i ) 2.............................. (2.42) The first term corresponds to the relaxation term and is similar to what was described in SCMP: (Ω k i ) 1 = 1 τ k (f k i f k(eq) i ).......................... (2.43) The viscosity of each fluid can be selected by choosing the desired τ k. The second term contributes to the dynamics in the interfaces and generates a surface tension: (Ω k i ) 2 = A k 2 F [(e i.f) 2 / F 2 1/2]................... (2.44) Where bff is the color gradient defined as: F = i e i (ρ r (x + e i ) ρ b (x + e i )).................... (2.45)

SECTION 2. LATTICE BOLTZMANN METHODS 56 In single phase F = 0. The parameter A k is a free parameter, which determines the surface tension. The additional collision term in Eq. 2.44 does not cause phase segregation. In order to do so, we force a color momentum j = j (f r i f b i )e i............................... (2.46) to align with the direction of F or in other words, to maximize j.f. This step will force colored fluids to move toward fluids with the same colors. Two drawbacks: First, the procedure of redistribution of the colored density at each node requires time-consuming calculations of local maxima. Second, the perturbation step with the redistribution of colored distribution functions causes an anisotropic surface tension that induces non-physical vortices near interfaces. Method of Shan and Chen, [27] employs microscopic interactions to modify the surface-tension related collision operator, for which the surface interface can be maintained automatically. The collision operator (Ω k i ) 2 in Eq. 2.44 is replaced by: (Ω k i ) 2 = e i.f k................................. (2.47) where F k is an effective force on the k th phase. F k (x) = V kk (x, x + e i )e i...................... (2.48) k i and V kk is an interaction pseudo-potential between different phases, or components. V kk (x, x ) = G kk (x, x )ψ k (x)ψ k (x).................... (2.49) G is the amplitude of the interaction and ψ is a function of the density for k th phase. The collision operator (Ω k i ) 2 in the Shan-Chen model does not satisfy local momentum conservation. G kk acts like a temperature; when G is smaller than the critical value G c (depending on the lattice structure and initial density), the fluids separate. In the Shan-Chen model, the separation of fluid phases or components is automatic. This is an important improvement in numerical efficiency compared with the original LBM multiphase models. The Shan-Chen model also improves the isotropy of the surface tension.

SECTION 2. LATTICE BOLTZMANN METHODS 57 In the Free Energy approach, [24], [23], the distribution function is based on thermodynamic arguments. A term is added to the original equilibrium distribution expression in Eq. 2.10: f eq i = f eq i + G αβ e iα e iβ............................ (2.50) We obtain a new stress-tensor condition: i f eq i e iα e iβ = P αβ u α u β........................... (2.51) Two components system Two components (oil and water) are present and form an immiscible fluid pair. The nature of the interaction between the particles of the two different fluids is repulsive contrary to what we have seen previously. Adding a second component in the model requires introducing a new set of particles with different properties and updating all the macroscopic variable. The equilibrium distribution function is computed in Eq. 2.52: u = σ 1 τ σ a f σ a e a σ 1 τ σ f σ a............................. (2.52) To be compared with the SCMP macroscopic velocity described in Eq. 2.8, the density for each component is computed the same way as for SCMP. The macroscopic velocities u represent the bulk fluid. Interparticles Forces The force on fluid component σ is written in Eq. 2.53. 8 F σ (x) = Gψ σ (x, t) w a ψ σ (x + e a t, t)e a.............. (2.53) a=1 Where σ is the other s fluid index. The ψ function is usually associated to the component density. The interaction force F σ is added to the updated momentum ρu in order to compute the equilibrium distribution (same as previously). u eq σ = u + τ af σ ρ σ............................... (2.54)

SECTION 2. LATTICE BOLTZMANN METHODS 58 The value attributed to G is very important, since it provides the magnitude of the interaction force. These lead to the velocity increments, which must be kept small, and this limits the range of possible values for G. We aim at having sharp, non-diffusing interfaces, and that requires a large G and small increments in the velocities, which call for a small G. When using boundary conditions, the interaction force must be computed differently at those boundaries because the density is not necessarily continuous across the periodicity. The terms associated with nodes across the periodic boundary are unavailable. Replacing those terms with terms in the other direction gives good results. Fig 2.19 shows the density of each component at different time steps. (a) (b) (c) (d) (e) (f) (g) (h) Figure 2.19: Simulation of an equilibrium between two fluids represented by different components ρ 1 = 1ρ 2 = 0, G = 0.1. 2.5.1 Phase separation The time to reach equilibrium increases due to the presence of two components. We discuss here the separation of two phases. We can establish the cut off density half way between the two densities, or we can also use the point at which the densities

SECTION 2. LATTICE BOLTZMANN METHODS 59 intersect (i.e., the point at which in going from the interior of the drop, the density of the denser fluid becomes lower than the density of the surrounding fluid), see Fig. 2.20. Another idea is to consider the drop to extend all the way to its lowest density. The Figure 2.20: Crossed density in order to decide surface position. area of the drop corresponds to the entire region where the drop component density is higher than its density in the bulk of the surrounding fluid component. This seems to improve the Laplace linear intersect. 2.5.2 MCMP LBM with surfaces Each fluid component interacts independently with the solid. This is the result of the interfacial tension between fluids, σ 12 and between a fluid and the solid, σ S1. The Young s equation becomes (Eq. 2.55): cosθ = σ S1 σ S2 σ 12............................... (2.55) Surface forces are incorporated into the MCMP model as follows: 8 F σ ads(x, t) = G σ adsρ(x, t) w a s(x + e a t)e a............. (2.56) a=1 We apply the same logic as for SCMP in order to compute the equilibrium with a solid phase and the contact angles. We find that when a complementary density

SECTION 2. LATTICE BOLTZMANN METHODS 60 is low, G ads should be small relative to G. There is a direct relationship between G, G 1 ads and G 2 ads. If G 1 ads = G 2 ads, we can expect σ S1 = σ S2 and a 90 degree contact angle. This is the result of Eq. 2.55. 2.5.3 Flow in porous media, permeability computation Relative permeability is a dimensionless measure of the permeability of a fluid phase as it flows through a porous medium in the presence of another fluid phase. Relative permeability is calculated as follows: q i µ i k ri =............................. (2.57) k abs AdP/dx where the index i refers to one of the fluid phases present in the system. If only one fluid is present in a rock, its relative permeability is equal to 1. Relative permeability allows comparison of the different abilities of fluids to flow in the presence of each other, since the presence of more than one fluid generally inhibits flow. Relative permeability is quite complex to determine as many elements affect its value (pore structure, wettability, viscosity of the fluids, surface tension between the fluids and between the fluids and the solid, etc.). Lattice Boltzmann methods can mimic most of the physical phenomena listed above. Many authors [14], [30] propose the use of LBM as an alternative to lab testing in order to compute relative permeabilities on sample cores. This technique combines high resolution images of the pore-geometry, post processing treatment, and pore-scale dynamic simulation. A method called Multirelaxation LBM [9] is used to compute a succession of steady states. This method shows superior numerical stability over the popular lattice Bhatnagar Gross Krook equation, Eq. 2.11. Multi-relaxation LBM is supposed to allow for accurate modeling of not only static, but also dynamic configurations of the contacts between the fluid phases and the pore walls. This is done by taking into account both the surface tension and the contact angles.

SECTION 2. LATTICE BOLTZMANN METHODS 61 Three dimensional flow in a porous media Code workflow A simulator operating at the pore scale based on LBM was developed by Yongseuk Keehm [17]. He shows extensive examples and tests on the code and makes use of experimental comparisons in order to validate theoretical results. Here, we describe his algorithm and the code. A user guide is provided in appendix. The code s structure revolves around one class Lattice and two main subgroups of functions, initlattice.cpp and flowsim.cpp: initlattice.cpp sets up the geometry of the problem, builds up the lattice structure based on the porous medium and handles memory allocation. flowsim.cpp is responsible for the flow dynamics of the problem. It handles the propagation and collisions at each time step and computes macroscopic variables such as density and velocity. Fig. 2.21 shows how the program is executed. The code itself is divided into two main sets of functions as described earlier. Here, Figure 2.21: Elements in the execution of the code. On the left, the input file and the pore structure. The program execution (middle) leads to the two phase flow simulation in the porous medium as well as the permeability computation. we present the main structure of the code. int main(){

SECTION 2. LATTICE BOLTZMANN METHODS 62 } Lattice lat( inputfile );// Constructs the lattice based on input file param lat.initlattice(); // Sets the geometry of the problem lat.flowsim(); // Runs the 2-phase flow simulation 1. Geometric part: The lattice construction obeys the D3Q19 rule (see previous chapter). It reads the pore file, Fig. 2.22 and allocates a lattice to each of the nodes that are located in a pore space. The calculation concerns a buffer region which excludes the extremities in the x direction. The boundaries (x, z) and (x, z) are closed to flow. Each active node is associated with an eighteen- Figure 2.22: Process of setting up the problem s geometry. Only the cells located inside the buffer region and associated to pore space are considered. stencil lattice, Fig. 2.23. The memory allocation is handled in this part too (function memalloc()). We located and fixed some memory leaks from the original code. They caused the code to stop prematurely when dealing with large cases. This parts also sees the initialization of the problem. The initial saturation distribution can be imposed with a restart file.

SECTION 2. LATTICE BOLTZMANN METHODS 63 Figure 2.23: Lattice structure and indexing chosen in the code.

SECTION 2. LATTICE BOLTZMANN METHODS 64 2. Dynamic part: The function flowsim() can be summarized. void::lattice flowsim(){ for(int i = startiter; i<maxiter; i++){ collision(); applyforces();// Surface tension propagate(); } } Each of these three functions follows the formulation presented earlier. We find the same type of structure in all of them. First modify the density distribution function, then update the momentum and finally integrate. Recall that the LBM equation for each phase is given by: fi k (x + e i, t + t) = fi k (x, t) + (Ω k i ) 1 + (Ω k i ) 2.......... (2.58) Each term in this equation is handled by one of the three functions presented in the pseudo code. The first term corresponds to the propagation. It is implemented as a mere swapping between density distributions of neighboring nodes. The second term (Ω k i ) 1 is the collision term. It is implemented in a similar fashion as LBGK, even if the form varies slightly. (Ω k i ) 1 = ρω i [α i + e i.u]........................ (2.59) with ω i = 1/6 for i = 0,..., 5 and ω i = 1/12 for i = 6,..., 17 (see Fig. 2.23). α is a term accounting for relaxation and can be adjusted depending on the viscosity of the fluids. This equation is to be compared with Eq. 2.10 and 2.11. The third term (Ω k i ) 2 contributes to the dynamics in the interfaces and generates a surface tension. It is implemented in the applyforces() function. (Ω k i ) 2 = 2A k F [ (ei.f) 2 ] F 2 1 2.................. (2.60)

SECTION 2. LATTICE BOLTZMANN METHODS 65 This formulation, which was proposed by Gunstensen [8] is described by Chen [3]. The efficient implementation of surface tension relies on an accurate localization of the interfaces between the two fluids. The gradient color approach consists of computing a map of the domain where the difference of densities between red and blue particles is computed. The regions that record the highest gradient are the ones that are more likely to see an interface appear. F is the color gradient defined as: F = i e i (ρ r (x + e i ) ρ b (x + e i ))................ (2.61) The function maxst() ranks the node by order of highest gradient and updates the density distribution following Eq. 2.59. The density distributions are updated (as well as the color gradient), and we stop applying forces when the gradient becomes very small. The simulation stops when the code reaches the maximum number of iterations, or when the system reaches a steady state. Convergence is established when the new computed flow is close to the one calculated from the previous time step. The convergence ratios (ratior and ratiob) are not computed at every time step. Instead they are updated every time the program outputs results. Examples Several tests were performed with the revived Keehm s code [17]. A sample porous media with dimensions of (125 125 125) is generated and a drainage process is simulated. The nonwetting fluid (in blue) is flooding into a pore sample saturated with a wetting fluid (transparent). Fig. 2.24 shows snapshots of the simulation at different time steps. The simulation seems to capture the trapping of the wetting fluid. We observe the establishment of a preferential connected path between the inlet and the outlet. One of the tests used in Keehm s thesis is a Fontainbleau sandstone with dimensions of (288 288 288), Fig. 2.25. This problem is too large to be solved on a simple desktop as we hit memory limitations. We switch to a larger machine (cees-tool with higher processing and memory capacities. The imbibition process

SECTION 2. LATTICE BOLTZMANN METHODS 66 (a) (b) (c) (d) Figure 2.24: Invasion of a nonwetting fluid (blue) into a porous media saturated with a wetting fluid (transparent). The system has (125 125 125) nodes. Figure 2.25: Pore structure for the Fontainbleau sandstone sample.

SECTION 2. LATTICE BOLTZMANN METHODS 67 is represented in Fig. 2.26. In this case. A nonwetting fluid that saturates the porous medium is invaded with a wetting fluid. The drainage is represented in Fig. 2.27. (a) (b) (c) (d) Figure 2.26: Imbibition process. The wetting fluid (blue) invades the porous media characterizing a Fontainbleau sandstone. We are interested in reproducing an experiment in which drainage is followed by (a) (b) (c) (d) Figure 2.27: Drainage process. The non-wetting fluid (blue) invades the porous media characterizing a Fontainbleau sandstone. imbibition, in order to reproduce the hysteresis. This is shown in Fig. 2.28. There are multiple applications to this type of simulation. The permeability calculation based on a Lattice Boltzmann flow simulation, [17] or pore network simulation,[16] have been proposed. Renard [5] shows a review of methods on permeability calculation. Other studies, [22] used LBM to establish conditions in which Darcy s law cannot be applied.

SECTION 2. LATTICE BOLTZMANN METHODS 68 (a) (b) (c) (d) Figure 2.28: Imbibition process. Following the drainage presented in Fig. 2.27, the wetting fluid (transparent) invades the porous media already saturated with non wetting fluid (blue). 2.6 Conclusion The purpose of this study was to present a limited survey of the capabilities of Lattice Boltzmann methods for modeling fluid flow in porous media. We document and test two simulators that apply this method to simple porous media. The collision operator formulation differs from one simulator to the other. The formulation based on Shan and Chen method [27] can handle large variations in density, but is more suitable for static equilibrium. The collision operator based on Gunstensen s color gradient accounts for the influences of both capillary and viscous forces. We show the limitations of this approach for two-phase flow. The ability of the simulation to provide a physical result depends strongly on the flow boundary conditions. Moreover, the transition between the given microscopic variables and their macroscopic equivalent is still far from rigorous. The ability of an LBM simulator to provide quantitative predictions rely on a tuning process in which simulation results are compared with experiments. We find that those issues need to be properly addressed as we analyze the complex behaviors of immiscible two-phase flow in natural porous media.