You are on page 1of 15

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/12291961

Gravity in a lattice Boltzmann model

Article  in  Physical review A, Atomic, molecular, and optical physics · June 2000


DOI: 10.1103/PhysRevE.61.5307 · Source: PubMed

CITATIONS READS
324 2,433

2 authors, including:

James M Buick
University of Portsmouth
69 PUBLICATIONS   1,653 CITATIONS   

SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Development and assessment of a haemodynamic based numerical model for stenosis growth in the carotid artery View project

All content following this page was uploaded by James M Buick on 09 June 2014.

The user has requested enhancement of the downloaded file.


PHYSICAL REVIEW E VOLUME 61, NUMBER 5 MAY 2000

Gravity in a lattice Boltzmann model


J. M. Buick and C. A. Greated
Department of Physics and Astronomy, The University of Edinburgh, The Kings Buildings, Mayfield Road,
Edinburgh, EH9 3JZ, United Kingdom
共Received 26 March 1999; revised manuscript received 19 November 1999兲
In this paper we consider the introduction of a body force, in the incompressible limit, into the lattice
Boltzmann model. A number of methods are considered and their suitability to our objectives determined.
When there is no density variation across the fluid, gravity can be introduced in the form of an altered pressure
gradient. This method correctly satisfies the Navier-Stokes equation; however, if there is a non-negligible
density variation present 共produced by the body force or otherwise兲 this method becomes less accurate as the
density variation increases and the constant density approximation becomes less valid. Three other methods are
also considered for application when there is a non-negligible density variation. The equations of motion
satisfied by these models are found up to second order in the Knudsen number and it is seen that only one of
these methods satisfies the true Navier-Stokes equation. Numerical simulations are performed to compare the
different models and to assess the range of application of each.
PACS number共s兲: 47.11.⫹j, 02.70.⫺c

I. INTRODUCTION Each link has length c and direction ei , i⫽1, . . . ,b. In prac-
tice the grid is either a two-dimensional hexagonal grid 关5兴
A recent development in the computational study of fluids (D⫽2, b⫽6) or a four-dimensional face-centered hypercu-
has been the lattice Boltzmann model 关1–4兴 which has de- bic lattice 关17,18兴 (D⫽4, b⫽24). The technique involves
veloped from the lattice-gas automata 关5兴. This has been simulating the Boltzmann equation 关19,20兴
used successfully to simulate many problems including mag-
netohydrodynamics 关6兴, turbulence 关7,8兴 colloidal suspen- f i 共 r⫹ei ,t⫹1 兲 ⫺ f i 共 r,t 兲 ⫽⍀ i 共 r,t 兲 . 共1兲
sions 关9兴, and multiphase flow 关10–12兴. Lattice Boltzmann
simulations have traditionally been performed on a regular The functions f i (r,t), i⫽1, . . . ,b are the distribution func-
grid, however, it has recently been shown that, with the in- tions along the b links at position r and time t. The fluid
clusion of an interpolation step, the technique can be applied density, ␳ , and velocity, u, can be found from the distribu-
on an irregular grid with the introduction of only a small tion functions as
error 关13兴.
There is a wide range of fluid problems in which gravity
and buoyancy effects are significant, for example, the study ␳⫽ 兺i f i and ␳ u ␣ ⫽ 兺i f ie i␣ , 共2兲
of water waves 关14–16兴. In this paper we consider the inclu-
sion of a body force in the lattice Boltzmann scheme. We where we have used the notation (ei ) ␣ ⫽e i ␣ . The collision
begin by describing the lattice Boltzmann model and show- term, ⍀ i (r,t), is usually taken to be the single relaxation
ing that the model does indeed mimic the Navier-Stokes time or Bhatnagar-Gross-Krook 共BGK兲 operator 关21,6兴
equation. Different methods for implementing gravity into
the model are then considered and their ability to satisfy the 1
Navier-Stokes equation is assessed. A number of simulations ⍀ i 共 r,t 兲 ⫽⫺ 关 f i 共 r,t 兲 ⫺ f̄ i 共 r,t 兲兴 , 共3兲
involving gravity are presented to verify the theoretical con- ␶
clusions.
Here we are concerned with simulating gravity in the in- where f̄ i is the equilibrium distribution function and ␶ is the
compressible limit of a linearly varying density. In this limit relaxation time, where ␶ ⬎1/2. The form of this equilibrium
we require gzⰆc s2 , where g is the gravitational strength, z is distribution function must be chosen so that the fluid mass
the vertical extent of the simulation, and c s is the speed of and momentum are conserved and so that the resulting con-
sound. In this limit g can have a significant value so it is tinuum equations describe the hydrodynamics of the fluid
clearly important that the introduction of gravity does not being simulated 关12兴. The correct form of the equilibrium
affect the existing scheme, other than by introducing the re- distribution also ensures that the fluid is isotropic and Gal-
quired body force, since terms of order O(g) cannot be ne- ilean invariant 关22兴. The following equilibrium distribution
glected in the fluid equations. function produces an isotropic, single phase fluid that satis-
fies the continuity and Navier-Stokes equations:
II. LATTICE BOLTZMANN MODEL
f̄ i 共 r,t 兲 ⫽E i 共 ␳ ,u兲 , 共4兲
The simulation described here is performed on a
D-dimensional regular grid with b links at each grid point. where

1063-651X/2000/61共5兲/5307共14兲/$15.00 PRE 61 5307 ©2000 The American Physical Society


5308 J. M. BUICK AND C. A. GREATED PRE 61

冉 冊

1⫺d 0 D D 共 D⫹2 兲 Du 2
␳ ⫹ 2 ei •u⫹ 共 ei •u 兲 2
⫺ , i⫽1, . . . ,b
b c b 2c 4 b 2c 2 b
E i 共 ␳ ,u兲 ⫽ 共5兲

␳ d 0⫺ 冉 冊 u
c2
2
, i⫽0

and d 0 is a constant 关3,7兴.


c s⫽ 冑 c 2 共 1⫺d 0 兲
D
. 共10兲
III. CHAPMAN-ENSKOG EXPANSION

The derivation of the continuity equation and the Navier- IV. GRAVITY IN A LATTICE BOLTZMANN MODEL
Stokes equation from the equilibrium distribution is normally We now wish to consider a lattice Boltzmann model that
carried out using a Chapman-Enskog expansion, following will mimic the Navier-Stokes equation with a body force.
the lattice gas derivation of Frisch et al. 关17兴. To perform the
Chapman-Enskog expansion we must first Taylor expand Eq.
A. The classic Boltzmann equation
共1兲:


The Boltzmann equation for a fluid with a body force per
1 unit mass F is 关19兴
f i 共 r⫹ei ,t⫹1 兲 ⫺ f i 共 r,t 兲 ⯝ ⳵ t ⫹e i ␣ ⳵ ␣ ⫹ e i ␣ ⳵ ␣ 共 e i ␤ ⳵ ␤ ⫹ ⳵ t 兲
2
⳵ t f ⫹c ␣ ⳵ r ␣ f ⫹F ␣ ⳵ c ␣ f ⫽⍀ 共 f 兲 , 共11兲
1

⫹ ⳵ t 共 e i ␣ ⳵ ␣ ⫹ ⳵ t 兲 f i 共 r,t 兲 .
2
共6兲 where f (c,r,t)dcdr is the number of molecules at time t with
velocities in the range c→c⫹dc and position in the range r
→r⫹dr and
Expanding the population functions and the time and space
derivatives in terms of the Knudsen number 关19,17兴, ⑀ , we ⳵
⳵ c␣⫽ . 共12兲
get ⳵c␣
i ⫹ ⑀ f i ⫹ ⑀ f i ⫹•••,
f i ⫽ f (0) (1) 2 (2)
The difference between the Boltzmann equation when there
⳵ t ⫽ ⑀ ⳵ 1t ⫹ ⑀ ⳵ 2t ⫹•••,
2
共7兲 is no body force present and when there is a body force is an
extra term: F ␣ ⳵ c ␣ f . In the lattice Boltzmann equation we are
⳵ r⫽ ⑀ ⳵ 1r . looking to add a similar term to incorporate a body force.
Since, however, the velocity of all the ‘‘particles’’ is con-
Substitution of Eq. 共7兲 into Eq. 共6兲 and considering sepa- stant in the lattice Boltzmann model, we cannot simply in-
rately the terms O( ⑀ ) and O( ⑀ 2 ) we can perform a troduce an expression with exactly the same form but must
Chapman-Enskog expansion to obtain the continuity equa- instead look to add a term that will modify the fluid momen-
tion, tum.
⳵ t ␳ ⫹ ⳵ ␣ ␳ u ␣ ⫽0 共8兲
B. Combining the gravity term and the pressure tensor—
and the Navier-Stokes equation
method „1…

⳵ t ␳ u ␣ ⫹ ⳵ ␤ ␳ u ␤ u ␣ ⫽⫺ ⳵ ␤ 冋 ␳ 共 1⫺d 0 兲 2
D 册
c ␦ ␣␤ ⫹ ␯⳵ ␤ ⳵ ␤ ␳ u ␣ When a body force is included in the Navier-Stokes equa-
tion it is common to express the force in terms of the gravi-
⫹ ⳵ ␣ ␨⳵ ␤ ␳ u ␤ , 共9兲 tational potential: ⫺ ␳ “ ␾ . When this approach is taken, and
the density variation produced by the body force is negli-
where ␯ ⫽c 2 ( ␶ ⫺1/2)/(D⫹2) and ␨ ⫽( ␶ ⫺1/2) 关 2c 2 /(D gible, the Navier-Stokes equation incorporating the body
⫹2)⫺c 2 (1⫺d 0 )/D 兴 are the kinematic and bulk viscosities. force can be expressed in the same form as in the absence of
The pressure term in Eq. 共9兲 is p⫽ ␳ c 2 (1⫺d 0 )/D, which gravity but with an altered pressure: p→p⫹ ␳ ␾ . Following
gives the speed of sound as this approach we can redefine the equilibrium distribution:

冉 冊

1⫺d 0 l ␾ D D D 共 D⫹2 兲 Du 2
␳ ⫹ ⫹ ei •u⫹ 共 ei •u 兲 2
⫺ , i⫽1,b
b bc 2 c 2 b 2c 4 b 2c 2 b
E i⬘ 共 ␳ ,u兲 ⫽ 共13兲


␳ d 0⫺
l␾D
c2

u2
c2
冊 , i⫽0,
PRE 61 GRAVITY IN A LATTICE BOLTZMANN MODEL 5309

with l⫽1. The parameter l is introduced here in such a way This is a combination of methods 共2兲 and 共3兲 with the coef-
that l⫽1 corresponds to gravity being incorporated as a pres- ficients selected to ensure the model satisfies the continuity
sure term and l⫽0 corresponds to the standard lattice Bolt- and Navier-Stokes equations for a fluid under the influence
zmann model without gravity. of a body force. This will be shown in Sec. IV F.

C. Calculating the equilibrium distribution with an altered F. The equations of motion for a lattice Boltzmann model
velocity—method „2… incorporating gravity
Gravity can be introduced into the lattice Boltzmann Now consider the following Boltzmann equation:
scheme by considering the momentum change produced by a
body force 关23兴. If a gravitational force F is acting, then at 1 D
every timestep there is a change of momentum ⌬P⫽F. To f i 共 r⫹ei ,t⫹1 兲 ⫺ f i 共 r,t 兲 ⫽⫺ 共 f i ⫺ f̄ i 兲 ⫹m 2 F ␣ e i ␣ ,
␶ bc
incorporate this into the model an equilibrium distribution 共21兲
f̄ i 共 r,t 兲 ⫽E i 共 ␳ ,u* 兲 共14兲 where
is used where u* is the ‘‘equilibrium velocity’’ 关24兴, which f̄ i ⫽E i⬘ 共 ␳ ,u⫹nw兲 , 共22兲
is given by 关23兴
w⫽ ␶ F/ ␳ and E i⬘ is defined by Eq. 共13兲. This represents
␳ u* ⫽ ␳ u⫹ ␶ F. 共15兲
method 共1兲 for l⫽1, m⫽n⫽0, method 共2兲 for m⫽1, l⫽n
Here u is defined, as before, by ␳ u ␣ ⫽ 兺 i f i (r,t)e i ␣ . The fluid ⫽0, method 共3兲 for n⫽1, l⫽m⫽0, and method 共4兲 for l
momentum ␳ v is defined 关24兴 to be the average of the mo- ⫽0, m⫽(2 ␶ ⫺1)/(2 ␶ ), n⫽1/(2 ␶ ). As before, we wish to
mentum before the collision, ␳ u, and the momentum after perform a Chapman-Enskog expansion by expressing
the collision, ␳ u⫹F:
i ⫹ ⑀ f i ⫹ ⑀ f i , ⳵ t ⫽ ⑀ ⳵ 1t ⫹ ⑀ ⳵ 2t , and ⳵ ␣ ⫽ ⑀ ⳵ 1 ␣ ,
f i ⫽ f (0) (1) 2 (2) 2

1 共23兲
␳ v ␣⫽ ␳ u ␣⫹ F ␣ . 共16兲
2 where the notation ( ⳵ 1r ) ␣ ⫽ ⳵ 1 ␣ has been used. The body
force F ␣ , and hence ␾ , are of order ⑀ 关25兴. This can be seen
D. Adding an additional term to the Boltzmann by assuming that F ␣ ⫽O( ⑀ 0 ) and considering the zeroth-
equation—method „3… order expansion of the Chapman-Enskog expansion:
Gravity can also be introduced into the lattice Boltzmann
scheme in a manner similar to that adopted for the lattice-gas m␶D
i ⫽ f̄ i ⫹
f (0) F ␣e i␣ . 共24兲
model 关17兴, that is, by adding a term to the collision function bc 2
that modifies the distribution function 关25,26兴. Here the Bolt-
zmann equation is Multiplying this expansion by e i ␤ and summing gives
f i 共 r⫹ei ,t⫹1 兲 ⫺ f i 共 r,t 兲 ⫽⍀ i 共 r,t 兲 , 共17兲
兺i i e i␤⫽
f (0) 兺i f̄ i e i ␤ ⫹m ␶ F ␤ ⫽ ␳ u ␤ ⫹ 共 n⫹m 兲 ␶ F ␤ .
where
共25兲
1 D But 兺 i f i e i ␤ ⫽ ␳ u ␤ so we must have
⍀ i 共 r,t 兲 ⫽⫺ 关 f i 共 r,t 兲 ⫺ f̄ i 共 r,t 兲兴 ⫹ 2 F ␣ e i ␣ , 共18兲

冉兺 冊
bc

and u and f̄ i are defined in the usual way: ␳ u ␣ ⫽ 兺 i f i e i ␣ and



i
i e i␤⫹ ⑀
f (1) 兺i i e i ␤ ⫹••• ⫽⫺ 共 n⫹m 兲 F ␤ ,
f (2)

f̄ i ⫽E( ␳ ,u). The fluid momentum is defined, as before, 共26兲


through ␳ v ␣ ⫽ ␳ u ␣ ⫹ 12 F ␣ . ⫺1
which requires F ␣ ⫽O( ⑀ ) or f (1)
i ⫽O( ⑀ ), both of which
E. Composite model—method „4… are in contradiction of the hypothesis. Thus, since f̄ i is now
a function of F, we also need to expand
Here we consider a new method for introducing gravity
into the lattice Boltzmann model. This has the collision func-
i ⫹ ⑀ f̄ i ⫹ ⑀ f̄ i , F ␣ ⫽ ⑀ F 1 ␣ , and ␾ ⫽ ⑀␾ 1 .
f̄ i ⫽ f̄ (0) (1) 2 (2)
tion given by 共27兲
1 2 ␶ ⫺1 D Performing a Chapman-Enskog expansion, see Appendix A,
⍀ i 共 r,t 兲 ⫽⫺ 关 f i 共 r,t 兲 ⫺ f̄ i 共 r,t 兲兴 ⫹ F e ,
␶ 2 ␶ bc 2 ␣ i ␣ we obtain the following macroscopic equations:
共19兲

where 冋 1
⳵ t ␳ ⫹ ⳵ ␣ ␳ u ␣ ⫹ 共 n⫹m 兲 F ␣ ⫽0
2 册 共28兲

f̄ ⫽E 共 ␳ ,u⫹F/2␳ 兲 . 共20兲 and


5310 J. M. BUICK AND C. A. GREATED PRE 61

冋 1

⳵ t ␳ u ␣ ⫹ 共 n⫹m 兲 F 1 ␣ ⫹ ⳵ ␤ 关 ␳ u ␣ u ␤ ⫹ ␶ n 共 u ␣ F ␤ ⫹u ␤ F ␣ 兲兴
2

␶ 再冋 ␳

␳2

2u ␣ ␶ F ␤ ␶ 2 F ␣ F ␤ D 共 D⫹2 兲 e i ␣ e i ␤
2c 4 b

⫽⫺ ⳵ ␣ 冉 ␳ 共 1⫺d 0 兲 c 2
D 冊⫹ ␯⳵ ␤ ⳵ ␤ ␳ u ␣ ⫹ ␨⳵ ␣ ⳵ ␤ ␳ u ␤

D
2c 2 b

2u ␣ ␶ F ␣ ␶ 2 F ␣ F ␣


␳2
册冎 i⫽1,b

冉 冊
⫹ 共 n⫹m 兲 F ␣ ⫺l ⳵ ␣ ␳ ␾ . 共29兲
␳ 2 ␶ F ␣u ␣ ␶ 2F ␣F ␣
⫺ ⫹ 2 2 , i⫽0. 共32兲
␶ ␳c2 ␳ c
For method 共1兲 we have l⫽1, m⫽n⫽0 in which case Eqs.
共28兲 and 共29兲 are the continuity and Navier-Stokes equations The difference contains terms O(uF/ ␳ ) and O„(F/ ␳ ) 2 …. It is
for a fluid with velocity u and a body force F⫽⫺ ␳ “ ␾ . For assumed in the derivation of the equations of motion that u
methods 共2兲, 共3兲, and 共4兲 we have l⫽0, m⫹n⫽1 in which Ⰶc s and, in the incompressible limit, we also have 兩 F 兩
case Eqs. 共28兲 and 共29兲 can be written 共up to second order in
Ⰶc s2 /z. This gives a measure on the size of the terms in Eq.
⑀)
共32兲. Thus, in general, the difference expressed in Eq. 共32兲
will be small. Although F/ ␳ is small it can still produce a
significant effect. The difference expressed in Eq. 共32兲 being
⳵ t ␳ ⫹ ⳵ ␣ ␳ v ␣ ⫽0 共30兲
small does not imply that the density change is small, as
required for method 共1兲. The differences ⍀ (2) i ⫺⍀ i
(4)
and
⍀ i ⫺⍀ i will contain terms of the same order. We note
(3) (4)
and
i ⫺⍀ i
that while the values of ⍀ (1) (2)
are different for each i,
兺 i (⍀ i ⫺⍀ i )⫽0 and 兺 i (⍀ i ⫺⍀ (2)
(1) (2) (1)
i )e i ␥ ⫽0. This means
⳵ t ␳ v ␣ ⫹ ⳵ ␤ ␳ v ␣ v ␤ ⫹ ⳵ ␤ 共 n ␶ ⫺1/2兲共 u ␣ F ␤ ⫹u ␤ F ␣ 兲 that in simulations where methods 共2兲, 共3兲, and 共4兲 satisfy the
same equations of motion, that is ⳵ ␤ (u ␣ F ␤ ⫹u ␤ F ␣ )⫽0,
⫽⫺ ⳵ ␣ 冉 ␳ 共 1⫺d 0 兲 c 2
D 冊⫹ ␯⳵ ␤ ⳵ ␤ ␳ v ␣ ⫹ ␨⳵ 1 ␣ ⳵ 1 ␤ ␳ v ␤ ⫹F ␣ ,
there will be a difference in the values of f i between the
different models, but the values of ␳ and u should, however,
be identical.
共31兲

V. ERRORS IN A LATTICE BOLTZMANN SIMULATION


where v is defined, as before, to be the mean fluid velocity: There are a number of sources of error that can affect a
␳ v ␣ ⫽ ␳ u ␣ ⫹F ␣ /2. Equations 共30兲 and 共31兲 are the continuity lattice Boltzmann simulation. Rounding errors will always
and the Navier-Stokes equations for a fluid with velocity v be present in any numerical model. Here double precision
and a body force F with an additional term ⳵ ␤ (n ␶ arithmetic was used to give results with 15 significant fig-
⫺1/2)(u ␣ F ␤ ⫹u ␤ F ␣ ). This term may be small for the values ures. In single precision simulations a precision of seven
of F considered here but will only be zero for n⫽1/(2 ␶ ), significant figures would give an error of O(10⫺7 ).
that is for method 共4兲. In the derivation of the Navier-Stokes equation described
in Sec. III only terms up to O( ⑀ 2 ) are considered—higher
order terms are neglected. The Knudsen number, ⑀ , is the
G. Review of methods
ratio of the grid separation to the typical macroscopic length
The Navier-Stokes equation is recovered from Eq. 共29兲 in the simulation. Thus we must ensure that ⑀ is small in any
for l⫽1 and m⫽n⫽0, only when the term ⳵ ␣ ␳ ␾ can be simulation to minimize the error introduced by neglecting
expressed as ␳⳵ ␣ ␾ . Thus we only expect method 共1兲 to be higher order terms. Small ⑀ is equivalent to having a large
appropriate in situations where there is no density change number of grid points corresponding to the shortest length
across the fluid, or the density change is negligibly small. scale in the simulation. Here we typically use a grid with 64
This is common to any situation where gravity is introduced points, which gives ⑀ ⫽1/(64冑3/2), since the length scale is
through a potential that modifies the pressure term. Methods the grid size and the grid is orientated so that the horizontal
共2兲 and 共3兲 can be applied where there is a density change but separation of grid points is 冑3/2. This also relates to the
we are looking at a steady state solution, where ⳵ ␤ (u ␣ F ␤ spatial discretization error, which is introduced because we
⫹u ␤ F ␣ )⫽0. Two situations were this can occur are consid- are mimicking a continuous system by a grid simulation. A
ered in this paper. First, when the steady state velocity is small Knudsen number that implies a significant number of
zero and second, when the nonlinear term in the Navier- grid points along any length scale also implies a small spatial
Stokes equation is zero and the induced velocity is parallel to discretization error. Time is also discrete in the lattice Bolt-
F. Method 共4兲 is applicable in any situation where gravity is zmann model and the temporal discretization error must also
applied in the incompressible limit. In general the variation be small if a simulation is to produce meaningful results.
between methods 共2兲, 共3兲, and 共4兲 will depend on the values That is, a typical macroscopic time scale must be large with
of u and F through the anomalous term ⳵ ␤ (u ␣ F ␤ ⫹u ␤ F ␣ ). respect to the discrete time step. Since c s is O(1) this is also
The difference between the lattice Boltzmann operators satisfied by a small Knudsen number.
i ⫺⍀ i
⍀ (2) (3)
for methods 共2兲 and 共3兲, acting on the same dis- It has been shown by many authors that, provided the
tribution function f i , is boundary conditions are suitably implemented, the lattice
PRE 61 GRAVITY IN A LATTICE BOLTZMANN MODEL 5311

Boltzmann model is a second-order scheme. This was stud-


ied by Noble et al. 关27兴 who considered flow between two
parallel porous plates; one stationary and one moving. They
showed that the lattice Boltzmann model applied with the
boundary conditions used here is a second-order scheme. For
a length scale of 64冑3/2 lattice units they find the average
error to be E⯝3⫻10⫺4 , where E is defined by

兺y 兩 u⫺û 兩
E⫽ , 共33兲
兺y 兩u兩

and where u is the simulated velocity, û is the analytic ve-


locity, and the summation is over all points in a line perpen-
dicular to the two plates. This gives an estimation of the FIG. 1. Density as a function of height at selected times when
discretization errors for a simulation with length scale gravity is applied using method 共3兲 when F⫽⫺0.001ez . The den-
64冑3/2. sity is measured in particles per site and the height in lattice sites.
We note that the lattice Boltzmann equation, Eq. 共1兲, can
be viewed as a finite difference equation. Although the dis- precision. The single phase simulations were performed on a
cretization is first order the lattice Boltzmann method is a Sun server, each simulation taking no more than 20 CPU
second-order scheme as discussed above. The second-order minutes. The immiscible fluid simulations were performed
nature of the lattice Boltzmann model is further discussed by on the CM-200 at Edinburgh University.
Sterling and Chen 关28兴. Under certain special circumstances
a second-order difference scheme on a regular grid can give
an exact solution with zero discretization error. This occurs if A. Density gradient
the terms in the expression for the discretization error are A system was initialized on a 64⫻64 grid with zero ve-
identically zero. One such case is Poiseuille flow, which is locity and initial density ␳ 0 ⫽1. An impermeable boundary
created between stationary parallel vertical walls when a was placed at the bottom (z⫽0) of the grid, which also acted
fluid is driven by gravity. The steady-state solution can eas- as a boundary at the top; continuous boundary conditions
ily be found since the Navier-Stokes equation reduces to were applied at the other two edges. Gravity was then ap-
plied using each of the methods and the density measured
⳵ 2u z共 x 兲 every 1000 timesteps along a vertical line through the middle
␯ ⫽g, 共34兲
⳵x2 of the grid. The results are shown in Fig. 1 at times 1000,
2000, 3000, 4000, and 5000 timesteps when gravity is ap-
which has the solution plied with strength g⫽0.001 using method 共3兲 with ␶ ⫽1.0.
The density profile is seen to ‘‘oscillate’’ about its final po-
g 2 sition for several thousand timesteps before reaching its final
u z共 x 兲 ⫽ 共 x ⫺L 2 兲 共35兲 state. The final state density distribution is found to lie close
2␯
to the distribution for t⫽3000 timesteps in Fig. 1 and so is
where the walls are at x⫽⫾L. The truncation error for a not included for clarity. The observed ‘‘oscillations’’ are just
second-order central difference scheme depends on the de- the damping of sound waves due to the fact that the initial
rivatives ⳵ 4 u z (x)/ ⳵ x 4 , ⳵ 6 u z (x)/ ⳵ x 6 , . . . , which are all zero density is uniform.
in this special case. Thus we expect to be able to simulate This was repeated for each of the methods for g⫽0.001,
Poiseuille flow using the lattice Boltzmann model to within g⫽0.0001, and g⫽0.000 01 and for ␶ ⫽0.55, 1.0, 5.5, and
the truncation error of the computer 关27兴. 50.5. The simulations were run until the final density varia-
The lattice Boltzmann model satisfies the Navier-Stokes tion with depth settled down to a steady state. The different
equation in the nearly incompressible limit. By introducing density variations were then compared with each other and
gravity we inevitably introduce a compressibility error into with the analytic expressions for the incompressible limit,
the system. Here we consider a body force in the incom- which are found in Appendix B. The density difference ␳ ab
pressible limit, gzⰆc s , and consider the compressibility er- for a,b苸 兵 1,2,3,4,T 其 is defined to be ␳ ab ⫽ ␳ (a) ⫺ ␳ (b) , where
rors that this introduces into the model. ␳ (a) is the steady state density produced when method 共a兲 is
applied for a⫽1, 2, 3, and 4 and the density predicted by the
VI. NUMERICAL SIMULATIONS theoretical expression, Eq. 共B19兲, for a⫽T. First we con-
sider the differences between method 共1兲 and method 共4兲.
Methods 共1兲–共4兲 were implemented so that the affect they This is shown in Fig. 2 when g⫽0.001 and there is a signifi-
have on a fluid simulation could be observed and any differ- cant density change across the fluid of about 20%. The den-
ences between the models could be considered. The value of sity variation produced by method 共4兲 is seen to be approxi-
d 0 ⫽0.5 was used throughout. The simulations were written mately linear while for method 共1兲 it is curved. This is
in FORTRAN using double precision arithmetic giving 64-bit expected since the conditions here clearly break the assump-
5312 J. M. BUICK AND C. A. GREATED PRE 61

FIG. 4. The density differences 兩 ␳ T1 兩 and 兩 ␳ T4 兩 as functions of


FIG. 2. The density variations with height produced by methods depth for different values of g. The differences 兩 ␳ T1 兩 are represented
共1兲 and 共4兲 when g⫽0.001. The density is measured in particles per by the thin lines and the differences 兩 ␳ T4 兩 by the thick lines. The
site and the height in lattice sites. height is measured in lattice sites.

tion that ␳ is constant as required in method 共1兲. When g tion is only about 1%. The difference between the results for
⫽0.000 01 and the density variation is about 0.2%, the den- method 共1兲 and the analytic result are also shown in Fig. 4.
sity variation is considerably smaller and so is the difference In each case the difference is generally larger. For g
between the density variation produced by methods 共1兲 and ⫽0.000 01 it is O(10⫺6 ), as was seen in Fig. 3 and is not
共4兲 as shown in Fig. 3. The difference here is not signifi- significant. For g⫽0.0001 the error is O(10⫺3 ), which is an
cantly larger than the computational rounding error in a stan- order of magnitude larger then 兩 ␳ T4 兩 suggesting that the con-
dard 32-bit calculation. When g⫽0.0001 the density varia- stant density approximation is not valid and method 共4兲 关or
tion across the fluid is about 2% and the difference between methods 共2兲 or 共3兲兴 would be preferred. For g⫽0.001 the
the results, 兩 ␳ 14兩 ⫽O(10⫺3 ). The difference between the den- difference 兩 ␳ T1 兩 can be larger than 1% and is typically
sity variation produced by method 共4兲 and the analytic results double 兩 ␳ T4 兩 although the differences are for different rea-
in the incompressible limit, gz/c s2 Ⰶ1, is shown in Fig. 4 for sons. The large value of 兩 ␳ T1 兩 is due to the density gradient
the three values of g considered. The ratio c s2 /gz is 4.5, 45, that cannot be approximated to zero. The error in 兩 ␳ T4 兩 is due
and 450 for g⫽0.001, 0.0001, and 0.000 01, respectively. to gz⫽O(c s2 ) implying that we are outside the incompress-
For the lowest value of g the incompressibility condition is ible limit and so we do not expect a linear density change.
fully satisfied and the variations are not much larger than the For both methods the difference between the simulation re-
numerical rounding error when standard 32-bit precision is sults and theory is seen to depend on g, suggesting that in
used. When g⫽0.001 the incompressibility condition this case the compressibility error is the main source of error.
(gz/c s2 Ⰶ1) is just met since gz/c s2 ⫽0.022. Here the agree- The difference between the densities predicted by meth-
ment between the analytical results and the simulation is ods 共2兲, 共3兲, and 共4兲 are shown in Fig. 5. For each value of g
reasonable with a variation of no more than about 0.01%. the densities obtained by methods 共2兲 and 共4兲 and hence the
This is no larger than the typical discretization error of difference 兩 ␳ 24兩 are independent of ␶ as predicted by Eq.
O(10⫺4 ), which we would expect in a simulation of this
size. For the largest value of g the incompressible limit is not
truly satisfied (gz/c s2 ⫽0.22), however, even here the varia-

FIG. 5. The density differences 兩 ␳ 24兩 and 兩 ␳ 34兩 as functions of


depth for different values of g and ␶ . The differences 兩 ␳ 24兩 are
independent of ␶ so, for a given value of g the four results for the
four different values of ␶ lie on the same curve. The other curves
FIG. 3. The difference between the density variations with represent 兩 ␳ 34兩 and are marked 1, 2, 3, or 4 corresponding to ␶
height produced by methods 共1兲 and 共4兲 when g⫽0.000 01. The ⫽0.55, ␶ ⫽1.0, ␶ ⫽5.5, and ␶ ⫽50.5, respectively. The height is
height is measured in lattice sites. measured in lattice sites.
PRE 61 GRAVITY IN A LATTICE BOLTZMANN MODEL 5313

共B18兲. The differences 兩 ␳ 34兩 are increasing functions of ␶ , in


agreement with the difference being dependent on a term
containing the factor ( ␶ ⫺1/2), for ␶ ⬎1/2. All the relative
differences are observed to increase with g. The difference
between the results for g⫽0.000 01 and g⫽0.0001 and the
difference between the results for g⫽0.0001 and g⫽0.001
differing by a factor O(10⫺3 ). In all the cases considered the
largest value of the differences between the methods is at
least an order of magnitude smaller than the difference be-
tween the results and the analytic expression, Eq. 共B19兲. For
the lower values of g 共0.0001 and 0.000 01兲, which are
strictly within the incompressible regime, the difference is
greater and at the low values of ␶ at which the lattice Bolt-
zmann model is normally run, the difference is greater still: FIG. 6. The boundary condition applied to produce continuous
for g⫽0.0001 and ␶ ⫽1 we have 兩 ␳ 34兩 ⫽O(10⫺9 ) and 兩 ␳ T4 兩 boundary conditions for method 共1兲.
⫽O(10⫺4 ). Thus the density gradients produced by the dif-
ferent models are not significantly different when compared tential. To overcome this, the following boundary conditions,
to the error introduced by the incompressibility approxima- see Fig. 6, were applied after the standard streaming: distri-
tion. bution functions on the penultimate rows are mapped onto
the end rows at the opposite side of the grid. An example of
B. Simulations with nonzero velocities the flow patterns set up is shown in Fig. 7, which agrees with
Two situations are considered where the fluid velocity is Eq. 共36兲 to the machine accuracy. Here there is no discreti-
nonzero. Gravity driven Poiseuille flow, where the density is zation error, as discussed in Sec. V and there is no compress-
constant, the velocity is nonzero, and the nonlinear term in ibility error since the density is constant.
the Navier-Stokes equation is zero, is a simulation that all
four methods should be suited to. During the time between 2. Changeable flow
the initialization of the fluid as described in Sec. VI A and Flow phenomena where the nonlinear term of the Navier-
the formation of the steady state density gradients that were Stokes equation is nonzero are in general more complex and
measured, the density and velocity of the fluid are functions do not have simple analytic solutions. We expect methods
of time, as seen in Fig. 1, in such a way that the nonlinear 共2兲, 共3兲, and 共4兲 to exhibit differences in such situations so
term in the Navier-Stokes equation is nonzero. Thus the dif- we consider the evolution of the fluid between the initializa-
ferences between methods 共2兲, 共3兲, and 共4兲 should be observ- tion described in Sec. VI A 共zero velocity and constant den-
able in this interim period. sity兲 and the steady state situation, which was just discussed.
The difference between the density and velocity at a point in
1. Poiseuille flow
the center of the grid, found using methods 共2兲, 共3兲, and 共4兲,
Poiseuille flow is created between stationary parallel ver- as a function of time, is shown in Fig. 8 when ␶ ⫽50.5 and
tical walls when a fluid is driven by gravity and has a steady g⫽0.0005. This gives c s2 /gz⫽9 and so is the largest value of
state solution g that could be reasonably used in the incompressible limit.
This value of g gives a maximum value for the velocity no
g 2 larger than 0.1. The density difference, ␳ ab between methods
u z共 x 兲 ⫽ 共 x ⫺L 2 兲 , 共36兲 共a兲 and 共b兲 can be thought of as relative density differences
2␯
since ␳ ⯝1 at the center of the grid. Relative velocity differ-
where the walls are at x⫽⫾L. Method 共2兲 has been applied ences cannot sensibly be considered since the velocity is os-
to simulate Poiseuille flow 关23兴 for a body force that pro-
duces a maximum velocity 0.0005 and method 共3兲 has been
applied 关25,27兴 and seen to produce results that are correct
up to the machine accuracy. Poiseuille flow was simulated
here for all four methods. When suitable boundary condi-
tions 关27兴 were applied at the wall boundaries and continu-
ous boundary conditions at the nonwall edges, methods 共2兲,
共3兲, and 共4兲 all produced the expected flow pattern correct to
machine accuracy for a range of different values of ␶ and g.
Since method 共4兲 can be thought of as a composite of meth-
ods 共2兲 and 共3兲 it is hardly surprising that it performs equally
well. Method 共1兲 can also be applied here since there is no
density variation in the fluid. Since the gravitational potential
is a linear function of the vertical position continuous bound-
ary conditions cannot be applied across the open ends; this FIG. 7. The steady state Poisseuille flow simulated using
would produce a large potential difference across the edge of method 共1兲 when g⫽0.0001. The pipe width x is measured in lattice
the grid that would exactly cancel out the gravitational po- sites and the velocity u z in 共lattice sites兲/共time step兲.
5314 J. M. BUICK AND C. A. GREATED PRE 61

兩 ␳ 34兩 ⫽ 兩 ␳ 24兩 and 兩 u 34兩 ⫽ 兩 u 24兩 as predicted.


The results here show that there is an observable differ-
ence between the models, due to the incorrect nonlinear term
in methods 共2兲 and 共3兲. The maximum value of the velocity
in the simulations is at the upper end of the range of veloci-
ties that can be used in a lattice Boltzmann simulation and
the value of g used is at the upper limit of values for which
the incompressible limit holds 共at least for the value of z used
here兲. Thus we expect that the magnitude of the errors pro-
duced due to methods 共2兲 and 共3兲 not satisfying the correct
Navier-Stokes equation will typically be no larger than the
differences measured here. The results suggest that, although
the differences are small, at high values of ␶ it is inadvisable
FIG. 8. The density and velocity differences ␳ 24 , ␳ 34 , u 24 , and to use method 共3兲, while at low values of ␶ it is inadvisable
u 34 for g⫽0.0005 and ␶ ⫽50.5. The time is measured in time steps. to use method 共2兲. At intermediated values, for example ␶
⫽1, the results differ by about 0.01%, which is too small to
cillating about zero, however the velocity differences relative make a significant difference to a simulation but the accuracy
to the maximum value of the velocity can be considered. At can be improved by using method 共4兲. At low ␶ the differ-
small times 兩 ␳ 34兩 peaks at about 3⫻10⫺4 giving a relative ence ␳ 24 is O(10⫺4 ) and at high ␶ the difference ␳ 34 is
density difference of about 3⫻10⫺4 , whereas 兩 ␳ 24兩 gives a O(10⫺4 ). These are of the same order of magnitude as the
much smaller maximum density difference of about 3 estimation of the compressibility error for g⫽0.0001, see
⫻10⫺6 . Initially the values of 兩 u 24兩 and 兩 u 34兩 peak at values Fig. 4, and the estimation of the discretization error, see Sec.
O(10) smaller than the corresponding density differences. V. Therefore we do not expect errors due to the anomalous
Since u max⫽O(0.1) at these times the relative density differ- term in Eq. 共31兲 to swamp the results, however, in some
ence and the relative velocity difference 共relative to the simulations it may be the largest source of error and so it is
maximum value of u) are of the same order for each com- advisable to reduce it by using method 共4兲.
parison. At later times the peak values of 兩 u 24兩 and 兩 u 34兩
remain O(10) smaller than the corresponding densities, how- C. Gravity in an immiscible fluid model
ever, the peak values of the velocity are reduced at these
times so the relative velocity differences become larger than We now consider the body force applied to an immiscible
the relative density differences at the peaks as time increases. binary fluid. This was done using the model of Orlandini
The absolute value of all the differences, however, decrease et al. 关29兴, where the fluid is described in terms of the total
with time in an approximately exponential manner at about density ␳ and the density difference between the two fluids
the same rate. ⌬ ␳ . This was done using method 共3兲 for the relaxation times
This was repeated for ␶ ⫽5.50, 1.0, 0.55, and 0.505. In ␶ ⌬ ⫽0.8, ␶ ␳ ⫽0.9, ␳ 0 ⫽1 and for an interaction strength ␭
each case the maximum values of 兩 ␳ ab 兩 and 兩 u ab 兩 were found ⫽1.1. The immiscible binary fluid was initialized with the
for the different values of a and b of interest. The results are two fluids separated by a horizontal interface. The upper
shown in Fig. 9 as a function of the viscosity, an increasing fluid has ⌬ ␳ negative. Gravity was applied to both fluids
function of ␶ . For both the density and the velocity, the dif- with strength ␳ g⫽ 关 (g a ( ␳ ⫺⌬ ␳ )⫹g b ( ␳ ⫹⌬ ␳ ) 兴 /2, where g a
ferences between methods 共2兲 and 共4兲 are decreasing func- ⬍g b . At temperature T⫽0.5 we expect that 兩 ␳ /⌬ ␳ 兩 ⯝2 in
tions of ␶ and the differences between methods 共3兲 and 共4兲 the absence of gravity 关29兴. Figure 10 shows the value of the
are increasing functions of ␶ . At ␶ ⫽1( ␯ ⫽1/8) we find modulus of the ratio ␳ /⌬ ␳ at different depths for the immis-
cible fluid when g a ⫽0.0001 and g b ⫽0.0002. At the inter-
face the value of 兩 ␳ /⌬ ␳ 兩 is different from 2.0 by no more
than 4%. Away from the interface the ratio appears constant
with depth, and hence also with density. Thus the value of g
in both fluids is given by

g 1 ⫽ 关 g a 共 1⫹1/2兲 ⫹g b 共 1⫺1/2兲兴 /2,


共37兲
g 2 ⫽ 关 g a 共 1⫺1/2兲 ⫹g b 共 1⫹1/2兲兴 /2.

Figure 11 shows the variation in density with depth for the


immiscible fluid for two different sets of values g a and g b .
The values are shown in Table I as are the values of g 1 , g 2
in the upper and lower fluids, respectively. Straight lines
with gradients 4 ␳ 0 g are also shown in Fig. 11. The agree-
FIG. 9. The maximum values of the density and velocity differ- ment between the actual gradients and the predicted gradi-
ences ␳ 24 , ␳ 34 , u 24 , and u 34 for g⫽0.0005 as a function of the ents is good and reinforces the use of Eq. 共37兲 for calculating
fluid viscosity, which is an increasing function of ␶ . The viscosity is g 1 and g 2 . Method 共3兲 was preferred over methods 共2兲 and
measured in units of 共lattice sites兲 2 /共time step兲. 共4兲 here since the nonlinear term of the Navier-Stokes equa-
PRE 61 GRAVITY IN A LATTICE BOLTZMANN MODEL 5315

TABLE I. The values of g a and g b used in cases 共i兲 and 共ii兲 in


Fig. 11 and the values of g 1 and g 2 calculated using Eq. 共37兲.

Case ga gb g1 g2

共i兲 1⫻10⫺4 2⫻10⫺4 1.25⫻10⫺4 1.75⫻10⫺4


共ii兲 5.0⫻10⫺5 5.5⫻10⫺5 5.125⫻10⫺5 5.375⫻10⫺5

which produces an altered pressure term—the difference cor-


responding to a gravitational potential. This approach is re-
stricted to simulations where there is no density change or
the density change is small enough that it can be neglected.
Method 共1兲 was seen to be capable of simulating Poiseuille
flow 共where there is no density change兲 correct to the com-
puter accuracy. When a density gradient is present, method
共1兲 performs less well than the other methods considered,
even when the density variation is small. The difference be-
FIG. 10. The modulus of the ratio ␳ /⌬ ␳ as a function of depth
tween the accuracy of method 共1兲 and the other methods can
when gravity is applied to a binary fluid with a horizontal interface
be as large as an order of magnitude when g is within the
between the fluids. Gravity was applied with g a ⫽0.0001 and g b
incompressible limit. Despite this the error was observed to
⫽0.0002. The height is measured in lattice sites.
be little more than the computer accuracy of a 32-bit simu-
lation when the density variation across the fluid was 0.2%.
tion is zero and it is not clear how replacing f̄ ( ␳ ,u) with Method 共2兲 introduces gravity into the lattice Boltzmann
f̄ ( ␳ ,u* ) would affect the thermodynamical properties of the model by considering the equilibrium distribution function to
fluid mixture, and over method 共1兲 since it can be applied for be a function, not of the lattice Boltzmann velocity
a larger range of g. ( 兺 i f i ei / 兺 i f i ), but of an ‘‘equilibrium velocity’’ defined as
Other schemes have also been proposed for multifluid the sum of the lattice Boltzmann velocity and ␶ F/ ␳ , where F
simulation. Shan et al. 关11,24兴 consider a model in which the is the body force due to gravity. Method 共3兲 introduces grav-
fluids are separated by an intersite force that is introduced in ity by adding a term to the collision function, which is pro-
the same manner as the body force in method 共2兲. For such a portional to F ␣ e i ␣ . For both these methods, if we define the
model there is no thermodynamical equilibrium to be af- fluid velocity, v , to be the sum of the lattice Boltzmann
fected so method 共2兲 can be applied 关23兴, however, given the velocity and F/2␳ , then the models satisfy 共up to second
order兲 the continuity equation and an equation similar to the
errors involved in method 共2兲, particularly at low ␶ , method
Navier-Stokes equation. The difference is an additional term
共4兲 might be better applied in such cases.
of order O(Fu). Method 共4兲 introduces gravity by consider-
ing the equilibrium distribution to be a function of an altered
VII. CONCLUSION velocity and by adding an additional term to the collision
Different methods have been considered for introducing a operator. In this method the introduction of gravity can be
body force, in the incompressible limit, into the lattice Bolt- thought of as being made up from a combination from
zmann model. Method 共1兲 introduces gravity by including an method 共2兲 and a combination from method 共3兲. The relative
additional term in the equilibrium distribution function, strengths of the contributions are selected to ensure that the
technique satisfies the exact 共up to second order兲 Navier-
Stokes equation in the velocity v . Within the incompressible
limit methods 共2兲, 共3兲, and 共4兲 were found to compare well
with theory in situations where the nonlinear term of the
Navier-Stokes equation is zero. When the nonlinear term is
nonzero an observable difference is found between methods
共2兲 and 共3兲, which have the wrong nonlinear term, and
method 共4兲, which has the correct nonlinear term. This dif-
ference is small but under certain circumstances is large
enough to influence the simulation results, in which case
method 共4兲 is an improvement over the other methods.
The introduction of gravity into a two-phase model was
also considered. Here the error introduced by the incorrect
nonlinear term when method 共3兲 is used has to be weighed
against any effect of using an altered ‘‘equilibrium velocity’’
rather than the true velocity in the definition of f̄ i may have
on the thermodynamical properties of the fluid.
FIG. 11. The density as a function of depth for case 共i兲 (⫻) and ACKNOWLEDGMENTS
case 共ii兲 共⫹兲 shown in Table I. Also shown are straight lines with
gradients 4 ␳ 0 g i . The density is measured in particles per site and The authors wish to thank Dominique d’Humières for
the height in lattice sites. helpful comments on an earlier draft of this manuscript and
5316 J. M. BUICK AND C. A. GREATED PRE 61

in particular for suggesting we consider the analytical results. where


We are also grateful to the Edinburgh Parallel Computing
Center 共EPCC兲 for providing us with the use of their facili-
ties. f̄ i ⫽E i⬘ 共 ␳ ,u⫹nw兲 , 共A2兲

APPENDIX A: CHAPMAN-ENSKOG EXPANSION FOR A


w⫽ ␶ F/ ␳ and E i⬘ is defined by Eq. 共13兲 where we expand
LATTICE BOLTZMANN MODEL INCORPORATING
GRAVITY
i ⫹ ⑀ f i ⫹ ⑀ f i , ⳵ t ⫽ ⑀ ⳵ 1t ⫹ ⑀ ⳵ 2t , ⳵ ␣ ⫽ ⑀ ⳵ 1 ␣ ,
f i ⫽ f (0) (1) 2 (2) 2
Here we wish to consider the Chapman-Enskog expansion
of the Boltzmann equation 共A3兲

i ⫹ ⑀ f̄ i ⫹ ⑀ f̄ i , F ␣ ⫽ ⑀ F 1 ␣ , and ␾ ⫽ ⑀␾ 1 .
f̄ i ⫽ f̄ (0) (1) 2 (2)
1 D
f i 共 r⫹ei ,t⫹1 兲 ⫺ f i 共 r,t 兲 ⫽⫺ 共 f i ⫺ f̄ i 兲 ⫹m 2 F ␣ e i ␣ ,
␶ bc
共A1兲 Substituting the expansion of F ␣ and ␾ into E ⬘ gives

␳ 冋 1⫺d 0 ⑀ l ␾ 1 D D

⑀ nD ␶
⫹ 2 e i␣u ␣⫹ 2
c b␳
e i␣F 1␣

¦冋
b bc 2
c b


D 共 D⫹2 兲
冉 ␶ n 2␶ 2
e i ␣ e i ␤ u ␣ u ␤ ⫹2 ⑀ n e i ␣ e i ␤ F 1 ␣ u ␤ ⫹ ⑀ 2 2 e i ␣ e i ␤ F 1 ␣ F 1 ␤ 冊
冉 n␶
冊 2c 4 b ␳ ␳

冉 冊册
E ⬘ ␳ ,u⫹ ⑀ F1 ⫽ 共A4兲
␳ D ␶ ␶2
⫺ 2 u 2 ⫹2 ⑀ n u ␣ F 1 ␣ ⫹ ⑀ 2 n 2 2 F 21 , i⫽1,2, . . . ,b
2c b ␳ ␳

␳ d 0⫺
⑀ l ␾ 1D
c 2

u2
c 2

2⑀n␶
c ␳
2
u ␣F 1␣⫺
⑀ 2n 2␶ 2
c ␳
2 2 册
F 21 , i⫽0.

i ⫽E( ␳ ,u),
From this we get f̄ (0)

冋 册

l ␾ 1D nD ␶ nD 共 D⫹2 兲 ␶ nD ␶
␳ ⫹ e i␣F 1␣⫹ e i ␣ e i ␤ F 1 ␣ u ␤ ⫺ 2 u ␣ F 1 ␣ , i⫽1,b
bc 2
c b␳
2 4
c b ␳ c b␳
i ⫽
f̄ (1) 共A5兲

␳ ⫺ 冋 ␾ 1D
c2

2n ␶
c 2␳

u ␣ F 1 ␣ , i⫽0

and

冋 册

n 2 D 共 D⫹2 兲 ␶ 2 n 2D ␶ 2
␳ e e F F ⫺
2 i␣ i␤ 1␣ 1␤
F 21 , i⫽1,2, . . . ,b
2c b 4
␳ 2c b ␳
2 2 2

i ⫽
f̄ (2) 共A6兲

␳ 冋 ⫺n 2 ␶ 2
c 2␳ 2

F 21 , i⫽0,

from which we find and

兺i i ⫽0,
f̄ (1) 兺i i ⫽0,
f̄ (2) 兺i i e i ␣ ⫽n ␶ F 1 ␣ ,
f̄ (1) 兺i i e i ␣ e i ␤ ⫽n ␶ 共 F 1 ␣ u ␤ ⫹F 1 ␤ u ␣ 兲 ⫹l ␳ ␾ 1 ␦ ␣␤ .
f̄ (1)

兺i i e i ␣ ⫽0,
f̄ (2) 共A7兲 Now, the expansion of the Boltzmann equation up to second
order in ⑀ is
PRE 61 GRAVITY IN A LATTICE BOLTZMANN MODEL 5317

⑀ 共 ⳵ 1t f (0) (0) 2

i ⫹e i ␣ ⳵ 1 ␣ f i 兲 ⫹ ⑀ ⳵ 2t f i ⫹ ⳵ 1t f i ⫹e i ␣ ⳵ 1 ␣ f i
(0) (1) (1)
兺i e i ␣ e i ␤ f (1)
i ⫽n ␶ 共 F 1 ␣ u ␤ ⫹F 1 ␤ u ␣ 兲

1
⫹ e i ␣ e i ␤ ⳵ 1 ␣ ⳵ 1 ␤ f (0)
2
1
i ⫹ e i ␣ ⳵ 1 ␣ ⳵ 1t f i
2
(0)
⫺ ␶ ⳵ 1t 冉 ␳ 共 1⫺d 0 兲 c 2
D
␦ ␣␤ ⫹ ␳ u ␣ u ␤ 冊
1
⫹ e i ␣ ⳵ 1 ␣ ⳵ 1t f (0)
2
1
i ⫹ ⳵ 1t ⳵ 1t f i
2
(0)
冊 ⫺ ␶ ⳵ 1␥
␳c2
共 u ␦ ⫹u ␤ ␦ ␣␥ ⫹u ␥ ␦ ␣␤ 兲
共 D⫹2 兲 ␣ ␤␥
1 ⫹ ␳ ␾ 1 l ␦ ␣␤ , 共A16兲
⫽⫺ 共 f (0) ⫹ ⑀ f (1)
i ⫹ ⑀ f i ⫺ f̄ i ⫺ ⑀ f̄ i ⫺ ⑀ f̄ i 兲
2 (2) (0) (1) 2 (2)
␶ i
which is found from Eq. 共A10兲. Combining Eqs. 共A12兲 and
mD 共A14兲 gives
⫹⑀ 共A8兲

冋 册
F 1␣e i␣ .
bc 2 1
⳵ t ␳ ⫹ ⳵ ␣ ␳ u ␣ ⫹ 共 n⫹m 兲 F ␣ ⫽0, 共A17兲
This gives O( ⑀ 0 ), 2

while combining Eqs. 共A13兲 and 共A15兲 gives


i ⫽ f̄ i ,
f (0) 共A9兲
(0)

O( ⑀ ), 冋 1

⳵ t ␳ u ␣ ⫹ 共 n⫹m 兲 F 1 ␣ ⫹ ⳵ ␤ 关 ␳ u ␣ u ␤ ⫹ ␶ n 共 u ␣ F ␤ ⫹u ␤ F ␣ 兲兴
2

冉 冊
1 (1) (1) mD
⳵ 1t f (0) ␳ 共 1⫺d 0 兲 c 2
i ⫹e i ␣ ⳵ 1 ␣ f i ⫽⫺ 共 f i ⫺ f̄ i 兲 ⫹
(0)
F 1␣e i␣ ,
␶ bc 2 ⫽⫺ ⳵ ␣ ⫹ ␯⳵ ␤ ⳵ ␤ ␳ u ␣ ⫹ ␨⳵ 1 ␣ ⳵ 1 ␤ ␳ u ␤
D
共A10兲
⫹ 共 n⫹m 兲 F ␣ ⫺l ⳵ ␣ ␳ ␾ . 共A18兲
and O( ⑀ 2 ),

1 APPENDIX B: ANALYTICAL RESULTS


⳵ 2t f (0)
i ⫹ ⳵ 1t f i ⫹e i ␣ ⳵ 1 ␣ f i ⫹ e i ␣ e i ␤ ⳵ 1 ␣ ⳵ 1 ␤ f i
(1) (1) (0)
2 We now consider exact analytical solutions 关25,26,30兴 for
methods 共1兲–共4兲 applied to a two-dimensional hexagonal
1 1 1 grid (D⫽2,b⫽6). In doing this we assume a steady solution
⫹ e i ␣ ⳵ 1 ␣ ⳵ 1t f (0)
i ⫹ e i ␣ ⳵ 1 ␣ ⳵ 1t f i ⫹ ⳵ 1t ⳵ 1t f i
(0) (0)
2 2 2 invariant in the x direction. This steady state implies
1
⫽⫺ 共 f (2) ⫺ f̄ (2)
i 兲. 共A11兲 f 0 共 z 兲 ⫽ f̄ 0 共 z 兲 , f 2 共 z 兲 ⫽ f̄ 2 共 z 兲 , f 5 共 z 兲 ⫽ f̄ 5 共 z 兲 , ᭙z,
␶ i 共B1兲
We can now sum Eqs. 共A10兲 and 共A11兲 and their product where ei ⫽sin(␲i/3⫺ ␲ /6)êx ⫹cos(␲i/3⫺ ␲ /6)êz , êx and êz
i ⫽ 兺 i f i e i ␣ ⫽ 兺 i f i ⫽ 兺 i f i e i ␣ ⫽0.
with ei where 兺 i f (1) (1) (2) (2)
are unit vectors in the horizontal and vertical directions, re-
Summing Eq. 共A10兲 gives spectively, and gravity acts in the z direction. We are solving
the lattice Boltzmann equation,
⳵ 1t ␳ ⫹ ⳵ 1 ␣ ␳ u ␣ ⫽0, 共A12兲

while multiplying by e i ␤ before summing gives 1 D


f i 共 r⫹ei ,t⫹1 兲 ⫺ f i 共 r,t 兲 ⫽⫺ 共 f i ⫺ f̄ i 兲 ⫹m 2 F ␣ e i ␣ ,
␶ bc
共 1⫺d 0 兲 2 共B2兲
⳵ 1t ␳ u ␤ ⫹ ⳵ 1 ␣ ␳ u ␣ u ␤ ⫽⫺ c ⳵ 1 ␤ ␳ ⫹ 共 n⫹m 兲 F 1 ␤ .
D
共A13兲 where

Summing Eq. 共A11兲 gives f̄ i ⫽E i⬘ 共 ␳ ,u⫹nw兲 共B3兲


1 and w⫽ ␶ F/ ␳ . This represents method 共1兲 for l⫽1, m⫽n
⳵ 2t ␳ ⫹ ⳵ 1 ␣ 共 n⫹m 兲 F 1 ␣ ⫽0, 共A14兲
2 ⫽0, method 共2兲 for m⫽1, l⫽n⫽0, method 共3兲 for n⫽1, l
⫽m⫽0, and method 共4兲 for l⫽0, m⫽(2 ␶ ⫺1)/(2 ␶ ), n
where we have used Eqs. 共A12兲 and 共A13兲. Multiplying by ⫽1/(2 ␶ ). We also define v according to Eq. 共16兲. Now
e i ␥ before summing gives 兺 i f i ⫽ 兺 i f̄ i and 兺 i f i e ix ⫽ 兺 i f̄ i e ix , while 兺 i f i e iz ⫽ 兺 i¯
f i e iz
⫹n ␶ F z . This gives
1
⳵ 2t ␳ u ␥ ⫹ ⳵ 1t 共 n⫹m 兲 F 1 ␥ ⫹ ⳵ 1 ␣ n ␶ 共 F 1 ␥ u ␣ ⫹F 1 ␣ u ␥ 兲
2 f 1 共 z 兲 ⫹ f 3 共 z 兲 ⫹ f 4 共 z 兲 ⫹ f 6 共 z 兲 ⫽ f̄ 1 共 z 兲 ⫹ f̄ 3 共 z 兲 ⫹ f̄ 4 共 z 兲 ⫹ f̄ 6 共 z 兲 ,
⫹ ⳵ 1 ␥ l ␳ ␾ 1 ⫽ ␯⳵ 1 ␣ ⳵ 1 ␣ ␳ u ␥ ⫹ ␨⳵ 1 ␥ ⳵ 1 ␣ ␳ u ␣ , 共A15兲
f 1 共 z 兲 ⫹ f 3 共 z 兲 ⫺ f 4 共 z 兲 ⫺ f 6 共 z 兲 ⫽ f̄ 1 共 z 兲 ⫹ f̄ 3 共 z 兲 ⫺ f̄ 4 共 z 兲 ⫺ f̄ 6 共 z 兲 ,
where we have used 共B4兲
5318 J. M. BUICK AND C. A. GREATED PRE 61

f 1 共 z 兲 ⫺ f 3 共 z 兲 ⫺ f 4 共 z 兲 ⫹ f 6 共 z 兲 ⫽ f̄ 1 共 z 兲 ⫺ f̄ 3 共 z 兲 ⫺ f̄ 4 共 z 兲 ⫹ f̄ 6 共 z 兲

2

␳ 共 z⫹ 冑3/2兲 共 1⫺d 0 兲 ⫹2l ␾ 共 z⫹ 冑3/2兲 ⫺ 冑3u z 共 z⫹ 冑3/2兲

冋 册冎
⫺ ␶ F z共 z 兲 .
冑3 F z 共 z⫹ 冑3/2兲
2

⫹2 v z 共 z⫹ 冑3/2兲 ⫹ 共 n ␶ ⫺1/2兲
␳ 共 z⫹ 冑3/2兲
Assuming that u x (z)⫽0, ᭙z these have solution
⫺ 共 n⫹m 兲 冑3F z 共 z⫹ 冑3/2兲

f 3 共 z 兲 ⫽ f 4 共 z 兲 , f 1 共 z 兲 ⫽ f 6 共 z 兲 , f̄ 3 共 z 兲 ⫽ f̄ 4 共 z 兲 , f̄ 1 共 z 兲 ⫽ f̄ 6 共 z 兲 ,
共B5兲

⫽ ␳ 共 z 兲 共 1⫺d 0 兲 ⫹2l ␾ 共 z 兲 ⫺ 冑3u z 共 z 兲

f 1 共 z 兲 ⫽ f̄ 1 共 z 兲 ⫺
n ␶ F z共 z 兲
, and f 3 共 z 兲 ⫽ f̄ 3 共 z 兲 ⫹
n ␶ F z共 z 兲
.

⫹2 v z 共 z 兲 ⫹ 共 n ␶ ⫺1/2兲
F z共 z 兲
␳共 z 兲 册冎
2
. 共B9兲
2 冑3 2 冑3
Subtracting Eq. 共B9兲 from Eq. 共B8兲 gives
Now the Boltzmann equation for i⫽1 and i⫽3 combined 2 ␳ 共 z⫹ 冑3/2兲 u z 共 z⫹ 冑3/2兲 ⫹ 共 n⫹m 兲 F z 共 z⫹ 冑3/2兲
with Eq. 共B5兲 gives
⫽2 ␳ 共 z 兲 u z 共 z 兲 ⫹ 共 n⫹m 兲 F z 共 z 兲 , 共B10兲
n ␶ F z 共 z⫹ 冑3/2兲
f̄ 1 共 z⫹ 冑3/2兲 ⫺
while adding the equations gives
2 冑3

n ␶ F z共 z 兲
再 冋
␳ 共 z⫹ 冑3/2兲 2 共 1⫺d 0 兲 ⫹4 v z 共 z⫹ 冑3/2兲 ⫹ 共 n ␶ ⫺1/2兲

册冎
⫽ f̄ 1 共 z 兲 ⫺
2 冑3 F z 共 z⫹ 冑3/2兲
2

⫻ ⫹4l ␳ 共 z⫹ 冑3/2兲 ␾ 共 z⫹ 冑3/2兲 ⫺ 共 m


␳ 共 z⫹ 冑3/2兲
F z共 z 兲
⫹ 共 n⫹m 兲 共B6兲
2 冑3 ⫹n 兲 冑3F z 共 z⫹ 冑3/2兲

and 再 冋
⫽ ␳ 共 z 兲 2 共 1⫺d 0 兲 ⫹4 v z 共 z 兲 ⫹ 共 n ␶ ⫺1/2兲
F z共 z 兲
␳共 z 兲 册 2

f̄ 3 共 z⫺ 冑3/2兲 ⫹
n ␶ F z 共 z⫺ 冑3/2兲
2 冑3

⫹4l ␾ 共 z 兲 ⫹ 共 m⫹n 兲 冑3 f z 共 z 兲 . 共B11兲

Now consider a bounce-back boundary condition between


n ␶ F z共 z 兲 F z共 z 兲 the last fluid site at z⫽z 0 and an obstacle at z⫽(z 0 ⫺ 冑3/2).
⫽ f̄ 3 共 z 兲 ⫹ ⫺ 共 n⫹m 兲 . 共B7兲
2 冑3 2 冑3 This can be expressed as

f 1 共 z 0 兲 ⫽ f 4 共 z 0 ⫺ 冑3/2兲 . 共B12兲
Replacing f̄ i with E ⬘i ( ␳ ,u⫹nw) in Eqs. 共B6兲 and 共B7兲, not-
ing that c⫽1 in lattice units and replacing z with z⫹ 冑3/2 in Using Eqs. 共B5兲 and 共B7兲 this can be written as
Eq. 共B7兲, gives
n ␶ F z共 z 0 兲 n ␶ F z共 z 0 兲 F z共 z 0 兲
f̄ 1 共 z 0 兲 ⫺ ⫽ f̄ 3 共 z 0 兲 ⫹ ⫺ 共 n⫹m 兲


.
2 冑3 2 冑3 2 冑3
␳ 共 z⫹ 冑3/2兲 共 1⫺d 0 兲 ⫹2l ␾ 共 z⫹ 冑3/2兲 ⫹ 冑3u z 共 z⫹ 冑3/2兲 共B13兲

冋 册冎
Since f̄ i ⫽E ⬘i ( ␳ ,u⫹nw) this gives the boundary condition
F z 共 z⫹ 冑3/2兲
2

⫹2 v z 共 z⫹ 冑3/2兲 ⫹ 共 n ␶ ⫺1/2兲 2 ␳ 共 z 0 兲 u z 共 z 0 兲 ⫹ 共 n⫹m 兲 F z 共 z 0 兲 ⫽0. 共B14兲


␳ 共 z⫹ 冑3/2兲


⫽ ␳ 共 z 兲 共 1⫺d 0 兲 ⫹2l ␾ 共 z 兲 ⫹ 冑3u z 共 z 兲
Consider first methods 共2兲, 共3兲, and 共4兲, which have l
⫽0 and m⫹n⫽1. In these cases the boundary condition Eq.
共B14兲 becomes


⫹2 v z 共 z 兲 ⫹ 共 n ␶ ⫺1/2兲
F z共 z 兲
␳共 z 兲 册冎
2
2 ␳ 共 z 0 兲v z 共 z 0 兲 ⫽0 or ␳ 0 v z 共 z 0 兲 ⫽0, 共B15兲

⫹ 冑3 共 n⫹m 兲 F z 共 z 兲 共B8兲 where ␳ 0 ⫽ ␳ (z 0 ). Combining Eq. 共B10兲 with this boundary


condition gives

and ␳ 共 z 兲v z 共 z 兲 ⫽ ␳ 0 v z 共 z 0 兲 ⫽0, 共B16兲


PRE 61 GRAVITY IN A LATTICE BOLTZMANN MODEL 5319

which shows that the bounce-back condition imposes a con- For method 共1兲 we have l⫽1 and m⫽n⫽0. In this case a
fined fluid under gravity to be at rest only if the velocity is similar argument leads to
taken to be v as is the case for methods 共2兲, 共3兲, and 共4兲.
Setting v z ⫽0 in Eq. 共B11兲 to find the long-term behavior ␳ 共 z 兲 u z 共 z 兲 ⫽ ␳ 0 u z 共 z 0 兲 ⫽0, 共B21兲
of the fluid and F z (z)⫽⫺ ␳ (z)g gives

␳ 共 z⫹ 冑3/2兲 implying that the fluid velocity should be taken as u, and

⫽␳共 z 兲 冋 1⫺ 冑3g/2共 1⫺d 0 兲 ⫹2 共 n ␶ ⫺1/2兲 2 g 2 / 共 1⫺d 0 兲


1⫹ 冑3g/2共 1⫺d 0 兲 ⫹2 共 n ␶ ⫺1/2兲 2 g 2 / 共 1⫺d 0 兲
册 ␳ 共 z⫹ 冑3/2兲关共 1⫺d 0 兲 ⫹2u z 共 z⫹ 冑3/2兲 ⫹2 ␾ 共 z⫹ 冑3/2兲兴
⫽ ␳ 共 z 兲关共 1⫺d 0 兲 ⫹2u z 共 z 兲 ⫹2 ␾ 共 z 兲兴 . 共B22兲
共B17兲
or Since method 共1兲 can only be applied if there is a negli-
gible change in the fluid density it is not sensible to consider
␳共 z 兲 a density gradient since this is negligibly small. Here we
consider the density variation in this limit to enable a com-

⫽␳0 冋 1⫺ 冑3g/2共 1⫺d 0 兲 ⫹2 共 n ␶ ⫺1/2兲 2 g 2 / 共 1⫺d 0 兲


1⫹ 冑3g/2共 1⫺d 0 兲 ⫹2 共 n ␶ ⫺1/2兲 2 g 2 / 共 1⫺d 0 兲
册 2z/ 冑3

.
parison to be made with the other methods. In this limit we
can write
共B18兲
2 ␳ 共 z⫹ 冑3/2兲 ␾ 共 z⫹ 冑3/2兲 ⫺2 ␳ ␾ 共 z 兲
When ␶ ⫽1 the density gradient produced by both methods
共2兲 and 共3兲 will be the same, although different from the ⯝2 ␳ 共 z 兲关 ␾ 共 z⫹ 冑3/2兲 ⫺ ␾ 共 z 兲兴
gradient produced by method 共4兲, despite it being a compos- ⯝ 冑3 ␳ 共 z 兲 ⵜ ␾ 共 z 兲 . 共B23兲
ite of the two methods. If ␶ ⫽1 the density gradient will
differ between the different methods, for method 共3兲 this will
depend on ␶ and for methods 共2兲 and 共4兲 the gradient is Or, to the same approximation
independent of ␶ , however these differences will in general
be small. In the incompressible limit, gzⰆc s2 , we expect 2 ␳ 共 z⫹ 冑3/2兲 ␾ 共 z⫹ 冑3/2兲 ⫺2 ␳ ␾ 共 z 兲 ⯝ 冑3 ␳ 共 z 兲 ⵜ ␾ 共 z 兲 .
冑3g/2Ⰷ(n ␶ ⫺1/2) 2 g 2 for the values of ␶ typically used in 共B24兲
lattice Boltzmann simulations; for method 共4兲 this is always
true since n ␶ ⫺1/2⫽0. In this incompressible limit This approximation allows Eq. 共B11兲 to be expressed as


␳ 共 z 兲 ⯝ ␳ 0 1⫺
2gz
1⫺d 0 冊 共B19兲 ␳ 共 z⫹ 冑3/2兲关 2 共 1⫺d 0 兲 ⫹ 冑3g 兴 ⯝ ␳ 共 z 兲关 2 共 1⫺d 0 兲 ⫺ 冑3g 兴
共B25兲
for each method. It is worth noting that in the compressible
limit the exponential law, ␳ (z)⫽ ␳ 0 exp(g⬘z/cs2), is obtained giving

冉 冊
in terms of a rescaled gravity

冋 册
2gz
2c s2 1⫺ 冑3g/2共 1⫺d 0 兲 ⫹2 共 n ␶ ⫺1/2兲 2 g 2 / 共 1⫺d 0 兲
␳ 共 z 兲 ⯝ ␳ 0 1⫺ 共B26兲
1⫺d 0
g ⬘⫽ ln .
冑3 1⫹ 冑3g/2共 1⫺d 0 兲 ⫹2 共 n ␶ ⫺1/2兲 2 g 2 / 共 1⫺d 0 兲
共B20兲 as was found for the other methods.

关1兴 G. R. McNamara and G. Zanetti, Phys. Rev. Lett. 61, 2332 关9兴 A. J. C. Ladd, J. Fluid Mech. 271, 311 共1994兲.
共1988兲. 关10兴 E. G. Flekko” y, Phys. Rev. E 47, 4247 共1993兲.
关2兴 F. J. Higuera, S. Succi, and R. Benzi, Europhys. Lett. 9, 345 关11兴 X. Shan and H. Chen, Phys. Rev. E 47, 1815 共1993兲.
共1989兲. 关12兴 M. R. Swift, E. Orlandini, W. R. Osborn, and J. M. Yeomans,
关3兴 H. Chen, S. Chen, and H. Matthaeus, Phys. Rev. A 45, 5339 Phys. Rev. E 54, 5041 共1996兲.
共1992兲. 关13兴 X. He, L.-S. Luo, and M. Dembo, J. Comput. Phys. 129, 357
关4兴 Y. H. Qian, D. d’ Humières, and P. Lallemand, Europhys. Lett. 共1996兲.
17, 479 共1992兲. 关14兴 J. Lighthill, Waves In Fluids 共Cambridge University Press,
关5兴 U. Frisch, B. Hasslacher, and Y. Pomeau, Phys. Rev. Lett. 56, Cambridge, England, 1978兲.
1505 共1986兲. 关15兴 J. S. Turner, Buoyancy Effects in Fluids 共Cambridge Univer-
关6兴 S. Chen, H. Chen, D. Martinez, and W. Matthaues, Phys. Rev. sity Press, Cambridge, England, 1973兲.
Lett. 67, 3776 共1991兲. 关16兴 J. M. Buick, C. A. Greated, and W. J. Easson, Phys. Fluids 9,
关7兴 S. Chen, Z. Wang, X. Shan, and G. D. Doolen, J. Stat. Phys. 2585 共1997兲.
68, 379 共1992兲. 关17兴 U. Frisch, D. d’ Humières, B. Hasslacher, P. Lallemand, and
关8兴 S. Succi, R. Benzi, and F. Higuera, Physica D 47, 219 共1991兲. Y. Pomeau, Complex Syst. 1, 649 共1987兲.
5320 J. M. BUICK AND C. A. GREATED PRE 61

关18兴 S. Wolfram, J. Stat. Phys. 45, 471 共1986兲. 关24兴 X. Shan and G. Doolen, J. Stat. Phys. 81, 379 共1995兲.
关19兴 S. Chapman and T. G. Cowling, The Mathematical Theory of 关25兴 I. Ginzbourg and P. M. Alder, J. Phys. II 4, 191 共1994兲.
Non-Uniform Gases 共Cambridge University Press, Cambridge, 关26兴 X. He, Q. Zou, L.-S. Luo, and M. Dembo, J. Stat. Phys. 87,
1970兲. 115 共1997兲.
关20兴 C. Cercignani, Theory and Application of the Boltzmann Equa- 关27兴 D. R. Noble, S. Chen, J. G. Georgiadis, and R. O. Buckius,
tion 共Scottish Academic Press, Edinburgh, U.K., 1975兲. Phys. Fluids 7, 203 共1995兲.
关21兴 P. L. Bhatnagar, E. P. Gross, and M. Krook, Phys. Rev. 94, 关28兴 J. D. Sterling and S. Chen, J. Comput. Phys. 123, 196 共1996兲.
511 共1954兲. 关29兴 E. Orlandini, M. R. Swift, and J. M. Yeomans, Europhys. Lett.
关22兴 R. D. Kingdon, Technical Report No. AEA-InTec-1298, AEA 32, 463 共1995兲.
Technology, 1993, 共unpublished兲. 关30兴 Q. Zou, S. Hou, and G. D. Doolen, J. Stat. Phys. 81, 319
关23兴 N. S. Martys and H. Chen, Phys. Rev. E 53, 743 共1996兲. 共1995兲.

View publication stats

You might also like