thermodynamic equilibrium computation of systems with an ......dynamic part: the function flowsim()...
TRANSCRIPT
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
Cedric Fraces 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 behav-
ior 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 simu-
lation, 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 meth-
ods, 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 represen-
tation combined with linear pressure and temperature interpolation in tie-simplex
iii
space, which is implemented as an adaptive tabulation strategy, leads to highly ro-
bust 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 knowl-
edge is then used to estimate the macroscopic (Darcy-scale) properties and solve the
macroscopic equations governing flow and transport in very large domains. We sur-
vey 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 ap-
proaches 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 office-
mates, 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 Ise-
bor, Alejandro Leiva.
Finally, I thank my family for their constant support and belief in me.
v
Contents
Abstract iii
Acknowledgments v
Table of Contents vi
List of Tables ix
List of Figures x
1 Thermodynamic Equilibrium: Arbitrary Number of Phases 1
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Compositional space parametrization for systems with arbitrary num-
bers 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 CO2, C1, C4, C10at T = 345 K and P = 50 bars (a) and tie-triangles for system CO2, N2, C1, H2Sat T = 130 K and P = 100 bar (b). . . . . . . . . . . . . . . . . . . . 6
1.3 Ternary diagram for system CO2, C1, C16 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 CO2, N2, C1, H2S. . . . . . 11
1.5 Sensitivity of the methods to the shift parameter. . . . . . . . . . . . 14
1.6 Phase diagram for C1, C10, CO2, H2O at P = 50 bar (left) and 100
bar (right) T = 280K. . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.7 Phase diagram for C1, N2, CO2, H2S at P = 100 bars T = 80 K (left)
and 140 K (right). . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.8 Degeneration of tie triangle into tie line for C1, C10, CO2, H2O at p
= 150 bars, T = 373 K. . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.9 Representation of composition distributions for four components sys-
tems C1, C10, CO2, H2O at t = 10 days and Projection in the com-
positional 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
C1, C10, CO2, H2O system at t = 10 days. . . . . . . . . . . . . . . 21
1.12 Representation of simulation results for C1, C10, CO2, H2O system at
t = 10 days. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
x
1.13 Composition distributions for a 6 components systems C1, C10, CO2, NC5, H2S,H2Oat 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 fi. 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
Gads = −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 differ-
ent 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 dif-
ferent methods. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
xii
Section 1
Thermodynamic Equilibrium:
Arbitrary Number of Phases
1.1 Introduction
Enhanced oil recovery (EOR) of heavy hydrocarbons usually involve thermal pro-
cesses that are described using a thermal-compositional model [3]. The equations
that describe the flow, transport and thermodynamic behavior include mass and en-
ergy conservation and thermodynamic-equilibrium relations. The accurate descrip-
tion 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 computa-
tional 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 sys-
tem 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 disap-
pearance 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 computa-
tions 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 sophisti-
cated nonlinear solvers, in which significant changes in the mixture composition in
gridblock can take place.
While two-phase EoS computations associated with compositional flow simula-
tion are becoming quite robust and efficient, reliable methods for handling multi-
component 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 pro-
pose 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 sys-
tems 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, zi, is usually used in thermodynamic equi-
librium calculations. The independent mole fractions form a subset of <nc , where nc
is the number of components, and can be expressed as follows:
∆nc−1 = (z1 . . . znc) ∈ <nc |∑
zi = 1, zi ≥ 0, ∀i. (1.1)
This relation defines an (nc − 1)-dimensional simplex in <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
(np − 1)-dimensional tie-simplex defined as
∆np−1 = (ν1 . . . νnp) ∈ <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 np is the number of phases. Thus, we have a tie-line for two phases, a tie-
triangle for three phases, etc. The tie-simplex can be represented by the np vertices
that correspond to the equilibrium fractions, namely,
V1 = xi,1, V2 = xi,2, . . . Vnp = xi,np , (1.3)
where xi,j is the mole fraction of component i in phase j. The relationship between
the overall mole fraction, zi, and the phase equilibrium fractions is given by
zi =np∑j=1
xi,jνj. (1.4)
Notice that there are only nc− 1 independent zi because of the constraint that phase
fractions must add up to unity. Combining this equation with the linear constraint
for νj, we have
np∑j=1
xi,jνj = zi, i = 1, . . . , nc − 1 (1.5)
np∑j=1
νj = 1 (1.6)
Now, consider the subspace J of i = 1, . . . , nc− 1 with dimension np− 1. Then,
we can represent the vector ν as the solution of the equation xJ
e
ν =
zJ
1
, (1.7)
where e =[
1, . . . , 1]
is the unit vector. Substitution of this solution in the other
equations, I = i = 1, . . . , nc − 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:
zI = xIν = xI
xJ
e
−1 zJ
1
, (1.8)
or in more familiar form
zI = AzJ + b, (1.9)
where A is a matrix whose dimensions are [(nc − np) × (np − 1)] and b is a vector
with [nc − np] entries. Equation (1.8) defines a complete parametrization for multi-
component 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 np-phases, this face represents an np-dimensional subspace of the nc-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
xj1
np. (1.10)
An orthogonal shift with lengthD 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 dj = det(XjJ), where Xj
J is a square matrix
XJ with column j replaced by 1. The shift correction, ∆z, orthogonal to tie-simplex
face is given by
∆zJ = −D dj‖dj‖
, ∆zi = 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 np-phase region completely. In Fig. 1.2, you can see the end-
points 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 systemCO2, C1, C4, C10 at T = 345 K and P = 50 bars (a) and tie-triangles for systemCO2, N2, C1, H2S 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 nc − np 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 multi-
component systems, in which an arbitrary number of phases can coexist at equilib-
rium. Interpolation in tie-simplex space is possible from observations of the smooth-
ness 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 nc−np-dimensional
tie-simplex space is triangulated. For any tessellation of scattered data, interpolation
of any point inside a hyper-triangle is performed, namely,
λi =n∑k=1
ai,kγk + bi, i = 1, . . . , n+ 1, (1.12)
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 ai,k and bi, 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
ei = Γai + bi, ∀i ∈ 1, . . . , n+ 1 (1.13)
Here, Γ is a matrix of the coordinates of all the neighbors ((n + 1) × n), and ei is a
unit vector (e1 = [1, 0, . . . , 0], e2 = [0, 1, 0, . . . , 0], etc.). In order to find coefficients ai
and bi, we solve Eq. 1.13 for each ei. 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:
ν = αtzJ + βt, ∀t, (1.14)
SECTION 1. THERMODYNAMIC EQUILIBRIUM: ARBITRARY NUMBER OF PHASES8
fi =∑j
xti,jνj − zi = 0, i ∈ I. (1.15)
is computed. For the compositional space, the dimension n from Eq. 1.12 is equal to
nc − np.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 com-
putation
In this section, we describe how to use the CSP framework to deal with phase-
behavior 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 gen-
eral 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:
fi,j(p, T, xi,j)− fi,k(p, T, xi,k) = 0, ∀j 6= k ∈ 1, . . . , np, i ∈ [1, . . . nc],(1.17)
zi −np∑j=1
νjxi,j = 0, i ∈ [1, . . . nc], (1.18)
np∑j=1
νj − 1 = 0, (1.19)
nc∑i=1
(xi,j − xi,k) = 0, ∀j 6= k ∈ 1, . . . , np. (1.20)
Here p, T , and zi denote pressure, temperature, and overall mole fraction of compo-
nent i, respectively; xi,j and νp represent phase mole fractions. We assume that p, T ,
and zi are known, and that the fi,j are governed by a nonlinear function. The objec-
tive is to find xi,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 CO2, C1, C16 at p = 100 bars and T = 323K.
The CSP approach can be used to avoid most of these difficulties. The closest pa-
rameterized tie-simplex that intersects the given overall composition can be obtained
using criteria based on equations (1.7)-(1.8). Specifically,
ν =
zJ
1
xJ
e
−1
(1.21)
‖zI − xIν‖ < ε. (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 differentpressures for a four components system CO2, N2, C1, H2S.
1.3.2 CSP preconditioning, two-phase system
Here, we employ negative-flash based CSP approach for two-phase systems. A tie-
line 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 pro-
cedure. 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 per-
forming 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 ap-
proach, we use four test cases:
• Case 1: 3 C4, C1, C10, shift = 0.01.
• Case 2: 4 CO2, C4, C1, C10, shift = 0.01.
• Case 3: 5 CO2, C1, C3, NC5, C10, shift = 0.03.
• Case 4: 6 (CO2, C4, C1, C6, C7C10, shift = 0.05.
The shift parameter is a measure of the density of the initial tie-lines that are pre-
processed (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, zi, are used as input for
negative-flash computations starting from different initial guesses. The first (stan-
dard) type of initial guess is the Wilson formula. Two additional initial-guess strate-
gies 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 pro-
jection 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.91 100 289 5.4 3.6 3.2 2.3
140 289 6.3 4.0 3.7 1.170 289 5.1 3.9 3.5 3.4
2 100 289 6.3 4.5 3.2 2.2140 289 8.4 5.1 4.6 1.670 289 5.2 4.3 3.4 3.2
3 100 289 7.3 5.3 3.9 2.1140 289 9.1 6.0 5.2 1.150 345 5.0 3.8 3.4 3.8
4 70 345 5.1 4.1 3.9 3.6100 345 6.1 4.2 4.1 2.4
Table 1.2 presents the results of the numerical experiments, in terms of the av-
erage 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 support-
ing 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 CO2, 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 tie-
simplex belongs to a (hyper) plane that connects the compositions with the largest
np K-values in the system (see plane C1, C10, H2O 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 C1, C10, CO2, H2O 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
C1, CO2, H2O in Fig. 1.6,b or C1, CO2, N2 in Fig. 1.7,b). Numerical tests were
performed for the following mixtures:
• Case 1: 4 components with water C1, C10, CO2, H2O, shift = 0.01.
• Case 2: 4 components with sour gas C1, N2, CO2, H2S, shift = 0.01.
• Case 3: 5 components with water C1, C10, CO2, H2S,H2O, shift = 0.03.
• Case 4: 6 components with water C1, C10, CO2, NC5, H2S,H2O, 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 tie-
triangle, 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 C1, N2, CO2, H2S 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.71 100 110 13 12.6 12.2 11.3
100 140 37.2 12.2 11.1 9.610 289 6.2 5.8 5.7 5.8
2 50 289 9.1 7.6 7.3 6.5100 289 10.4 9.05 7.2 5.7100 289 10.1 9.5 8.2 6.3
3 125 289 15.3 10 9.7 3.25150 289 37.5 15.2 11.1 4.310 289 6.6 5.9 5.7 5.9
4 50 289 7.5 6.4 6.1 5.5100 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 C1, CO2, C10 reach the critical
Figure 1.8: Degeneration of tie triangle into tie line for C1, C10, CO2, H2O 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 systemsC1, C10, CO2, H2O at t = 10 days and Projection in the compositional space withtie 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 re-
search 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 dif-
ferent 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
C1(10%), C10(10%), CO2(40%), H2O(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 com-
positional 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 Np-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 EoS-
free 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
C1, C10, CO2, H2O. 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 C1(15%), C10(20%), CO2(30%), NC5(5%), H2S(5%), H2O(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 forC1, C10, CO2, H2O system at t = 10 days.
(a) (b)
Figure 1.12: Representation of simulation results for C1, C10, CO2, H2O system att = 10 days.
SECTION 1. THERMODYNAMIC EQUILIBRIUM: ARBITRARY NUMBER OF PHASES22
Figure 1.13: Composition distributions for a 6 components systemsC1, C10, CO2, NC5, H2S,H2O at t = 10 days.
1.5 Conclusions
In this section of the report, we proposed a new approach to precondition negative-
flash calculations using tie-simplex compositional space parameterization. The ap-
proach 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 com-
positional reservoir simulation. Although we limited the scope of this work to the
presentation of the methodology and initial validation examples, further testing in-
volving 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 im-
plicit 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 Pub-
lishers, 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 construc-
tion 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 engineer-
ing 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 dis-
placement 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 back-
ground and application for immiscible displacements. SPE Journal, (106029),
February 2008. presented at 2007 SPE Reservoir Simulation Symposium, Wood-
lands, TX.
[16] Tchelepi H. Voskov D. Mathematical framework for general multi-phase ther-
modynamical 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) = 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (2.1)
∂ρu
∂t+∇(ρ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 dis-
cretize 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 rela-
tion 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, par-
ticles 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 re-
place 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] pro-
vide 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 (1)(x,p, t) + dx.∇xf(1) + dp.∇pf
(1) +
(∂f (1)
∂t
)dt+ . . . (2.5)
We replace the left member in Eq. 2.4. We obtain Boltzmann’s equation, Eq. 2.6[f (1)(x,p, t) + dx.∇xf
(1) + dp.∇pf(1) +
(∂f (1)
∂t
)dt+ . . .
]dxdp =
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 mag-
nitudes, 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 re-
quirement 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 num-
ber of connections (directions) have been proposed [12]. The distribution function
can conveniently be thought of as a typical histogram representing a frequency of oc-
currence. It allows calculation of some continuous properties, such as the macroscopic
fluid density:
ρ =8∑i=0
fi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (2.7)
The macroscopic velocity u is a weighted average of microscopic velocities ea, namely,
u =1
ρ
8∑i=0
fiei . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (2.8)
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 indepen-
dently suggested by several authors [12], [3], [15]. Eq. 2.9 shows how it is formulated.
fi(x + ei∆t, t+ ∆t) = fi(x, t)−fi(x, t)− f eqi (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 opera-
tor 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 equa-
tions. 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(u2),
where u is the local velocity.
f eqi = ρ[a+ b(ei.u) + c(ei.u)2 + du2] . . . . . . . . . . . . . . . . . . . (2.10)
where a b c and d are lattice constants. This expansion is valid only for small velocities,
or small Mach numbers u/Cs , where Cs is the speed of sound. If we use the constraint
in Eq. 2.8, we obtain the coefficients of Eq. 2.10.
f eqi (x) = wiρ(x)
[1 + 3
ei.u
c2+
9
2
(ei.u)2
c4− 3
2
u2
c2
]. . . . . . . . . . . . (2.11)
Where the weights wi 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 den-sities fi. The effective wall location is halfway between the fluid and solid nodes.Source [29].
For Neumann boundary conditions, we impose a velocity u0 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 = f1 + f2 + f3 + f4 + f5 + f6 + f7 + f8
0 = f1 − f3 + f5 − f6 − f7 + f8
ρ0v = f2 − f4 + f6 − f7 − f8
f4 − f eq4 = f2 − f eq2 (2.12)
in order to find the remaining density distribution functions. For Dirichlet bound-
ary 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 prop-
erties. 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 = C2sρ = ρ/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 porous-
media. 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 par-
ticles 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 distribu-
tion after collision. The no-slip boundary condition is implemented using the bounce-
back 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 bound-
ary, and this leads to the parabolic profile characteristic of Poiseuille flow. This case,
which is described by Sokup [20], has the following parameters:
• umax < 0.1 lu.ts−1
• Re = 4.4 = 2au/ν where ν is the kinematic viscosity, Eq. 2.13 with τ = 1,
ν = 1/6 lu2ts−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∗ =3uaveµ
a2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (2.14)
Gravity can be thought of as a flow potential. Replacing G∗ with ρg and µ with νρ,
we get
g =3uaveν
a2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (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 min-
imum 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 perpendic-
ularly 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:
F(x, t) = −Gψ(x, t)8∑i=1
wiψ(x + ei∆t, t)ei . . . . . . . . . . . . . . . . (2.16)
SECTION 2. LATTICE BOLTZMANN METHODS 38
Where G is the interaction strength, wi is 1/9 for i = 1, 2, 3, 4 and 1/36 for i =
5, 6, 7, 8
ψ(ρ) = ψ0exp(−ρ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 . . . . . . . . . . . . . . . . . . . . . . . . . . (2.18)
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 ap-
proach, 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 giventhreshold
SECTION 2. LATTICE BOLTZMANN METHODS 40
Porous media Flow without capillary effects
The boundary-condition treatment raises several questions. In the code implementa-
tion used here, our attempts to introduce a particle-solid interaction were not success-
ful. 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 sys-
tem 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., compress-
ibility). 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 pos-
sible 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 litera-
ture. 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 arehere 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 = mdu
dt. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (2.20)
∆u =τF
ρ. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (2.21)
Where ∆u is the change in velocity and τ is the relaxation time.
ueq = u + ∆u = u +τF
ρ. . . . . . . . . . . . . . . . . . . . . . . . . . (2.22)
Note that ueq is used in the computation of feq.
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 ex-tension 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 phenomenolog-
ical approach of type Gunstensen [10] and Shan and Chen, [27].
We include an adhesive interaction between fluid particles and surfaces [19]. In-
stead 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 Gads, Eq. 2.23.
Fads(x, t) = −Gadsψ(x, t)8∑i=1
wis(x + ei∆t, t)ei . . . . . . . . . . . . . (2.23)
Where s is one if the site at x + ei∆t is a solid and zero otherwise.
2.3.5 Contact Angles
Varying the Gads 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:
F(x, t) = −Gψ2(x, t)8∑i=1
wiei . . . . . . . . . . . . . . . . . . . . . . . . (2.24)
the ψ’s are equal and can be combined. For the vapor and liquid phases, respectively,
we have
Fv(x, t) = −Gψ2v(x, t)
8∑i=1
wiei . . . . . . . . . . . . . . . . . . . . . . . (2.25)
and
Fl(x, t) = −Gψ2l (x, t)
8∑i=1
wiei . . . . . . . . . . . . . . . . . . . . . . . (2.26)
SECTION 2. LATTICE BOLTZMANN METHODS 47
A similar approach is used for interaction with the solid
Fvads(x, t) = −Gadsψv(x, t)
8∑i=1
wiei . . . . . . . . . . . . . . . . . . . . . (2.27)
and
Flads(x, t) = −Gadsψl(x, t)
8∑i=1
wiei . . . . . . . . . . . . . . . . . . . . . (2.28)
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:
Gads = 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.000002Gads = −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 cor-
relation 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 ampli-
tude 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, Ca, 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 capil-
lary 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 =C2
3(τ − ∆t
2)ρinj
C2
3(τ − ∆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 = 100and ρ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 = 100and ρ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 fol-
lowing 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 ex-
ample, the non-wetting fluid cannot enter a throat as long as the available pressure
gradient is greater than the Pc value associated with the interface given by Laplaces
law (Eq. 2.37:
Pc =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 qij between them is given by:
qij =πr4
ij
8aµij(pi − pj) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (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:
qij =πr4
ij
8aµijmax[(pi − pj − Pij), 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, fromstable displacement to capillary fingering: (c) logC = 0, from viscous fingering tostable 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, multi-
phase 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 ri (x, t) and f bi (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: fi = f ri (x, t) + f bi (x, t). The LBM equation is written for each phase:
fki (x + ei, t+ ∆t) = fki (x, t) + Ωki (x, t) . . . . . . . . . . . . . . . . . . (2.41)
With the collision operator given by:
Ωki = (Ω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:
(Ωki )
1 = − 1
τk(fki − 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:
(Ωki )
2 =Ak2‖F‖[(ei.F)2/‖F‖2 − 1/2] . . . . . . . . . . . . . . . . . . . (2.44)
Where bfF is the color gradient defined as:
F =∑i
ei(ρr(x + ei)− ρb(x + ei)) . . . . . . . . . . . . . . . . . . . . (2.45)
SECTION 2. LATTICE BOLTZMANN METHODS 56
In single phase F = 0. The parameter Ak 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 ri − f bi )ei . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (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 main-
tained automatically. The collision operator (Ωki )
2 in Eq. 2.44 is replaced by:
(Ωki )
2 = ei.Fk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (2.47)
where Fk is an effective force on the kth phase.
Fk(x) =∑k′
∑i
Vkk′(x,x + ei)ei . . . . . . . . . . . . . . . . . . . . . . (2.48)
and Vkk′ is an interaction pseudo-potential between different phases, or components.
Vkk′(x,x′) = Gkk′(x,x′)ψk(x)ψk′(x) . . . . . . . . . . . . . . . . . . . . (2.49)
G is the amplitude of the interaction and ψ is a function of the density for kth phase.
The collision operator (Ωki )
2 in the Shan-Chen model does not satisfy local momentum
conservation. Gkk′ acts like a temperature; when G is smaller than the critical value
Gc (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 eqi +Gαβeiαeiβ . . . . . . . . . . . . . . . . . . . . . . . . . . . . (2.50)
We obtain a new stress-tensor condition:∑i
f eq′i eiαeiβ = 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 ea∑
σ1τσfσa
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . (2.52)
To be compared with the SCMP macroscopic velocity described in Eq. 2.8, the den-
sity 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.
Fσ(x) = −Gψσ(x, t)8∑
a=1
waψσ(x + ea∆t, t)ea . . . . . . . . . . . . . . (2.53)
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).
ueqσ = 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 differentcomponents ρ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:
Fσads(x, t) = −Gσ
adsρ(x, t)8∑
a=1
was(x + ea∆t)ea . . . . . . . . . . . . . (2.56)
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, Gads should be small relative to G. There is a direct relationship between G,
G1ads and G2
ads. If G1ads = G2
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:
kri = − qiµikabsAdP/dx
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . (2.57)
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 Multi-
relaxation 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 de-
scribe 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 andthe pore structure. The program execution (middle) leads to the two phase flowsimulation 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 parameter
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 locatedinside 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:
fki (x + ei, t+ ∆t) = fki (x, t) + (Ωki )
1 + (Ωki )
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 imple-
mented as a mere swapping between density distributions of neighboring nodes.
The second term (Ωki )
1 is the collision term. It is implemented in a similar
fashion as LBGK, even if the form varies slightly.
(Ωki )
1 = ρωi [αi + ei.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 (Ωki )
2 contributes to the dynamics in the interfaces and generates
a surface tension. It is implemented in the applyForces() function.
(Ωki )
2 = 2Ak‖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 local-
ization of the interfaces between the two fluids. The gradient color approach
consists of computing a map of the domain where the difference of densities be-
tween 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
ei(ρr(x + ei)− ρb(x + ei)) . . . . . . . . . . . . . . . . (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 up-
dated (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 witha 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 mediacharacterizing 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 mediacharacterizing 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, thewetting fluid (transparent) invades the porous media already saturated with nonwetting 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 limi-
tations 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.
Bibliography
[1] Pierre M. Adler and Howard Branner. Multiphase flow in porous media. Annual
Review Fluid Mechanics, 20:35–59, 1988.
[2] Chopard B. and Droz M. Cellular automata modeling of physical systems. Cam-
bridge Univeristy Press, page 341, 1998.
[3] Shiyi Chen and Gary D. Doolen. Lattice boltzmann method for fluid flow. Annual
Review Fluid Mechanics, 30(329-364), 1998.
[4] Romain de Loubens. Construction of High Order Adaptive Implicit Methods for
Reservoir Simulation. Department of Energy Resources Engineering Stanford
University, June 2007.
[5] Ph. Renard G. de Marsily. Calculating equivalent permeability: A review. Ad-
vances in Water Resources, 20(5), 1997.
[6] Cancelliere A. Chang C. Foti E. Rothman D.H. and Succi A. The permeability
of a random medium: Comparison of simulation with theory. Physics of Fluids,
A(2):2085–2088, 1990.
[7] Gunstensen A.K. Rothman D.H. Microscopic modeling of immiscible fluids in
three dimensions by a lattice boltzmann method. EPL (Europhysics Letters),
18(2):157–161, 1992.
[8] Gunstensen A.K. Rothman D.H. Lattice boltzmann studies of immiscible two
phase flow through porous media. Journal of Geophysical Research, 98(B4):6431–
6441, 1993.
69
BIBLIOGRAPHY 70
[9] Dominique dHumi‘eres Irina Ginzburg Manfred Krafczyk Pierre Lallemand and
Li-Shi Luo. Multiple-relaxation-time lattice boltzmann models in three dimen-
sions. The Royal Society, 360, February 2002.
[10] Gunstensen A.K. Rothman D.H. Zaleski S. Zanetti G. Lattice boltzmann model
of immiscible fluids. Physical Review A, 43(8):4320–4327, 1991.
[11] P. L. Bhatnagar E. P. Gross and M. Krook. A model for collision processes in
gases. small amplitude processes in charged and neutral one-component systems.
Physical Review, 94:511–525, 1954.
[12] Andrew K. Gunstensen. Lattice Boltzmann Studies of Multiphase Flow Through
Porous Media. Massachusetts Institute of Technology, June 1992.
[13] J. Hardy and Y. Pomeau. Microscopic model for viscous flow in two dimensions.
The American Physical society, (DOI: 10.1103/PhysRevA.16.720), 1976.
[14] Boaz Nur Amos Nur Jack Dvorkin Meghan Armbruster Chuck Baldwin Qian
Fang Naum Derzhi Carmen Gomez and Yaoming Mu. The future of rock physics:
Computational methods vs. lab testing. Ingrain, 2008.
[15] Che J.D. and D. Wilkinson. Pore-scale viscous fingering in porous media. Phys-
ical Review Letters, 55(18):1892–1895, 1985.
[16] Liping Jia. Reservoir Definition Through Integration of Multiscale Petrophysical
Data. Department of Energy Resources Engineering Stanford University, March
2005.
[17] Youngseuk Keehm. Computational Rock Physics: Transport Properties in Porous
Media and Applications. Department of Geophysics School of Earth Sciences
Stanford University, June 2003.
[18] Roland Lenormand and Eric Touboul. Numerical models and experiments on
immiscible displacements in porous media. Journal of Fluid Mechanics, 189:165–
187, 1988.
BIBLIOGRAPHY 71
[19] Nicos S. Martys and Hudong Chen. Simulation of multicomponent fluids in
complex three dimensional geometries by the lattice boltzmann method. The
American Physical society, 53(47.55.Mh), January 1996.
[20] Jr Michael C. Sukop, Daniel T. Thorne. Lattice Boltzmann Modeling. An Intro-
duction for Geoscientists and Engineers. Springer, krips bv edition, 2006.
[21] A. Kuzmin A.A. Mohamad. Multirange multi-relaxation time shan-chen model
with extended equilibrium. Computers and Mathematics with Applications, (El-
sevier), 2009.
[22] Dardis O. and McCloskey J. Lattice boltzmann scheme with real numbered
solid density for the simulation of flow in porous media. Physical Review E,
57(4):4834–4837, 1998.
[23] Michael R. Swift E. Orlandini W. R. Osborn and J. M. Yeomans. Lattice boltz-
mann simulations of liquid-gas and binary fluid systems. Physical Review E,
54(5), 1996.
[24] Michael R. Swift W. R. Osborn and J. M. Yeomans. Lattice boltzmann simula-
tion of nonideal fluids. Physical Review Letters, 75(5), 1995.
[25] Y. Cinar A. Riaz and H.A. Tchelepi. Experimental study of co2 injection into
saline formations. SPEJ, December 2009.
[26] Rothman D.H. Zaleski S. Lattice-gas models of phase separation: interfaces,
phase transitions and multiphase flow. Review Mod. Physics, (66):14171479,
1994.
[27] X. Shan and H. Chen. Lattice boltzmann model for simulating flows with multiple
phases and components. Physical Review E, 47(3), 1993.
[28] F. J. Higuera S. Succi and R. Benzi. Lattice gas dynamics with enhanced colli-
sions. EPL (Europhysics Letters), 9(4), 1989. doi: 10.1209/0295-5075/9/4/008.
BIBLIOGRAPHY 72
[29] Michael C. Sukop and Dani Or. Lattice boltzmann method for modeling liquid-
vapor interface configurations in porous media. Water Resources Research,
40(W01509, doi:10.1029/2003WR002333), 2004.
[30] YoungSeuk K. Mukerji T. and Nur A. Computational rock physics at the pore
scale: Transport properties and diagenesis in realistic pore geometries. TLE, 20,
2001.
BIBLIOGRAPHY 73
2.7 Acknowledgment
This work was funded by the Stanford University Petroleum Research Institute for
Reservoir Simulation (SUPRI-B).
Appendix A
SSI and Newton for three phase
system
A.0.1 Successive substitution iterations
In order to use the SSI method, we need to slightly modify the equilibrium system.
The K-values represent the equilibrium parameter we are going to use as a convergence
criterion. K-values are defined as the ratio between the mole fractions of different
phases. However, they are also functions of the pressure and temperature. [?] also
introduces a dependency to the fugacity of a component. For three phase cases, let
us call V, L1 and L2, respectively, as the vapor, first-liquid and second- liquid phases.
Here, y x w refer to the molar fractions associated with the ν1, ν2, ν3 phase fractions.
The fugacity of a component in each of these phases can be written as:
fVi = yiϕVi P, i ∈ [1, . . . nc], (A.1)
fL1i = xiϕ
L1i P, i ∈ [1, . . . nc], (A.2)
fL2i = wiϕ
L2i P, i ∈ [1, . . . nc], (A.3)
where ϕji are the fugacity coefficients (related to the potentials, see [?]). At equilib-
rium, f ji = fki . Therefore we have:
K1i = yi/xi = ϕL1
i /ϕVi , i ∈ [1, . . . nc], . . . . . . . . . . . . . (A.4)
74
APPENDIX A. SSI AND NEWTON FOR THREE PHASE SYSTEM 75
K2i = wi/xi = ϕL1
i /ϕL2i , i ∈ [1, . . . nc], . . . . . . . . . . . . . (A.5)
The fact that we use for K2 the ratio of the second liquid over the first one is a norm
we adopt and related to the previous work we have done on K-values, as well as, some
papers like Four Component Gas/Water/Oil Displacements in One Dimension, [?].
The general idea is to have the lightest phase over the heaviest one. The Rachford
Rice equation is written as a combination of 1.17, 1.18, 1.19, 1.20 and appears under
the form:
nc∑i=1
zi(K1i − 1)
1 + ν1(K1i − 1) + ν3(K2
i − 1)= 0, (A.6)
nc∑i=1
zi(K2i − 1)
1 + ν1(K1i − 1) + ν3(K2
i − 1)= 0, (A.7)
This is obviously a nonlinear equation. We have to find the zeros of a function with
two components and two parameters (np − 1 for a general case).
F (ν1, ν3) =
nc∑i=1
zi(K1i −1)
1+ν1(K1i −1)+ν3(K2
i −1)
nc∑i=1
zi(K2i −1)
1+ν1(K1i −1)+ν3(K2
i −1)
..
In order to clarify the process, let us recall the different steps of the successive
substitution:
1. Initial guess for y, x, w. Since there is no such a correlation as Wilson for a
Liquid-Liquid partition, let us consider the result as a stability analysis on the
one hand and the CSP results on the other.
2. Solve the equations A.6 and A.7. We use a Newton-Raphson method. The
jacobian is :
J =
−nc∑i=1
zi(K1i −1)2
(1+ν1(K1i −1)+ν3(K2
i −1))2−
nc∑i=1
zi(K1i −1)(K2
i −1)
(1+ν1(K1i −1)+ν3(K2
i −1))2
−nc∑i=1
zi(K1i −1)(K2
i −1)
(1+ν1(K1i −1)+ν3(K2
i −1))2−
nc∑i=1
zi(K2i −1)2
(1+ν1(K1i −1)+ν3(K2
i −1))2
.
APPENDIX A. SSI AND NEWTON FOR THREE PHASE SYSTEM 76
. If ν is the vector composed of ν1 and ν31., the implementation becomes:
ν(1) = ν(0) − J−1F (ν(0)), (A.8)
It is also possible to use a 2D bisection. The technique is presented in Three-
Phase Equilibrium Calculations for Compositional Simulation, [?] but its appli-
cation to our case does not seem relevant.
3. Calculate the compositions as well as the compressibility factor from an EoS.
4. Calculate and compare the fugacities. If they are all equal we have equilibrium,
else, update the K values using some correction. It can be a mere norm:
K(1)newi = K
(1)oldi ‖f
L1i
fVi‖, (A.9)
K(2)newi = K
(2)oldi ‖f
L1i
fL2i
‖, (A.10)
or a correction type Laplace or Gauss with exponential evaluation. we use the
A.9, A.10 type of update.
5. Stop when you reach the convergence. We evaluate the square of the ratio of
the fugacities compared to 1.
The details of the implementation of the SSI can be found in the appendix ?? (function
flash calculation of class eos parameters).
N.B: It is important to understand that there exists two levels of non linear cal-
culation. A first one (small loop) is the Rachford Rice equation included in the SSI
part of the solving. The general system (large loop) with the equilibrium equations
is a combination of SSI and Newton.
A.0.2 Newton algorithm
Since the SSI converges slowly (linear), it is followed by a Newton computation with
a higher rate (quadratic) provided we are close enough to the solution. The system
1We also tried a more general implementation adding ν2 as a variable and the phase constraintas an equation
APPENDIX A. SSI AND NEWTON FOR THREE PHASE SYSTEM 77
we solve using Newton does not need to be modified. We can update directly the
primary variables of our problem (y x w and ν1ν3) considering the 3nc + 2 equations
of the system. The use of AD made this process completely straightforward since we
just have to define new AD variables and the jacobian (3nc+2×3nc+2) is computed
automatically. The system can be described as following:
g(y,x,w, ν1, ν3) =
fV1 − fL11
...
fVnc − fL1nc
fL21 − fL1
1
...
fL2nc − f
L1nc
Z1 − ν1y1 − (1− ν1 − ν3)x1 − ν3w1
...
Znc − ν1ync − (1− ν1 − ν3)xnc − ν3wncnc∑i=1
(xi − yi)nc∑i=1
(xi − wi)
.
In order to find the zeros of this function, the jacobian is computed and the
Newton-Raphson algorithm is applied. The initial guess being the result of SSI calcu-
lation. The corresponding code is presented in the appendix ?? (Nflash calculation,
eos parameters). Since we solve a negative flash, we allow the phase coefficients (ν)
to become less than zero or more than one and just interpret this as the disappearance
of one or more phases. The three phase situation actually corresponds to 0 < νj < 1
for every j.
Appendix B
Workflow and Algorithms layout
B.1 Algorithms designs for CSP
B.1.1 Tie simplex calculation
B.1.2 Methods comparisons
78
APPENDIX B. WORKFLOW AND ALGORITHMS LAYOUT 79
Figure B.1: Representation of the tie triangle calculation functions.
APPENDIX B. WORKFLOW AND ALGORITHMS LAYOUT 80
Figure B.2: Representation of the procedure handling the comparison between differ-ent methods.
Appendix C
Appendix Lattice Boltzmann
Methods
C.1 Integration of Lattice Boltzmann laws to re-
cover the Navier-Stokes equations
We present here the development of the Lattice Boltzmann equation as well as the
derivation of Navier Stokes equations resulting: We recall the equation for propaga-
tion:
fi(x + ei∆t, t+ ∆t) = fi(x, t) + Ωi(f(x, t)) . . . . . . . . . . . . . . . (C.1)
Where fi is the particle velocity distribution function along the ith direction. Ωi(f(x, t))
is the collision operator and gives information about the rate of change of fi due to
collisions. Density ρ and momentum ρu are defined as:
ρ =8∑i=0
fi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (C.2)
ρu =8∑i=0
fiei . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (C.3)
Ωi has to satisfy the continuity equation as well as the momentum conservation:
8∑i=0
Ωi = 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (C.4)
81
APPENDIX C. APPENDIX LATTICE BOLTZMANN METHODS 82
8∑i=0
Ωiei = 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (C.5)
If we consider the elementary time ∆t and space ∆x as first order ε’s, we can perform
a Taylor expansion of Eq. C.1.
∂fi∂t
+ ei.∇fi + ε
(1
2eiei.∇∇fi + ei.∇
∂fi∂t
+1
2
∂2fi∂t2
)=
Ωi
ε. . . . . . (C.6)
We derive the hydrodynamic equation by using Chapman-Enskog expansion, Eq. C.7.
∂
∂t= ε
∂
∂t1+ ε2
∂
∂t2∂
∂x= ε
∂
∂x1
(C.7)
Assuming that the diffusion time scale t2 is much slower than the convection time
scale t1. fi can be expanded as a sum of the equilibrium distribution and the non
equilibrium distribution:
fi = f eqi + εf(neq)i . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (C.8)
f ei q shoul satisfy the macroscopic equations:
8∑i=0
f eqi = ρ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (C.9)
8∑i=0
f eqi ei = ρu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (C.10)
The non equilibrium function can be written as a first order polynomial of equilibrium
functions:
f(neq)i = f
(1)i + εf
(2)i +O(ε2) . . . . . . . . . . . . . . . . . . . . . . . (C.11)
Where :
8∑i=0
f(k)i = ρ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (C.12)
8∑i=0
f(k)i ei = ρu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (C.13)
APPENDIX C. APPENDIX LATTICE BOLTZMANN METHODS 83
for k = 1, 2. Inserting fi into the collision operator and operating a Taylor expansion,
we obtain:
Ωi(f) = Ωi(feq)+ε
∂Ωi(feq)
∂fjf
(1)j +ε2
(∂Ωi(f
eq)
∂fjf
(2)j +
∂2Ωi(feq)
∂fj∂fkf
(1)j f
(1)k
)+O(ε3) (C.14)
from Eq. C.6, if ε→ 0, Ωifeq = 0 which leads to a linearized collision opertaor:
Ωi(f)
ε=Mij
ε(fj − f eqj ) . . . . . . . . . . . . . . . . . . . . . . . . . . (C.15)
Where Mij = ∂Ωi(feq)
∂fjis the collision matrix [?], which determines the scattering rate
between directions i and j. It only depends on the angle between directions i and j
and has a limited set of values. It satisfies mass and momentum conservation:
8∑i=0
Mij = 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (C.16)
8∑i=0
Mijei = 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (C.17)
If we further assume that the local particle distribution relaxes to an equilibrium
state at a single rate τ
Mij = −1
τδij . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (C.18)
We finally get the lattice BGK collision term:
Ωi
ε= −1
τf
(neq)i = − 1
ετ(f
(1)i + εf
(2)i ) (C.19)
the LBGK equation:
fi(x + eit, t+ 1) = fi(x, t)−fi − f eqi
τ(C.20)
From Eq. C.6 one obtains the following equations:
∂f eqi∂t1
+ ei.∇1f(1)i +
1
2eiei.∇∇f eqi + ei.∇
∂f eqi∂t1
+1
2
∂2f eqi∂t21
=1
τf
(2)i . (C.21)
To order ε1 we obtain
∂f(1)i
∂t2+(
1− 2
τ
)∂f (1)i
∂t1+ ei.∇1f
(1)i
= −f(2)i
τ. . . . . . . . . . . . (C.22)
APPENDIX C. APPENDIX LATTICE BOLTZMANN METHODS 84
From Eq. C.20 and C.22 we obtain the following mass and momentum equations
∂ρ
∂t+∇.ρu = 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (C.23)
∂ρu
∂t+∇Π = 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (C.24)
which are accurate to second order in ε for Eq. C.1. Here the momentum flux tensor
Π has the form:
Παβ =8∑i=0
(ei)α(ei)β
[f eqi +
(1− 2
τ
)f
(1)i
]. . . . . . . . . . . . . . . . (C.25)
(ei)α is the component of the velocity vector ei in the α-coordinate direction. We
need to consider the choice taken for the lattice form in order to go further. In our
2-D lattice with eight directions, we obtain:
ei =(cos(
π
2(i− 1)), sin(
π
2(i− 1)))
). . . . . . . . . . . . . . . . . . (C.26)
for i = 1, 3, 5, 7
ei =√
2(cos(
π
2(i− 1) +
π
4), cos(
π
2(i− 1) +
π
4))
. . . . . . . . . . (C.27)
for i = 2, 4, 6, 8 and e0 = 0. Note that the Navier-Stokes equations has a second-order
nonlinearity. The general form of the equilibrium distribution function can be written
up to O(u2).
f eqi = ρ[a+ b(ei.u) + c(ei.u)2 + du2] . . . . . . . . . . . . . . . . . . (C.28)
where a b c and d are lattice constants. This expansion is valid only for small velocities,
or small Mach numbers u/Cs , where Cs is the sound speed. If we use the constraint
in Eq. 2.8, we obtain the coefficients of Eq. C.28.
f eqi (x) = wiρ(x)
[1 + 3
ei.u
c2+
9
2
(ei.u)2
c4− 3
2
u2
c2
]. . . . . . . . . . . (C.29)
Eq. C.28 and C.29 show the Taylor development and the expression of the linear BGK
collision operator. If we include the formula in Eq. C.25, we obtain:
Π(0)αβ =
8∑i=0
(ei)α(ei)βfeqi
= pδαβ + puαuβ (C.30)
APPENDIX C. APPENDIX LATTICE BOLTZMANN METHODS 85
Π(1)αβ =
(1− 1
2τ
) 8∑i=0
(ei)α(ei)βf1i
= ν (∇α(ρuβ) +∇β(ρuα)) (C.31)
Where p = ρ/3 is the pressure and ν = (2τ − 1)/6 is the kinematic viscosity. The
momentum equation is derived from the expression above:
ρ
(∂uα∂t
+∇βuαuβ
)= −∇αp+ ν∇β.(∇αρuβ +∇βρuα) . . . . . . (C.32)
This corresponds to the Navier-Stokes equation in cases where the density variation
is small.