Lattice Gas Cellular Automata and Lattice Boltzmann Models Chapter6
Lattice Gas Cellular Automata and Lattice Boltzmann Models Chapter6
Lattice Gas Cellular Automata and Lattice Boltzmann Models Chapter6
Table 5.1.1. Diseases of lattice-gas cellular automata: its causes and therapies and
cures.
1
A lattice Boltzmann model encompasses a lattice, an equilibrium distribution
and a kinetic equation which is called lattice Boltzmann equation (LBE). In
Multi-speed LBGK models are most popular today. However, more complex
collision operators are still in use in models of multi-phase flows (Rothman
and Zaleski, 1994).
U
= tc
L
may be interpreted as either the ratio of collision time to flow time or as the
ratio of mean free path to the characteristic length (i.e., Knudsen number).
A discretization of eq. (5.1.3) is given by:
Fi x̂, t̂ + ∆t̂ − Fi x̂, t̂ Fi x̂ + ∆x̂, t̂ + ∆t̂ − Fi x̂, t̂ + ∆t̂
+ cix
∆x̂
∆t̂
Fi x̂ + ∆y, t̂ + ∆t̂ − Fi x̂, t̂ + ∆t̂
+ciy
∆y
Fi x̂ + ∆z, t̂ + ∆t̂ − Fi x̂, t̂ + ∆t̂
+ciz
∆z
1 (eq)
= − F i − Fi
τ̂
Thus two terms on the left hand side cancel each other and thereby the
method becomes explicit. Choosing ∆t = tc , multiplying eq. (5.1.4) by ∆t̂
and dropping all carets leads to the (BGK) lattice Boltzmann equation
1 (eq)
Fi (x + ci ∆t, t + ∆t) − Fi (x, t) = − Fi − Fi (5.1.5)
τ
Sterling and Chen (1996, p.200) give the following interpretation of Eq.
(5.1.5)2 :
2
Readers not familiar with lattice-gas cellular automata should skip this
quotation.
5.1 From lattice-gas cellular automata to lattice Boltzmann models 163
Table 5.1.2. From the Boltzmann equation to the lattice Boltzmann equation.
Boltzmann equation:
∂f
+ v∇f = Q
∂t
Boltzmann equation (BGK approximation):
∂f 1
+ v∇f = − f − f (eq)
∂t τ
discrete Boltzmann equation:
∂fi 1 (eq)
+ v i ∇fi = − fi − fi
∂t τ
non-dimensional discrete Boltzmann equation:
∂Fi ˆ i = − 1 Fi − F (eq)
+ ci ∇F i
∂ t̂ τ̂
discretized Boltzmann equation:
Fi x̂, t̂ + ∆t̂ − Fi x̂, t̂ Fi x̂ + ∆x̂, t̂ + ∆t̂ − Fi x̂, t̂ + ∆t̂
+ cix ...
∆t̂ ∆x̂
1 (eq)
=− Fi − Fi
τ̂
lattice Boltzmann equation:
1 (eq)
Fi (x + ci ∆t, t + ∆t) − Fi (x, t) = − Fi − Fi
τ
The following remarks are mainly of historical interest and should be skipped
by readers not familiar with LGCA.
LGCA are plagued by noise which can be suppressed by coarse graining
over large domains and/or time intervals. Thus low noise levels are costly in
terms of memory and computer time (see Dahlburg et al., 1987, for further
discussion). In order to get rid of this noise McNamara and Zanetti (1988)
proposed to use directly the mean occupation numbers instead of the Boolean
fields. The lattice Boltzmann equation (LBE) had been applied already before
by Wolfram (1986) and Frisch et al. (1987) as an analytical tool to calculate
the viscosity coefficients of LGCA. McNamara and Zanetti for the first time
used the LBE as a numerical scheme.
where the form of the collision operator Ωi is identical to the arithmetic form
of the microscopic collision operator of the corresponding LGCA. For FHP,
for example, the Boolean (discrete) variables ni in (3.2.17) are replaced by
mean (continuous) occupation numbers Fi :
This type of LBM has been improved by Higuera and Jiménez (1989). They
could show that the nonlinear collision operator which evaluation is time
consuming can be approximated by a linear operator.
Further reading: Benzi et al. (1992) give an extensive review on LBMs
based on the FHP and FCHC models.
5.2 BGK lattice Boltzmann model in 2D 165
Lattice Boltzmann models (LBMs) of the first generation are plagued by the
same problems as the corresponding lattice-gas cellular automata except for
the noise. Modern LBMs with Boltzmann distribution functions, several lat-
tice speeds and BGK approximation of the collision operator are free of all
problems mentioned in Table 5.1.1. In this chapter a detailed discussion of
such a model in 2D will be given. The derivations of the equilibrium distri-
butions and the Navier-Stokes equation will be presented in full length. We
will refer to this model as the D2Q9-LBM.
On the contrary, a LGCA is basically defined by the lattice and the collision
rules.
Koelman (1991) defines his LBM for the Navier-Stokes equation over the
lattice with the following lattice velocities ci
cK
0 = (0, 0)
cK
1,2,3,4 = (±a, ±b)
cK5,6 = (±2a, 0)
cK7,8 = (0, ±2b)
c0 = (0, 0)
c1,3 , c2,4 = (±c, 0), (0, ±c) (5.2.1)
c5,6,7,8 = (±c, ±c).
166 5. Lattice Boltzmann Models
6 2 5
&% &% &%
I
@ 6
@
@
@
@
@
@
@
@
@
'$ @'$ '$
-
3 0 1
&% &% &%
@
@
@
@
@
@
@
@
@
@
'$
?
'$ R'$
@
7 4 8
&% &% &%
5.2 BGK lattice Boltzmann model in 2D 167
Note that the constraint (5.2.8) is more rigorous than pure isotropy (compare
Section 3.3).
168 5. Lattice Boltzmann Models
Nonnegative solutions of Eqs. (5.2.6 - 5.2.8) for the Wi can be found whenever
the number of lattice velocities ci is large enough. For the D2Q9 lattice (5.2.1)
one obtains (see Section 5.2.1 for derivation):
4
W0 /ρ0 =
9
1
W1 /ρ0 =
9
1
W2 /ρ0 =
36
kB T c2
= .
m 3
The evolution of the LBM consists of the recurring alternation between tran-
sition to the local equilibrium and propagation of the distributions to neigh-
boring sites according to the lattice velocities. The BGK (compare Section
4.1.3) kinetic equation reads
∆t
(0)
Fi (x + ci ∆t, t + ∆t) − Fi (x, t) = − Fi (x, t) − Fi (x, t)
τ
∆tciα
+ [Kα (x, t) + Kα (x + ci ∆t, t + ∆t)]
12c2
(5.2.9)
or
(0)
Fi (x + ci ∆t, t + ∆t) = (1 − ω) Fi (x, t) + ωFi (x, t)
(5.2.10)
∆tciα
+ [Kα (x, t) + Kα (x + ci ∆t, t + ∆t)]
12c2
They can be derived by applying the maximum entropy principle under the
constraints of mass and momentum conservation (see Section 5.2.2). Up to
second order in j one obtains
5.2 BGK lattice Boltzmann model in 2D 169
% &
(0) Wi m m m 2
Fi (ρ, j) = ρ+ ci · j + (ci · j) − j 2 (5.2.11)
ρ0 kB T 2ρkB T kB T
or more explicitly
% &
4 3 u2
Fi = ρ 1− i=0
9 2 c2
% &
1 ci · u 9 (ci · u)2 3 u2
Fi = ρ 1+3 2 + − i = 1, 2, 3, 4
9 c 2 c4 2 c2
% &
1 ci · u 9 (ci · u)2 3 u2
Fi = ρ 1+3 2 + − i = 5, 6, 7, 8.
36 c 2 c4 2 c2
1. For given initial values of mass ρ(x, t) and momentum density j(x, t)
(0)
calculate the equilibrium distributions Fi (ρ(x, t), j(x, t)) according to
(0)
Eq. (5.2.11) and set Fi = Fi . Remark: Global equilibrium distributions
(5.2.11) but with different values of ρ and j are used for local initializa-
tion, i.e. in the beginning there is a patchwork of local equilibria which
is far from a global equilibrium.
2. Apply the kinetic equation (5.2.10), i.e. add the (non-equilibrium) dis-
tribution function Fi (x, t) and the equilibrium distribution function
(0)
Fi (x, t) with the appropriate weights (1−ω) and ω, and then propagate
it to the next neighbor (except for the distribution of ‘rest particles’ with
c0 = 0).
3. Calculate from the propagated distributions new values of ρ(x, t) and
j(x, t) according to the definitions (5.2.2) und (5.2.3).
4. The next time step starts with the calculation of new equilibrium distri-
butions. Thereafter proceed with the second step of the algorithm.
3
But: There is always a disturbing fly or two in the ointment. Qian and Orszag
(1993) and Qian and Zhou (1998) have shown that a higher order term (slightly
compressible regime) leads to frame-velocity-dependent viscosity.
170 5. Lattice Boltzmann Models
In BGK-LBMs collisions are not explicitly defined. They are kind of fictive
and make themselves felt only by the transition to local equilibrium (the
(0)
term ω Fi (x, t) in the kinetic equation). On the other hand for LGCA the
collisions are explicitly defined and the distribution functions are theoretical
constructs which can not be observed on the lattice because of their contin-
uous nature.
The D2Q9 model includes three different speeds (compare Table 5.2.1). The
Wi for directions with identical speeds are equal for reason of symmetry.
– 0. moment:
Wi = W0 + 4W1 + 4W2 = ρ0 (5.2.13)
i
Remark: (kB T )/m will be calculated from Eqs. (5.2.14) and (5.2.15).
kB T
c2i2 Wi = 2c2 W1 + 4c2 W2 = ρ0
i
m
One readily confirms that the first and third moments of the lattice velocities
over Wi vanish.
k (0)
(0)
F (ρ, j)
S(ρ, j) := − F (ρ, j) ln i . (5.2.17)
m i i Wi
(0)
Wi . The equilibrium distributions Fi will be calculated by maximizing the
entropy for given constraints which for the case under consideration are the
mass and momentum density
4
Kullback (1959) and Cover and Thomas (1991) are standard references on rela-
tive entropy.
172 5. Lattice Boltzmann Models
(0)
ρ(ρ, j) = Fi (ρ, j)
i
(0)
j(ρ, j) = ci Fi (ρ, j).
i
The functional
Ŝ := S + Ãρ + B̃ · j
k (0) (0)
(0)
F (ρ, j) (0)
= − Fi (ρ, j) ln i + Ã Fi (ρ, j) + B̃ ci Fi (ρ, j)
m i Wi i i
= Wi eA(ρ, j) + B(ρ, j) · ci
(0)
Fi
with m m
à − 1, and B = B̃.
A=
k k
(0)
A and B can be determined by Taylor series expansions of Fi around j = 0
(same procedure as for the FHP lattice-gas cellular automata). Because of
the symmetry of the D2Q9 lattice the ansatz
A(ρ, j) = A0 (ρ) + A2 (ρ)j 2 + O(j 4 )
B(ρ, j) = B1 (ρ)j + O(j 3 ).
(0)
is sufficient. The expansion of Fi around j = 0 reads
(0)
∂Fi (0)
= (2A2 jα + B1 ciα )Fi
∂jα
→ B1 ciα Wi eA0 at j = 0
2
∂ Fi
(0)
' ( (0)
= (2A2 jα + B1 ciα )2 + 2A2 Fi
∂jα2
→ (B12 c2iα + 2A2 )Wi eA0 at j = 0
2 (0)
∂ Fi (0)
= (2A2 jα + B1 ciα )(2A2 jβ + B1 ciβ )Fi
∂jα ∂jβ
→ B12 ciα ciβ Wi eA0 at j = 0
5.2 BGK lattice Boltzmann model in 2D 173
with
(1)
(1)
Fi (x, t) = 0, ci Fi (x, t) = 0,
i i
(5.2.24)
(2)
(2)
Fi (x, t) = 0, ci Fi (x, t) = 0,
i i
(1) (2)
i.e. the perturbations Fi (x, t) and Fi (x, t) do not contribute to the mass
and momentum density. The small expansion parameter can be viewed as
the Knudsen number Kn which is the ratio between the mean free path and
the characteristic length scale of the flow.
The left hand side of the kinetic equation (5.2.10) and the forcing term are
expanded into a Taylor series up to terms of second order (∆xi = ∆t · ci ):
and
∆t ciα
[Kα (x, t) + Kα (x + ci ∆t, t + ∆t)]
c2 12
(5.2.26)
∆t ciγ
2
(∆t) ciγ ' (
3
= Kγ (x, t) + ∂t Kγ + ciβ ∂xβ Kγ + O (∆t) .
c2 6 c2 12
5.2 BGK lattice Boltzmann model in 2D 175
As for the FHP model two time scales and one spatial scale with the following
scaling will be introduced
(1) (2)
∂t → ∂t + 2 ∂t
(5.2.27)
∂xα → ∂x(1)
α
.
which leads to
0 =
Fi (x, t) + ∆t∂t Fi + ∆tciγ ∂xγ Fi
(5.2.25)
(∆t) ' (
2
+ ∂t ∂t Fi + 2ciγ ∂t ∂xγ Fi + ciβ ciγ ∂xβ ∂xγ Fi
2
' ( (0)
+O ∂ 3 Fi − Fi (x, t) + ω Fi (x, t) − Fi (x, t)
(∆t)
(1) (1) (0)
2
(1) (0)
+2 ∂t ∂t Fi + 2ciγ ∂t ∂x(1)
γ
Fi
2
(0) (1)
+ciβ ciγ ∂x(1)
β
∂x(1)
γ
Fi + ωFi
(2) ∆t ciγ
+2 ωFi − Kγ
c2 6
2
(∆t) ciγ
' 3(
(1)
−2 ∂t Kγ + ciβ ∂x(1)
β
K γ +O
c2 12
176 5. Lattice Boltzmann Models
Please note that the leading order of the body forcing was set proportional
to . Sorting according to orders in yields
(0) (1) ' (
0 = Ei + 2 Ei + O 3 (5.2.28)
with
(0) (1) (0) ω (1) ciγ (0)
Ei = ∂t Fi F − 2 Kγ
+ ciγ ∂x(1) Fi + (5.2.29)
∆t iγ
6c
(1) (1) (1) (2) (0) (1) ∆t (1) (1) (0)
Ei = ∂t Fi + ∂t Fi + ciγ ∂x(1) Fi + ∂ ∂ F
γ
2 t t i
(1) (0) ∆t (0)
+∆tciγ ∂t ∂x(1)γ
Fi + ciβ ciγ ∂x(1)
β
∂x(1)
γ
Fi (5.2.30)
2
ω (2) ciγ (1) ciγ
+ Fi − ∆t ∂ Kγ − ∆t ciβ ∂x(1) Kγ .
∆t 12c2 t 12c2 β
(0)
We will now calculate the zeroth and first lattice velocity moments of Ei
(1)
and Ei (conservation of mass and momentum density).
Terms of first order in . The zeroth and first lattice velocity moments
(0)
of Ei can be readily calculated:
(0) / (1) (0) (0) ω (1) ciγ 0
Ei = ∂t Fi + ciγ ∂x(1) F i + F − K γ
i i
γ
∆t i 6c2
(1)
= ∂t ρ + ∂x(1)
γ γ
j
/ ω (1) ciβ 0
(0) (1) (0) (0)
ciα Ei = ciα ∂t Fi + ciβ ∂x(1)
β
F i + F i − K β
i i
∆t 6c2
(5.2.31)
(1) (0)
= ∂t jα + ∂x(1)
β
Pαβ − Kα
kB T (0)
where p = ρ is the pressure (a detailed calculation of Pαβ will be given
m
below).
Thus to first order in we obtain the continuity equation
∂t ρ + ∇ · j = 0 (5.2.34)
and (in the incompressible limit: ρ = constant) the Euler equation (Navier-
Stokes equation without friction):
∂u 1
+ u∇u = − ∇p + K. (5.2.35)
∂t ρ
(0)
Calculation of the momentum flux tensor. In the calculation of Pαβ the
detailed form of the equilibrium distribution has to be taken into account for
(0.1) (0.4)
the first time. Four different summands Pαβ to Pαβ have to be evaluated.
The first term reads:
(0.1) ρ kB T
Pαβ := ciα ciβ Wi = ρ δαβ = pδαβ .
ρ0 i m
=p
kB T c2
For the pressure p = ρ = ρ the speed of sound cs is given by
m 3
1
dp c
cs = =√ .
dρ 3
Prefactor: !2 !2
1 m kB T 1
· ρ0 =
2ρ0 ρ kB T m 2ρ
Tensor of fourth rank:
– α = β = 1:
1 2
* γ = δ = 1 → T1111 = 3 → 3j
2ρ 1
1 2
* γ = δ = 2 → T1122 = 1 → j
2ρ 2
* γ = δ → T1112 = T1121 = 0
1 2
– α = β = 2: → j1 + 3j22
2ρ
– α = 1 β = 2:
– γ = δ → T1211 = T1222 = 0
1
– γ = δ → T1212 = T1221 = 1 → · 2j1 j2
2ρ
# $
(0.3) 1 2 1 j12 j1 j2
Pαβ = j δαβ +
2ρ ρ j1 j2 j22
The pressure of the D2Q9-LBM does not depend explicitly on the flow speed
(0.4)
(see to the contrary the FHP model) because the summand Pαβ is exactly
(0.3)
compensated by a part of Pαβ .
and
∆t (1)
2
∂t Kγ ciγ = 0.
12c i
The second term of Eq. (5.2.38) is the time derivative of the density:
(2)
(0) (2)
∂t Fi = ∂t ρ. (5.2.39)
i
(1)
The sum of these three terms yields ∆t∂xα Kα /2 which cancels with the term
derived from the body force gradient (Eq. 5.2.40), i.e. inclusion of the spatial
gradient of the body force is essential to ensure that there is no mass diffusion:
(2)
∂t ρ = 0. (5.2.41)
(1) (0)
An approximation of Fi can be derived from the first order in : Ei =0
⇒
(1) ∆t (1) (0) ∆t (0) ∆t ciγ
Fi (x, t) = − ∂t Fi − ciγ ∂x(1)
γ
Fi + Kγ , (5.2.42)
ω ω 6c2 ω
i.e. deviations from local equilibrium are driven by gradients in time and
space (compare Eq. 4.2.25) and by applied body forces.
In the transformation of the following summands terms of the order O(j 2 ) will
be neglected (indicated by ≈ instead of =). Thus the Navier-Stokes equation
will be recovered in the limit of low Mach numbers only.
(1)
(1)
∂t ciα Fi = 0
i (5.2.24)
(2)
(0) (2)
∂t ciα Fi = ∂t jα (5.2.43)
i
∆t (1)
+ 2
∂xβ Kγ ciα ciβ ciγ
6c ω i
=0
The term derived from the time derivative of the body force
∆t (1) ∆t (1) ∆t
− ∂t K β ciα ciβ = − ∂t Kα ⇒ − ∂t K (5.2.45)
12c2 i
2 2
cancels with the term in Eq. (5.2.44), i.e. inclusion of the time derivative
of the body force is essential to obtain the exact form of the Navier-Stokes
equation.
∆t (1)
− 2
∂xβ Kγ ciα ciβ ciγ = 0
12c i
∇·u=0 (5.2.50)
and
1
∂t u + (u∇) u = − ∇p + ν∇2 u + K (5.2.51)
ρ
Procedure 1 leads to some increase in the length of the code but seems to be
worth the effort especially in 3D where the reduction factor is even larger.
The second procedure requires some additional coding to treat the bound-
aries of the subdomains but offers a further reduction in memory by a factor
of almost 2.
The storage demand for BGK-LBM with ω = 1 is substantially larger be-
cause one has to keep all (non-equilibrium) distributions Fi . The adventage
is the tunable viscosity which allows simulation of flows with high Reynolds
numbers.
is 10000.
The following Figures (5.2.2 - 5.2.5) show isocontours of the vorticity a =
(∇ × u)z at four dimensionless times. Dashed lines indicate negative values.
The upper plots show the results of the spectral model and the lower plots
those of the lattice Boltzmann model. The features compare very well which
gives confidence in both methods.
What is most surprising: the LBM is as fast as the spectral model! And
the LBM keeps its efficiency in more complex geometries (porous media, for
example) whereas spectral models may not be applicable anymore. These
simulations clearly demonstrated the great potential of BGK-LBMs.
5.2 BGK lattice Boltzmann model in 2D 185
Fig. 5.2.2. Isovorticity contour plots for time 1. Dashed lines correspond to neg-
ative values of vorticity. The values for the contours are the same for all cases
(Figures 5.2.2 – 5.2.5). Strikingly similar features can be found for the lattice Boltz-
mann simulation, as compared with the spectral simulation. (SP refers to the spectral
sumulation and LBE to the lattice Boltzmann simulation; Martinez et al., 1994)
186 5. Lattice Boltzmann Models
Fig. 5.2.3. Same as in Fig. 5.2.2 for time 5 (Martinez et al., 1994).
5.2 BGK lattice Boltzmann model in 2D 187
Fig. 5.2.4. Same as in Fig. 5.2.2 for time 17 (Martinez et al., 1994).
188 5. Lattice Boltzmann Models
Fig. 5.2.5. Same as in Fig. 5.2.2 for time 80 (Martinez et al., 1994).
5.2 BGK lattice Boltzmann model in 2D 189
in-state: F0 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8
out-state: F0 , F1 , F4 , F3 , F2 , F7 , F8 , F5 , F6 .
are ‘dry’ (dry or wall nodes), i.e. outside the ‘wet’ domain which encom-
passes nodes with j = 2 to j = N − 1 (wet or interior or fluid nodes).
The lower (upper) boundary is located half-way between the first and
second (last but one and last) nodes in y-direction. Particle distributions
are propagated between wet and dry nodes and vice versa. On the dry
nodes no collision or forcing is performed and the distributions are all
bounced back. Note that the width of the channel is one unit smaller
than that with the complete bounceback scheme.
d2 u
ν +K =0
dy 2
du(y)
and the continuity equation = 0 is satisfied. At the channel walls no-
dx
slip boundary conditions apply, i.e. u(y) = 0 at y = −L and y = L. The
analytical solution is a parabola
K 2
u(y) = L − y2 . (5.2.56)
2ν
near the boundaries. The plot at the lower left shows the numerical solu-
tion together with the analytical solution but the latter one now based on a
smaller channel width 2L = Y M AX − 2 = 18. This solution compares very
well with the analytical solution except for the two boundary nodes. This fig-
ure suggests the following interpretation. The boundary is located half-way
between the first and second node respectively half-way between the second
to last and the last node. Therefore the ’wet’ channel has only a width of
2L = Y M AX − 2 = 18. The nodes at j = 1 and j = Y M AX are auxiliary
nodes which take care of the correct boundary conditions at j = 3/2 and
j = Y M AX − 1/2. The velocity values on these auxiliary nodes should not
be interpreted as flow velocities (these nodes are located ‘on land’ and could
by called ‘dry nodes’).
Fig. 5.2.6. No-slip boundary conditions and Poiseuille flow (see text for discus-
sion).
0.06 0.06
0.04 0.04
u(y)
u(y)
0.02 0.02
0 0
−10 0 10 −10 0 10
y y
0.06 0.03
0.04 0.02
j (t)
u(y)
0.02
x
0.01
0
0
−10 0 10 0 1000 2000
y Time t
Numerical experiments with different channel widths 2L = 16, 32, 64, 128 (dif-
ferent spatial resolutions of the parabola) have been performed while keeping
constant the viscosity ν and the product of channel width and maximum
speed (by varying the forcing). Thus the Reynolds number is kept constant.
The Mach number varies but for L ≥ 16 is small compared to 1. The error
192 5. Lattice Boltzmann Models
(n) (a)
where the summation is over N = 14 inner points and ûi and ûi are the
normalized numerical and analytical solutions with maximum speed equal to
one. Fig. (5.2.7) shows the error as a function of L. The slop of the curve is
close to −2 which indicates that this scheme is of second order in the spatial
discretization.
Fig. 5.2.7. Error of the numerical compared to the analytical solution of the
Poiseuille flow as a function of spatial resolution. The bounceback scheme is ap-
plied and the resulting data are interpretated such that the boundaries are located
between the first and second respectively between the second to last and the last node
(compare also Fig. 5.2.6C). The slop of the curve is close to −2 which indicates
that this scheme is of second order in the spatial discretization.
−3
10
slope = −2.1279
−4
10
Error
−5
10
−6
10 0 1 2
10 10 10
L
∂ut
Slip boundary condition. To test slip boundary condition ( = 0 at
∂xn
|y| → ∞, i.e. the normal derivative of the tangential velocity component ut
vanishes on the boundary) a shear layer with
5.2 BGK lattice Boltzmann model in 2D 193
−U for y < 0
u = , v=0
+U for y > 0
Fig. 5.2.8. Shear layer flow in a channel: test of slip boundary conditions (see
text).
0.1
0.08
0.06
0.04
0.02
u(y)
0
−0.02
−0.04
−0.06
−0.08
−0.1
−10 −5 0 5 10
y
(1995), Noble et al. (1995a,b), Inamuro et al. (1995), Noble et al. (1996),
Chen et al. (1996), Ginzbourg and d’Humiéres (1996), Maier et al. (1996),
Filippova and Hänel (1997), Gallivan et al. (1997), Stockman et al. (1997),
Kandhai et al. (1999).
5.3 Hydrodynamic lattice Boltzmann models in 3D 195
BGK-LBMs have been discussed so far only in two dimensions. The extension
to three dimensions is straightforward. One just has to choose a 3D lattice
and calculate appropriate equilibrium distributions. In this section we will
calculate equilibrium distributions by the method of Koelman (1991) for 3D
lattices with 19 and 15 velocities.
(eq)
The derivation of the equilibrium distribution functions Fi (5.2.11) by
minimizing the functional (5.2.18) is independent of the lattice velocities ci
and the dimension D. Only the constraints (5.2.6 to 5.2.8) for the veloc-
ity moments were used in Section (5.2). Thus one can use the form of the
(eq)
equilibrium distribution functions Fi (5.2.11) with the appropriate lattice
velocities ci and weights Wi .
The calculation of the Wi for the 3D model proceeds in close analogy with
the 2D case. There are three different speeds: 1 √
time√speed 0 (rest particle),
6 times speed 1 (1-particles) and 12 times speed 2 ( 2-particles). The even
moments yield four independent equations for the calculation of W0 , W1 , W2
and kb T /m:
– 0. moment:
Wi = W0 + 6W1 + 12W2 = ρ0
i
– 2. moment: kT
c2αx Wi = 2W1 + 8W2 = ρ0
i
m
– 4. moment:
!2
kT
c4αx Wi = 2W1 + 8W2 = 3ρ0
i
m
!2
kT
c2αx c2αy Wi = 4W2 = ρ0
i
m
196 5. Lattice Boltzmann Models
– 0. moment:
Wi = W0 + 6W2 + 8W3 = ρ0
i
– 2. moment:
kT
c2αx Wi = 8W2 + 8W3 = ρ0
i
m
– 4. moment: !2
kT
c4αx Wi = 32W2 + 8W3 = 3ρ0
i
m
!2
kT
c2αx c2αy Wi = 8W3 = ρ0
i
m
5.3 Hydrodynamic lattice Boltzmann models in 3D 197
The equilibrium distributions are not unique and other choices are possible.
As an example we give the equilibrium distributions proposed by Chen et al.
(1992):
where
ρ ρ
d(0) = d(1) = , d(2) =
11 22
ρ ρ
α(1) = , α(2) =
24 12
ρ ρ
γ (1) = , γ (2) =
32 16
7 ρ ρ
δ (0) = − ρ, δ (1) =− , δ (2) = − .
24 48 24
“The question that we are most often asked about cellular automata
is the following.
‘I’ve been shown cellular automata that make surprisingly good mod-
els of, say, hydrodynamics, heat conduction, wave scattering, flow
through porous media, nucleation, dendritic growth, phase separa-
tion, etc. But I’m left with the impression that these are all ad hoc
models, arrived at by some sort of magic.’
‘I’m a scientist, not a magician. Are there well-established correspon-
dence rules that I can use to translate features of the system I want to
model into specifications for an adequate cellular-automaton model
of it?’
Physical modeling with cellular automata is a young discipline. Sim-
ilar questions were certainly asked when differential equations were
new - and, despite three centuries of accumulated experience, mod-
eling with differential equations still requires a bit of magic.”
Toffoli und Margolus (1990)
The problem addressed for CA by Toffoli and Margolus exists also for lattice
Boltzmann models. However, in what follows it will be shown that a LBM
for the Navier-Stokes equation can be developed by an almost straightfor-
ward method. In chapter 5.2 global equilibrium functions Wi for vanishing
velocity (u = 0) and constant density ρ = ρ0 were determined in close anal-
ogy to the Maxwell distribution (more precise: the velocity moments of Wi
up to fourth order are equal to the corresponding velocity moments over
the Maxwell distribution; compare Eqs. 5.2.6 - 5.2.8). Subsequently the local
equilibrium distributions Fi have been derived using the maximum entropy
principle. These ‘Koelman-distributions’ lead to the Navier-Stokes equation
with isotropic advection, Galilean invariance and pressure which does not
explicitly depend on flow speed.
To be sure, these are not the only distributions over that lattice which in the
macroscopic limit yield the Navier-Stokes equation. This is not a problem
because the equilibrium distributions of our artificial microworld are not of
interest by themselves.
In the current section I will discuss an alternative approach to suitable equi-
librium distributions Fi whereby an ansatz for Fi will be used. After the
multiscale analysis the free parameters in the ansatz will be chosen such that
isotropy etc. are assured. This alternative approach will be of central impor-
tance for the development of lattice Boltzmann models for given differential
equations.
5.4 Equilibrium distributions: the ansatz method 199
1. From lattice-gas cellular automata (FHP, FCHC, PI) and the Koelman
model we know that terms quadratic in u and ci ·u in the equilibrium dis-
tributions yield the nonlinear advection term of the Navier-Stokes equa-
tion; no higher moments are required.
2. The free parameters of the ansatz should depend only on the mass density
and the speeds |ci | but not on the directions of the ci .
Fi = A0 + D0 u2 i=0
Fi = A1 + B1 ci · u + C1 (ci · u)2 + D1 u2 i = 1, 2, 3, 4 (5.4.1)
Fi = A2 + B2 ci · u + C2 (ci · u)2 + D2 u2 i = 5, 6, 7, 8.
The definitions of mass and momentum densities give three scalar constraints
ρ := Fi = A0 + 4(A1 + A2 ) +u2 (D0 + 4D1 + 4D2 + 2C1 + 4C2 ) (5.4.2)
i
=ρ =0
j := ci Fi = (2B1 + 4B2 ) u. (5.4.3)
i
=ρ
into
# $
u2 uv
ρ + p δαβ .
uv v2
The portion of the tensor which is independent of the flow velocity u yields
the pressure p:
p = 2A1 + 4A2 .
All other terms lead to the following constraints for the free parameters
(0)
4C2 + 2D1 + 4D2 = 0 (u2 term in P11 must vanish)
(0)
2C1 = ρ (u2 term in P11 must yield ρu2 )
(0)
8C2 = ρ (uv term in P12 must yield ρuv)
and therefore
ρ ρ
C1 =and C2 = .
2 8
The remaining eight unknowns (A0 , A1 , A2 , B1 , B2 , D0 , D1 , D2 ) are con-
strained by only four linear equations
5.4 Equilibrium distributions: the ansatz method 201
A0 + 4(A1 + A2 ) = ρ
2B1 + 4B2 = ρ
3
D0 + 4D1 + 4D2 = −2C1 − 4C2 = − ρ
2
ρ
2D1 + 4D2 = − .
2
1.8
1.6
s
Speed of sound c
1.4
1.2
0.8
0.6
0.4
−2 0 2 4 6 8 10
r
5.4 Equilibrium distributions: the ansatz method 203
% &
4 3
Fi = ρ 1 − u2 i=0
9 2
% &
1 9 3 2
Fi = ρ 1 + 3ci · u + (ci · u)2 − u i = 1, 2, 3, 4
9 2 2
% &
1 9 3 2
Fi = ρ 1 + 3ci · u + (ci · u)2 − u i = 5, 6, 7, 8.
36 2 2
Eq. (5.4.5) suggests that the speed of sound cs might be tuned to arbitrary
values by variing the parameter r. For small or even negative r, however, the
distribution functions Fsi become negative which leads to numerical instabil-
ity very quickly. Let rc be the critical r where one of the Fsi first vanishes. It
can be shown (see Exercise 5.4.2) that rc depends on the velocity u as follows
2u2
rc = (5.4.6)
1 − u2
and therefore "
cs < cs (rc ) = 1 − u2 . (5.4.7)
The Navier-Stokes equation has been derived in the small Mach number limit.
Thus
|u| |u|
Ma := =√ (5.4.8)
cs 1 − u2
204 5. Lattice Boltzmann Models
Fig. 5.4.2. The Mach number Ma and the speed of sound cs as a function of the
speed |u|.
1.4
1.2
Ma (solid line) and cs (dashed line)
0.8
0.6
0.4
0.2
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8
Speed | u |
Using the ansatz method described in Section 5.4 it is possible to develop hy-
drodynamic LBMs including an energy equation (so-called thermal models).
Alexander, Chen and Sterling (1993) proposed a thermal LBM over the
D2Q13-FHP lattice (multi-speed FHP) with the following lattice velocities
ci (compare Fig. 3.3.8):
ci = (0, 0) ! i=0
2πk 2πk
ci = cos , sin i = 1, 2, ..., 6; k=i
6 6 !
2πk 2πk
ci = 2 cos , sin i = 7, 8, ..., 12; k =i−6
6 6
Further reading:
Chen et al. (1995a,b) introduced an additional parameter in order to tune the
Prandtl number. McNamara et al. (1995) discussed numerical instabilities of
the models proposed by Alexander et al. (1993) and Chen et al. (1995a,b).
Vahala et al. (1996) applied the model of Alexander et al. (1993) to free-
decaying turbulence in 2D. McNamara et al. (1997) proposed a 3D thermal
LBM with 27 velocities. They apply a Lax-Wendroff scheme in order to im-
prove numerical stability. They performed simulations of Rayleigh-Bénard
convection in 2D and compared the results with those of an explicit finite-
difference (FD) solver. The computer times of LBM and FD are comparable
whereas LBM requires significantly more memory and stability is significantly
poorer. Thus they conclude that currently there is no potential advantage in
using a thermal LBM over a conventional FD solver. Hu et al. (1997) con-
sider the energy levels, εσ , of the three different speeds as free parameters and
thereby are able to tune the ratio of specific heats, γ. Shan (1997) proposed a
two-component LBGK in which temperature is advected as an passive scalar
and simulated Rayleigh-Bénard convection. Pavlo et al. (1998a,b) investigate
linear stability of thermal LBMs. The model of Alexander et al. (1993) has
been revisited by Boghosian and Coveney (1998). They showed “that it is
possible to achieve variable (albeit density-dependent) Prandtl number even
within a single-relaxation-time lattice-BGK model”. He et al. (1998), Vahala
et al. (1998b).
208 5. Lattice Boltzmann Models
Inspection of Eq. (5.6.1) shows that an initially uniform flow, in the sense
Fm (x, t0 ) = Fm (t0 ),
Furthermore, mass and momentum density are conserved and retain their
initial value
ρ(x, t) = ρ(t0 ) = ρ0 , j(x, t) = j(t0 ) = j 0
and therefore
Fm (t + 1) = Fm (t) − ω Fm (t) − Fm
(0)
(ρ0 , j 0 ) .
(0)
Subtracting Fm (ρ0 , j 0 ) on both sides leads to
∞ τ 0.5
2
1.8
1.6
1.4
|1−ω| = |1−1/τ|
1.2
0.8
0.6
0.4
0.2
0
−1 −0.5 0 0.5 1 1.5 2 2.5 3
ω
210 5. Lattice Boltzmann Models
and show that for uniform flows the following equation holds
F̃ (t + 1) = [I + Ω]F̃ (t)
(0)
where the vector F̃ (t) has components F̃m (t) = Fm (t) − Fm (ρ0 , j 0 ).
In reality, a flow is never uniform in the strict sense because some noise
is always around. Therefore we have to investigate whether small spatially
varying perturbations grow or are damped with time. No general methods are
known that allow stability analysis of arbitrary nonlinear systems. In each
case you have to find special tricks (like, for instance, the construction of a
Liapunov function). To get an idea of the stability properties of the nonlinear
system one usually expands the system up to linear terms and investigates the
stability of the resulting linear system. Before attacking the kinetic equation
(5.6.1) we will discuss the von Neumann stability analysis for two simpler
equations.
The Fourier method of John von Neumann is the standard method for sta-
bility analysis because it is applicable to arbitrary linear systems. As a first
example we will consider the linear advection equation
∂u ∂u
+c = 0, c>0
∂t ∂x
which shall be solved numerically by the following finite difference scheme
with
λ := 1 − µ + µe−ik∆x .
5.6 Stability of lattice Boltzmann models 211
It follows that
|Un+1 | = |λ| · |Un | = |λ|n · |U1 |.
Stability in the sense that |Un+1 | is bounded (i.e. limn→∞ |Un+1 | < B < ∞)
yields the constraint
|λ| ≤ 1.
Here we have
|λ|2 = 1 − 2µ(1 − µ)(1 − cos k∆x)
which is ≤ 1 when
∆t
0≤µ=c ≤1
∆x
or
∆x
≥c (5.6.4)
∆t
or
∆x
0 ≤ ∆t ≤ . (5.6.5)
c
This is the stability condition we were looking for. According to Eq. (5.6.4)
the ‘grid speed’ cgrid := ∆x/∆t has to be as fast or faster than the advection
speed c (this holds in very similar form also for several spatial dimensions,
for other explicit numerical schemes and other hyperbolic equations whereby
the advection speed is eventually replaced by the speed of the fastes wave of
the system).
As a second example we consider the diffusion equation
∂T ∂2T
=κ 2.
∂t ∂x
A finite difference approximation reads
∆t
Tj,n+1 = Tj,n + κ 2 (Tj+1,n − 2Tj,n + Tj−1,n ) .
(∆x)
Inserting the ansatz
Tj,n = An eikj∆x
leads to
An+1 = An + µ An eik∆x − 2 + e−ik∆x = λ An
with
∆t
µ = κ 2
(∆x)
and
λ = 1 − 2µ (1 − cos k∆x)
The condition |λ | ≤ 1 yields the stability condition
∆t 1
0 ≤ µ = κ 2 ≤
(∆x) 2
or
2
(∆x)
0 ≤ ∆t ≤ . (5.6.6)
2κ
212 5. Lattice Boltzmann Models
(0)
where Fm are the distribution functions and Fm are the equilibrium distri-
bution functions. Expansion about time-independent but otherwise arbitrary
(bf )
distribution functions Fm (‘background flow’) leads to
(bf )
Fm (x, t) = Fm (x) + fm (x, t)
Fm (x + cm , t + 1) = Fm
(bf )
(x + cm ) + fm (x + cm , t + 1)
(0) (0)
Fm (x, t) = Fm ({Fs (x, t)})
# $
∂F (0)
m
≈ Fm {Fs (x)} +
(0) (bf )
fn (x, t)
∂Fn
(x)}
(bf )
n {Fs
Km (x, t) = Km ({Fs (x, t)})
!
∂Km
≈ Km {Fs(bf ) (x)} + fn (x, t)
n
∂Fn (bf )
{Fs (x)}
where
Gm (x) (bf )
= Fm (x) − Fm (bf )
(x + cm ) − ω Fm
(bf )
(x) − Fm
(0)
{Fs(bf ) (x)}
(bf )
+Km Fm (x)
and + ,
(0)
∂Fm ∂Km
Jmn = ω + . (5.6.8)
∂Fn ∂Fn (bf )
{Fs ( x)}
Here we are interested only in instabilities with exponential growth. Therefore
we will neglect the time-independent term Gm (x) which can lead to linear
growth at most. The rectangular domain of length L and width W comprises
a lattice with nodes at (xr = 0, 1, 2, ..., L; ys = 0, 1, 2, ..., W ). We will now
Fourier transform the linear equation
5.6 Stability of lattice Boltzmann models 213
fm (x + cm , t + 1) = (1 − ω)fm (x, t) + Jmn (x)fn (x, t). (5.6.9)
n
(k,l)
The functions fm (t) and fm (x, y, t) are connected by the Fourier transform
(k,l)
fm (x, y, t) = fm (t)eikx2π/L eily2π/W . (5.6.10)
k,l
fm (x + cx,m , y + cy,m , t + 1)
(k,l)
= fm (t + 1)eik(x+cx,m )2π/L eil(y+cy,m )2π/W
k,l
(k,l)
= fm (t + 1)eikx2π/L eily2π/W eikcx,m 2π/L eilcy,m 2π/W
k,l
Since the x modes remain uncoupled, they are considered independently via
eikcx,m 2π/L eilcy,m 2π/W fm
(l)
(t + 1) = (1 − ω)fm
(l)
(t) + (q) (l−q)
Jmn fn (t) (5.6.11)
n,q
It can be shown (for some fine points see Worthing et al., 1997) that Eq.
(5.6.11) can be written as a matrix iteration
f t+1 = Af t (5.6.12)
(l)
where the vector f has components fm . If the spectral radius (= magnitude
of the largest eigenvalue) of A, ρ(A), is larger than unity, then the system
is said to be linear unstable (this corresponds to the case |λ| > 1 in the two
examples with one component each discussed in Subsection 5.6.2). In case of
uniform background flow and no external forcing considered by Sterling and
Chen (1996) the matrix A reads
A = D [(1 − ω) I + J ] (5.6.13)
I is the identity matrix (diagonal matrix with value 1 of all diagonal compo-
nents) and the components of J are given by
(0)
∂Fm
Jmn = ω . (5.6.15)
∂Fn
The matrix A (and therefore also its spectral radius ρ(A)) depends on the
relative wave numbers (θx = 2πk/L, θy = 2πl/W ), the uniform inital velocity
(U ), the collision parameter (ω) and the rest mass parameters (α, β; see
below). Instability occurs if the maximal spectral radius (for given values of
U , ω, α and β) becomes larger than 1 for any wave number:
The coefficients for the various models are listed below. The coefficients Am
include free parameters α and β (denoted as rest mass parameters) which
can be tuned in order to improve stability.
5.6 Stability of lattice Boltzmann models 215
FHP (D2Q7).
Am = α, Bm = 0, Cm = 0, Dm = −1; m=0
1−α
Am = , Bm = 13 , Cm = 23 , Dm = − 16 ; m = 1, ..., 6.
6
D2Q9.
Am = α, Bm = 0, Cm = 0, Dm = − 23 ; m=0
Am = β, Bm = 13 , Cm = 12 , Dm = − 16 ; m = 1, ..., 4
1 − α − 4β
Am = , Bm = 1
12 , Cm = 18 , Dm = − 24
1
; m = 5, ..., 8
4
D3Q15.
m=0:
Am = α, Bm = 0, Cm = 0, Dm = − 12 .
m = 1, ..., 6 :
Am = β, Bm = 13 , Cm = 12 , Dm = − 16 .
m = 7, ..., 14 :
1 − 6β − α
Am = , Bm = 1
24 , Cm = 1
16 , Dm = − 48
1
.
8
5.6.4 Summary
The main results of Sterling and Chen (1996) and Worthing et al. (1997) can
be summarized as follows:
– For the D2Q7 (FHP) model and homogeneous flow the wavenumber vector
k of the most unstable mode is parallel to the velocity u.
216 5. Lattice Boltzmann Models
Fig. 5.6.2. The maximum eigenvalues for the D2Q7 (FHP) model with 1.) (u, v) =
(0.2, 0), α = 0.2, θy = 0 (solid line) and 2.) (u, v) = (0.23, 0), α = 0.3, θy = 0
(broken line) are shown as a function of the relative wave number θx (compare Fig.
1 in Sterling and Chen, 1996).
1.2
1.18
1.16
Maximum eigenvalue
1.14
1.12
1.1
1.08
1.06
1.04
1.02
1
1.5 2 2.5 3 3.5
Relative wave number θx
5.6 Stability of lattice Boltzmann models 217
– For the D2Q9 model and homogeneous flow the wavenumber |k| of the
most unstable mode is equal to about 2.3 (k is not necessary parallel to
u). An explanation for the ‘magic’ value 2.3 is not known.
– The stability domain as a function of the rest mass parameters α and β of
the D2Q9 model shrinks with increasing lattice size. The ‘canonical’ values
α = 4/9, β = 1/9, which have been derived from maximum entropy prin-
ciple (compare Section 5.2), lie inside one of the stability islands (compare
Fig. 5.6.3).
– The D2Q7 model is less stable than the D2Q9 model in the sense that insta-
bility occurs already at smaller flow velocities (compare Fig. 2 in Sterling
and Chen, 1996).
– The D2Q9 lattice is a projection of the D3Q15 lattice. Therefore it may
be come at no big surprise that their linear stability properties for homo-
geneous background flows show some similarities. The wavenumber |k| of
the most unstable mode is again equal to about 2.3 (Sterling and Chen,
1996).
– The stability domain shrinks further when the background flow includes
shear. Please note that the usual linear stability analysis assumes a time-
independent background flow whereas free shear layers decay by momen-
tum diffusion. Therefore predictions from linear stability analysis are less
reliable at high viscosities where the shear flow may decay before an in-
stability has enough time to develop. Thus the unstable region is smaller
than predicted (see, for example, Fig. 9 in Worthing et al., 1997). How-
ever, the linear stability analysis works fine in the low viscosity region (high
Reynolds numbers) which is of most interest.
To the best of our knowledge linear stability analysis for D3Q19 and for
thermal LB models is not available yet.
Fig. 5.6.3. Contour plot of the spectral radius as a function of the rest mass pa-
rameters α and β for the D2Q9 model. On a lattice with 64 times 64 grid points
the stability region shrinks to small islands (domains inside the contour lines). The
‘canonical’ values α = 4/9, β = 1/9, which have been derived from maximum en-
tropy principle, lie inside one of the stability islands.
0.2
0.18
0.16
0.14
0.12
0.1
β
0.08
0.06
0.04
0.02
0
0.4 0.45 0.5 0.55 0.6
α
5.7 Simulating ocean circulation with LBM 219
Additional forces - wind stress, Coriolis force, and frictional forces - were
implemented into a LB model with 9 lattice velocities in two dimensions
(D2Q9). With this extended model it is possible to simulate the wind-driven
circulation of a barotropic ocean. Model results are compared with analytical
solutions of the linearized problem by Munk and with a finite difference
model of the full nonlinear problem. The implementation of various boundary
conditions and of body forces is discussed in some detail.
5.7.1 Introduction
One of the grand challenges of physical oceanography in the first half of the
20th century was the explanation of the western boundary currents like the
Gulf Stream, the Agulhas or the Kuroshio. Ekman (1905 and 1923), Sver-
drup (1947) and others had made important contributions to the theory of
wind-driven circulation but could not explain the intensification of the flow
near the western boundaries of oceanic basins. In the late 40ties in the time
span of only two years different approaches for the basin-wide circulation
were proposed by Stommel (1948) and Munk (1950) .
With the North Atlantic in mind Munk defined the following problem. Con-
sider a rectangular (L × H) flat-bottom barotropic (vertically integrated)
220 5. Lattice Boltzmann Models
ocean which is driven by wind stress of the form (locally cartesian coordi-
nates x, y where x is eastward and y northward)
π
Tx = −T0 cos y and Ty = 0, (5.7.1)
H
corresponding to westerly wind in mid latitudes and easterly wind in low
latitudes. The Navier-Stokes equation contains only molecular diffusion as
dissipative process. For large scale oceanic circulation molecular diffusion
does not play a role. To get rid of the vorticity imparted by the wind Munk
replaced the molecular viscosity coefficient, ν, by the so-called eddy viscos-
ity coefficient, A, which is several orders of magnitude larger than ν. The
Laplacian friction, A∇2 u, can be interpreted as a simple parameterization of
subscale processes. The equation of motion thus reads
∂u 1
+ (u∇) u + f û + ∇p − A∇2 u − T = 0 (5.7.2)
∂t ρ
with û = (−v, u). The Coriolis parameter f is approximated by f f0 + βy
(β-plane), where
!
∂f 2Ω cos ϕ0
f0 = 2Ω sin ϕ0 and β = = . (5.7.3)
∂y ϕ0 R
R = 6371 km is the mean radius of the Earth, Ω = 7.29·10−5 s−1 the angular
velocity of the Earth and ϕ0 the reference latitude. A ≈ 104 m2 s−1 is the
horizontal eddy viscosity coefficient. This value corresponds to a typical value
of 200 − 250 km for the widths of the western boundary currents (see Munk,
1950). The velocity u of an incompressible (∇ · u = 0) two-dimensional flow
can be calculated from a stream function ψ(x, y)
∂ψ ∂ψ
u=− and v= . (5.7.4)
∂y ∂x
Taking the curl of Eq. (5.7.2) to eliminate the pressure gradient one obtains
the vorticity equation
!
∂ 2 ∂ψ ∂Ty ∂Tx
∇ ψ + J(ψ, ∇2 ψ) + β − A∇4 ψ + − =0 (5.7.5)
∂t ∂x ∂x ∂y
where
∂a ∂b ∂a ∂b
J(a, b) = −
∂x ∂y ∂y ∂x
is the Jacobi operator.
5.7 Simulating ocean circulation with LBM 221
The analytical solution of the linear Munk problem. For the station-
ary and linear case the vorticity equation (5.7.5) simplifies:
β ∂ψ T0 π π
∇4 ψ − =− sin y (5.7.6)
A ∂x AH H
The characteristic length (Munk scale)
!1/3
A
WM = (5.7.7)
β
gives an estimate of the width of the western boundary current (see below).
In order to resolve this current in the numerical simulation the grid spacing,
ci ∆t, has to be smaller than WM (= 80 km for β = 2 · 10−11 m−1 s−1 and
A = 104 m2 s−1 ).
Ideally one would like to derive an analytical solution with noslip conditions
(u = 0) on all boundaries (an ocean basin bounded by continents on all
sides). In terms of the streamfunction ψ this would mean that ψ = 0 on all
boundaries, ∂ψ/∂x = 0 on the west and east boundary, and ∂ψ/∂y = 0 on
the south and north boundary. These conditions cannot easily be fulfilled ex-
actly (consider the Fourier expansion of the meriodinal variation of the zonal
wind stress: for each term Yn of the series a solution Xn of the differential
equation has to be constructed and the sum of all these terms has to fulfill
the boundary conditions). Thus we will somewhat relax the constrains and
∂2ψ
allow slip conditions (ψ = 0, ) at the southern and northern boundaries
∂y 2
(these boundary conditions are appropriate for an ocean gyre bounded on
the west and east by continents, and on the south and north by other gyres
circulating in the opposite direction).
The exact solution of Eq. (5.7.6) reads
T0 H 3 π
ψM,e = − sin y
A π3 H
(5.7.8)
· 1+e αr kx
[p1 cos (αi kx) − p2 sin (αi kx)] + p3 eα3 kx
+ p4 eα4 kx
We apply the lattice Boltzmann model introduced in Section 5.2, i.e. the
BGK kinetic equation (Eq. 5.2.9) over the D2Q9 lattice with the equilibrium
distributions given in Eq. (5.2.12). In the simulations of the linear Munk
problem the nonlinear terms of the distribution functions have been dropped:
4
Fi = ρ i=0
9
1
ci · u
Fi = ρ 1+3 2 i = 1, 2, 3, 4
9 c
1
ci · u
Fi = ρ 1+3 2 i = 5, 6, 7, 8.
36 c
Fig. 5.7.1. Ocean model: lattice, wet (inside the dashed box) and dry (outside the
dashed box) sites, slip or no-slip boundary conditions.
North (slip)
b b b b b b b b b y = Y M AX
b b b b b b b b b
b b b b b b b b b
b b b b b b b b b
6 I
@ 6
@
R
@ @
b
I
@
@b - b b @b - b b b b
West - East
@ @
@ @
(no-slip) b b? @
Rb b b? @
Rb b b b (no-slip)
b b b b b b b b b
I
@ 6
@
b b b b @b - b b b b
I
@ @
@ ?6
R
@
b b b b b b b b b y=1
x=1 South (slip) x = XM AX
224 5. Lattice Boltzmann Models
Near the boundary on wet sites not all Fi are occupied because no distribu-
tions are propagated from dry sites. On the other hand some distributions
from sites near the boundary make it to dry sites. The latter distributions
propagate back to wet sites according to the local boundary conditions, i.e.
in case of no-slip boundary conditions the Fi bounce back:
where cRi is the lattice velocity that results from reflection of the lattice
velocity ci at the boundary and FRi is the distribution in the direction of cRi .
After the propagation all dry sites are empty and all wet sites are occupied.
This procedure obviously conserves total mass.
Forcing. As shown in Section 5.2 the inclusion of body forces requires
changes of the distributions whereby spatial and temporal variations of the
forcing have to be taken into account. Two difficulties immediately arise.
When the time dependence of the forcing is not explicitely given in ad-
vance, the scheme becomes implicit, i.e. unknown values at the future time
step are requested in the forcing term. This is indeed the case for the
Coriolis force where the velocity at the new time step is required to cal-
culate K(x + ∆tci , t + ∆t) = f (−u, v)x+∆tci ,t+∆t . This problem can be
solved by applying a predictor-corrector method. In the predictor, we use
[K(x, t) + K(x + ∆tci , t)] /2. In the corrector we evaluate the forcing term
by using the previous iterate. One corrector seemed to be sufficient; without
the corrector a numerical instability occurs after an integration time of sev-
eral weeks.
The forcing should respect conservation of total mass. Mass is conserved at
each lattice site in the case of the ’local forcing’ because
ci K(x, t) = K(x, t) ci = 0. (5.7.13)
i i
On the other hand mass is in general not conserved locally under ’non-local
forcing’
ci K(x + ∆tci , t) = 0. (5.7.14)
i
5.7 Simulating ocean circulation with LBM 225
Nevertheless, total mass should (and can) be conserved. Problems arise near
the boundaries where some forcing terms are not compensated (in terms of
mass) by contributions from other sites. This can best be illustrated by an
onedimensional example (Fig. 5.7.2; all forcings at t + ∆t). K(x1 ) does not
exists because x1 is a dry site; it is set to zero. K(x2 ) is not compensated. In
order to compensate this term and to add some forcing at x2 , K(x2 ) is added
at x2 in such a way that after propagation the forcing at x2 is comparable
to that at neighboring sites (the details of the algorithm depend on the type
of boundary conditions).
226 5. Lattice Boltzmann Models
Fig. 5.7.2. External forcing: a onedimensional example. The arrows indicate com-
pensation in terms of mass.
dry wet
b b b b b b
Fig. 5.7.3. Time series of the global kinetic energy (LBM simulation of the linear
Munk problem). The oscillations in the quasi steady state are due to Rossby waves.
−5
x 10
3
2.5
2
Kinetic energy
1.5
0.5
0
0 5 10 15
Time (weeks)
Fig. 5.7.4. Isocontours of the velocity component u (times 104 ) show excellent
agreement between the analytical solution (left) and the LBM result (right).
1000 1000
−0.5 −0.5
500 500
measures the ratio between the advection (u∇u) and the β term (βyû), and
the Reynolds number
UL
Re = (5.7.20)
A
is the ratio between the advection and the friction term (A∇2 u). The ratio
of the Rossby and Reynolds number gives the Ekman number
A
EA = (5.7.21)
βL3
which measures the ratio between the friction and the β term. The Reynold
U ·L U
number, Re = , was set to 80 and the Rossby number, Ro = ,
A β · L2
to 1.28 · 10−3 . U = 0.4 m s−1 and A = 20300 m2 s−1 where calculated from
Re and Ro. The grid spacing, ∆x = 40 km, was chosen small than the Munk
width, WM = 100 km. The applied wind stress
πy
Tx = −T0 sin2 , Ty = 0 (5.7.22)
L
with T0 = 8 · 10−7 m s−2 leads to the formation of a double gyre (Fig. 5.7.5).
1 1
5
3500
1
5
1
10
3000
2500 5
5
y (km)
1
1 1
2000
−1 −1
−1
−5
1500 −5
1000
−1
−5
500
−1
−5
−1 −1
where 1
β2 π2
α= + . (5.7.28)
4ks2 H2
5.7 Simulating ocean circulation with LBM 231
The creation of LGCA for certain partial differential equations still seems
to require ‘some sort of magic’ (compare quotation of Toffoli and Margulos,
1990, in Section 5.4). Here a simple LBM for diffusion is presented and it
is shown how straightforward it is to derive such a model. In addition, the
resulting algorithms are compared with an explicit finite difference (EFD)
scheme.
∂T
= κ∇2 T (5.8.1)
∂t
where equidistant and equal spacing in all dimensions have been assumed.
The scheme is stable for
1 (∆x)2
0 < ∆t ≤
2D κ
(see, for example, Ames, 1977; compare Subsection 5.6.2 for the case D = 1).
At the upper stability limit the scheme becomes especially simple
(n+1) (n) (n)
Tk1 ,k2 ,...,kD = Tk1 +1,k2 ,...,kD + Tk1 −1,k2 ,...,kD
6
(n) (n)
... + Tk1 ,k2 ,...,kD +1 + Tk1 ,k2 ,...,kD −1 (2D)
that is T at the new time level is given by the mean over all neighbor values
at the previous time level.
c2n−1 = (0, 0, ..., 0, 1, 0, ..., 0), c2n = (0, 0, ..., 0, −1, 0, ..., 0) n = 1, 2, ..., D
6
We will use the notation Tm insteed of Fm for the distribution functions. The
(0)
equilibrium distribution functions for pure diffusive problems, Tm , (diffusion of
(0)
temperature or tracers) are simpler than those for flow problems, Fm .
234 5. Lattice Boltzmann Models
(0) T
Tm = (5.8.4)
2D
that is, all free parameters are already fixed by the definition of the tracer
concentration. The diffusion coefficient κ will result from the multi-scale ex-
pansion as described below.
(0)
The LBM is defined by the grid, the equilibrium distribution Tm and the
kinetic equation
which states that the distribution at the new time level (t + 1) at the neigh-
boring site (x + cm ) is a weighted sum of the distribution Tm (x, t) and the
(0)
equilibrium distribution Tm (x, t). Models with parameter ω go under various
names: ‘enhanced collision’ (Higuera et al., 1989), BGK (named after Bhatna-
gar, Gross and Krook, 1954; compare, for example, Qian et al., 1992), STRA
(‘single time relaxation approximation’, Chen et al., 1991) or SOR (‘succes-
sive over-relaxation’, Qian et al., 1992). The LBM is stable for 0 < ω < 2. Now
the macroscopic equations will be derived by a multi-scale analysis (compare
Frisch et al., 1987, for an analogous procedure for LGCA). The distribution
functions are expanded up to linear terms in the small expansion parameter
Tm = Tm (0) (1)
+ Tm + O(2 ).
(1)
From the kinetic equation (5.8.5) one can calculate an approximation of Tm
→
1 1
(1)
Tm = − ∂xα cmα Tm − ∂t Tm + O(2 ).
ω ω
5.8 A lattice Boltzmann equation for diffusion 235
Diffusion is a slow process on large spatial scales which suggests the following
scaling (same as for the derivation of the Navier-Stokes equations in Frisch
et al., 1987)
(2)
∂t → 2 ∂t
∂xα → ∂x(1)
α
.
and therefore T
cm Tm
(0)
= cm = 0.
m
2D m
Inserting the expansion and the scalings into the conservation relation for
tracer concentration, one obtains up to second order in
0 = [Tm (x + cm , t + 1) − Tm (x, t)]
m
(2) 1
= [Tm (x, t) + 2 ∂t Tm +∂x(1) c T + 2 ∂x(1)
α mα m
∂x(1) c c T (0)
β mα mβ m
m
2 α
→ ∂t T
−Tm (x, t) + O(3 )]
and
∂x(1) c T
α mα m
= ∂x(1)
α
(0)
cmα Tm + 2 ∂x(1) c T (1) + O(3 )
α mα m
m m m
=0
1 2 (1) (1)
= − (0)
∂xα ∂xβ cmα cmβ Tm + O(3 ) (5.8.6)
ω m
1 1 2
= − δαβ ∂x(1)
α
∂x(1)
β
T +O(3 )
ωD
→∇ T 2
1 1 2
2 ∂x(1)
α
∂x(1) c c T (0) =
β mα mβ m
δαβ ∂x(1)
α
∂x(1)
β
T
m
2 2D
236 5. Lattice Boltzmann Models
and finally
∂T
= κ∇2 T
∂t
with !
1 1 1
κ= − . (5.8.7)
ω 2 D
To test the predictions of the LBM outlined above the one-dimensional dif-
fusion equation was integrated. As initial conditions, values of an analytical
solution were used, namely
% &
1 x2
T (x, ti ) = √ exp − .
2 πκti 4κti
5.8 A lattice Boltzmann equation for diffusion 237
Fig. 5.8.1. Integration of the diffusion equation in one dimension by the BGK-
LBM with ω = 0.3. The % integration
& starts at time ti = 15/κ(ω) with initial values
1 x2
T (x, ti ) = √ exp − (dotted line) and ends at tf = 75/κ(ω). The figure
2 πκti 4κti
shows the numerical results (broken line) together with the analytical solution (solid
line).
0.08
0.07
0.06
num
and T
0.05
0.04
ana
,T
0.03
init
T
0.02
0.01
0
−50 0 50
x
5.8 A lattice Boltzmann equation for diffusion 239
Fig. 5.8.2. Integrations of the diffusion equation in one dimension by the BGK-
LBM. The integration
% & starts at time ti = 15/κ(ω) with initial values T (x, ti ) =
1 x2
√ exp − and ends at tf = 75/κ(ω). The plot shows the logarithm of
2 πκti 4κti
the maximum error (max{|Tnumerical solution − Tanalytical solution |}) at the end
of the integrations as a function of ω. The error increases at small values of ω (large
values of the diffusion coefficients).
−1
10
−2
10
error
−3
10
−4
10
−5
10
0 0.5 1 1.5
ω
240 5. Lattice Boltzmann Models
∂T
= ∇ [κ(T )∇T ] (5.8.8)
∂t
with % &
1 1 1
κ(T ) = − . (5.8.9)
ω(T ) 2 D
Fig. 5.8.3. Integration of the nonlinear diffusion equation (5.8.10) by the lattice
Boltzmann model. The initial distribution is marked by circles. The numerical solu-
tion at t = 210 (solid line) is indistinguishable from the analytical solution (dashed-
dotted line; not visible). The broken line shows the difference between numerical and
analytical solution multiplied by 100.
2
1.5
1
T(x)
0.5
−0.5
−50 0 50
x
242 5. Lattice Boltzmann Models
Elton et al. (1990) proposed a LBM for a nonlinear diffusion equation in 2D.
The collision operator is based on variants of the HPP model (extended by
one- and two-particle collisions which conserve mass but not momentum).
The diffusion coefficients are functions of the tracer density.
The LBM for reaction-diffusion systems by Dawson et al. (1993) lives on
the FHP lattice (D2Q7) and applies the BGK approximation of the collision
operator.
Qian and Orszag (1995) developed a LBM for reaction-diffusion equations.
Their diffusion model is identical to that proposed by Wolf-Gladrow (1995).
Further reading: Sun (1998), van der Sman and Ernst (1999).
Finite differences: Teixeira (1999).
5.9 Lattice Boltzmann model: What else? 243
Because LGCA and LBM are still in rapid development it is not possible
to give an actual and complete picture of the whole field. Instead I have
tried to introduce the basic models (HPP, FHP, FCHC, D2Q9) plus some
personal favorites (like PI) together with methods from statistical mechanics
(Chapman-Enskog expansion, BGK approximation, maximum entropy prin-
ciple) which are necessary for the theory of LGCA or LBM but which are
usually not part of the curriculum for students of physics or mathematics.
Knowledge of these special methods is usually taken for granted in articles
and even in reviews.
I am still fascinated by these new methods, and I guess, I am not alone. Al-
though the emergence of new numerical methods is often driven by practical
requirements by engineers and natural scientists, (applied) mathematicians
usually take the lead in the development of the schemes. However, many re-
searchers working on LGCA and LBM would call themselves most probably
physicists. Why are these kind of schemes so attractive to them? At least
three reason come to my mind. Firstly, both approaches are based on conser-
vation laws. Physicists feel at home with conservation laws. The continuity
equation and the Navier-Stokes equation express the conservation of mass
and momentum. Certain conserved quantities are related (Noether theorem)
to symmetry groups which allow us to derive equations of the fundamen-
tal field theories by the gauge principle. Secondly, LGCA and LBM require
more (physical) theory than many other numerical methods. Whereas you
can teach to a beginner how to create and apply the simplest schemes of
finite differences or spectral methods to partial differential in a few hours,
this seems not possible for LGCA, LBM, and finite elements. And the the-
ory required stems from statistical mechanics (Chapman-Enskog expansion,
maximum entropy principle) whereas for finite elements, for example, weak
convergence in Sobolev spaces is more the backyard of mathematicians. Last
but not least, it is fascinating to see the role of symmetry. The symmetry of
the underlying lattice is still important on the macroscopic level. It took more
than 10 years to discover that it is sufficient to replace a lattice with four-
fold (HPP) by one with hexagonal (FHP) symmetry in order to obtain the
correct form of the nonlinear advection term of the Navier-Stokes equation.
The same symmetry requirement even led us into four dimensions (FCHC).
Chiral symmetry has to be established by random processes (FHP). Spuri-
ous invariants have to be detected (still not solved in general) and then to be
destroyed (for example: three-particle collisions in FHP) or not to be initial-
ized or generated (Zanetti invariants). And finally consequences of missing
symmetry has to be scaled away (symptomatic treatment of the violation of
Galilean invariance).
As a final remark let me ask the question: What will be the future of LGCA
and LBM? Will these schemes have outcompeted the traditional methods (fi-
246 5. Lattice Boltzmann Models