Quick viewing(Text Mode)

Lattice-Boltzmann Fluid Dynamics a Versatile Tool for Multiphase and Other Complicated flows Shiyi Chen, Gary D

Lattice-Boltzmann Fluid Dynamics a Versatile Tool for Multiphase and Other Complicated flows Shiyi Chen, Gary D

Lattice-Boltzmann Dynamics a versatile tool for multiphase and other complicated flows Shiyi Chen, Gary D. Doolen, and Kenneth G. Eggert

98 Los Alamos Science Number 22 1994 Number 22 1994 Los Alamos Science 99

Lattice-Boltzmann Fluid Dynamics

ong-term research efforts at the method yields a good approximation to projects of this type helped motivate Laboratory often produce results the standard equations of fluid flow, the the oil companies to ask that Congress Lthat prove highly valuable to Navier-Stokes equations, in the limit of substantially increase DOE support for U.S. industry. The example described long wavelengths and low frequencies. oil and gas research and make those here is a new approach to modeling the Also, recent generalizations of the funds available for significant new col- flow of multiphase fluid mixtures, such method have extended its applicability laborations between the oil and gas in- as oil and water, through very compli- to multiphase flows, chemically react- dustry and the National Laboratories. cated geometries. This new modeling ing flows, and thermohydro- The result is ACTI—the Advanced technique, called the lattice-Boltzmann dynamics. Computational Technology Initiative— method, evolved out of ideas that have United States oil companies have an initiative that will receive $30Ð50 been intensely investigated since 1985, expressed considerable interest in the million in funding in 1995. when Laboratory scientists and others lattice-Boltzmann method for address- In this article we will first sketch the discovered that very simple models of ing problems in oil recovery. For ex- basic ideas of the lattice-Boltzmann discrete particles confined to a lattice ample, we are collaborating with the method and its general applicability. can be used to solve very complicated Mobil Exploration and Producing Tech- We will then explain how the lattice- flow problems. nical Center on using the lattice-Boltz- gas and lattice-Boltzmann methods are This lattice method can be regarded mann method to simulate the flow of adapted to describe the dynamics at the as one of the simplest microscopic, or oil and water through oil-bearing sand- interfaces between two immiscible flu- particle, approaches to modeling macro- stone at a scale and an accuracy never ids such as oil and water and present scopic dynamics. It is based on the before possible. Mobil provided Los some simulations of phase separation. Boltzmann transport equation for the Alamos with 5-micron-resolution sand- Finally, we will mention a few of the time rate of change of the particle dis- stone geometries for use in the simula- new directions into which lattice-Boltz- tribution function in a particular state. tions. (Typical pore diameters are tens mann research is moving. Specific ap- The Boltzmann equation simply says of microns.) The goal of the work is to plications to the flows in oil reservoirs that the rate of change is the number of simulate, at the scale of individual are discussed in the companion article. particles scattered into that state minus pores in the rock, what happens when the number scattered out of that state. water is pumped though the rock to The method is fully parallel (the force out oil. , surface ten- Lattice Methods for Modeling same calculations are performed at sions, contact angles, and surfactant ef- Continuum Dynamics every lattice site) and local (only near- fects can be varied to determine how by particles interact with each other). well this method of oil recovery can be Lattice methods, including the lat- It is therefore easily programmed and made to work in specific circumstances. tice-gas method and its derivative, the runs efficiently on parallel machines. The collaboration is described by Mobil lattice-Boltzmann method, present pow- Complex boundary conditions are in- and Los Alamos scientists in the com- erful alternatives to the standard “top- corporated in a straightforward way and panion article, “Toward Improved Pre- down” and “bottom-up” approaches to cause the calculational speed to de- diction of Reservoir Flow Perfor- modeling the behavior of physical sys- crease by only a few percent. The mance—Simulating Oil and Water tems. The “top-down” approach begins Flows at the Pore Scale.” The work with a continuum description of macro- Illustration on previous spread: A lattice-Boltz- has included the development of soft- scopic phenomena provided by partial mann simulation of flow past a slab shows the ware to calculate relative permeabilities differential equations. The Navier- complicated flow patterns that can be modeled of oil and water in complex geometries. Stokes equations for incompressible with this technique. The lattice is 1024 ϫ 256 The software received an R&D-100 fluid flows are an example. Numerical sites; the thickness of the slab is 32 sites, which gives the flow a Reynolds number of 960. Wind- award for 1993. techniques, such as finite-difference and tunnel boundary conditions are used—the flow The lattice-Boltzmann work is a su- finite-element methods, are then used to velocity at the entrance (left), the top, and the perb example of applying the extraordi- transform the continuum description bottom boundaries is fixed. The top image shows nary computer power and expertise in into a discrete one in order to solve the contours of equal vorticity; the bottom image shows the distribution of the flow. The computational physics available at Los equations numerically on a computer. simulation was done using the Connection Ma- Alamos to problems in petroleum pro- The “bottom-up” approach is based chine 2 at the Advanced Computing Laboratory. duction. The Laboratory’s success at on the microscopic, particle description

100 Los Alamos Science Number 22 1994

Lattice-Boltzmann Fluid Dynamics

lattice1.adb 7/26/94

provided by the equations of molecular dynamics; here the and veloci- ty of each atom or molecule in the sys- tem are closely followed by solving Newton’s equations of motion. This microscopic description is straightfor- ward to program on a computer but simulations using the largest computers presently available are limited to very small systems (ten million particles) and very short times (a few picosec- Figure 1. Allowed Velocities at a Lattice Site onds). Therefore molecular dynamics The arrows indicate the magnitudes and directions of the allowed velocities ei at a lat- simulations are more suitable for under- tice site in a three-dimensional lattice-Boltzmann simulation. The lattice has a cubic standing the fundamental interactions structure. Six arrows point to nearest-neighbor sites. Eight arrows point along body

-Lattice-Boltz .0 ؍ that underlie macroscopic material diagonals. The sphere at the lattice site represents zero velocity, e0 properties than for modeling macro- mann simulations based on a proper equilibrium particle distribution and this minimum scopic dynamics. set of velocities preserve the desired isotropy of fluid properties. Intermediate between the two schemes are the lattice-Boltzmann and attain a speed of 20 gigaflops on a 512- mohydrodynamics, magnetohydrody- lattice-gas methods, which might be processor CM-5 Connection Machine. namics, the dynamics of liquid crystals considered mesoscopic approaches. Typical simulations of flow through and the design of semiconductors. The lattice methods begin from a parti- porous media include 100 million lat- These models are validated by precise cle description of matter: A gas of par- tice sites and run for 5000 timesteps comparisons with other numerical algo- ticles exists on a set of discrete points and therefore require only a few hours rithms, analytic results, and experiments. that are spaced at regular intervals to on that machine. When applied to peri- form a lattice. Time is also divided odic geometries, the three-dimensional into discrete timesteps, and during each lattice-Boltzmann model is able to The Lattice-Boltzmann Method timestep particles jump to the next lat- achieve the same spatial resolution as tice site and then scatter according to conventional methods in half the time. In the lattice-Boltzmann method, simple kinetic rules that conserve , Also, because boundary conditions— space is divided into a regular lattice , and energy. This simpli- even complex ones—are imposed local- (for example, a simple cubic lattice) fied molecular dynamics is very care- ly, lattice methods simulate flows in and real numbers at each lattice site fully crafted to include the essentials of both simple and complex geometries represent the single-particle distribution the real microscopic processes. Conse- with almost the same speed and effi- function at that site, which is equal to quently the macroscopic, or averaged, ciency. They are therefore suitable for the expected number of identical parti- properties of lattice simulations obey, simulating flows in the extremely com- cles in each of the available particle to a good approximation, the desired plex geometries of porous media states i. In the simplest model, each continuum equations. Despite their ori- whereas conventional methods are not. particle state i is defined by a particle gin in a particle description, lattice Finally, developing code for lattice velocity, which is limited to a discrete methods are essentially numerical methods is considerably faster and easi- set of allowed velocities. During each schemes for studying averaged macro- er than for traditional schemes. discrete timestep of the simulation, par- scopic behavior. They nevertheless re- General lattice models already exist ticles move, or hop, to the nearest lat- tain the advantages of a particle descrip- for solving the equations of fluid flow, tice site along their direction of motion, tion, including clear physical insight, the wave equation, and the diffusion where they “collide” with other parti- easy implementation of boundary condi- equation. Special versions of these cles that arrive at the same site. The tions, and fully parallel algorithms. models have been developed for simulat- outcome of the collision is determined Because lattice methods are entirely ing flow through porous media, turbulent by solving the kinetic (Boltzmann) local, they are extremely fast. A simu- flows, phase transitions, multiphase equation for the new particle-distribu- lation of a simple lattice-gas model can flows, chemically reacting flows, ther- tion function at that site and the particle

Number 22 1994 Los Alamos Science 101

Lattice-Boltzmann Fluid Dynamics

A f3 e3 A A f e f e 4 4 2 2 lattice2.adb 7/26/94

A A A fi’s unchanged. (No particles are lost.) f5 e5 f1 e1 f0e0 The rules are also selected to conserve the total energy and momentum at each lattice site. To ensure that the particles B A have zero average velocity at bound- A f8 e8 f6 e6 aries (both perpendicular and parallel to A the walls), one normally imposes f7 e7 c “bounce-back” boundary conditions: Any flux of particles that hits a bound- ary simply reverses its velocity so that 8 A the average velocity at the boundary is Total momentum at lattice site A = Σf e i=1 i i automatically zero, as observed experi- mentally. The outcome of collisions is very simply approximated by assuming that Figure 2. Momentum Distributions in Two the momenta of the interacting particles

The single-particle distribution function at each lattice site, fi ( x,t), equals the expected will be redistributed at some constant number of identical particles in each of the available particle states i. Particle veloci- rate toward an equilibrium distribution eq ties ei are limited to a discrete set defined by the geometry of the lattice, and the mo- fi . This simplification is called the mentum distribution at a lattice site is equal to fi (x,t)ei. On a two-dimensional square single-time-relaxation approximation. -Each arrow indicates In mathematical terms, the time evolu .8 ,…,1 ,0 ؍ lattice, eight directions of motion are possible, so i the momentum in one of the allowed directions of motion. The circles represent the tion of the single-particle distribution is rest particles. The figure shows several examples of momentum distributions in two given by dimensions. The distribution at site B has a net momentum in direction 3. The net momentum is equal to zero at sites A and C. fi(x ؉ ei, t ϩ 1) ϭ eq fi(x,t) Ϫ fi (x,t) distribution function is updated. particles to the next lattice site along f (x,t) − ᎏᎏ, i ␶ More specifically, the single-particle their directions of motion. Since speed distribution function at a single site in a equals the distance traveled divided by where i = 0, 1,…, 14. The second term simple cubic lattice is represented by a ⌬t, this model has only three speeds, on the right-hand side is the simplified set of real numbers, fi(x,t),the expected zero for particles at rest, c for particles collision operator ⍀i. The rate of number of particles at lattice site x and moving to nearest-neighbor sites and change toward equilibrium is 1/␶, the time t moving along the lattice vector ͙ෆ3c for particles moving to the next inverse of the relaxation time, and is ei, where each value of the index i sites along body diagonals. Usually the chosen to produce the desired value of specifies one of the allowed directions units are chosen such that the distance the fluid . of motion. Figure 1 shows these direc- to nearest neighbors and ⌬t are unity, Figure 3 illustrates the single-time- tions. Six lattice vectors point to the so that c ϭ 1 and the lattice vector ei is relaxation approximation in two dimen- six nearest-neighbor sites. Eight lattice numerically equal to the velocity of the sions. The net momentum of the in- vectors point along the body diagonals particles moving in direction i. If we coming state is zero. In that case, if no to the next sites along those diagonals. also set the mass of each particle equal external forces exist, the equilibrium Thus particles can travel in fourteen di- to unity, the momentum in direction i at distribution consists simply of equal rections from each lattice site. The ball site x and time t is just fi(x,t) ei. Figure amounts of particle momentum in each in the center denotes the vector 2 illustrates sample momentum distribu- of the allowed directions of motion. e0,which is equal to 0 and represents tions in two dimensions. The collision rules will therefore force particles that are not moving. In total, The second operation is to simulate the larger fi’s at the site to decrease and fifteen real numbers describe the parti- particle collisions, which cause the par- the smaller fi’s to increase so that the cle distribution function at a site. ticles at each lattice site to scatter into particle distribution is closer to the The first operation in each timestep different directions . The collision equilibrium distribution after the colli- ⌬t of the calculation is to advance the rules are chosen to leave the sum of the sion than before. External forces (grav-

102 Los Alamos Science Number 22 1994 lattice3.adb 7/26/94

Lattice-Boltzmann Fluid Dynamics

Step 1—Hopping Step 2—Collision

Particle momenta that Incoming momentum Outgoing momentum will collide at site A distribution distribution

(a) Single-time relaxation with τ = 1

A A A

τ = 1

Equilibrium distribution

(b) Single-time relaxation with τ = 2

A A A

τ = 2

Halfway between incoming and equilibrium distributions

Figure 3. The Single-Time-Relaxation Process In the single-time-relaxation approximation, the momentum distribution at each lattice site is forced toward the equilibrium distribu- tion at each timestep. In the absence of external forces, the equilibrium distribution of a state with zero net momentum is just equal amounts of momentum in each direction. The figure illustrates the two calculational steps that occur during each timestep. First the incoming momentum distribution assembles at a lattice site as particles at the neighboring sites hop along their directions of motion to that site. Second, the incoming distribution changes, according to the single-time-relaxation collision rule, to an outgoing distribution that is closer to the equilibrium distribution. When ␶ ϭ 1, the incoming momentum distribution changes to the equilibri- um distribution in one time step; when ␶ ϭ 2, the outgoing momentum distribution is halfway between the incoming and the equilibri- um distributions. ity or electromagnetic forces) can be past a rectangular plate. Periodic methods and with experiment have ver- added to the model and make the fi’s boundary conditions are imposed per- ified the accuracy of this method. In grow in the direction of the net force pendicular to the plate; wind-tunnel general, lattice-Boltzmann simulations and shrink in the opposite direction. boundary conditions (air flowing in agree with exact solutions to the Although lattice models consist of a from the left at higher pressure and out Navier-Stokes equations to second very simple set of rules, those rules at the right at lower pressure) are im- order in the lattice spacing and the lead to very complicated flow patterns. posed in the flow direction. Attached timestep. The opening pages of this article show vortices and vortex shedding are evi- The lattice-Boltzmann method is an a snapshot from a two-dimensional lat- dent, showing the complicated flow pat- outgrowth of lattice-gas models, provid- tice-Boltzmann simulation performed terns that can be modeled with lattice- ing something akin to an ensemble av- by Lishi Luo here at the Laboratory. Boltzmann methods. Detailed, erage of many realizations of a lattice The simulation models the flow of air quantitative comparisons with other gas but without the unphysical effects.

Number 22 1994 Los Alamos Science 103 Lattice-Boltzmann Fluid Dynamics

Lattice-gas models differ from lattice- leading to the appropriate macroscopic fluid density at the neighboring sites Boltzmann models in that the former equations. In other words, although lat- and that pushes the red fluid in the di- follow the motion of actual particles tice-Boltzmann simulations ignore par- rection of increasing red-fluid density. whereas the latter utilize the expected ticle-particle correlations and use sim- The effect of the force must be added values of the particle-distribution func- plified collision rules, the collision rules to the collision operator in such a way tion. The gas is composed of identical can be tailored to reproduce the correct that it does not change the total mo- particles that obey an exclusion princi- evolution of the macroscopic behavior mentum of the two fluids. The size of ple: At most one particle can occupy a of a system in a wide variety of cir- the force must be chosen to produce the given particle state at a given time. cumstances. The relevant equations are desired surface tension between the two Since Ni ( x,t), the number of particles presented in the sidebar, “Equations of fluids. Under these rules, an initially that occupy state i at a lattice site, is ei- the Lattice-Boltzmann Method.” random mixture of the red and blue flu- ther 0 or 1, only single-digit binary ids should unmix and form an equilibri- arithmetic is required to update the par- um distribution in which a spherical in- ticle numbers following each collision. Strategies for Modeling the terface separates the two fluids, as Consequently lattice-gas calculations Flow of Two Fluid Phases expected physically in mixtures of oil are extremely fast. Collision rules and water. specify the possible outcomes of two- Modeling the flow of two immisci- particle and three-particle collisions and ble fluids, such as oil and water, pre- Lattice-gas simulations of immisci- the explicit choice at each site is imple- sents the difficulty of how to treat the ble fluids. The extension of lattice mented by random sampling. The lat- dynamics at the interfaces between the methods to two immiscible fluids was tice gas is therefore very noisy, and two. These dynamics control phenome- done originally in the context of lattice spatial and temporal averaging are re- na such as the flow of oil and water gases. Our particular method imple- quired to obtain macroscopic quantities. through porous media, the development ments the effects of surface tension in a Also the method has several major of viscous fingering, which occurs purely local manner—through the intro- drawbacks, including restriction to low when water pushes oil, and dendrite duction of two species of colored holes. Reynolds number, lack of Galilean in- formation (such as the growth of A hole acts like a massless “ghost” par- variance (convective flow velocities snowflakes). Traditional finite-differ- ticle that moves freely on the lattice but don’t add properly unless the system is ence and finite-element schemes can be carries no momentum. A hole of one at nearly constant density), and an un- used to model two-phase flow in simple color is created at a lattice site when an physical in which the flow geometries, but they are difficult incoming particle of that color is scat- pressure depends on the local velocity to apply in the complicated geometries tered into a new direction; the new hole in addition to the usual dependence on of porous media. Here we describe lat- moves in the incoming direction of the the local density. tice methods for complex two-phase scattered particle and thereby carries a In contrast, the lattice-Boltzmann phenomena; these methods are being memory of that particle. The hole is method uses real (continuous) numbers successfully applied to problems in oil annihilated, or disappears, when it to describe a particle distribution at recovery. meets a particle of the same color trav- each site; in this sense it approaches a To extend lattice methods to the eling in the same direction. continuum description. Although one flow of two immiscible fluids (say red To create surface tension, a new col- pays a penalty in that floating-point and blue fluids), one must double the lision rule is added to the usual ones arithmetic operations are now required information at each lattice site. In the that causes the colored particles at a to carry out the simulations, the contin- lattice-Boltzmann approach this is done site to respond to the presence of col- uum feature eliminates most of the by postulating a single-particle distribu- ored holes by moving in the opposite noise associated with lattice-gas simula- tion for each of the fluids. It is also direction. The overall effect is like that tions. In addition, the local equilibrium necessary to create new scattering rules of a short-range attractive potential eq particle distribution fi that appears in that will cause the two fluids to sepa- among particles of the same color. Al- the collision operator can be chosen to rate at an interface and to emulate the though the “color potential” has a range eliminate the unphysical features of the effects of surface tension. The essential of more than one lattice spacing, only lattice gas while including dependence idea is to compute a force at each lat- local information is needed to compute on the local fluid variables only and tice site that depends on, say, the red- the results of collision at each lattice

104 Los Alamos Science Number 22 1994 Lattice-Boltzmann Fluid Dynamics

site; consequently the colored-hole gles, one for each fluid, formed at the scheme is much faster for modeling the point of intersection. By definition, the effects of surface tension than methods sum of the two contact angles is equal requiring the calculation of nearest- to 180Њ. neighbor color . The contact angle of a fluid decreas- The colored-hole scheme has been es as the affinity, or preference, of the used successfully to simulate phase sep- wall for that fluid increases. That pref- aration, surface tension between phases, erence is called wettability. On a and contact angles between fluids and strongly water-wet surface, water solid walls. Figure 4 shows the results droplets in a background of oil will of a lattice-gas simulation of red and tend to spread out on the surface and blue fluids: Red drops have formed in the contact angle of water will be close blue fluid starting from a random initial to 0Њ. On a strongly oil-wet surface, configuration in which the density of those water droplets will bead up and red particles was equal to one-fifth the the contact angle will be close to 180Њ. Figure 4. Droplet Formation in density of blue particles. Figure 5 In our lattice-gas simulations, wettabili- Two-Phase Lattice-Gas Mixtures demonstrates that the results shown in ty is controlled by a special rule for The figure shows the results of a lattice- Figure 4 obey the Laplace formula for collisions of colored holes with the gas simulation in which the dynamics of surface tension. That is, the pressure wall: With a certain P, a the interface between red and blue phas- drop ⌬p across the boundary of each hole of either color bounces back and es was modeled by using the colored- drop is given by becomes, say, a red hole. This rule can hole scheme summarized in the text. The produce contact angles for the red fluid simulation produced this distribution of ␴ of between 20Њ and 180Њ. red droplets in a blue background after ⌬p ϭ p Ϫ p ϭ ᎏ , Figure 7 shows the results of colored- 17,200 time steps, starting from a random red blue R hole two-fluid simulations in which dif- initial distribution of red and blue parti- ferent values of the probability P for cles on 512 ؋ 512 lattice sites. The total where pred is the pressure of red parti- the upper and lower surfaces of a wall particle density is 0.4 and the ratio of red cles inside the drop, pblue is the pres- (white) have led to marked differences to blue particles is 1/5. Because the lat- sure of blue particles outside the drop, in the contact angles of the red fluid. tice gas is very noisy, the droplets have ␴ is the surface-tension coefficient, and The results shown were obtained by av- very rough surfaces, in contrast to the R is the radius of the drop. Figure 5a eraging 12 realizations of the lattice smooth surfaces expected at fluid-fluid shows the pressure versus the distance r gas. interfaces. Consequently the results of from the center of a drop; the pressure the lattice-gas simulations must be aver- change at the red-blue interface demon- Lattice-Boltzmann model for two aged spatially and temporally to be com- strates the existence of surface tension. fluids. Lattice-gas simulations produce pared with the macroscopic description Figure 5b shows ⌬p, the pressure realistic surface phenomena for immis- of immiscible fluids (see Figure 5). This change across the interface of the drop cible fluids, but they do so only when figure should also be compared with for drops of different radii R. As re- temporal and spatial averaging are used Figure 8, which shows that the lattice- quired by the Laplace formula, the to eliminate the noise induced by parti- Boltzmann method produces smoother, pressure change is directly proportional cle fluctuations. A more convenient ap- more realistic droplets. to 1/R. proach is to extend the lattice-Boltz- In addition to surface tension at mann method to colored fluids and use fluid-fluid interfaces, the two-fluid lat- color gradients, or nearest-neighbor in- tice-gas model must also simulate inter- teractions, for modeling interfacial dy- actions between the fluids and the namics. In this approach, each colored walls. Typically, when the interface fluid is described by a single-particle between two fluids intersects a solid distribution function, and each is as- wall, the angle of intersection is fixed. signed a number density as well as a Figure 6 illustrates the two contact an- characteristic relaxation time, which

Number 22 1994 Los Alamos Science 105 Lattice-Boltzmann Fluid Dynamics

lattice5.adb Figure 5. Verification of the Laplace (a) Pressure profile of red droplet 7/26/94 Formula for Surface Tension in Two-Phase Lattice-Gas Simulations RedMixed Blue For real droplets in a mixture of immisci- 1.2 ∆p ble fluids, a pressure difference across the interface balances the surface tension created by the mutual attraction of parti- cles of like kind. The relation is given by p 1.15 ␴/R where ␴ is ؍ the Laplace formula, ⌬p the surface-tension coefficient and R is the radius of the droplet. To compare the lattice-gas results of Figure 4 with that macroscopic description, the pressure is 1.1 0 20 40 60 80 calculated from the local particle-number r (lattice units) -n/3, and the results are aver ؍ density, p aged temporally over 1000 timesteps and spatially in the circumferential direction (b) Pressure difference across red-blue interface for red droplets of different radii (R) around the center of each droplet. (a) That average pressure is plotted as a function of the distance r from the center 0.01 of a droplet. The pressure difference be- tween the red phase and the blue phase σ demonstrates the existence of surface ∆p ~ tension in these two-phase simulations. p R ∆ (b) The pressure difference across the 0.005 droplet surface is plotted as a function of 1/R, where R is the radius of the droplet. The linear relation shows that the surface tension coefficient ␴ is a constant, as re- 0 quired by the Laplace formula. Thus the 0 0.01 0.02 0.03 0.04 averaged results of the colored-hole, two- 1/R (lattice units) phase lattice-gas simulations reproduce the correct macroscopic interfacial dy- namics. determines its viscosity. The collision mines the dynamics at the fluid-fluid in- operator now has two parts. The first terfaces. It is given by part of ⍀i induces single-time relax- ation to equilibrium, as was done for 2 Ak (eiиF) the single phase. Again each fluid ᎏF ᎏ Ϫ 1/2 , 2  2 tends to relax to a local equilibrium dis- ΄ F ΅ tribution that depends on the local den- sity and velocity and is analogous to where k denotes red or blue, Ak is a the single-phase equilibrium distribu- free parameter that controls the surface tion presented in the sidebar. The mass tension, and F is the local color gradi- of each fluid is conserved and the total ent, defined as momentum of the system is conserved. The second part of the collision op- .[(erator ⍀i depends on the red and blue F(x) ϭ Α ei [␳r(x ؉ ei) Ϫ␳b(x ؉ ei densities at nearest neighbors and deter- i

106 Los Alamos Science Number 22 1994 Lattice-Boltzmann Fluid Dynamics

In the incompressiblelattice6.adb• limit, the density Blue fluid in a single-phase region7/26/94 is uniform and therefore the local color is θ θ blue blue zero. Thus this second part of the colli- θ Red fluid θ sion operator does not contribute. In a red red mixed-phase region, this part of the col- Wall lision operator maintains the interfaces θ + θ = 180° red blue between fluids by forcing the momen- r r tum of the red fluid, j ϭ ⌺␫ fi ei, to align with the direction of the local Figure 6 . The Definition of Contact Angle color gradient. In other words, the red The contact angle is defined as the angle between a two-fluid interface and a solid sur- density at an interface is redistributed face. As shown in the figure, each fluid has its own contact angle and the sum of the to maximize the quantity Ϫ( jؒF). The two must equal 180Њ. The wetting fluid (the fluid that tends to wet the surface) has a blue-particle distribution can then be contact angle of less than 90Њ, and the nonwetting fluid (the fluid that has less affinity obtained by applying mass conservation b r for the solid surface) has a contact angle of greater than 90Њ. along each direction: fi ϭ fi Ϫ fi . Using a scaling and expansion pro- cedure similar to that used to derive the macroscopic behavior of a single phase (see sidebar), one can rigorously prove that each fluid will obey the Navier- Stokes equations and that the pressure difference across fluid-fluid interfaces will obey the Laplace formula. Results of two-phase lattice-Boltzmann simula- tions have also demonstrated that the surface-tension coefficient ␴ is a con- stant independent of the radius of a drop. Over the past three years, several Los Alamos scientists and several sci- entists from Mobil Oil Company have developed a collaboration, applying the two-phase model to study flows through Figure 7. Contact Angles in Two-Phase Lattice-Gas Simulations porous media. The results of simula- This simulation demonstrates the ability of lattice-gas simulations to model different tions in two and three dimensions are contact angles, or different wettability conditions, as required in studies of porous- shown in the companion article. The media flow. The simulation conditions are identical to those described in Figure 4 ex- goal of the collaboration is to develop a cept that a solid horizontal wall (white) divides the computational box into an upper greater understanding of the fundamen- and a lower region. The upper surface of the wall has a greater affinity for the blue tal physics related to enhanced oil re- fluid than for the red fluid, whereas the opposite is true of the lower surface of the covery, and to predict relative perme- wall. The affinity, or preference, of the wall for one fluid over the other is modeled by abilities and other bulk properties of a special rule for collisions between a hole and the wall that controls the color of the porous media from basic properties of hole flux at the walls. The rule specifies that when a hole of either color collides with the fluid-fluid and fluid-rock interac- a wall, there is a probability P that it will bounce back and become a red hole. In the tions. So far, lattice-Boltzmann simula- simulation shown the upper surface has P = 0.2; that choice produces a surface that is tions look promising: Initial results strongly blue-wet, and the contact angle of the red fluid is greater than 90Њ. The lower compare well with experimental mea- surface has P = 0.8, which results in a strongly red-wet surface and a contact angle for surements of flow patterns and relative the red fluid of close to 0Њ. permeabilities.

Number 22 1994 Los Alamos Science 107 Lattice-Boltzmann Fluid Dynamics

Figure 8. Lattice-Boltzmann Simulations of Phase Separation Each of the three figures is a snapshot of a lattice-Boltzmann simulation after 6000 timesteps, starting from an initial random distrib- ution of the phases present. (a) The red and blue densities are 0.4 and 0.6, respectively. Since the density of the red fluid is lower than that of the blue, red drops form in a blue background. At each site the lattice-Boltzmann simulation produces, in essence, an ensemble average of lattice-gas simulations, so the boundaries between the red and blue fluids are much smoother in this simula- tion than in the corresponding lattice-gas simulation shown in Figure 4. (b) The densities of the red and blue fluids are 0.5 and 0.5. Phase separation again takes place readily but produces a different pattern than in (a) because the densities of the two phases are equal. (c) The model for immiscible fluids can be applied to any number of phases. Here there are three phases, red, blue, and green, and each has a density equal to 0.33. Again the three phases separate from an initial random distribution.

Applications and Extensions forced to have a much more extensive Recently, stability analyses have been interface. This approach is being used completed, and the conditions under Lattice multiphase models have been for studying the self-assembly of bio- which the method becomes unstable (as used for investigating the details of in- logical membranes, surfactant effects in do all finite-difference schemes) have terface dynamics, including the well- two- and three-dimensional multiphase been determined. When the allowed known phenomena Rayleigh-Taylor in- models, the formation of membranes, number of speeds is increased from stability, Saffman-Taylor instability, and self-assembly of amphiphilic struc- three to many, a thermohydrodynamic and domain growth in the separation of tures at aqueous organic interfaces. version of the lattice-Boltzmann method two immiscible fluids (see Figure 8). Simple reaction-diffusion systems are emerges. Such a model has been devel- The two-phase lattice-Boltzmann model also being modeled with lattice-Boltz- oped and tested by several scientists. has been extended to three and four mann methods. Recent work has shown The current lattice models for reacting phases to study critical and off-critical that these simple systems can exhibit systems are based on simple isothermal quenches and phase transitions. extremely complicated and unexpected models, but they can easily be extended Features of interest in biological behavior. For example, solutions have to include temperature effects and to problems have also been added to lat- been found that behave like biological model phase transitions in which the re- tice-Boltzmann models. For example, cells; that is, concentrations of chemical action rate depends on local temperature. the addition of a surfactant fluid to two- densities within well-defined regions of Clearly, the lattice-Boltzmann phase flows is being used to study the the solution divide as cells divide. method is still in the developmental formation of lipid bilayers. If one end The lattice-Boltzmann method, like stages. Because it is relatively straight- of the surfactant prefers the red fluid any new method, is going through an forward to introduce new physics into and the other end of the surfactant exploratory stage to determine its limi- the model, we expect it will be applied prefers the blue fluid, the fluids are tations and optimal areas of application. to many additional physical phenomena.

108 Los Alamos Science Number 22 1994 Lattice-Boltzmann Fluid Dynamics

Acknowledgements

Members of the Lattice-Boltzmann Re- search Effort: Francis Alexander, Mario Ancona, Daryl Grunau, Brosl Hasslacher, Shuling Hou, Nathan Kreis- berg, Turab Lookman, Lishi Luo, Daniel Martinez, Guy R. McNamara, Balu Nadiga, Silvina Ponce-Dawson, Xiaowen Shan, James Sterling, and Qisu Zou.

Further Reading

U. Frisch, B. Hasslacher, and Y. Pomeau. 1986. Lattice-gas automata for the Navier-Stokes equa- tion. Physical Review Letters 56: 1505.

S. Wolfram. 1986. Cellular automata fluids I: Basic theory. Journal of Statistical Physics 45: 471Ð526. Seated at the monitor, Shiyi Chen; standing, left to right, Gary D. Doolen, Kenneth G. Eggert, and G. McNamara and G. Zanetti. 1988. Use of the Wendy E. Soll. [Soll is a co-author of “Toward Improved Prediction of Reservoir Flow Perfor- Boltzmann equation to simulate lattice-gas au- mance.”] tomata. Physical Review Letters 61: 2332. Shiyi Chen first joined the Laboratory as a postdoctoral fellow in 1987; he was an Oppenheimer Fel- D. H. Rothman and J. M. Keller. 1988. Immis- low from 1990 to 1992. In 1992 he became a staff member in the Complex Systems Group of the cible cellular-automaton fluids. Journal of Statis- Theoretical Division. His research interests include lattice-gas automata and lattice-Boltzmann compu- tical Physics 52: 1119. tational methods, the statistical theory of fluid turbulence, and two-phase and compressible fluid flows. A native of the People’s Republic of China, Chen earned his B.S. in 1981 from Zhejing University and S. Succi, P. Santangelo, and R. Benzi. 1988. his M.S. and Ph.D. from Beijing University in 1984 and 1987. High-resolution lattice-gas simulation of two-di- mensional turbulence. Physical Review Letters Gary D. Doolen joined the Laboratory’s Applied Theoretical Physics Group in 1975. His research in- 61: 2738Ð2740. terests include nuclear physics, plasma physics, magnetohydrodynamics, neural networks, and nonlinear mathematics. Doolen was with the Center for Nonlinear Studies from 1988 through 1993. He is now S. Chen, H. Chen, D. Martínez, and W. H. the leader of the Complex Systems Group. He received his B.S. in engineering science in 1961 and his Matthaeus. 1991. Lattice Boltzmann model for M.S. and Ph.D. in physics in 1964 and 1967 from Purdue University. simulation of magnetohydrodynamics. Physical Review Letters 67: 3776. Kenneth G. Eggert joined the Laboratory’s Geoanalysis Group as a section leader in 1987 and became group leader in 1992. His research interests include use of simulation in the management of surface S. Chen, G. D. Doolen, K. Eggert, D. Grunau, and subsurface hydrologic systems, physics of multiphase flow, and parallel computation in the earth and E. Y. Loh. 1991. Local lattice-gas model sciences. From 1984 to 1987 he was a physicist in the Earth Sciences Department at Lawrence Liver- for immiscible fluids. Physical Review A more Laboratory where he participated in the Yucca Mountain Project. Eggert received his B.S. in 43: 7053. aerospace engineering from Purdue University in 1969 and his M.S. and Ph.D. in civil engineering from Colorado State University at Fort Collins in 1976 and 1980. Eggert is a member of the Society A. K. Gunstensen, D. H. Rothman, S. Zaleski, and of Petroleum Engineers and the American Geophysical Union. G. Zanetti. 1991. Lattice Boltzmann model for immiscible fluids. Physical Review A 43: 4320.

Y. H. Qian, D. d’Humieres, and P. Lallemand. 1992. Lattice BGK models for Navier-Stokes R. Benzi, S. Succi, and M. Vergassola. 1993. W. E. Soll, S. Y. Chen, K. G. Eggert, D. W. equation. Europhysics Letters 17: 479. The lattice Boltzmann equation: Theory and ap- Grunau, and D. R. Janecky. July, 1994. Appli- plications. Physics Reports 222: 145Ð197. cation of the lattice-Boltzmann/lattice gas tech- F. J. Alexander, S. Chen, and D. W. Grunau. nique to multi-fluid flow in porous media. In 1993. Hydrodynamic spinodal decomposition: G. D. Doolen, editor. 1993. Lattice Gas Meth- Proceedings of Computational Methods in Water Growth kinetics and scaling functions. Physical ods for PDE’s: Theory, Application and Hard- Resources. Review B 48: 634Ð637. ware. Physica D 47.

F. J. Alexander, S. Chen, and J. D. Sterling. D. Grunau, S. Chen, and K. Eggert. 1993. A lat- 1993. Lattice-Boltzmann thermohydrodynamics. tice Boltzmann model for multi-phase fluid flows. Physical Review E 47: 2249Ð2252. Physics of A 5: 2557.

Number 22 1994 Los Alamos Science 109 Equations of the Lattice-Boltzmann Method

he Boltzmann equation for any lattice model is an equation for the time Tevolution of fi (x,t), the single-particle distribution at lattice site x:

fi (x ϩ ei, t ϩ ⌬t) ϭ fi (x,t) ϩ ⍀i( f(x,t)), … where ⍀i ϭ ⍀i( f(x,t)) is the local collision operator at that site, i ϭ 0,1, ,14, and ⌬t is assigned a value of unity. Since the usual aim of lattice methods is to model macroscopic dynamics, the “exact” collision operator is unnecessarily complex and therefore numerically inefficient. Two groups (see Chen et al. and Qian et al. in the Further Reading) nearly simultaneously suggested that the collision operator be approximated by a single-time-relaxation process in which relaxation to some ap- propriately chosen equilibrium distribution occurs at some constant rate. In particu- lar the collision term, ⍀( f ), is replaced by the single-time-relaxation approximation,

eq fi(x,t) Ϫ fi (x,t) ⍀ ( f(x,t)) ϭ Ϫᎏᎏ. i ␶ The appropriately chosen equilibrium distribution, denoted by f eq, depends on the local fluid variables, and 1/␶ is the rate of approach to this equilibrium. The rela- tions ϭ 0 and e ⍀ ϭ 0 must be true to conserve mass and momentum, re- ⌺i ⍀i ⌺i i i spectively. In order for the fluid to have Galilean-invariant convection and a pres- eq sure that does not depend on velocity, an appropriate equilibrium distribution, fi , must be assumed. For a two-dimensional hexagonal lattice, the formula is:

␳(1 Ϫ ␣) ␳ 2␳ ␳ f eq ϭᎏ ϩ ᎏ e иv ؉ ᎏ(e иv)2 Ϫ ᎏ v2 i 6 3 i 3 i 6 and eq 2 f0 ϭ ␣␳ Ϫ ␳v .

(The corresponding formulas for the cubic lattice appear in the article by Alexan- der, Chen, and Grunau listed in the Further Reading.) In these equations the den- sity ␳ (x,t) ϭ mn(x,t) (where m is the mass of each particle), the number density n(x,t) ϭ ⌺i fi(x,t), and ␣ is a free parameter related to the sound speed as shown below. For the lattice-Boltzmann method, the particle distribution does not have an upper bound. The only requirement is that fi Ն 0.

To derive the macroscopic equations obeyed by this model, one performs a Taylor expansion in time and space and takes the long-wavelength and low-frequency limit of the lattice-Boltzmann equation for the single-particle distribution. The re- sult is a continuum form of the Boltzmann equation correct to second order in the lattice spacing and the timestep. A scaling expansion argument, the assumption of single-time relaxation, and the neglect of higher-order terms lead to the following final form of the macroscopic equations obeyed by the simulated system

110 Los Alamos Science Number 22 1994 Equations of the Lattice-Boltzmann Method

∂( ∂␳ ␳v␤) ᎏ∂ ϩ ᎏ∂ ϭ 0, the equation of mass continuity; t x␤

∂ ∂ ∂ ∂ ∂ ␳ v␣ v␣ ∂p ∂ ␭ ␳v␥ ∂␳ ∂␳ ∂ v v ᎏ ϩ ␳v ᎏ ϭ Ϫ ϩ ᎏ ᎏ␦ ϩ v ᎏ ϩ v ᎏ ϩ ᎏ ␮ ␤ ϩ ␣ , ∂ ␤ ∂ ᎏ∂ ᎏ∂ ∂ ␣␤ ␣ ∂ ␤ ∂ ∂ ᎏ∂ ᎏ∂ t x␤ x␣ x␤ ΄␳ ΂ x␥ x␤ x␣ ΃΅ x␤ ΄ ΂ x␣ x␤ ΃΅ the equation of momentum conservation; and

1 Ϫ ␰ p ϭ ᎏ␳. 2 the equation of state.

In the above equations, v␤ is the component of the velocity in the ␤-direction; p is the pressure; and the sound speed, cs, is ͙ෆ(1ෆϪෆ␰ ෆ)/ෆ2, where ␰ is a free parameter. The shear viscosity, ␮, and the bulk viscosity, ␭, are given by

2␶ Ϫ 1 ␮ ϭ ᎏ␳ 8 and (␶ Ϫ 1/2)(2␰Ϫ 1) ␭ ϭ ᎏᎏ␳. 4

The above equations converge to the exact incompressible Navier-Stokes equa- tions only when the derivatives of the number density in the second viscosity term on the right-hand side of the equation are small. Since the gradients of the density are O(v2), the unphysical terms in the momentum-conservation equation are cor- rect to order (v3). Thus, although the physics of the lattice-Boltzmann method con- tains compressibility effects, one may come arbitrarily close to solving the incom- pressible Navier-Stokes equations by reducing the Mach number (through the choice of ␣) and thereby reducing the simulated flow to very low speed. (Never- theless the compressibility effects in the lattice-Boltzmann approach are physical and the method can also be used to simulate compressible fluids.)

Traditional methods for solving incompressible flows, such as finite-difference or finite-element, require solution of a Poisson equation for the pressure term, which is induced by the mass- and the momentum-conservation equa- tion. In the lattice-Boltzmann approach, this time-consuming step is avoided be- cause the incompressibility requirement has been relaxed and the effects of pres- sure changes are controlled by an equation of state rather than a Poisson equation. It can be argued that the conventional methods most closely related to the lattice- Boltzmann method are the pseudocompressible algorithms for solving incompress- ible fluid flows.

Number 22 1994 Los Alamos Science 111