Straight Velocity Boundaries in The Lattice Boltzmann Method
Straight Velocity Boundaries in The Lattice Boltzmann Method
The moment of order 2 yields the tensor Π, and the fi′ (r, t) = Ωi (f0 (r, t), f1 (r, t), · · · fq−1 (r, t)). (6)
3
The collision is followed by a streaming step, which takes populations for the conserved variables ρ and ρu:
the post-collision variables to a neighbor node deter-
q−1
mined by the corresponding lattice vector:
fieq
X
ρ = and (13)
i=0
fi (r + ci , t + 1) = fi′ (r, t). (7)
q−1
ci fieq .
X
LB models possess exact mass and momentum conserva- ρu = (14)
i=0
tion laws which are not subject to numerical approxima-
tion. This is expressed by the fact that the pre-collision
populations fi and their post-collision counterparts fi′ B. Multi-scale analysis
yield the same mass and momentum. Thus,
X Through a multi-scale Chapman-Enskog analysis of
Ωi = 0 and (8) the LBGK model, it can be shown that the macroscopic
i variables defined in Eqs. (1) and (2) obey the Navier–
X
ci Ωi = 0. (9) Stokes equation for a weakly compressible fluid. Only the
i results of this analysis are shown here, and the reader is
referred to Refs. [1–3] for more details. In this analysis,
The common LBGK model [1, 2, 5] approximates the the LB dynamics is developed into a truncated Taylor
collision operator as a relaxation of the particle popula- series in space and time, up to second order accuracy.
tions to a local equilibrium distribution fieq , which de- Furthermore, to separate physical phenomena happening
pends only on the value of ρ and u: at different scales, the particle populations are expanded
into a power-law
P∞series with respect to a small parameter
Ωi = −ω(fi − fieq (ρ, u)). (10) ε ≪ 1: fi = k=0 εk fik . The two first terms, of order
O(ε0 ) and order O(ε1 ), are sufficient to recover asymptot-
The parameter ω determines the inverse time scale of the ically the dynamics of the Navier–Stokes equation. Thus,
relaxation process. Through the multi-scale analysis in the approximation
the next section, this parameter can be formally related (0) (1)
to the kinematic shear viscosity ν of the fluid: fi = fi + εfi + O(ε2 ) (15)
is made. The same approximation is applied to develop
1 1
ν= c2s − . (11) the time derivative over two scales:
ω 2
∂t = ε∂t1 + ε2 ∂t2 + O(ε3 ). (16)
The local equilibrium depends only on the macroscopic
variables ρ and u. It can be viewed as a truncated ex- Space derivatives are analyzed at a single scale:
pansion of the Maxwell-Boltzmann distribution and is
written as ∇ = ε∇1 + O(ε2 ). (17)
nature of the physics described by the momentum equa- As terms with non-linear velocity components do not con-
tion, Eq. (18b), depends on the form of these tensors. In (1)
tribute to Π(1) , it is reasonable to approximate fi by
(0)
the case of the LBGK model, the component fi of the its linear term only:
particle populations is equal to the equilibrium distribu- ti
(1)
tion: fi ≈− Qi : ρ∇u. (23)
c2s ω
(0)
fi = fieq (ρ, u). (19)
(1)
Indeed, both values of fi in Eq. (20) and Eq. (23) yield
Assuming a low Mach-number regime, Eqs. (18a) and
the same stress tensor. They are therefore equivalent
(18b) are then equivalent to the Navier–Stokes equations
in view of their effect on fluid flow, as the asymptotic
for a weakly compressible fluid with fixed bulk viscosity.
dynamics in Eq. (9) only depends on Π(1) , and not on
The terms in the multi-scale analysis are approximated (1)
with finite series of second order, which leads to the con- the details of the first-order particle populations fi .
clusion that the LB method is second-order accurate in In summary, the particle populations can be split into
space and time for the numerical simulation of weakly two main components which fully determine the hydro-
compressible fluids. dynamic behavior of the model. The term of order O(ε0 )
Although this is not the point of view adopted in the yields the equilibrium distribution, which depends on the
present paper, we also point the reader to an alternative macroscopic variables ρ and u via Eq. (12). The term of
theoretical framework in which the LB model is viewed order O(ε1 ) depends additionally on the velocity gradi-
as a discrete analogue of the continuum Boltzmann equa- ents. For the implementation of a boundary condition it
tion with a BGK collision term [7]. This discretization is therefore necessary to possess knowledge of both the
is again second-order accurate, even though the explicit macroscopic variables and their gradients.
time stepping scheme of Eq. (7) seems to indicate first- By introducing the results of the multi-scale expansion
order accuracy in time. As it is shown in Ref. [8], the into Eqs. (18a) and (18b), and by taking the limit of
streaming operator of the Boltzmann equation can be ap- small Mach-number, the Navier–Stokes equations for an
proximated by a second-order accurate trapezoidal rule, incompressible fluid are recovered:
after which the resulting implicit scheme is recast into ∇ · u = 0, (24)
the explicit LBGK model by an appropriate change of
variables. ∂t u + (u · ∇)u = −∇p + ν∇2 u.
It is interesting to point out that the terms of order These equations are used as a reference in the bench-
O(ε0 ) in Eq. (18b) yield the Euler equation, and that the marks of Section V, to verify the quality of the boundary
viscous contributions to the dynamics are determined by conditions.
the O(ε1 ) tensor Π(1) . During the implementation of a
boundary condition, it is not only central that boundary
nodes implement an appropriate value of ρ and u, which III. IMPLEMENTATION OF BOUNDARY
determines the form of the equilibrium distribution, and CONDITIONS
thus the O(ε0 ) Euler components of the dynamics. As
has been pointed out previously among others in Ref. Prior to the collision step, some particle populations
[9], it is also crucial that the first-order tensor Π(1) is are unknown on boundary nodes, as they are lacking cor-
implemented correctly to ensure a proper representation responding neighbors. This is illustrated in Fig. 2 for an
of fluid viscosity. The multi-scale analysis is helpful to upper boundary on a D2Q9 lattice. The particle popu-
understand the relation between the O(ε1 ) terms compo- lations on the boundary node are represented schemati-
nents of LB models and the macroscopic variables. For cally by a lattice vector pointing into the direction along
(1)
the LBGK model, the value of fi reads which they were propagated during the previous stream-
(1) ti ing step. Three particle populations, indicated by dashed
fi = − 2 Qi : ρ∇u − ci ∇ : ρuu vectors, are unknown. The role of a boundary condition
cs ω
is to find a substitution for the three missing popula-
1
+ 2 (ci · ∇)(Qi : ρuu) . (20) tions, and potentially also for the remaining six, in a way
2cs which is consistent with the dynamics of the model and
It contains a dominating term proportional to u and two which leads to the desired macroscopic behavior on the
terms scaling as the square of u which are less important domain boundary. When only the unknown populations
at low Mach numbers. They cancel for symmetry reasons are substituted, the action of a boundary condition can
during the evaluation of the tensor Π(1) : be viewed as the effect of a fictitious fluid portion located
outside the numerical grid. This fluid portion streams the
2c2s results from an imaginary LB operation into the bound-
Π(1) = − ρS, (21)
ω ary node and attributes a value to the unknown particle
where S is the strain rate tensor: populations. In other types of boundary conditions, the
1 vision of a fictitious LB dynamics is abandoned, and all
S= ∇u + (∇u)T . (22) particle populations are replaced on the boundary node.
2
5
0.6
ux
B. Preserving the known particle populations 0.4
The two boundary conditions BC1 and BC2, which are 0.2 Poiseuille profile
introduced in Section IV and listed in Table I, compute Equilibrium on boundary
Regularized boundary condition BC3
values for the unknown particle populations only, and 0
leave the others untouched. By doing so, they exploit all 0 0.2 0.4 0.6 0.8 1
y−position in channel
the information available from the LB dynamics in the
bulk of the simulation. As it is shown in Section V, they
are rewarded by achieving more accurate results in 2D FIG. 3: 2D channel flow, simulated once with an equilibrium
flows, but lose this advantage in a 3D problem. distribution on boundaries, and once with the Regularized
boundary condition BC3. The solid line plots the analytic
As it is pointed out in the introduction to Section III, Poiseuille profile. Although only 11 data points are used to
it is important that the values for the density and the resolve the channel width, the result obtained with BC3 is
velocity are recovered accurately from Eqs. (1) and (2) visually indistinguishable from the Poiseuille profile. With
on boundary nodes. It is clear from Section III A that equilibrium boundaries on the other hand, the velocity gra-
the particle density of a boundary node depends on the dients are ill represented on boundary nodes, which impairs
known populations and on the value of uy , but not on the accuracy of the whole simulation.
the detail of the unknown populations. Therefore, in
situations where only the unknown particle populations
are replaced, the value of ρ needs not (and cannot) be
enforced explicitly. Enforcing the value of the velocity C. Replacing all particle populations
via Eq. (2) on the other hand yields two equations in 2D
and three equations in 3D. Additional closure relations The boundary conditions BC3, BC4 and BC5 in Ta-
are therefore required to match the number of unknown ble I use the known particle populations only to compute
particle populations, which amount to 3 on the D2Q9 the particle density ρ and, in the case of BC3, the stress
lattice, and to 9 (for D3Q27) or 5 (for D3Q19 and D3Q15) tensor Π(1) . After this, they disregard all particle pop-
on 3D lattices. ulations and replace their value by new ones, based on
the velocity and the computed macroscopic variables. As
It was argued in Section II B that the hydrodynamic
limit of the lattice Boltzmann equation is expressed in they treat all particle populations in the same way, they
can be formulated generically and are easily implemented
terms of the quantities ρ, u and Π(1) . To help understand
the boundary conditions from a hydrodynamic point of on various 2D and 3D lattices. Furthermore, they turn
out to be more stable than BC1 and BC2, and can there-
view, it is therefore good to reinterpret the closure rela-
tions suggested by the authors of boundary conditions as fore be used at substantially higher Reynolds numbers.
closure relations for the values of the stress tensor Π(1) . A tempting approach to setting up such velocity
As Π(1) is symmetric, this introduces a set of 3 equations boundaries might be to initialize all particle populations,
in 2D, and 6 equations in 3D, which are enforced by Eq. the known and the unknown ones, to their equilibrium
(3). Some of the equation for Π(1) (Eq. (3)) are however distribution with the imposed velocity and the density
linearly dependent on those for u (Eq. (2)). In the 2D computed from Eq. (28). It is however clear from the dis-
(1) cussion in Section II B that this method is inappropriate,
example illustrated in Fig. 2, the equation for Πxy de- as it respects the O(ε0 ) contributions to the dynamics,
pends linearly on the equation for ux , and the equation but neglects the hydrodynamically relevant O(ε1 ) terms.
(1)
for Πyy depends on the one for uy . Generally speaking, As a result, the quality of the simulation is spoiled, not
(1)
a total of d equations for the tensor components Πnα , for only close to boundaries, but in the full simulated do-
α = 0 · · · d−1, are linearly dependent on the equations of main. The expected second-order accuracy can conse-
uα . Here, the index n labels the direction of the bound- quently not be reached. To illustrate this issue, Figure
ary normal (in the above example, this is the y-index). 3 displays the velocity profile obtained for the steady-
In 2D in particular, the two equations for u and the re- state solution of a 2D channel flow. The no-slip (zero
maining equation for Π(1) yield three closure relations, in velocity) walls are implemented once via this equilib-
the same amount as when a closure relation is introduced rium approach, and once with the obviously more ac-
for each of the missing particle populations. curate boundary condition BC3. An exact visual match
7
boundary on a D2Q9 lattice, they read enlightening, and we present therefore two limit values.
The first represents the case of a no-slip wall, with van-
gi = fieq (ρ′ , ux + sx , uy ) for i = 3, 4, 5, (29) ishing values of u:
where fieq is the equilibrium distribution described by Eq. −5Sxx + ω2 (3Sxy
2
+ 5Sxx Syy )
(12). As has been emphasized in Section III B, the value Π(1)
xx = ρ when u = 0.
9ω − 18Syy
of the velocity u needs to be enforced on the boundary
(34)
via Eq. (2). This system of two equations can be solved (1)
for the two unknowns ρ′ and sx , with the following result: For the second limit case, Πxx is expanded into a finite
Taylor series for small values of the components Sxx , Syy
−ρuy + f1 + f7 + f8 and Sxy . It is assumed that, in the limit of fluid incom-
ρ′ = 6 , (30)
1 + 3u2y − 3uy pressibility, the Mach number Ma, and thus the velocity
ρux + f1 + f2 − f6 − f7 u in lattice units, scales like the small parameter ε [15].
sx = −ux + 6 . (31) The components of the strain rate tensor S exhibit there-
ρ′ (1 − 3uy ) fore order ε2 scaling. From the above Taylor series, only
In these relations, the lattice constants have been re- terms of order ε2 are retained, and terms of the form
placed by their numerical value for the D2Q9 lattice. The Sαβ Sγδ or Sαβ uγ are neglected. This leads to the follow-
missing populations are now evaluated with the help of ing approximation of Eq. (33a):
Eq. (29), and the other populations are left unchanged: 5
Π(1)
xx = − ρSxy + O(ε3 ). (35)
gi = fi for i = 0, 1, 2, 6, 7, 8. (32) 9ω
In 3D, the slip velocity s has two independent compo- This expression is identical to the hydrodynamic tensor
nents. The unknowns thus amount to 3, which matches value in Eq. (21), with exception of the factor 5/9, which
the number of closure relations introduced by Eq. (2). differs from the expected factor 2/3 by 20%. This er-
This system of equations is more difficult to solve than ror has however no important effect in practice, as the
in the 2D case, and to our knowledge, no analytic solution Inamuro method is found to be equally or even more
is presently known. For the 3D benchmarks in Section accurate than the other approaches in low-Reynolds ap-
V, the lattice Boltzmann code solves these equations nu- plications (see Section V). One may however point out
merically on each boundary cell and at every time step that as a consequence of Eq. (35), the trace of Π(1) is
with the help of a multivariate Newton-Raphson solver non-zero with BC1. This is a violation of the continuity
[14]. equation, because Eqs. (21) and (22) show that the trace
The velocity u is explicitly enforced by this boundary of Π(1) is proportional to ∇·u in the hydrodynamic limit.
condition, but nothing is known a priori about the value
of the stress tensor. The method described in the intro-
duction of Section IV is now applied to evaluate Π(1) for B. Zou/He method (BC2 )
the D2Q9 lattice, by making use of a computer algebra
system. The following values are found: The boundary condition BC2 by Q. Zou and X. He
is based on an idea referred to by its authors as “apply-
ρ
Π(1)
xx = · (33a) ing the bounce-back rule to off-equilibrium parts”. This
9ω(1 − 3uy )2 (ω − 2Syy − 3ωuy + 3ωu2y ) expression can be understood as a reference to a symme-
(1)
10Sxx Syy (1 − 3uy )2 + 6Sxy
2
(1 − 3uy + 3u2y ) try property of the variables fi that follows from Eq.
(23). Let the opposite opp(i) of a lattice direction i be
−ω(3uy − 1) 5Sxx (−1 + 6uy − 12u2y + 9u3y ) defined by the relation copp(i) = −ci . Then, Eq. (23)
1 is symmetric under the operation of taking the opposite
+Syy u2x (3 − 9uy ) + 18uxSxy ( − uy + u2y ) , direction:
3
2
Π(1)
yy = − ρSyy , and (33b) fi
(1) (1)
= fopp(i) . (36)
3ω
2
Π(1)
xy = − ρSxy . (33c) This relation can be used to copy data from known par-
3ω
ticle populations to the opposite, unknown ones. It may
The tensor components Πyy and Πxy yield an exact however not be applied blindly to all unknown particle
match with the value expected from Eq. (21). As has populations, because this would conflict with Eq. (2) for
been pointed out in Section III B, this is a direct corol- the velocity. On a D2Q9 lattice for example, there is re-
lary of the fact that the equation for the velocity, Eq. (2), ally only one degree of freedom left on which the bound-
is satisfied. The component Πxx is the only free parame- ary condition may have an influence. The choice made in
ter on a D2Q9 lattice, and can be viewed as a signature the case of BC2 was to apply Eq. (36) to the unknown
of how the boundary condition influences the dynamics particle population whose lattice vector is parallel to the
of the fluid. In its present form, Eq. (33a) is not very boundary normal. Thus, for an upper boundary on a
9
(1) (1)
g4 = f8 . (37) The method [3] by J. Latt and B. Chopard replaces all
particle populations on a boundary node. It first eval-
(1) (1)
The remaining two unknown populations g3 and g5 are uates the value of Π(1) , based on the knowledge of the
computed by enforcing the values of the velocity through known particle populations. Then, the equations of the
Eq. (2). On a D2Q9 lattice, the obtained values are multi-scale analysis in Section II B are reversed to recon-
struct all particle populations from ρ, u and Π(1) in a
(1) (1) 1 (1) (1) way consistent with the hydrodynamic limit of the model.
g3 = f7 + (f6 − f2 ) and (38)
2 With the use of Eq. (21), and by exploiting the symmetry
(1) (1) 1 (1) (1) of tensors Qi and of tensor Π(1) , Eq. (23) is rewritten as
g5 = f1 + (f2 − f6 ). (39) follows:
2
(1) ρti ti
The value of the unknown particle populations is con- fi ≈− 2
Qi : S = 4 Qi : Π(1) . (44)
structed by adding equilibrium and off-equilibrium parts: cs ω 2cs
(1)
With this relation, the off-equilibrium part of the particle
gi = fieq (ρ, u) + gi for i = 3, 4, 5. (40) populations can be reconstructed from the tensor Π(1) .
This procedure is called a regularization of the particle
All other populations are kept as they are: (1)
populations, because it compels the fi to respect ex-
actly (without numerical error) the symmetry properties
gi = fi for i = 0, 1, 2, 6, 7, 8. (41) of Eq. (21), such as the symmetry explicited in Eq. (36).
The tensor Π(1) is evaluated as follows. First, all un-
Like the Inamuro method BC1, the Zou/He method known particle populations are assumed to take the value
BC2 enforces the value of the velocity explicitly, but does obtained by a “bounce-back of off-equilibrium parts”,
not specify anything about the stress tensor. The values as in Eq. (36). Thus, their value is described as fi =
of Π(1) can again be computed for the D2Q9 lattice, us- fieq (ρ, u) + fopp(i) − fopp(i)
eq
. It was emphasized in Sec-
ing the procedure described in the introduction of Section tion IV B that this relation may not be used to define
IV. The resulting expressions match exactly the hydro- a boundary condition, because it prohibits an exact im-
dynamic values of Π(1) claimed in Eq. (21). This con- plementation of Eq. (2). It it therefore used temporarily
firms analytically the validity of the Zou/He boundary only, to evaluate the value of Π(1) by means of Eq. (3).
condition for 2D simulations. After this, Eq. (44) is used to construct all particle
This algorithm cannot be used as it stands in 3D. In populations:
that case, Eq. (2) yields three independent equations,
but the number of unknowns is larger (5 or 9). In that ti
gi = fieq (ρ, u) + Qi : Π(1) for i = 0 · · · q − 1. (45)
case, the authors of Ref. [12] suggest to proceed as fol- 2c4s
lows. To begin with, the “off-equilibrium bounce-back”
rule, Eq. (36), is applied to assign a value to all missing It is obvious that not only ρ and u, but also the ten-
particle populations. By doing this, the exact value of sor Π(1) are recovered appropriately by this boundary
the component uα is recovered for the index α in direc- condition.
tion of the boundary normal. To keep this relation valid,
the sum over the value of the unknown particle popula-
tions is kept invariant during subsequent operations. The D. Finite-difference velocity gradient method
(BC4 )
excess of momentum is then evaluated in the remaining
directions:
In the regularized approach of BC3, the stress tensor
Π(1) is evaluated on the boundary from information lo-
fineq ciβ cally available on the cell. The boundary condition BC4
X
δβ ≡ for β 6= α. (42)
i computes Π(1) from Eq. (21) instead, by relating it to
the strain rate tensor S. The components of S are eval-
Finally, the values δβ are redistributed over the unknown uated by a second-order accurate finite-difference scheme,
particle populations, in order to find an exact match for which accesses the value of the velocity on neighboring
Eq. (2): grid cells. The algorithm of BC4 is summarized by the
following equation:
X 1
gineq = fineq − ciβ δβ for all unknown fi ’s, (43) ρti
nβ gi = fieq (ρ, u) − Qi : S for i = 0 · · · q − 1, (46)
β6=α c2s ω
where nβ is the number of unknown particle populations where the strain rate tensor S is defined as in Eq. (22).
for which ciβ is non-zero. The velocity gradients of S that run along directions
10
parallel to the boundary are evaluated by a symmetric uses the same principles as BC4, but also includes the
finite difference scheme. This presumes the knowledge non-linear velocity contributions to the particle popula-
of the velocity on nearest-neighbor cells. Velocity gra- tions. This approach has not been published previously
dients along the boundary normal use non-symmetric in the literature, and serves only as a toy model to exper-
finite differences, which access the velocity on nearest iment with the limits of BC4. It is explicited as follows:
and next-to-nearest neighbors. Please note that, instead
of evaluating the symmetric tensor S, one may alter- ti
gi = fieq (ρ, u) − Qi : ρ∇u − ci ∇ : ρuu
natively compute all components of the non-symmetric c2s ω
tensor ∇u and calculate the population functions from 1
Eq. (23). These two ways of constructing the boundary + (c i · ∇)(Qi : ρuu)
2c2s
condition are algebraically equivalent. for i = 0 · · · q − 1. (48)
This boundary condition was published in 1993 in a
pioneering article by P. A. Skordos [13]. It should be For the implementation of this method, the gradients of
mentioned that Ref. [13] makes a slightly different as- the components of the tensor uu need to be evaluated via
sumption on the asymptotic value of Π(1) , as it uses the a finite difference scheme, additionally to the gradients
following expression in lieu of Eq. (21), in which the den- of u.
sity ρ resides inside the spatial derivative:
c2s
Π(1) = − ∇(ρu) + (∇(ρu))T . (47) V. BENCHMARKS
ω
It has however been shown that Eq. (21), which pre- This section produces the results of lattice Boltzmann
dicts the proper deviatoric strain rate for a compressible simulations, based on the five reviewed boundary con-
fluid, can be recovered in a multi-scale analysis by tak- ditions. For some of the simulated problems, analytical
ing into account derivatives of non-linear velocity terms solutions are known which describe the steady state of
[3, 16, 17]. The difference between Eqs. (21) and (47), the flow. In that case, the simulation is iterated until
however subtle, may have a noticeable effect in compress- a steady state is reached. Then, the numerical result is
ible fluids. We decided therefore to depart from the origi- validated against the analytical solution on every grid
nal article on this point, but emphasize that the credit for point, and the mean discrepancy between these two val-
this boundary condition should be attributed to Skordos ues is evaluated as a measure of quality for the imple-
[13]. It should also be mentioned that Ref. [13] discusses mented boundary condition. Other benchmarks focus on
both first- and second-order accurate finite difference ap- the time evolution of the flow. They keep track of the
proximations to velocity gradients, but only second-order time-evolution of a scalar quantity (such as the average
schemes are presented here. energy in Section V C), or the occurrence of a partic-
An interesting discussion of boundary conditions with ular event (as the maximum value of the enstrophy in
finite-difference approximation to velocity gradients is Section V D). Several 2D benchmarks are presented, im-
presented in Ref. [9]. This paper points out that other plemented on a D2Q9 lattice, and one 3D benchmark on
choices than Eq. (46) also lead to the expected value a D3Q19 lattice.
of the stress tensor, and it proposes different closure The simulated domains of all presented problems have
schemes that are compatible with the hydrodynamic a rectangular shape. This raises the issue of how to im-
limit of the model. plement corner nodes and, in 3D, edge nodes that lie on
the connexion between two plane walls. Although some
authors of boundary conditions make suggestions on how
E. Nonlinear finite-difference method (BC5 ) to treat these cases, some authors do not. To guaran-
tee an equal treatment, the present article treats cor-
It is shown by multi-scale analysis that Eq. (23) is a ners and edges always in the same way, independently of
valid approximation to Eq. (20) within the hydrodynamic the boundary condition that is being tested. The finite-
scales of the model. It is therefore clear that bound- difference algorithm of BC5 was selected to implement
ary conditions BC3 and BC4, which are based on this these special boundary nodes. This approach is straight-
approximation, yield accuracy of second order, consis- forward, because the velocity gradients referred to in Eq.
tent with the overall accuracy of the lattice Boltzmann (45) can be evaluated on corners and edges just like ev-
scheme. Beyond this asymptotic estimate, the accuracy erywhere else. It must furthermore be pointed out that
may however vary in actual simulations, due to higher- Eq. (28) for the particle density cannot be evaluated on
order effects that are not visible in the finite expansion of corners and edges. In those cases, the density is extrapo-
Section II B. For this reason, it is sometimes argued that lated with second-order accuracy from neighboring cells.
the full term of Eq. (20) should be implemented on the In all benchmark problems, a velocity U and a length
boundary, to gain accuracy and numerical stability. In L are selected that are characteristic for the flow. The
order to test this conjecture numerically, a corresponding dynamics of the flow is then described in a system of di-
boundary condition BC5 is presented in the following. It mensionless variables, independent of the numerical grid,
11
in which U = 1 and L = 1. The equations of motion A. Steady plane channel flow (2D)
depend only on the dimensionless Reynolds number, de-
fined as a function of the kinematic fluid viscosity ν: This 2D stationary flow evolves in a straight channel,
UL which extends in x-direction between x = 0 and x = lx .
Re = . (49) The walls of the channel are parallel to the x-axis, and
ν defined by the equations y = 0 for the lower wall, and
The parameters used for the numerical implementation y = ly for the upper wall. A no-slip condition for the
are described by the number N , which is the number of velocity is enforced on these walls. The flow is character-
grid nodes used to resolve the length L, and the veloc- ized by a constant pressure drop along the channel. This
ity Ulb , representing the velocity U in a system of lat- pressure drop can be obtained by using pressure bound-
tice units. This is a common choice in LB simulations, ary conditions on the inlet and the outlet. An alternative
because Ulb is proportional to the Mach number of the approach, which is used in this benchmark, is to enforce
fluid. It can therefore be fine-tuned to make sure the flow the velocity profile from the analytical solution of the
is close enough to the limit of incompressibility. For the flow on the inlet and on the outlet. The velocity is par-
numerical implementation of the benchmarks, the pre- allel to the walls, and the only non-zero component ux is
scribed velocity field for the initial and/or boundary con- independent of x: ux = ux (y). The height ly of the chan-
dition needs to be converted from dimensionless variables nel is taken to represent the characteristic length L. The
to lattice units. This is simply done by multiplying the maximum value of the velocity, which is measured in the
dimensionless velocity by Ulb . From these definitions, the middle of the channel, is selected for the characteristic
discrete parameters of the simulation are characterized as velocity U . The analytic solution to this flow is given by
follows. The grid interval δx is given by the parabolic Poiseuille profile, which, in dimensionless
variables, reads
1
δx = . (50)
N −1 ux (y) = 4(y − y 2 ). (53)
The time lapse of an iteration δt is defined through
The pressure drop amounts to ∂p/∂x = −8/Re.
the relation U = δx /δt Ulb , which recovers the lattice-
The two-dimensional channel flow is for many reasons
independent form of the velocity. Given our choice of
an inappropriate benchmark, and it is presented here in a
U = 1, this leads to
historical spirit, to conform with some authors of bound-
δt = δx Ulb . (51) ary conditions that use it as a basic test case for their
algorithm. One shortcoming of this flow as a benchmark
At a given time step, the numerical error is evalu- case is that the components Sxx and Syy of the strain
ated by computing a l2 -norm of the difference between rate tensor S vanish in the analytical solution. Bound-
the simulated velocities ulb (rk ) on grid nodes located ary conditions that replace only unknown particle popu-
at position rk , and the dimensionless analytical solution lations (BC1 and BC2 in this article) are therefore au-
uanalytic (rk ): tomatically exempt from numerical errors. This follows
from the discussion in Section III B, where the compo-
nents Πxx (on horizontal boundaries) and Πyy (on verti-
v
u P −1
2
u 1 X
ulb (rk )
cal boundaries) of the stress tensor are shown to be the
ǫ= t
− uanalytic (rk )
, (52)
P
Ulb only degrees of freedom for which the boundary condition
k=0
could possibly be wrong. If the corner nodes are imple-
where the sum runs over all P nodes of the numerical mented in an appropriate way, these two methods are
grid. shown in Refs. [11] and [12] to solve the 2D channel flow
The parameters of the simulation for a varying res- with a precision close to machine accuracy (the best accu-
olution N are adapted in order to keep the value of racy one can expect to obtain, given the limited precision
the Reynolds number constant, and to prevent effects of of floating point values on a computer), independent of
fluid compressibility from interfering with the accuracy the grid resolution. Machine accuracy is however not ex-
of the result. Compressibility errors ǫcompr are known hibited in the present benchmark, because we chose to
to scale like the square Mach-number and are therefore implement corner nodes in a generic way that works for
estimated by ǫcompr = O(Ulb2 ). This error is required all boundary conditions and for all types of flows.
to decrease at least as fast as the discretization error In this benchmark, the channel has quadratic shape
ǫδx = O(1/L2lb ) = O(1/N 2 ). It follows from Eq. (49) (lx = ly = 1), the grid resolution is varied from N = 25
that this is achieved by keeping the viscosity νlb constant to N = 400, and the Reynolds number is Re = 10. Com-
when the grid resolution is modified. pressibility effects are controlled by setting Ulb = 0.01 at
The benchmark codes can be retrieved from the Inter- a grid resolution N = 50. As discussed in the previous
net address [18]. The programs are based on the open paragraph, the velocity Ulb is recomputed for different
source lattice Boltzmann library OpenLB [19], which is values of N in such a way as to keep the viscosity νlb
publicly available. constant from one grid to another. Figure 4 (a) shows
12
(a) (b)
5
10
−3
Inamuro
10 Zou/He
Regularized
3
−5
10
10
−2 Slope
Inamuro 2
−6
10 Zou/He 10
Regularized
Finite difference
−7
Nonlinear finite difference
1
10 1 2 3
10
10 10 10 50 100 150 200
Grid resolution N Grid resolution N
FIG. 4: (a) Numerical accuracy in a 2D channel flow. (b) Numerical stability in a 2D channel flow. The maximum Reynolds
number which can be reached before numerical instabilities appear is plotted.
that all reviewed boundary conditions lead to the ex- The maximum velocity of the flow, reached in the middle
pected second-order accuracy with respect to grid reso- of the channel at time t = n2π/ω for any integer value
lution. Boundary conditions BC1 and BC2 are distinctly n, is found to be
more accurate, because their overall accuracy is only af-
fected by the error in corner nodes. It is furthermore A 2
umax = L . (56)
observed that the non-linear finite difference scheme of 8ν
BC5 is slightly more accurate than the linear approach This value umax is used to define the reference velocity
of BC4. The numerical stability of boundary conditions U , as it characterizes the flow reasonably well when os-
is explored in Figure 4 (b) by means of the maximum cillations are slow. The reference length L is described
Reynolds number which can be reached before numerical by the channel height ly . As the flow depends on time, it
instabilities occur. The most accurate boundary condi- is characterized by two dimensionless parameters, which
tions, BC1 and BC2 are also the distinctly least stable. are the Reynolds number Re defined in Eq. (49), and the
Most stable boundary conditions are those based on a Womersley number α, defined as
non-local algorithm, BC4 and BC5. r
L ω
α= . (57)
2 ν
B. Oscillating plane channel flow (2D)
In a system of dimensionless variables described by U
and L, the time-dependent solution to this flow is given
This laminar channel flow is also known as “Womersley by the Womersley profile [20, 21]:
flow” on ground of the analytical solution proposed by
J. Womersley [20]. It is defined by the same geometry ux (y, t) =
as the steady flow in Section V A. The pressure gradient √ 1
is however not constant, but oscillates in time. Before iα
2
t 8 cosh 2(α + iα) y −
Re e Re 1 − √ 2 ,
the reference velocity U can be defined, the equations iα2 cosh 22 (α + iα)
of the flow are written in an arbitrary system of units,
other than the dimensionless one. In this system, the (58)
amplitude of the oscillations is denoted by A, and the where i is the imaginary unit, and Re means that the
frequency by ω: real part of the formula needs to be evaluated.
The error ǫ of the numerical result with respect to the
∂p
= −A cos(ωt). (54) analytical solution of Eq. (58) is computed at each time
∂x step by evaluation of Eq. (52) over the whole computa-
In the low-frequency limit ω → 0, the solution to this tional domain. The overall error ǭ of the simulation is
flow is defined by a succession of Poiseuille profiles, with defined as an average of ǫ over one time period. Only the
oscillating amplitude: asymptotic value of ǭ, reached after a large number of
iterations, is accounted for. The initial transient regime
A of the fluid, and consequently the choice of the initial
ux (y, t) = (ly y − y 2 ) cos(ωt). (55) condition, are irrelevant.
2ν
13
(a) (b)
−3 −3
Error 10 10
Error
−4
10 −4
10
−2 Slope −2 Slope
Inamuro Inamuro
Zou/He Zou/He
Regularized Regularized
−5 Finite difference Finite difference
10
Nonlinear finite difference Nonlinear finite difference
1 2 1 2
10 10 10 10
Grid resolution N Grid resolution N
FIG. 5: Numerical accuracy in an oscillating channel. (a) α = 2 (slow oscillations), (b) α = 5 (fast oscillations).
Energy
10
Energy
−6
10
−10
10
−8
10
−10 −12
10 10
0 0.002 0.004 0.006 0.008 0.01 2 3 4 5 6
Time Time x 10
−3
FIG. 6: Time-evolution of the average energy in the 2D periodic array of vortices. The curves for the linear and the non-linear
finite difference methods overlap as far as one can distinguish visually. Therefore, only the linear case is presented. A boundary
condition is considered to be of good quality if the point at which the curve oscillates and departs from an exponential decay
occurs late.
−1 ally stable, the simulations using BC1 and BC2 were still
10
subject to numerical instabilities.
The numerical results are presented in Fig. 7. Please be
aware that a resolution of N = 300, for example, stands
for a total grid size of 600 × 600, as the size of the system
−2
10 is 2 × 2 in dimensionless variables. For a Reynolds num-
ber Re = 625, all three boundary conditions BC3, BC4,
Error
(a) (b)
6
−3 10
10 Inamuro
5
Zou/He
10 Regularized
3
10
−5 −2 Slope 2
10 10
Inamuro
Zou/He
Regularized 1
10
Finite difference
−6
Nonlinear finite difference
0
10 1 2
10
10 10 0 20 40 60 80 100
Grid resolution N Grid resolution N
FIG. 8: (a) Numerical accuracy in a 3D channel flow. (b) Numerical stability in a 3D channel flow. The maximum Reynolds
number which can be reached before numerical instabilities appear is plotted. Boundary conditions based of finite difference
approximations (BC4 and BC5 ) are unconditionally stable at high grid resolution. Numerical values are therefore only reported
in the unstable regime, up to N = 25 for BC4 and up to N = 20 for BC5.
Figure 8 (a) shows results of numerical accuracy at from one boundary condition to another, depending on
Re = 10. The reference velocity is Ulb = 0.01 at N = 50, the flow geometry and the grid resolution. A way to
and the aspect ratio is ζ = 1. Numerical stability is ex- understand these differences might be to take the multi-
plored in Figure 8 (b) for a varying grid resolution. The scale analysis to a higher order O(ε2 ) and discuss the
numerical results in this 3D benchmark are similar to couplings between higher order terms and the hydrody-
those of the 2D application in Section V A. The boundary namic scales. This technique is for example employed in
condition BC1 is again much more accurate than bound- Ref. [27] to understand the asymptotic low Mach-number
ary conditions that replace all particle populations. As in behavior of a family of lattice Boltzmann models. In-
the 2D case, all but one component of the strain rate ten- stead of doing this, this review article produces bench-
sor vanish in this flow, and some potential deficiencies of mark results for the boundary conditions in many differ-
BC1, as the one shown in Eq. (35), might not be visible in ent geometries. Those results are intended to serve as a
the benchmark. An unexpected result is that boundary reference to help select the most appropriate boundary
condition BC2, which in 2D applications achieves results condition for a given lattice Boltzmann simulation. It is
very similar to those of BC3, falls in the same category emphasized once more that the results are valid only for
as the non-local boundary conditions BC4 and BC5 in straight boundaries which are aligned with the numer-
this 3D case. Another remarkable difference with respect ical grid. Different conclusions can be expected when
to 2D results is that the non-local boundary conditions off-lattice boundaries are implemented.
achieve unconditional numerical stability in 3D, as soon In 2D simulations and at low Reynolds numbers, the
as the grid resolution exceeds a certain threshold value. Inamuro and Zou/He boundary conditions BC1 and BC2
At this point, further investigations would be needed to are found to produce the most accurate results. Both
decide if this difference is due to different flow geometries of them preserve the known particle populations on a
(the analytical solutions in Eqs. (53) and (70) are qualita- boundary node, a fact which probably explains their ex-
tively different) or if 3D simulations are inherently more cellent benchmark performance. They retrieve a large
stable than 2D ones for this type of boundary conditions. amount of information from the bulk of the fluid, and
manipulate only few particle populations (3 out of 9).
It seems plausible that by doing this, they retain infor-
VI. DISCUSSION AND CONCLUSION mation on higher order terms which are not visible in
the hydrodynamic terms of the multi-scale analysis. The
Five boundary conditions for the lattice Boltzmann Inamuro method is also very accurate in the 3D bench-
method have been selected and presented in this review mark, but this performance is not reproduced by the
article. As it is concluded from applying the results of a Zou/He condition, which in this case compares to non-
multi-scale analysis to boundary nodes, all methods are local boundary conditions. The main deficiency of BC1
second-order accurate with respect to the grid resolution. and BC2 is that they are numerically unstable at (even
This implies that their error varies asymptotically at the moderately) high Reynolds numbers. They could for ex-
same rate. Beyond this asymptotic estimate, the accu- ample not be used to simulate the turbulent dipole-wall
racy experienced in numerical simulation differs however collision presented in Section V D.
17
In conclusion, BC1 and BC2 are the boundary con- they are even unconditionally stable on a sufficiently
ditions of choice for the simulation of laminar 2D flows, large grid. Their main disadvantage is the non-locality of
when high accuracy is important. The Inamuro bound- their algorithm. This violates the basic principles of the
ary condition BC1 is also a good candidate for laminar LB method, may substantially increase the complexity
3D flows, although it is not an explicit method, and thus of a code, and even be an obstacle to parallelizing the
tends to be complicated to implement. The extension of program in a straightforward way. On the other hand,
BC2 to 3D flow does not seem to make much sense, as it the boundary conditions BC4 and BC5 are very gen-
does not exhibit exceptional accuracy, and is less stable eral and may adapt well to a larger software project.
than other approaches. They are for example not bound to the lattice structure,
The Regularized boundary condition BC3 uses a hy- and can be extended to the case of off-lattice boundaries,
brid approach, as it is local like BC1 and BC2, but it like the one described in Ref. [28]. Boundary condition
replaces all particle populations like BC4 and BC5. As BC5 takes into account non-linear velocity terms in off-
such, it is less accurate than BC1 and BC2 in lami- equilibrium particle populations, which are neglected in
nar flows, but it has the ability to reach much higher BC4. Thanks to this, it is slightly more accurate and
Reynolds numbers. Furthermore, simulations of a tur- more stable. The difference is however so small that it
bulent dipole-wall collision show that it reproduces the does not seem to justify the increased complexity and
dynamics of boundary layers more accurately than all computational burden.
other boundary conditions. Because of its numerical sta-
bility, and because it is easy to implement in 2D and
3D applications, BC3 is a good general-purpose method, Acknowledgments
and seems to be the best candidate for high Reynolds
number flows. We thankfully acknowledge the support of the Swiss
The non-local boundary conditions BC4 and BC5, National Science Foundation SNF (Awards FN 200020–
which use a finite difference scheme to approximate the 1007931, PBGe2–117144, and FN 200021–107921). We
off-equilibrium part of particle populations, exhibit the also thank Andreas Malaspinas for inspiring suggestions.
best numerical stability. In the laminar 3D benchmark,
[1] S. Chen, H. Chen, D. Martinez, and W. Matthaeus, Phys. Gase und Lattice-Boltzmann-Methoden (Springer Verlag,
Rev. Lett. 67, 3776 (1991). 2004).
[2] S. Chen and G. D. Doolen, Ann. Rev. Fluid Mech. 30, [16] P. J. Dellar, Phys. Rev. E 64, 031203 (2001).
329 (1998). [17] Z. Guo, C. Zheng, and B. Shi, Phys. Rev. E 65, 046308
[3] J. Latt, PhD dissertation, University of Geneva, (2002).
Geneva, Switzerland (2007), http://www.unige.ch/ [18] LB boundary condition benchmarks. http://www.
cyberdocuments/theses2007/LattJ/meta.html. lbmethod.org/bcbench.html.
[4] M. Junk, A. Klar, and L.-S. Luo, J. Comput. Phys. 210, [19] The OpenLB project. http://www.lbmethod.org/
676 (2005). openlb/.
[5] Y. Qian, D. d’Humières, and P. Lallemand, Europhys. [20] J. R. Womersley, J. Physiol. 127, 553 (1955).
Lett. 17, 479 (1992). [21] J. A. Cosgrove, J. M. Buick, S. J. Tonge, C. G. Munro,
[6] S. Succi, The lattice Boltzmann equation for fluid dynam- C. A. Greated, and D. M. Campbell, J. Phys. A : Math.
ics and beyond (Oxford University Press, 2001). Gen. 36, 2609 (2003).
[7] X. He and L.-S. Luo, Phys. Rev. E 56, 6811 (1997). [22] O. Walsh, in The Navier-Stokes Equations II – The-
[8] X. He, X. Shan, and G. D. Doolen, Phys. Rev. E 57, R13 ory and Numerical Methods, edited by J. G. Hey-
(1998). wood, K. Masuda, R. Rautmann, and S. A. Solonnikov
[9] I. Halliday, L. A. Hammond, and C. M. Care, J. Phys. (Springer-Verlag, 1991), vol. 1530 of Lecture Notes in
A: Math. Gen. 35, L157 (2002). Mathematics, pp. 305–309.
[10] A. Dupuis and B. Chopard, Int. J. Mod. Phys. B 17, 103 [23] J. Latt and B. Chopard, Int. J. Mod. Phys. C 18, 619
(2003). (2007).
[11] T. Inamuro, M. Yoshina, and F. Ogino, Phys. Fluids 7, [24] H. J. H. Clercx and C.-H. Bruneau, Computers & Fluids
2928 (1995). 35, 245 (2006).
[12] Q. Zou and X. He, Phys. Fluids 9, 1592 (1997). [25] M. Griebel, T. Dornseifer, and T. Neunhoffer, Numerical
[13] P. A. Skordos, Phys. Rev. E 48, 4823 (1993). simulation in fluid dynamics (SIAM, 1998).
[14] W. Press, S. Teukolsky, W. Vetterling, and B. Flannery, [26] C.-S. Yih, Fluid Mechanics (McGraw-Hill, 1969).
Numerical Recipes in C++: The Art of Scientific Com- [27] P. J. Dellar, J. Comp. Phys. 190, 351 (2003).
puting (Cambridge University Press, 2002). [28] Z. Guo and C. Zheng, Phys. Fluids 14, 2007 (2002).
[15] D. Hänel, Einfuehrung in die kinetische Theorie der
y
c1 c8 c7
c2 c6
x
c3 c4 c5
Figure 1
Figure 2
1
0.8
0.6
ux
0.4
Figure 3
(a)
−3
10
−4
10
Error
−5
10
−2 Slope
Inamuro
−6 Zou/He
10
Regularized
Finite difference
−7
Nonlinear finite difference
10 1 2 3
10 10 10
Grid resolution N
Figure 4a
(b)
5
10
Inamuro
Zou/He
Regularized
Maximum Reynolds number
4
10 Finite difference
Nonlinear FD
3
10
2
10
1
10
50 100 150 200
Grid resolution N
Figure 4b
(a)
−3
10
Error
−4
10
−2 Slope
Inamuro
Zou/He
Regularized
−5 Finite difference
10
Nonlinear finite difference
1 2
10 10
Grid resolution N
Figure 5a
(b)
−3
10
Error
−4
10
−2 Slope
Inamuro
Zou/He
Regularized
Finite difference
Nonlinear finite difference
1 2
10 10
Grid resolution N
Figure 5b
(a) N=8
0
10
Inamuro
−2
Zou/he
10 Regularized
Finite difference
−4
10
Energy
−6
10
−8
10
−10
10
0 0.002 0.004 0.006 0.008 0.01
Time
Figure 6a
(b) N=32
Inamuro
−6
10 Zou/he
Regularized
Finite difference
−8
Energy
10
−10
10
−12
10
2 3 4 5 6
Time x 10
−3
Figure 6b
−1
10
−2
10
Error
−3
10
−2 Slope
Regularized
Finite difference
−4
Nonlinear finite difference
10
300 500 800
Grid resolution N
Figure 7
(a)
−3
10
−4
10
Error
−5 −2 Slope
10 Inamuro
Zou/He
Regularized
Finite difference
−6
Nonlinear finite difference
10 1 2
10 10
Grid resolution N
Figure 8a
(b)
6
10
Inamuro
5
Zou/He
10 Regularized
Maximum Reynolds number
Finite difference
4 Nonlinear FD
10
3
10
2
10
1
10
0
10
0 20 40 60 80 100
Grid resolution N
Figure 8b