General regularized boundary condition for multi-speed lattice Boltzmann models

16
General regularized boundary condition for multi-speed lattice Boltzmann models O. Malaspinas c,a,* , B. Chopard c , J. Latt b a Institut Jean le Rond d’Alembert - Universit´ e Pierre et Marie Curie, 4 place Jussieu - case 162, F-75252 Paris cedex 5, France b Ecole Polytechnique F´ ed´ erale de Lausanne, 1015 Lausanne, Switzerland c Universit´ e de Gen` eve, Comp. Sc. Dept., 1227 Carouge, Switzerland Abstract The lattice Boltzmann method is nowadays a common tool for solving com- putational fluid dynamics problems. One of the difficulties of this numerical approach is the treatment of the boundaries, because of the lack of physical in- tuition for the behavior of the density distribution functions close to the walls. A massive effort has been made by the scientific community to find appropriate solutions for boundaries. In this paper we present a completely generic way of treating a Dirichlet boundary for two and three dimensional flat walls, edges or corners, for weakly compressible flows, applicable for any lattice topology. The proposed algorithm is shown to be second order accurate and could also be extended for compressible and thermal flows. Keywords: lattice Boltzmann method, boundary conditions 1. Introduction The lattice Boltzmann method (LBM) is a now commonly used solver in the field of computational fluid dynamics. It is applied to a wide range of physical phenomena ranging from Newtonian, non-Newtonian (see [1, 2, 3]), to multi- phase and multi-component incompressible fluids (see [4]). Recent research has shown how to apply the LBM to compressible and thermal flows (see Shan et al. [5]). One of the difficulties with the LBM is the boundary conditions (BCs) treat- ment, since some distribution functions are unknown and have therefore to be reconstructed in an ad-hoc manner. The community has developed a large variety of different algorithms that are used for Dirichlet BCs on flat walls (see [6, 7, 8, 9] among others and a review of some of them can be found in [10]) and also on curved boundaries (see [11, 12, 13] for example). A problem of * Corresponding author Email addresses: [email protected] (O. Malaspinas), [email protected] (B. Chopard), [email protected] (J. Latt) Preprint submitted to Elsevier July 28, 2015

Transcript of General regularized boundary condition for multi-speed lattice Boltzmann models

General regularized boundary condition for multi-speedlattice Boltzmann models

O. Malaspinasc,a,∗, B. Chopardc, J. Lattb

aInstitut Jean le Rond d’Alembert - Universite Pierre et Marie Curie, 4 place Jussieu - case162, F-75252 Paris cedex 5, France

bEcole Polytechnique Federale de Lausanne, 1015 Lausanne, SwitzerlandcUniversite de Geneve, Comp. Sc. Dept., 1227 Carouge, Switzerland

Abstract

The lattice Boltzmann method is nowadays a common tool for solving com-putational fluid dynamics problems. One of the difficulties of this numericalapproach is the treatment of the boundaries, because of the lack of physical in-tuition for the behavior of the density distribution functions close to the walls.A massive effort has been made by the scientific community to find appropriatesolutions for boundaries. In this paper we present a completely generic way oftreating a Dirichlet boundary for two and three dimensional flat walls, edgesor corners, for weakly compressible flows, applicable for any lattice topology.The proposed algorithm is shown to be second order accurate and could also beextended for compressible and thermal flows.

Keywords: lattice Boltzmann method, boundary conditions

1. Introduction

The lattice Boltzmann method (LBM) is a now commonly used solver in thefield of computational fluid dynamics. It is applied to a wide range of physicalphenomena ranging from Newtonian, non-Newtonian (see [1, 2, 3]), to multi-phase and multi-component incompressible fluids (see [4]). Recent research hasshown how to apply the LBM to compressible and thermal flows (see Shan etal. [5]).

One of the difficulties with the LBM is the boundary conditions (BCs) treat-ment, since some distribution functions are unknown and have therefore to bereconstructed in an ad-hoc manner. The community has developed a largevariety of different algorithms that are used for Dirichlet BCs on flat walls(see [6, 7, 8, 9] among others and a review of some of them can be found in [10])and also on curved boundaries (see [11, 12, 13] for example). A problem of

∗Corresponding authorEmail addresses: [email protected] (O. Malaspinas),

[email protected] (B. Chopard), [email protected] (J. Latt)

Preprint submitted to Elsevier July 28, 2015

Figure 1: The D2Q9 lattice with the vectors representing the microscopic velocity set ξi. Arest velocity ξ0 = (0, 0) is added to this set.

most of the current state of the art approaches is that interpolation is neededfor geometries with corners and edges. In addition, no methodology has beenproposed for multi-speed models, such as those containing up to 121 velocitiesin 3D.

In this paper we propose a completely generic way of handling any 2D and3D on-lattice geometries (including corner and edges). Although we only discussincompressible flows and nearest-neighbor lattices, our procedure is also valid forextended lattices (as those proposed in [5]) in the case of thermal compressibleflows. This article is organized as follows. In Sec. 2 the LBM is briefly described.In Sec. 3 the general regularized boundary conditions (GRBC) are described. Itis then benchmarked in Sec. 4 against two 2D test cases, namely the Womersleyand the dipole-wall collision flows and one 3D test case, the Poiseuille flow in asquare duct. Finally we comment our results in Sec. 5.

2. Short lattice Boltzmann method introduction

The aim of this section is to remind the reader the basics of the LBM andto introduce the notations used throughout this work. For more details on theLBM, the reader should refer to [5, 1, 2, 14].

The LBM scheme for the BGK collision (for Bhatnagar, Gross, Krook [15])is given by

fi(x+ ξi∆t, t+ ∆t) = fi(x, t)−1

τ

(fi(x, t)− f (0)i (x, t)

), (1)

where fi is the is the discrete probability distribution to find a particle with

velocity ξi at position x at time t, f(0)i is the discrete Maxwell–Boltzmann

distribution, τ the relaxation time, and ∆t the discrete time step. In this paperwe are only interested in the weakly compressible case, therefore the discretevelocity set is given either by a D2Q9 (see Fig. 1)in 2D either by a D3Q15,D3Q19 or D3Q27 (see [5] for more details about lattices). The equilibrium

2

distribution is given by

f(0)i = wiρ

(1 +

ξi · uc2s

+1

2c4sQi : uu

), (2)

where ρ is the density, u is the macroscopic velocity field, Qi = ξiξi − c2sI,cs and wi the lattice speed of sound and the lattice weights respectively. Thedensity and the velocity fields are computed thanks to the following relations

ρ =

q−1∑i=0

fi =

q−1∑i=0

f(0)i , (3)

ρu =

q−1∑i=0

ξifi =

q−1∑i=0

ξif(0)i , (4)

where q is the number of discrete velocities. Doing a multi-scale Chapman–Enskog (CE) expansion (see [16, 17] for more details) one can show that theLBM–BGK scheme is asymptotically equivalent to the incompressible Navier–Stokes equations

∇ · u = 0, (5)

∂tu+ (u ·∇)u = −1

ρ∇p+ ν∇2u, (6)

with ν = c2s(τ − 12 ) being the kinematic viscosity and p the pressure.

The CE expansion is done under the assumption that fi is given by a per-turbation of the equilibrium distribution

fi = f(0)i + εf

(1)i +O(ε2), (7)

where ε 1 can be identified with the Knudsen number (see [18]).One can also show that f (1) is given by (see Latt and Chopard [8] for example)

εf(1)i =

wi2c4sQi : Π(1), (8)

where the tensor Π(1) ≡∑i ξiξif

(1)i is related to the strain rate tensor, S =

(∇u+ (∇u)T)/2 through the relation

Π(1) = −2c2sρτS. (9)

Therefore the fi can be approximated by

fi = wiρ

(1 +

ξi · uc2s

+1

2c4sQi : uu

)+wi2c4sQi : Π(1). (10)

3

Figure 2: A boundary node for the D2Q9 lattice. The dashed arrows represent the unknownpopulations.

3. Description of the general regularized boundary condition

In this section we assume that the velocity is prescribed on the boundary(Dirichlet BC). This BC can be applied for flat walls or for corners. From thealgorithmic point of view the LBM scheme is decomposed in two steps :

1. The collision

fouti (x, t) =

(1− 1

τ

)fi(x, t) +

1

τf(0)i (x, t). (11)

2. The propagationfi(x+ ξi, t+ 1) = fouti (x, t). (12)

Therefore on a boundary node there are populations that are unknown beforethe collision since they are incoming from outside the computational domain asdepicted on Fig. 2. Thus they have to be computed.

The idea is to compute all the unknown macroscopic moments, namely ρand Π(1), from the known fis (using expression (10)), the velocity field and theequation for the density (see Eq. (3)). We then construct a system of equationswhich is usually over-determined and solve it numerically.

We first define two sets of indices : the “known indices”, K, and the “un-known indices”, U , defined as

K = i|fi is known , U = i|fi is unknown . (13)

3.1. Construction of the linear system of equations

The first equation we use is the definition of ρ from Eq. (3)

ρ =∑i

fi =∑i∈K

fi +∑i∈U

fi. (14)

4

We then replace the unknown fis by their CE expansion (see Eq. (10))

ρ = ρK +∑i∈U

(ρwigi(u) +

wi2c4sQi : Π(1)

),

ρK = ρ

(1−

∑i∈U

wigi(u)

)−

(∑i∈U

wi2c4sQi

): Π(1). (15)

where we defined ρK ≡∑i∈K fi and gi as

gi(u) ≡ 1 +ξi · uc2s

+1

2c4sQi : uu. (16)

The other equations are just given by the assumption that the known fi aregiven by their CE expansion

fi = wiρgi(u) +wi2c4sQi : Π(1)

i∈K

. (17)

This usually gives an over-determined system of equations for ρ and Π(1). Thissystem is usually solved by using optimization techniques such as the leastsquares method, as discussed hereafter. Once the density and Π(1) are known,all the populations are recomputed using expression (10).

To illustrate the procedure we will consider a 2D flat boundary as depictedin Fig. 2. The two sets of indices, K and U are given by

K = 0, 1, 2, 6, 7, 8, U = 3, 4, 5. (18)

Thus the system of equations to solve will be

ρKf0f1f2f6f7f8

︸ ︷︷ ︸

b

=

56 + 1

2uy(1− uy) 0 0 − 12

49 −

23 (u2x + u2y) − 2

3 0 − 23

136 −

112 (ux − uy − u2x + 3uxuy − u2y) 1

12 − 14

112

19 −

16 (2ux − 2u2x + u2y) 1

3 0 − 16

19 + 1

6 (2ux + 2u2x − u2y) 13 0 − 1

6136 + 1

12 (ux + uy + u2x + 3uxuy + u2y) 112

14

112

19 + 1

6 (2uy − u2x + 2u2y) − 16 0 1

3

︸ ︷︷ ︸

A

·

ρ

Π(1)xx

Π(1)xy

Π(1)yy

︸ ︷︷ ︸

x

,

where ρK = f0 + f1 + f2 + f6 + f7 + f8. The standard approach to solve thiskind of overdetermined systems is to solve the following minimization problem(see Bjorck [19])

min ||A · x− b||. (19)

This problem has as a solution of the form

x = (AT ·A)−1 · (AT · b). (20)

5

Although this last step involves more computations that standard boundaryconditions, the overhead is small since the amount of nodes where the boundaryconditions are applied is usually small compared to the total amount of nodesin a standard simulation.

Similarly, one can construct a “mass conserving” BC. To do so we only needto replace Eq. (15) by the mass conservation constrain

ρin = ρout, (21)

where ρin and ρout are defined as

ρin =∑

i∈opp(U)

fi, (22)

ρout =∑i∈U

fouti =∑i∈U

[(1− 1

τ

)fi(x, t) +

1

τf(0)i (x, t)

],

=∑i∈U

[(1− 1

τ

)f(1)i (x, t) + f

(0)i (x, t)

], (23)

where opp(U) stands for all indices of the microscopic velocities that are pointingin the opposite direction than those that are present in the U ensemble (in thecase of Fig. 2, opp(U) = 1, 7, 8). Using Eq. (8) it is easy to put (21) is a formsimilar to Eq. (15)

ρin = ρ

(∑i∈U

wigi(u)

)+

(1− 1

τ

)(∑i∈U

wi2c4sQi

): Π(1). (24)

The reader should be aware, that this boundary condition will not ensure exactmass conservation on the wall, but will have as an effect to reduce the massexchange between the wall and the fluid.

The method presented above can be used on two and three dimensionallattices for flat walls, edges and corners. The only limitation concerns theimplementation of the corners for D3Q15 lattices since there are only 5 knownfis in such cases and therefore not enough information is available locally.

Finally it is possible to write a system of equations to impose pressure BCs.For pressure boundary conditions one actually imposes the density ρ throughthe perfect gas law p = c2sρ. We then chose, for the construction of our systemof equations, the equation for the velocity instead of Eq. (15)

u =1

ρ

∑i

ξifi = uK +1

ρ

∑i∈U

ξi

(ρwigi(u) +

wi2c4sQi : Π(1)

), (25)

and the known populations that are written in terms of Eq. (17). This systemis non-linear and therefore more difficult (and expensive) to solve.

6

3.2. Link with other boundary conditions

In the previous subsection we described a completely generic algorithm forimplementing boundary conditions for flat walls, edges and corners. We con-structed an over-determined system of equations and solved it with a numericalmethod. A natural question would be to know if the number of equations couldnot be reduced by simple symmetry considerations in order to have as manyequations as unknowns. To keep this discussion as simple as possible, we willagain use the example of the preceding subsection of the wall depicted in Fig. 2.As in the preceding subsection we have four unknowns : ρ and Π(1). We there-fore need four equations to compute them. The first equation to be used isexpression (15). Then, similarly to what we did in Subsec. 3.1, we use Eq. (17)for the three remaining equations needed in order to compute ρ and Π(1). Fromsimple symmetry constraints we see that only four combinations of indices arepossible

K026 = 0, 2, 6, (26)

K017 = 0, 1, 7, (27)

K268 = 2, 6, 8, (28)

K178 = 1, 7, 8. (29)

The system of equation to solve would then be

ρK = ρ

(1−

∑i∈U

wigi(u)

)+

(∑i∈U

wi2c4sQi

): Π(1),

fi = wiρgi(u) +wi2c4sQi : Π(1)

i∈Kj

,

where the index j stands for 026, 017, 268 or 178. The systems with K268 andK026 have no solution since they contain no information about the off diagonal

terms of the deviatoric stress tensor Π(1)xy . The two remaining systems yield the

following solutions

j = 017 :

ρ = (3/2)(4f7 + f0 + 4f1)/(1 + uy), (30)

Π(1)xx = −(u2x + (2/3)(uy + 1))ρ+ 2(f6 + f8 + f2), (31)

Π(1)xy = −(uy + (1/3))ρux − 2(f1 − f7), (32)

Π(1)yy = (−u2y + (1− uy)/3)ρ+ 6(f1 + f7)− 2(f2 + f6 + f8). (33)

j = 178 :

ρ = (2(f7 + f1 + f8) + f0 + f2 + f6)/(1 + uy), (34)

Π(1)xx = 4(f1 + f7)− 2f8 − ρu2x, (35)

Π(1)xy = −(uy + (1/3))ρux − 2(f1 − f7), (36)

Π(1)yy = −(u2y + 1/3 + uy)ρ+ 2(f1 + f7 + f8). (37)

7

A first remark is that in the case of j = 178 we get the same value for the densityρ as the one found by the method used by Zou and He in [6]. Nevertheless,there is no way to make an a priori choice about the correct system to solve.We implemented both possibilities and the solution with j = 017 showed to bevery unstable numerically. And therefore the solution yielding the “Zou-He”-like solution for the computation of the density must be chosen as the “correct”system to solve, which seems natural since this procedure is used for a long timeto evaluate the density on boundary nodes.

We also see that there is no unique and consistent choice to a priori select theset of indices that one should use. Our approach therefore offers a completelygeneric alternative by solving the optimization problem of Eq. (19).

3.3. Extension to the multi-speed models

The LBM has been shown to be applicable in a very elegant fashion to ther-mal flows by extending the discrete velocity set at each lattice point (see Shanet al. [5]). In this framework, the neighborhood of each grid point is not any-more restricted to its nearest neighbors. This extension increases dramaticallythe number of unknown fis while adding only a very limited number of con-straints. In 2D there are 37 populations at each grid point (the number ofunknowns for a flat wall is 15). There are only 2 more constraints for a Dirich-let no slip wall, namely mass and energy conservation (which makes a total offour in 2D). Therefore the way of computing the density in a “Zou-He” fashionis not applicable anymore (see [6] for the “Zou-He” fashion of computing ρ on awall). Our approach would be completely generic in this case too and the con-struction of a system of equation similar of the one presented in Subsection 3.1will remain similar. The Chapman–Enskog expansion of distribution functionsis in this case given by

fi = wiρgi(u, θ) +1

2c4sQi : Π(1) +

1

6c6sRi : T (1), (38)

where

gi =

(1 +

ξi · uc2l

+1

2c4l

[(ξi · u)2 − c2lu2 + c2l (θ − 1)(ξ2i − c2lD)

]+ξi · u6c6l

[(ξi · u)2 − 3c2lu

2 + 3c2l (θ − 1)(ξ2i − c2l (D + 2))]

+1

24c8l

[(ξi · u)4 − 6c2lu

2(ξi · u)2 + 3c4lu4

+ 6c2l (θ − 1)((ξi · u)2(ξ2i − c2l (D + 4)) + c2lu

2(c2l (D + 2)− ξ2i ))

+ 3c4l (θ − 1)2(ξ4i − 2c2l (D + 2)ξ2i + c4lD(D + 2)

) ]), (39)

Rαβγ ≡ ξαξβξγ − c2s(ξαδβγ + ξγδβα + ξβδαγ), and T (1) is a fully symmetric rankthree tensor. Therefore there will be, for a flat wall case, 22 equations for each

8

known fi and two additional equations for mass and energy conservation, for atotal of 24 equations with nine unknowns (the density, the temperature, Π(1)

and T (1)).Furthermore the extended neighborhood of these “multi-speed” lattices re-

quire that some unknown distribution functions have to be recovered away fromthe wall. A similar approach can be applied here, with the major difference thatthe velocity is not a known quantity anymore. The boundary conditions for suchextended lattices are currently an active research topic and will be addressed ina future paper.

4. Benchmarks

In this section two and three dimensional benchmarks have been imple-mented in order to test the numerical accuracy of the general regularized bound-ary condition. The GRBC is also compared with the existing and popularRegularized BC, where the populations are reconstructed form their Chapman–Enskog expansion (see Eq. (10)) and using the symmetries of the lattice tocompute ρ and Π(1) (see [8, 10] for details). The choice of the Regularized BCfor comparison is done because it has already be implemented in many test casesand compared with numerous other existing BC (see the review paper [10]). Forcompleteness a comparison with the half-way bounce back method is also donein one of the benchmarks proposed in this section.

The planar 2D Womersley, the planar 2D Kovasznay and the square 3Dchannel flows are compared to the analytical solutions of these flows, and forthe case of the self propelled dipole the present simulations are compared withresults obtained in Clercx and Bruneau [20] by a high accuracy pseudo-spectralmethod.

In all these benchmarks, the boundaries are flat walls or corners (in 2D) orflat walls, edges or corners (in 3D). They are all implemented with the methoddescribed in the preceding section. The lattice used for the 3D benchmarks isthe D3Q19.

Two different measures of the error are used in this section :

1. The L2 error, E2, which is defined as

E2 =

√1

M

∑i

||ua(xi)− us(xi)||2, (40)

2. The maximum error, Emax, which is computed as

Emax =√

maxi||ua(xi)− us(xi)||2, (41)

where ua and us stand respectively for the analytical and simulated solutions,the sum is carried out over the M nodes of the computational domain.

9

4.1. The 2D Womersley flow

The Womersley flow takes place in the same geometry as the planar channelflow. The main difference is that the flow is driven by a time periodic pressuregradient. The analytical solution was proposed by Womersley [21]. Let theamplitude of the pressure oscillations be denoted by A, and the frequency byω , then

∂xp = −A cos(ωt). (42)

The Reynolds number, Re = ULy/ν, is defined with respect to the characteristiclength L = Ly and to the velocity in the middle of the channel when ω →0. A second dimensionless parameter is defined to characterize the flow : theWomersley number, α, defined as

α =Ly2

√ω

ν. (43)

With respect to the Reynolds and the Womersley numbers the Womersley profileis given by

ux(y, t) =

Re

eiα2

Re t8

iα2

1−cosh

(√2(α+ iα)

(y − 1

2

))cosh

(√22 (α+ iα)

) , (44)

where i is the imaginary unit, and Re represent the real part of the expression.The flow is induced by imposing the analytical profile of Eq. (44) on the

inlet and on the outlet. The error of the Womersley flow is computed as theaverage over a period of time

〈E2〉 =1

T

∑j

E2(tj), (45)

where T is the period and the sum is made over each time-step of a period, andalso in terms of the maximal temporal error

maxE2 ≡ maxiE2(ti), (46)

where i ranges on all the time increments in one period.The Reynolds number is taken to be Re = 1, the lattice velocity is set to

U = 0.01 at a reference resolution of N = 10 and α = 2. As can be seen onFig. 3 the error is of order two as expected.

4.2. The 2D Kovasznay flow

The Kovasznay flow (see [22]) is an analytical solution of the steady in-compressible Navier–Stokes equations where one considers the flow behind a

10

GRBC MaxSlope -2

Figure 3: The error of the Womersley solution with respect to the resolution in lattice units.

two-dimensional periodic grid with spacing Ly. The Reynolds number is de-fined as Re = LyU/ν, where U is the average x velocity. The analytical solutionis given by

ux = 1− exp(λx) cos(2πy), (47)

uy =1

2πλ exp (λx) sin (2πy) , (48)

p =1

2(1− exp (2λx)) . (49)

where λ = Re/2−√

Re2/4 + 4π2. We use this benchmark to test the accuracy

not only of the velocity field but also of the pressure. We consider the compu-tational domain to be of extent Ly in each direction and impose the velocity onall boundaries. The L2 and maximum errors on the pressure are computed as

E2(p) =

√1

M

∑i

||ua(xi)− us(xi)||2, (50)

Emax(p) =√

maxi||ua(xi)− us(xi)||2. (51)

The parameters of the simulation are chosen as Re = 40, and the referencevelocity and resolution as U = 0.01 and N = 50. The numerical results inFig. 4, shows that the GRBC yields a second-order accuracy for the velocityerrors and first order accuracy for the pressure.

11

(a) (b)GRBC Max

Slope -2

GRBC MaxSlope -1

Figure 4: The maximum and L2 errors for the (a) velocity, and (b) pressure fields.

4.3. The 2D dipole–wall collision

This benchmark, based on Refs. [20] and [23], analyzes the time evolutionof a self-propelled dipole confined within a 2D box. The geometry of the boxis a square domain [−L,L] × [−L,L], surrounded by no-slip walls. The initialcondition describes two counter-rotating monopoles, one with positive core vor-ticity at the position (x1, y1) and the other one with negative core vorticity at(x2, y2). This is obtained with an initial velocity field u0 = (ux, uy) which readsas follows in dimensionless variables :

ux = −1

2‖ωe‖ (y − y1)e−(r1/r0)

2

+1

2‖ωe‖ (y − y2)e−(r2/r0)

2

, (52)

uy = +1

2‖ωe‖ (x− x1)e−(r1/r0)

2

− 1

2‖ωe‖ (x− x2)e−(r2/r0)

2

. (53)

Here, ri =√

(x− xi)2 + (y − yi)2, defines the distance to the monopole centers.The parameter r0 labels the diameter of a monopole and ωe its core vorticity.

The average kinetic energy of this system at a given time is defined by theexpression

〈E〉 (t) =1

2

∫ 1

−1

∫ 1

−1‖u‖2 (x, t)d2x, (54)

and the average enstrophy by

〈Ω〉 (t) =1

2

∫ 1

−1

∫ 1

−1ω2(x, t)d2x, (55)

where ω = ∂xuy − ∂yux is the flow vorticity.The dipole described by Eqs. (52) and (53), under the actions of viscous

forces, develops a net momentum in the positive x-direction and is self-propelledtowards the right wall. The collision between the dipole and the wall is charac-terized by a turbulent dynamics where the wall acts as a source of small-scalevortices that originate from detached boundary layers. After the first collision

12

(a) (b)

Figure 5: Numerical accuracy in the 2D dipole-wall collision flow for the two enstrophy peaks,(a) ω1 = 933.6, and (b) ω2 = 305.2. The error curves for the enstrophy peak obtained withthe Regularized and bounce-back BCs are also added for comparison purpose.

the monopoles under the action of viscosity are re-propelled against the wall.These collisions give rise to two peaks of enstrophy. The value of these localmaxima will be used for comparison of our boundary condition with the resultsobtained with a spectral method in Ref. [20].

In the benchmark, the initial core vorticity of the monopoles is fixed toωe = 299.5286, which leads to an initial average kinetic energy of E(0) = 2.Furthermore, the Reynolds number and the monopole radius are set to Re = 625and r0 = 0.1. The monopoles are aligned symmetrically with the box, in sucha way that the dipole-wall collision is frontal and takes place in the middleof a wall. The positions of the monopole centers are (x1, y1) = (0, 0.1) and(x2, y2) = (0,−0.1). The approach of Ref. [23] is used to set up the initialcondition. The initial pressure is evaluated numerically, by solving the Poissonequation with a successive over relaxation (SOR) scheme, using the algorithmdescribed e.g. in Ref. [24]. The off-equilibrium parts of the particle populationsare then computed with the help of Eq. (8), with numerically computed velocitygradients. The error, Ei = (ωi−ωi lb)/ωi, (i = 1, 2 is the label of the enstrophypeak, and ωi lb is the value computed with the LBM) is computed with respectto the values found in Ref. [20] : ω1 = 933.6 and ω2 = 305.2.

The numerical results in Fig. 5, for a Reynolds number Re = 625, indicatethat the GRBC yields the expected second-order accuracy for the first peakand yields indistinguishable results when compared to the Regularized BC. Onecan also see that when compared with the half-way bounce back BC, the resultsobtained by the GRBC and the Regularized BCs are of better accuracy since theerror for the first peak is smaller by a factor of two and by an order of magnitudefor the second peak. It is striking that the value of the second enstrophy peakis very much more accurately represented than the first one, even when the firstpeak has a 5% error. It should also be noted that at a resolution of N = 1500the second enstrophy peak, ω2 lb = 305.2, is exactly equal to the value foundin [20].

13

GRBC MaxRegularized

Slope -2

Figure 6: (Numerical accuracy in a 3D channel flow. The error curve of the Regularized BCis also present for comparison purpose.

4.4. The 3D square Poiseuille flow

This benchmark describes the steady flow in a 3D rectangular cylinder. Thegeometry of the channel extends in the z-direction. It has a rectangular crosssection, with x = 0, .., L and y = 0, .., βL where β is the aspect ratio of therectangle. The pressure is a linearly decreasing function of z. By symmetry, theonly non-null component of the velocity is along the z-direction and is dependingonly on x and y. The reference velocity U is taken as the maximum velocityin the channel. The pressure drop is the same in the 3D as in the 2D case :∂p/∂z = −8/Re. The complete analytic solution to this 3D channel flow is(see Yih [25] for example)

uz(x, y) = 4(x− x2) +32

π3

+∞∑n=0

((−1)n

(2n+ 1)3

cos ((2n+ 1)πx)cosh

((2n+ 1)πyβ

)cosh

((2n+ 1)π2β

)). (56)

Fig. 6 shows the numerical accuracy at Re = 10. The reference velocity isU = 0.01 at N = 50, and the aspect ratio is β = 1. The numerical results inthis 3D benchmark are similar to those of the 2D application in Sec. 4.1 andthe accuracy is again of second order as expected. Furthermore the results arevery similar to those obtained with the Regularized BC.

14

5. Conclusion

In this work we presented a generic way of handling flat walls and corners onboundaries for the lattice Boltzmann method. The boundary conditions wereapplied in 2D and 3D benchmarks and all of them showed a second order ac-curacy. Furthermore on two very different benchmarks they not only showedto be second order accurate but also to quantitatively give the same resultsas the Regularized BC, which is a widely used and validated BC. Thanks tothe genericity of the procedure, this boundary condition can be applied to lat-tice Boltzmann method for thermal flows and we are currently working on thisadaptation.

[1] S. Succi, The lattice Boltzmann equation for fluid dynamics and beyond,Oxford University Press, Oxford, 2001.

[2] B. Chopard, A. Dupuis, A. Masselot, P. Luthi, Cellular Automataand Lattice Boltzmann techniques: an approach to model and sim-ulate complex systems, Adv. Compl. Sys. 5 (2002) 103–246, doi:10.1142/S0219525902000602.

[3] O. Malaspinas, Lattice Boltzmann method for the simulation of viscoelas-tic fluid flows, PhD dissertation, EPFL, Lausanne, Switzerland, URLhttp://library.epfl.ch/theses/?nr=4505, 2009.

[4] X. Shan, H. Chen, Lattice Boltzmann model for simulating flows withmultiple phases and components, Phys. Rev. E 47 (1993) 1815–1819, doi:10.1103/PhysRevE.47.1815.

[5] X. Shan, X.-F. Yuan, H. Chen, Kinetic theory representation of hydro-dynamics: a way beyond the Navier Stokes equation, J. Fluid Mech. 550(2006) 413–441, doi:10.1017/S0022112005008153.

[6] Q. Zou, X. He, On pressure and velocity boundary conditions for the latticeBoltzmann BGK model, Phys. Fluids 9 (1997) 1592–1598.

[7] P. A. Skordos, Initial and boundary conditions for the lattice Boltzmannmethod, Phys. Rev. E 48 (1993) 4823–4842.

[8] J. Latt, B. Chopard, Lattice Boltzmann Method with regularized non-equilibrium distribution functions, Math. Comp. Sim. 72 (2006) 165–168.

[9] J. C. G. Verschaeve, Analysis of the lattice Boltzmann Bhatnagar-Gross-Krook no-slip boundary condition: Ways to improve accuracy and stability,Phys. Rev. E 80 (3) (2009) 036703, doi:10.1103/PhysRevE.80.036703.

[10] J. Latt, B. Chopard, O. Malaspinas, M. Deville, A. Michler, Straight ve-locity boundaries in the lattice Boltzmann method, Phys. Rev. E 77 (5)(2008) 056703–+, doi:10.1103/PhysRevE.77.056703.

15

[11] M. Bouzidi, M. Firdaouss, P. Lallemand, Momentum transfer of aBoltzmann-lattice fluid with boundaries, Phys. Fluids 13 (11) (2001) 3452–3459, doi:10.1063/1.1399290.

[12] M. Junk, Z. Yang, One-point boundary condition for the lat-tice Boltzmann method, Phys. Rev. E 72 (6) (2005) 066701, doi:10.1103/PhysRevE.72.066701.

[13] I. Ginzburg, D. d’Humieres, Multireflection boundary conditions forlattice Boltzmann models, Phys. Rev. E 68 (6) (2003) 066614, doi:10.1103/PhysRevE.68.066614.

[14] D. A. Wolf-Gladrow, Lattice-Gas Cellular Automata and Lattice Boltz-mann Models: An Introduction, Springer-Verlag, Berlin, 2000.

[15] P. L. Bhatnagar, E. P. Gross, M. Krook, A Model for Collision Pro-cesses in Gases. I. Small Amplitude Processes in Charged and Neu-tral One-Component Systems, Phys. Rev. 94 (3) (1954) 511–525, doi:10.1103/PhysRev.94.511.

[16] S. Chapman, T. G. Cowling, The mathematical theory of nonuniform gases,Cambridge University Press, Cambridge, 1960.

[17] B. Chopard, M. Droz, Cellular Automata Modeling of Physical Systems,Cambridge University Press, 1998.

[18] K. Huang, Statistical Mechanics, J. Wiley, New York, 1987.

[19] A. Bjorck, Numerical Methods for Least Squares Problems, SIAM,Philadelphia, 1996.

[20] H. J. H. Clercx, C.-H. Bruneau, The normal and oblique collision of a dipolewith a no-slip boundary, Comput. Fluids 35 (2006) 245–279.

[21] J. R. Womersley, Method for the calculation of velocity, rate of flow andviscous drag in arteries when the pressure gradient is known, J. Physiol.127 (1955) 553–563.

[22] L. I. G. Kovasznay, Laminar flow behind a two-dimensionalgrid, Math. Proc. Cambridge Philos. Soc. 44 (1948) 58–62, doi:10.1017/S0305004100023999.

[23] J. Latt, B. Chopard, A benchmark case for lattice Boltzmann: turbulentdipole-wall collision, Int. J. Mod. Phys. C 18 (2007) 619–626.

[24] M. Griebel, T. Dornseifer, T. Neunhoeffer, Numerical simulation in fluiddynamics: a practical introduction, Society for Industrial and AppliedMathematics, Philadelphia, PA, USA, ISBN 0-89871-398-6, 1998.

[25] C.-S. Yih, Fluid Mechanics, McGraw-Hill, London, 1969.

16