Professional Documents
Culture Documents
y
as moments of the particle populations. The particle
density stands for the moment of order 0, and the fluid
momentum u for the moment of order 1:
q1
X
= fi and (1)
c1 c8 c7
i=0
q1
X
c2 c6 u = ci f i . (2)
x i=0
fi (r, t) = i (f0 (r, t), f1 (r, t), fq1 (r, t)). (6)
Lattice Boltzmann simulations are executed on a reg-
ular grid. The state of the system consists of q variables The collision is followed by a streaming step, which takes
fi , i = 0 q 1 on each grid node, called particle pop- the post-collision variables to a neighbor node deter-
ulations. The topology of a lattice is defined by q lattice mined by the corresponding lattice vector:
vectors ci , i = 0 q 1. Thus, a node attributed to
the space location r finds its neighbors at the location fi (r + ci , t + 1) = fi (r, t). (7)
r + ci . Figure 1 displays these vectors for the D2Q9 lat-
tice, a common candidate for the implementation of 2D LB models possess exact mass and momentum conserva-
simulations [2, 3]. tion laws which are not subject to numerical approxima-
The hydrodynamic variables on each node are defined tion. This is expressed by the fact that the pre-collision
3
populations fi and their post-collision counterparts fi in Eqs. (1) and (2) obey the NavierStokes equation for
yield the same mass and momentum. Thus, a weakly compressible fluid. Only the results of this
X analysis are shown here, and the reader is referred to
i = 0 and (8) Refs. [1, 3] for more details. In this analysis, the LB
i dynamics is developed into a truncated Taylor series in
X
ci i = 0. (9) space and time, up to second order accuracy. Further-
i more, to separate physical phenomena happening at dif-
ferent scales, the particle populations are expanded into a
The common LBGK model [1] approximates the colli-
power-law
P series with respect to a small parameter 1:
sion operator as a relaxation of the particle populations
fi = k=0 k fik . The two first terms, of order O(0 ) and
to a local equilibrium distribution fieq , which depends
order O(1 ), are sufficient to recover asymptotically the
only on the value of and u:
dynamics of the NavierStokes equation. Thus, the ap-
i = (fi fieq (, u)). (10) proximation
(0) (1)
The parameter determines the inverse time scale of the fi = fi + fi + O(2 ) (15)
relaxation process. The local equilibrium depends only
on the macroscopic variables and u. It can be viewed is made. The same approximation is applied to develop
as a truncated expansion of the Maxwell-Boltzmann dis- the time derivative over two scales:
tribution and is written as
t = t1 + 2 t2 + O(3 ). (16)
eq 1 1
fi (, u) = ti 1 + 2 ci u + 4 Qi : uu . (11)
cs 2cs Space derivatives are analyzed at a single scale:
The scalar product between two vectors is denoted by a = 1 + O(2 ). (17)
single dot (), and the contraction between two tensors by
a colon (:). The tensors Qi are defined as Qi = ci ci c2s I The parameter is used in analytical developments to
for i = 0 q 1, where I is the identity. The scalars ti formally separate time scales, but it is skipped in the
are lattice weights that account for the varying lengths remaining of this article to enhance readability. The
of the lattice vectors ci . Thus, a lattice is fully defined asymptotic and scale separated form of the mass and
by means of the lattice vectors ci , the lattice weights momentum conservation laws in Eqs. (9) and (8) can be
ti , and the speed of sound c2s . The benchmarks in this written as follows:
paper make use of the 2D lattice D2Q9 and the 3D
lattice D3Q19. On the D2Q19 lattice, with the order- t + (u) = 0 and (18a)
ing of indexes used in Fig. 1, the lattice weights are
t0 = 4/9, ti = 1/9 for i {2, 4, 6, 8} and ti = 1/36 t (u)+
for i {1, 3, 5, 7}. The speed of sound on this lattice is
defined as c2s = 1/3. The lattice-specific constants for the (0) (1) 1 (0) (0)
+ + t + R = 0,
D3Q19 lattice can be found for example in Refs. [2, 3]. 2
A remarkable property of the equilibrium distribution (18b)
is that it has the same momenta as the particle popula-
tions for the conserved variables and u: where the operator denotes a divergence on the last
index of the involved tensors. The tensors (0) , (1) ,
q1
and R(0) are velocity moments equivalent to those de-
fieq
X
= and (12) fined by Eqs. (3) and (4), but evaluated on the com-
i=0 (0) (1)
ponents fi and fi of the particle populations. The
q1
nature of the physics described by the momentum equa-
ci fieq .
X
u = (13) tion, Eq. (18b), depends on the form of these tensors. In
i=0 (0)
the case of the LBGK model, the component fi of the
Through the multi-scale analysis in the next section, particle populations is equal to the equilibrium distribu-
this parameter can be formally related to the kinematic tion:
shear viscosity of the fluid:
(0)
fi = fieq (, u). (19)
2 1 1
= cs . (14)
2 Assuming a low Mach-number regime, Eqs. (18a) and
(18b) are then equivalent to the NavierStokes equations
for a weakly compressible fluid with fixed bulk viscosity.
B. Multi-scale analysis Given that the series development of the dynamics was
taken up to second order, the LB method is argued to be
Through a multi-scale analysis of the LBGK model, second-order accurate in space and time for the numerical
it can be shown that the macroscopic variables defined simulation of weakly compressible fluids.
4
(1)
contribution fi according to Eqs. (15) and (19). practically all authors of velocity boundary conditions.
A The actual mass balance is influenced by the com- It is therefore applied throughout in this article, for all
putation of the density on boundaries explained in Sec- boundary conditions and for all benchmark problems in
tion III A The actual mass balance is influenced by the Section V.
computation of the density on boundaries explained in The density of a boundary node can be split into three
Section III An important constraint in determining these components. The first, , is the sum of the unknown
values is given by the conservation laws in Eqs. (8) and particle populations, the second, + , is the sum of the
(9). Exact local mass and momentum conservation are particle populations opposite to the unknown ones, and
pillars of the LB method, as they ensure among others the third, 0 , sums up the particle populations whose
an exceptional numerical stability. It is therefore desir- lattice vector is perpendicular to the boundary normal
able that they are respected on boundary nodes as well. or zero. Let u be the projection of the velocity on the
This is achieved by making sure that mass and momen- boundary normal pointing outside of the numerical grid.
tum, as computed from Eqs. (1) and (2), yield exactly Then, the particle density of the boundary node is
the desired value. In that case, conservation laws are
automatically verified, as it is seen by inserting Eq. (10) = + + + 0 , (25)
into Eqs. (8) and (9), and using the properties of Eqs. and the normal momentum
(12) and (13). The following sections do therefore not
refer to conservation laws, but instead insist on an ac- u = + . (26)
curate implementation of Eqs. (1) and (2), without any
numerical approximation. It should be pointed out for These equations are combined to obtain
clarity that even though these conservation laws guar- 1
antee equal mass in the pre- and post-collision state of = (2 + + 0 ), (27)
a cell, they do not guarantee global mass conservation 1 + u
in the system. It has been pointed out in Ref. [5] that a which is independent of the unknown quantity . On
simulation may gain or loose mass during time evolution, the D2Q9 lattice of Fig. 1, and on a top grid node shown
even with no-slip boundaries. An interpretation of this in Fig. 2, the variables above are defined as follows. The
fact is that the actual mass balance is influenced by the partial densities are = f3 + f4 + f5 , + = f7 + f8 + f1
computation of the density on boundaries explained in and 0 = f2 + f6 + f0 . The normal velocity is given by
Section III A the y-component of the boundary velocity, and Eq. (27)
The first step toward the implementation of a bound- becomes
ary condition is the construction of the equilibrium distri-
1
bution, defined in Eq. (11), from and u. The velocity = (2 (f3 + f4 + f5 ) + f2 + f6 + f0 ). (28)
u is known by definition on velocity boundaries. The 1 + uy
value of the particle density is however missing, and it This method can obviously only be applied to straight
needs to be computed by a method described in the next boundaries. On other types of boundaries, for example
section. on corner nodes, the locally available information on a
cell may be insufficient for the evaluation of the density.
In that case, it is common to extrapolate the density from
A. Evaluation of the density on boundaries neighboring bulk cells. For the benchmarks problems in
Section V, second-order accurate extrapolation is used
With a Dirichlet velocity boundary condition, the to evaluate the pressure in the 4 corners in 2D problems,
incompressible NavierStokes equations always yield a and in the 8 corners and the 12 edges in 3D problems.
unique solution. No additional boundary condition for
the pressure is required. With traditional numerical
solvers for the NavierStokes equations, this fact is obvi- B. Preserving the known particle populations
ous, because the pressure is not treated as an independent
variable. Instead, it is viewed as a functional of the ve- The two boundary conditions BC1 and BC2 intro-
locity field, and may be determined by solving a Poisson duced in Section IV compute values for the unknown par-
equation. ticle populations only, and leave the others untouched.
The lattice Boltzmann approach on the other hand By doing so, they exploit all the information available
uses a quasi-compressible method to solve the Navier from the LB dynamics in the bulk of the simulation. As
Stokes equations. The fluid density , is simulated as it is shown in Section V, they are rewarded by achieving
an independent variable in a regime close to fluid incom- more accurate results in 2D flows, but lose this advantage
pressibility, and related to the pressure through Eq. (5). in 3D problems.
As it is shown in this section, the value of the density can As it is pointed out in the introduction to Section III, it
however be determined on straight walls from the known is important to ensure the equations for the density and
particle populations (indicated by solid arrows in Fig. 2) the velocity, Eqs. (1) and (2), accurately on the bound-
and the value of the velocity. This method is used by ary nodes. It is clear from Section III A that the particle
6
x
u
required to match the number of unknown particle popu- 0.4
lations, which amount to 3 on the D2Q9 lattice, and to 9
(for D3Q27) or 5 (for D3Q19 and D3Q15) on 3D lattices.
It was argued in Section II B that the hydrodynamic 0.2 Poiseuille profile
limit of the lattice Boltzmann equation is expressed in Equilibrium on boundary
terms of the quantities , u and (1) . To help understand Regularized boundary condition BC3
0
the boundary conditions from a hydrodynamic point of 0 0.2 0.4 0.6 0.8 1
view, it is therefore good to reinterpret the closure rela- yposition in channel
tions suggested by the authors of boundary conditions as
closure relations for the values of the stress tensor (1) . FIG. 3. 2D channel flow, simulated once with an equilibrium
As (1) is symmetric, this introduces a set of 3 equations distribution on boundaries, and once with the Regularized
in 2D, and 6 equations in 3D, which are enforced by Eq. boundary condition BC3. The solid line plots the analytic
(3). Some of the equation for (1) (Eq. (3)) are however Poiseuille profile. Although only 11 data points are used to
resolve the channel width, the result obtained with BC3 is
linearly dependent on those for u (Eq. (2)). In the 2D
(1) visually indistinguishable from the Poiseuille profile. With
example illustrated in Fig. 2, the equation for xy de- equilibrium boundaries on the other hand, the velocity gra-
pends linearly on the equation for ux , and the equation dients are ill represented on boundary nodes, which impairs
(1) the accuracy of the whole simulation.
for yy depends on the one for uy . Generally speak-
ing, an amount of d equations for the tensor components
(1)
n , for = 0 d 1, are linearly dependent on the
equations of u . Here, the index n labels the direction of
As a result, the quality of the simulation is spoiled, not
the boundary normal (in the above example, this is the
only close to boundaries, but in the full simulated do-
y-index). In 2D in particular, the two equations for u
main. The expected second-order accuracy cannot be
and the remaining equation for (1) yield three closure
reached. To illustrate this issue, Figure 3 displays the
relations, in the same amount as when a closure relation
velocity profile obtained for the steady-state solution of
is introduced for each of the missing particle populations.
a 2D channel flow. The no-slip (zero velocity) walls are
implemented once via this equilibrium approach, and
once with the obviously more accurate boundary con-
C. Replacing all particle populations dition BC3. An exact visual match between the exact
analytical solution and the numerical result is obtained
The boundary conditions BC3, BC4 and BC5 de- with the accurate boundary condition. With the equilib-
scribed in Section IV use the known particle populations rium boundary condition on the other hand, the numeri-
only to compute the particle density and, in the case cal values are far from the analytical curve. Although the
of BC3, the stress tensor (1) . After this, they disregard velocity has a correct no-slip value on the boundary, the
all particle populations and replace their value by new velocity gradient starts out erroneously. This confirms
ones, based on the velocity and the computed macro- the theoretical considerations of the previous section, in
scopic variables. As they treat all particle populations in which the O(0 ) components of the particle populations
the same way, they can be formulated generically and are are shown to represent macroscopic variables, and the
easily implemented on various 2D and 3D lattices. Fur- O(1 ) components their gradients.
thermore, they turn out to be more stable than BC1 and
BC2, and can therefore be used at substantially higher
Reynolds numbers. IV. PRESENTATION OF THE REVIEWED
A tempting approach to setting up such velocity BOUNDARY CONDITIONS
boundaries might be to initialize all particle populations,
the known and the unknown ones, to their equilibrium The five boundary conditions listed in Table I are ana-
distribution with the imposed velocity and the density lyzed in this review paper. The table specifies whether a
computed from Eq. (28). It is however clear from the dis- boundary condition replaces all particle populations by
cussion in Section II B that this method is inappropriate, a new value, or only the unknown ones. It also states
as it respects the O(0 ) contributions to the dynamics, whether they are local to a given boundary node, or if
but neglects the hydrodynamically relevant O(1 ) terms. they need to access neighboring nodes in order to execute
7
of the stress tensor. The method described in the intro- (23). Let the opposite opp(i) of a lattice direction i be
duction of Section IV is now applied to evaluate (1) for defined by the relation copp(i) = ci . Then, Eq. (23)
the D2Q9 lattice, by making use of a computer algebra is symmetric under the operation of taking the opposite
system. The following values are found: direction:
fi
(1) (1)
= fopp(i) . (35)
(1)
xx = (33a)
9(1 3uy )2 ( 2Syy 3uy + 3u2y )
This relation can be used to copy data from known par-
10Sxx Syy (1 3uy )2 + 6Sxy
2
(1 3uy + 3u2y ) ticle populations to the opposite, unknown ones. It may
(3uy 1) 5Sxx (1 + 6uy 12u2y + 9u3y ) however not be applied blindly to all unknown particle
populations, because this would conflict with Eq. (2) for
1
+Syy u2x (3 9uy ) + 18ux Sxy ( uy + u2y ) , the velocity. On a D2Q9 lattice for example, there is re-
3 ally only one degree of freedom left on which the bound-
2
(1)
yy = Syy , and (33b) ary condition may have an influence. The choice made in
3 the case of BC2 was to apply Eq. (35) to the unknown
2 particle population whose lattice vector is parallel to the
(1)
xy = Sxy . (33c)
3 boundary normal. Thus, for an upper boundary in a
The tensor components yy and xy yield an exact D2Q9 lattice, the following relation is applied:
match with the value expected from Eq. (21). As has (1) (1)
been pointed out in Section III B, this is a direct corol- g 4 = f8 . (36)
lary of the fact that the equation for the velocity, Eq. (2), (1) (1)
is satisfied. The component xx is the only free parame- The remaining two unknown populations g3 and g5 are
ter on a D2Q9 lattice, and can be viewed as a signature computed by enforcing the values of the velocity through
of how the boundary condition influences the hydrody- Eq. (2). On a D2Q9 lattice, the obtained values are
namics of the fluid. In its present form, Eq. (33a) is not (1) 1 (1)
(1) (1)
very enlightening. It is therefore expanded into a finite g 3 = f7 + (f6 f2 ) and (37)
2
Taylor series, for small values of the components Sxx , Syy (1) (1) 1 (1) (1)
and Sxy . It is assumed that, in the limit of fluid incom- g5 = f1 + (f2 f6 ). (38)
2
pressibility, the Mach number Ma, and thus the velocity
u in lattice units, scales like the small parameter [11]. The value of the unknown particle populations is con-
The components of the strain rate tensor S exhibit there- structed by adding equilibrium and off-equilibrium parts:
fore order O(2 ) scaling. From the above Taylor series, (1)
gi = fieq (, u) + gi for i = 3, 4, 5. (39)
only terms of order O(2 ) are kept, and terms of the form
S S or S u are neglected. This leads to the follow- All other populations are kept as they are:
ing approximation of Eq. (33a):
g i = fi for i = 0, 1, 2, 6, 7, 8. (40)
5
(1)
xx = Sxy + O(3 ). (34) Like the Inamuro method BC1, the Zou/He method
9
BC2 enforces the value of the velocity explicitly, but does
This expression is close to the hydrodynamic tensor value not specify anything about the stress tensor. The values
in Eq. (21), although the factor 5/9 differs from the ex- of (1) can again be computed for the D2Q9 lattice, us-
pected factor 2/3 by 20%. This error has however no ing the procedure described in the introduction of Section
important effect in practice, and the Inamuro method IV. The resulting expressions match exactly the hydro-
is even found to be more accurate than the other ap- dynamic values of (1) claimed in Eq. (21). This con-
proaches in low-Reynolds applications. One may how- firms analytically the validity of the Zou/He boundary
ever point out that as a consequence of Eq. 34, the trace condition for 2D simulations.
of (1) is non-zero with BC1. This is a violation of the This algorithm cannot be used as it stands in 3D. In
continuity equation, because it is deduced form Eqs. (21) that case, Eq. (2) yields three independent equations, but
and (22 that the trace of (1) is proportional to u in the number of unknowns is larger (5 or 9). In that case,
the hydrodynamic limit. the authors of Ref. [7] suggest to proceed as follows. To
begin with, the off-equilibrium bounce-back rule, Eq.
(35), is applied to assign a value to all missing particle
B. Zou/He method (BC2 )
populations. By doing this, the exact value of the com-
ponent u is recovered for the index in direction of
The boundary condition BC2 by Q. Zou and X. He the boundary normal. To keep this relation valid, the
is based on an idea referred to by its authors as apply- sum over the value of the unknown particle populations
ing the bounce-back rule to off-equilibrium parts. This is kept invariant during subsequent operations. The ex-
expression can be understood as a reference to a symme- cess of momentum is then evaluated in the remaining
(1)
try property of the variables fi that follows from Eq. directions:
9
uses the same principles as BC4, but also includes the depend only on the dimensionless Reynolds number, de-
non-linear velocity contributions to the particle popula- fined as a function of the kinematic fluid viscosity :
tions. This approach has not been published previously
in the literature, and serves only as a toy model to exper- UL
Re = . (47)
iment with the limits of BC4. It is explicited as follows:
ti The parameters used for the numerical implementation
gi = fieq (, u) 2 Qi : u ci : uu are described by the number N , which is the number of
cs
grid nodes used to resolve the length L, and the veloc-
1
+ 2 (ci )(Qi : uu) ity Ulb , representing the velocity U in a system of lat-
2cs tice units. This is a common choice in LB simulations,
for i = 0 q 1. (46) because Ulb is proportional to the Mach number of the
fluid. It can therefore be fine-tuned to make sure the flow
For the implementation of this method, the gradients of is close enough to the limit of incompressibility. For the
the components of the tensor uu need to be evaluated via numerical implementation of the benchmarks, the pre-
a finite difference scheme, additionally to the gradients scribed velocity field for the initial and/or boundary con-
of u. dition needs to be converted from dimensionless variables
to lattice units. This is simply done by multiplying the
dimensionless velocity by Ulb . Finally, the parameters x
V. BENCHMARKS and t , which stand for the size of a grid interval, and
the time lapse of an iteration, are expressed as follows in
This section produces the results of lattice Boltzmann dimensionless variables:
simulations, based on the five reviewed boundary con- 1
ditions. For some of the simulated problems, analytical x = and (48)
N 1
solutions are known for the steady state of the flow. In t = x Ulb .
that case, the simulation is iterated until a steady state is
reached. Then, the numerical result is validated against At a given time step, the numerical error is evalu-
the analytical solution on every grid point, and the mean ated by computing a l2 -norm of the difference between
discrepancy between these two values is used to evalu- the simulated velocities ulb (rk ) on grid nodes located
ate the quality of the implemented boundary condition. at position rk , and the dimensionless analytical solution
Other benchmarks focus on the time evolution of the uanalytic (rk ):
flow. They keep track of the time-evolution of a scalar v
quantity (such as the average energy in Section V C), u P 1
u 1 X
ulb (rk )
2
or the occurrence of a particular event (as the maximum
= t
uanalytic (rk )
, (49)
value of the enstrophy in Section V D). Several 2D bench- P
Ulb
k=0
marks are presented, implemented on a D2Q9 lattice, and
one 3D benchmark on a D3Q19 lattice. where the sum runs over all P nodes of the numerical
The simulated domains of all presented problems have grid.
a rectangular shape. This raises the issue of how to im- The parameters of the simulation for a varying res-
plement corner nodes and, in 3D, edge nodes that lie on olution N are adapted so as to keep the value of the
the connexion between two plane walls. Although some Reynolds number constant, and to prevent effects of
authors of boundary conditions make suggestions on how fluid compressibility from interfering with the accuracy
to treat these cases, some authors dont. To guaran- of the result. Compressibility errors compr are known
tee an equal treatment, the present article treats cor- to scale like the square Mach-number and are therefore
ners and edges always in the same way, independently of estimated by compr = O(Ulb2 ). This error is required
the boundary condition that is being tested. The finite- to decrease at least as fast as the discretization error
difference algorithm of BC5 was selected to implement x = O(1/L2lb ) = O(1/N 2 ). It follows from Eq. (47)
these special boundary nodes. This approach is straight- that this is achieved by keeping the viscosity lb constant
forward, because the velocity gradients referred to in Eq. when the grid resolution is modified.
(44) can be evaluated on corners and edges just like ev- The benchmark codes can be retrieved from the Inter-
erywhere else. It must furthermore be pointed out that net [12] address. The programs are based on the open
Eq. (28) for the particle density cannot be evaluated on source lattice Boltzmann library OpenLB [13], which is
corners and edges. In those cases, the density is extrapo- publicly available.
lated with second-order accuracy from neighboring cells.
In all benchmark problems, a velocity U and a length
L are selected that are characteristic for the flow. The A. Steady plane channel flow (2D)
dynamics of the flow is then described in a system of di-
mensionless variables, independent of the numerical grid, This 2D stationary flow evolves in a straight channel,
in which U = 1 and L = 1. The equations of motion which extends in x-direction between x = 0 and x = lx .
11
The walls of the channel are parallel to the x-axis, and Reynolds number which can be reached before numerical
defined by the equations y = 0 for the lower wall, and instabilities occur. The most accurate boundary condi-
y = ly for the upper wall. A no-slip condition for the tions, BC1 and BC2 are also the distinctly least stable.
velocity is enforced on these walls. The flow is character- Most stable boundary conditions are those based on a
ized by a constant pressure drop along the channel. This non-local algorithm, BC4 and BC5.
pressure drop can be obtained by using pressure bound-
ary conditions on the inlet and the outlet. An alternative
approach, which is used in this benchmark, is to enforce B. Oscillating plane channel flow (2D)
the velocity profile from the analytical solution of the
flow on the inlet and on the outlet. The velocity is par- This laminar channel flow is also known as Womersley
allel to the walls, and the only non-zero component ux is flow on ground of the analytical solution proposed by
independent of x: ux = ux (y). The height ly of the chan- J. Womersley [14]. It is defined by the same geometry
nel is taken to represent the characteristic length L. The as the steady flow in Section V A. The pressure gradient
maximum value of the velocity, which is measured in the is however not constant, but oscillates in time. Before
middle of the channel, is selected for the characteristic the reference velocity U can be defined, the equations
velocity U . The analytic solution to this flow is given by of the flow are written in an arbitrary system of units,
the parabolic Poiseuille profile, which, in dimensionless other than the dimensionless one. In this system, the
variables, reads amplitude of the oscillations is denoted by A, and the
frequency by :
ux (y) = 4(y y 2 ). (50)
p
The pressure drop amounts to p/x = 8/Re. = A cos(t). (51)
x
The two-dimensional channel flow is for many reasons
an inappropriate benchmark, and it is presented here in a In the low-frequency limit 0, the solution to this
historical spirit, to conform with some authors of bound- flow is defined by a succession of Poiseuille profiles, with
ary conditions that use it as a basic test case for their oscillating amplitude:
algorithm. One shortcoming of this flow as a bench-
mark case is that the components Sxx and Syy of the A
ux (y, t) = (ly y y 2 ) cos(t). (52)
strain rate tensor S vanish in the analytical solution. 2
Boundary conditions that replace only unknown particle The maximum velocity of the flow, reached in the middle
populations (BC1 and BC2 in this article) are there- of the channel at time t = n2/ for any integer value
fore automatically exempt from numerical errors. This n, is found to be
follows from the discussion in Section III B, where the
components xx (on horizontal boundaries) and yy (on A 2
vertical boundaries) of the stress tensor are shown to be umax = L . (53)
8
the only degrees of freedom for which the boundary con-
dition could possibly be wrong. If the corner nodes are This value umax is used to define the reference velocity
implemented in an appropriate way, these two methods U , as it characterizes the flow reasonably well when os-
are shown in Refs. [6] and [7] to solve the 2D channel flow cillations are slow. The reference length L is described
with a precision close to machine accuracy (the best accu- by the channel height ly . As the flow depends on time, it
racy one can expect to obtain, given the limited precision is characterized by two dimensionless parameters, which
of floating point values on a computer), independent of are the Reynolds number Re defined in Eq. (47), and the
the grid resolution. Machine accuracy is however not ex- Womersley number , defined as
hibited in the present benchmark, because we chose to r
implement corner nodes in a generic way that works for L
= . (54)
all boundary conditions and for all types of flows. 2
In this benchmark, the grid resolution is varied from
N = 25 to N = 400, and the Reynolds number is In a system of dimensionless variables described by U
Re = 10. Compressibility effects are controlled by set- and L, the time-dependent solution to this flow is given
ting Ulb = 0.01 at a grid resolution N = 50. Figure 4 (a) by the Womersley profile [14, 15]:
shows that all reviewed boundary conditions lead to the
ux (y, t) =
expected second-order accuracy with respect to grid reso-
lution. Boundary conditions BC1 and BC2 are distinctly 2 8 cosh 2( + i) y 21
i
Re t
more accurate, because their overall accuracy is only af- Re e 1 ,
i2
fected by the error in corner nodes. It is furthermore cosh 22 ( + i)
observed that the non-linear finite difference scheme of (55)
BC5 is slightly more accurate than the linear approach
of BC4. The numerical stability of boundary conditions where i is the imaginary unit, and Re means that the
is explored in Figure 4 (b) by means of the maximum real part of the formula needs to be evaluated.
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.
The error of the numerical result with respect to the the Laplacian operator with eigenvalue :
analytical solution of Eq. (55) is computed at each time
step by evaluation of Eq. (49) over the whole computa- 2 0 = 0 . (56)
tional domain. The overall error of the simulation is
The time evolution of this flow is characterized by an
defined as an average of over one time period. Only the
exponential decrease of the velocity amplitude:
asymptotic value of , reached after a large number of
iterations, is accounted for. The initial transient regime u(t) = u0 e(tt0 ) for t t0 . (57)
of the fluid, and consequently the choice of the initial
condition, are irrelevant. Among all eigenfunctions of the Laplacian, the following
In this simulation, the Reynolds number is Re = 1, initial stream function 0 was selected for the benchmark
and the lattice velocity is set to Ulb = 0.01 at a reference (expressed in dimensionless variables):
resolution of N = 10. The numerical results are plotted 1
in Fig. 5 (a) for a value of = 2 and on Fig. 5 (b) for 0 (x, y) = cos(2mx) cos(2ny), (58)
a value of = 5. All other parameters are chosen to be 2 m2 + n2
the same as in the steady channel flow. Figure 4 (a) in where x and y are contained in the interval [0, 1] and
Section V A can also be included in this discussion, as it label the two space directions. The velocity field is given
corresponds to the limit = 0 in which the flow does not by
oscillate. It should be pointed out that, as increases,
inertial effects on the flow dominate over viscous effects. 0 cos(2mx) sin(2ny)
ux,0 (x, y) = = (59a)
The velocity profile in the bulk becomes progressively
q
y m2
+1
independent of the boundary condition. As it can be n2
seen from the simulations (see Fig. 5 (b)), the result is and
practically independent of the chosen boundary condition
at a value of = 5. 0 sin(2mx) cos(2ny)
uy,0 (x, y) = = q . (59b)
x n2
+ 1
m 2
(a) = 2 (b) = 5
3 3
10 10
Error
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 a slowly (a) and rapidly (b) oscillating 2D channel, with Womersley number .
The dimensionless pressure p is converted as follows to fined within a square box. The box is located in the ge-
the density lb , expressed in lattice units: lb = 1 + ometrical domain [L, L] [L, L] and implements no-
px2 /(c2s t2 ), where the discrete steps x and t are defined slip walls. The initial condition describes two counter-
as in Eq. (48). This benchmark is formulated as an ini- rotating monopoles, one with positive core vorticity at
tial value problem. The initial condition is therefore set the position (x1 , y1 ) and one with negative core vortic-
up with special care, using an approach described in Ref. ity at (x2 , y2 ). This is obtained with an initial velocity
[17] and based on an original suggestion in Ref. [8]. The field u0 = (u0 , v0 ) which reads as follows in dimensionless
particle populations are first initialized at an equilibrium variables:
distribution, based on the desired value of u and p. The
1 2
off-equilibrium parts of the particle populations are then u0 = ke k (y y1 )e(r1 /r0 ) (62a)
instantiated with the help of Eq. (23), with numerically 2
computed velocity gradients. Although the flow is pe- 1 2
+ ke k (y y2 )e(r2 /r0 ) and
riodic in both space directions, non-periodic boundary 2
conditions are used. To obtain this, a sub-domain of the 1 2
v0 = + ke k (x x1 )e(r1 /r0 ) (62b)
full L L domain is selected for the simulation. The ve- 2
locity along the boundaries of this sub-domain is set to 1 2
ke k (x x2 )e(r2 /r0 ) .
the analytical value of Eq. 57 at every time step with the 2
help of the five tested boundary conditions.
Here, p
the distance to the monopole centers is defined as
Figure 6 displays the time-evolution of the average en- ri = (x xi )2 + (y yi )2 . The parameter r0 labels
ergy with different boundary conditions at a resolution the diameter of a monopole and e its core vorticity.
N = 8 and a resolution N = 32. The Reynolds number
The average kinetic energy of this system at a given
is Re = 1, and the reference velocity in lattice units is
time is defined by the expression
set to Ulb = 0.01 at a grid resolution N = 8. In an initial
regime, the energy decay is in all cases exponential, as 1 1
=1
Z Z
2
predicted by Eq. (57). After reaching a critical value of E(t) kuk (x, t)d2 x, (63)
the time t, the curve starts oscillating and deviates from 2 1 1
the theoretical prediction. For the non-local boundary
conditions BC4 and BC5, this deviation occurs earlier and the average enstrophy by
than for the local ones. It is therefore concluded that the 1 1
1
Z Z
non-local boundary conditions are less accurate for this
(t) = 2 (x, t)d2 x, (64)
problem. 2 1 1
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.
BC3 is the most accurate candidate in this benchmark, as the one shown in Eq. (34), might not be visible in
although it is least accurate in all benchmarks of laminar the benchmark. An unexpected result is that boundary
flows. A possible interpretation is that the finite differ- condition BC2, which in 2D applications achieves results
ence approximation of velocity gradients in BC4 and BC5 very similar to those of BC3, falls in the same category
becomes inaccurate due to small-scale velocity variations. as the non-local boundary conditions BC4 and BC5 in
In that case, the dynamics of boundary layers appears to this 3D case.
be best represented by the local, cell-based approach of
BC3.
VI. DISCUSSION AND CONCLUSION
(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.
3D flows, although it is not an explicit method, and thus to this, it is slightly more accurate and more stable. The
tends to be complicated to implement. The extension of difference is however so small that it does not seem to
BC2 to 3D flow does not seem to make much sense, as it justify the increased complexity and computational bur-
does not exhibit exceptional accuracy, and is less stable den.
than other approaches.
The Regularized boundary condition BC3 uses a hy-
brid approach, as it is local like BC1 and BC2, but it ACKNOWLEDGMENTS
replaces all particle populations like BC4 and BC5. As
a such, it is less accurate than BC1 and BC2 in lam- We thankfully acknowledge the support of the Swiss
inar flows, but it has the ability to reach much higher National Science Foundation SNF (Awards FN 200020
Reynolds numbers. Furthermore, simulations of a tur- 1007931, PBGe2117144, and FN 200021107921). We
bulent dipole-wall collision show that it reproduces the also thank Andreas Malaspinas for inspiring suggestions.
dynamics of boundary layers more accurately than all
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,
and seems to be the best candidate for high Reynolds
number flows.
The non-local boundary conditions BC4 and BC5,
which use a finite difference scheme to approximate the
off-equilibrium part of particle populations, exhibit the
best numerical stability. In the laminar 3D benchmark,
they are even unconditionally stable on a sufficiently
large grid. Their main disadvantage is the non-locality of
their algorithm. This violates the basic principles of the
LB method, may substantially increase the complexity of
a code, and even be an obstacle to parallelizing the pro-
gram in a straightforward way. On the other hand, the
boundary conditions BC4 and BC5 are very general and
may adapt well to a larger software project. They are for
example not bound to the lattice structure, and can be
extended to the case of off-lattice boundaries, like the one
described in Ref. [9]. Boundary condition BC5 takes into
account non-linear velocity terms in off-equilibrium par-
ticle populations, which are neglected in BC4. Thanks
17
[1] S. Chen and G. D. Doolen, Ann. Rev. Fluid Mech. 30, [12] LB boundary condition benchmarks. http://spc.
329 (1998). unige.ch/lb_boundaries .
[2] S. Succi, The lattice Boltzmann equation for fluid dynam- [13] The OpenLB project. http://www.openlb.org.
ics and beyond (Oxford University Press, 2001). [14] J. R. Womersley, J. Physiol. 127, 553 (1955).
[3] J. Latt, PhD dissertation, University of Geneva, [15] J. A. Cosgrove, J. M. Buick, S. J. Tonge, C. G. Munro,
Geneva, Switzerland (2007), http://www.unige.ch/ C. A. Greated, and D. M. Campbell, J. Phys. A : Math.
cyberdocuments/theses2007/LattJ/meta.html. Gen. 36, 2609 (2003).
[4] I. Halliday, L. A. Hammond, and C. M. Care, J. Phys. [16] O. Walsh, in The Navier-Stokes Equations II The-
A: Math. Gen. 35, L157 (2002). ory and Numerical Methods, edited by J. G. Hey-
[5] A. Dupuis and B. Chopard, Int. J. Mod. Phys. B 17, 103 wood, K. Masuda, R. Rautmann, and S. A. Solonnikov
(2003). (Springer-Verlag, 1991), vol. 1530 of Lecture Notes in
[6] T. Inamuro, M. Yoshina, and F. Ogino, Phys. Fluids 7, Mathematics, pp. 305309.
2928 (1995). [17] J. Latt and B. Chopard, Int. J. Mod. Phys. C 18, 619
[7] Q. Zou and X. He, Phys. Fluids 9, 1592 (1997). (2007).
[8] P. A. Skordos, Phys. Rev. E 48, 4823 (1993). [18] H. J. H. Clercx and C.-H. Bruneau, Computers & Fluids
[9] Z. Guo and C. Zheng, Phys. Fluids 14, 2007 (2002). 35, 245 (2006).
[10] W. Press, S. Teukolsky, W. Vetterling, and B. Flannery, [19] M. Griebel, T. Dornseifer, and T. Neunhoffer, Numerical
Numerical Recipes in C++: The Art of Scientific Com- simulation in fluid dynamics (SIAM, 1998).
puting (Cambridge University Press, 2002). [20] C.-S. Yih, Fluid Mechanics (McGraw-Hill, 1969).
[11] D. H anel, Einfuerung in die kinetische Theorie der [21] P. J. Dellar, J. Comp. Phys. 190, 351 (2003).
Gase und Lattice-Boltzmann-Methoden (Springer Verlag,
2004).