lattice boltzmann method - university of...

15
Seminar Lattice Boltzmann method Author: Igor Mele Mentor: prof. dr. Iztok Tiselj Ljubljana, March 2013 Abstract Lattice Boltzmann method is relatively new method in the field of computational fluid dynamics. It has been derived from lattice gas automata and is still under development. Basic steps of the LBM (collision, streaming, boundary conditions, macroscopic quantities) will be presented. Comparison with the finite difference method that uses Navier-Stokes equation on a lid driven cavity benchmark test will be made.

Upload: truongminh

Post on 07-May-2019

226 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lattice Boltzmann method - University of Ljubljanamafija.fmf.uni-lj.si/.../Lattice_Boltzmann_method.pdfthe lattice Boltzmann method (LBM). In the last 20 years, LBM developed into

Seminar

Lattice Boltzmann method

Author: Igor MeleMentor: prof. dr. Iztok Tiselj

Ljubljana, March 2013

Abstract

Lattice Boltzmann method is relatively new method in the field of computational fluid dynamics.It has been derived from lattice gas automata and is still under development. Basic steps of the LBM(collision, streaming, boundary conditions, macroscopic quantities) will be presented. Comparisonwith the finite difference method that uses Navier-Stokes equation on a lid driven cavity benchmarktest will be made.

Page 2: Lattice Boltzmann method - University of Ljubljanamafija.fmf.uni-lj.si/.../Lattice_Boltzmann_method.pdfthe lattice Boltzmann method (LBM). In the last 20 years, LBM developed into

Contents1 Introduction 2

2 Lattice gas 3

3 From LGA to LBM 43.1 BGK model equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53.2 Equilibrium distribution function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

4 Macroscopic quantities 7

5 Reynolds number 7

6 Lattice arrangements 86.1 Two-dimensional lattice arrangements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

7 Boundary conditions 87.1 Bounceback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

8 Driven cavity 2D 108.1 Driven cavity with LBM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108.2 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

9 Conclusion 11

1 IntroductionIn this seminar, a relatively new method in computational fluid dynamics will be presented. It is calledthe lattice Boltzmann method (LBM). In the last 20 years, LBM developed into an alternative andpromising numerical scheme for simulating fluid flows [1].

Transport equations (for heat, mass, momentum) can be simulated on different scales. On a macro-scopic scale, partial differential equations (PDE) like Navier-Stokes equation are used. This kind ofequations are difficult to solve analytically due to non-linearity, complicated geometry and boundaryconditions. With the help of numerical schemes like the finite difference method (FDM), finite volumemethod (FVM), finite element method (FEM), PDE is converted to a system of algebraic equations. Weusually solve these equations iteratively until satisfying results are obtained.

The second approach is to simulate small particles on a microscopic scale. This is molecular dynamics.The governing equation is the Hamilton’s equation. With molecular dynamics, we have to identify thelocation and velocity of each particle. But there would be simply too much data to handle in order tosimulate a problem that is interesting on a macroscopic scale (i.e. flow past an object). For example,one liter of air contains about 1022 molecules. We don’t have to know the position of every particle, theimportant thing is the resultant effect [2], for example wind.

The lattice Boltzmann method closes gap between macro-scale and micro-scale. Method considersbehaviour of a collection of particles as a unit [2]. LBM is based on microscopic models and mesoscopickinetic equations. The fundamental idea of the LBM is to construct simplified kinetic models thatincorporate the essential physics of microscopic processes so that the macroscopic averaged propertiesobey the desired macroscopic equations [1]. Reason, why simplified kinetic models can be used is thatthe macroscopic dynamics of a fluid is the result of the collective behaviour of many microscopic particlesin the system [1]. The property of the collection of particles is represented by a distribution function[2]. Reason, why LBM is becoming more and more popular in the field of CFD (exponential growthof number of articles with LBM topic), is the fact that LBM is solved locally. It has high degree ofparallelization, hence it is ideal for parallel machines (computational clusters).

First, the inception of LBM will be explained §2. Next, the reason for transition from lattice gas toLBM and it’s mainframe equation is written §3. Lattice models in two dimensions are presented in §6.An important part in every numerical method are boundary conditions §7. LBM was tested with thebenchmark driven cavity problem and compared with the finite difference method §8.

2

Page 3: Lattice Boltzmann method - University of Ljubljanamafija.fmf.uni-lj.si/.../Lattice_Boltzmann_method.pdfthe lattice Boltzmann method (LBM). In the last 20 years, LBM developed into

Navier-Stokes equation Hamilton’s equation

Mesoscopic scaleLBMBoltzmann equation

Microscopic scaleMolecular dynamics

Macroscopic scale - continuumFDM, FVM, FEM...

Figure 1: Techniques of simulations on different scales. Adapted after [2].

2 Lattice gasThe lattice Boltzmann method has its roots in the lattice gas automata (LGA), kinetic model withdiscrete lattice and discrete time. Starting from LGA on a hexagonal lattice, Frish, Hasslacher, andPomeau obtained correct Navier-Stokes equations for the first time [3]. This model is known as FHPmodel. As said before, the lattice gas automata is constructed as simple particle dynamics in discretizedspace and time. Consequently, all particle velocities are also discrete. So we have particles that can movearound, but only within lattice nodes. Let’s introduce a set of boolean (true or false) variables

ni(x, t), i = 0, ...M.

These variables will describe occupation of a particle. M is the number of directions of particle velocitiesat each node. For example i = 0, ..., 6 for hexagonal lattice frequently used in LGA simulations.. Booleanalgebra has the advantage that it is without round-off errors. There can be either 0 or 1 particle at alattice node.

ni(x, t) = 0 no particles at site x and time t

ni(x, t) = 1 a particle is present at site x and time t

Also, an exclusion rule applies, forbidding two particles sitting on the same node. We can write downthe evolution equation of the LGA:

ni(x + eiδt, t + 1) = ni(x, t) + Ωi(n(x, t)), i = 0, ...M,

where ei are local particle velocities, Ωi is the collision operator, δt is time step. Collision operatorcontains all possible collisions. For example, in case of a hexagonal lattice, two-, three- and four-bodycollisions are possible. There are scattering rules that bring proper dynamics to the system. Ωi changesoccupation number due to collision at site i and can have values -1, 0, 1. Number -1 means that theparticle was destroyed, 0 leaves things unchanged and 1 means new particle is created. Boolean natureis preserved. It is important to stress that interaction is completely local. Neighbouring sites do notinteract. Configuration of particles at each time step evolves in two sequential sub-steps:

• streaming: each particle moves to the nearest node in the direction of its velocity

• collision: particles arrive at a node and interact by changing their velocity directions accordingto scattering rules

If we set the collision operator Ω to zero, then we obtain an equation for streaming alone.In figure 2 we see an example of head-on collision of two particles at three sequential times (t− 1, t,

t + 1). At t− 1 we have two incoming particles at sites 1 and 4. At site zero, all directions e1 to e6 areempty. After the streaming process, these two particles collide at time t. Directions e1 and e4 are nowoccupied. After collision at time t + 1 particles move according to scattering rules in directions e2 ande5. This is possible if e2 and e5 are empty. We can write the expression for this specific collision in form

n1n4n2n5,

3

Page 4: Lattice Boltzmann method - University of Ljubljanamafija.fmf.uni-lj.si/.../Lattice_Boltzmann_method.pdfthe lattice Boltzmann method (LBM). In the last 20 years, LBM developed into

e2

e4

e6e5

e3

e1

t− 1 t + 1

n4

n5

n1

n2,3,5,6 = 0

t + 1

n1,3,4,6 = 0

n2,5 = 1

t

n1,4 = 1

tn2

Figure 2: FHP model with six velocity vectors left. Head-on collision of two particles at three sequentialtimes centre. Head-on collision with boolean values right.

where n5 means negation of n5. This is one of the contributions to the Ω. Between n’s is boolean ANDfunction. If the expression has a value of 1, then collision is possible. For example in figure 2 we get

1100 → 1111 = 1.

So collision is possible.

3 From LGA to LBMThe main motivation for the transition from LGA to LBM was the desire to remove the statisticalnoise by replacing particle occupation variables ni (boolean variables) with single particle distributionfunctions

fk = 〈nk〉.These functions are an ensemble average of nk and real variables [1, 4]. nk can be 0 or 1 whereas fk

can be any real number between 0 and 1. In order to obtain the macroscopic behaviour of a system(streamlines) in the LGA, one has to average the state of each cell over a rather large patch of cells (forexample a 32 × 32 square) and over several consecutive time steps [5]. With the replacement nk → fk,noise is erased because fk is by definition an averaged, a smooth quantity [6]. On the other hand, we getround-off errors. Now we will deal with the distribution function f(x, e, t). It depends on the position

x

F

e + Fmdt

x + edt

e

t

t + dtx

x + dx

Figure 3: Phase diagram left. Position and velocity vector before and after applying force right. Adaptedafter [2].

vector x, the velocity vector e and time t. f(x, e, t) represents the number of particles with mass m attime t positioned between x + dx which have velocities between e + de. Now, we apply force F on theseparticles. After time dt, position and velocity obtain new values.

position x → x + edt

velocity e → e +Fm

dt

4

Page 5: Lattice Boltzmann method - University of Ljubljanamafija.fmf.uni-lj.si/.../Lattice_Boltzmann_method.pdfthe lattice Boltzmann method (LBM). In the last 20 years, LBM developed into

If there is no collision, the number of particles before and after applying force stays the same:

f(x + edt, e +Fm

dt, t + dt)dxde = f(x, e, t)dxde.

In case of collision between particles, then all don’t arrive at new positions. The rate of change betweenfinal and initial status of the distribution function is called collision operator Ω. Evolution equation withcollisions now writes as

f(x + edt, e +Fm

dt, t + dt)dxde− f(x, e, t)dxde = Ω(f)dxdedt.

By dividing the equation with dxdedt and in the limit dt → 0 we can write

Df

dt= Ω(f).

The above equation states that the total rate of change of the distribution function is equal to the rateof the collision [2]. Let’s expand Df

Df =∂f

∂xdx +

∂f

∂ede +

∂f

∂tdt,

and divide it by dtDf

dt=

∂f

∂xdxdt

+∂f

∂ededt

+∂f

∂t,

fraction dxdt represents velocity e, fraction de

dt represents acceleration a, which can be written as Fm .

Finally we obtain∂f

∂t+

∂f

∂xe +

Fm

∂f

∂e= Ω(f).

We have derived the Boltzmann equation for a case without external forces (F = 0)

∂f

∂t+ e · ∇f = Ω(f). (1)

Kinetic form stays the same as in LGA. We write it as

fk(x + ek∆t, t + ∆t) = fk(x, t) + Ωk(f(x, t)), i = 0, ...M,

where ∆t is a time increment, fk is the particle velocity distribution along the kth direction, or in anotherwords, fk is the fraction of the particles having velocities in the interval ek and ek + dek. In the LBM,space is discretized in a way that is consistent with the kinetic equation, i.e. the coordinates of thenearest neighbour nodes around x are x + ek∆t [1, 2].

3.1 BGK model equationCollision operator Ωk mentioned before is in general a complex non-linear integral. The idea is tolinearize the collision term around its local equilibrium solution. Ωk is often replaced by the so-calledBGK (Bhatnagar, Gross, Krook, 1954 [7]) collision operator

Ωk = −1τ

(fk − fEQk ) ,

where τ is the rate of relaxation towards local equilibrium, fEQk is equilibrium distribution function (for

the details see subsection §3.2). Collision operator is equivalent to the viscous term in the Navier-Stokesequation. Rate of relaxation τ is constant for all k’s. This scheme is called single-time relaxation scheme(SRT). All nodes relax with the same time scale τ [6]. The Navier-Stokes equation can be recovered froma Chapman-Enskog expansion [3]. This gives the kinematic viscosity ν in terms of the single relaxationtime τ

ν =(

τ − ∆t

2

)c2s,

5

Page 6: Lattice Boltzmann method - University of Ljubljanamafija.fmf.uni-lj.si/.../Lattice_Boltzmann_method.pdfthe lattice Boltzmann method (LBM). In the last 20 years, LBM developed into

Navier-Stokes equation Lattice Boltzmann equationρ

(∂u∂t + (u · ∇)u

)= −∇p + µ∇2u ∂f

∂t + e · ∇f = − 1τ (f − fEQ)

second-order PDE first-order PDEneed to treat the non-linear convective term u · ∇u avoids convective term,

convection becomes simple advectionneed to solve Poisson equation for the pressure p pressure p is obtained from equation of state

Table 1: Comparison between Navier-Stokes equation and lattice Boltzmann equation.

where cs = 1√3

∆x∆t is the sound speed in the lattice, ∆x is lattice spacing, ∆t is time increment. Usually

both ∆x and ∆t are set to unity. After introducing the BGK approximation, the Boltzmann equation(without external forces) can be written as

∂f

∂t+ e · ∇f = −1

τ(f − fEQ) .

The form of the Boltzmann equation in a specific direction would be

∂fk

∂t+ ek∇fk = −1

τ(fk − fEQ

k ) .

We could say that this equation is the heart of lattice Boltzmann method. It is the most popular kineticmodel and replaces Navier-Stokes equation in CFD simulations. The completely discretized equationwith the time step ∆t and space step ∆xk = ek∆t is

fk(xk + ek∆t, t + ∆t) = fk(xk, t)− ∆t

τ(fk − fEQ

k ) . (2)

The main advantage of the above equation is simplicity. Adding the force term is also straightforward.Equation 2 is usually solved in two sub-steps. Like in the case of LGA we have

collision step : fk(xk, t + ∆t) = fk(xk, t)− ∆t

τ(fk − fEQ

k ) ,

streaming step : fk(xk + ek∆t, t + ∆t) = fk(xk, t + ∆t).

Collision is not defined explicitly any more as in LGA. In the LBM, collision of the fluid particles isconsidered as relaxation towards a local equilibrium [8]. During the computation, there is no need tostore both fk(xk, t + ∆t) and fk(xk, t)[9].

3.2 Equilibrium distribution functionEquilibrium distribution function fEQ, which appears in the BGK collision operator, is basically anexpansion of the Maxwell’s distribution function for low Mach number M . We start with normalizedMaxwell’s distribution function

f =ρ

2π/3e−

32 (e−u)2 =

ρ

2π/3e−

32 (e·e)e

32 (2e·u−u·u), (3)

where u is macroscopic velocity of particles in a medium, e are velocity vectors in the specific latticemodel and ρ is macroscopic mass density. Now we expand equation (3) for small velocities M = u

cs 1,

where cs represents speed of sound.

f =ρ

2π/3e−

32 (e·e)

[1 + 3(e · u)− 3

2(u · u) +

92(e · u)2

]. (4)

The expansion is done up to second order O(u ·u = u2) to match the order of the Navier-Stokes equation.Here, the non-linearity of the collision operator is hidden. Equilibrium distribution function is of theform

fEQk = ρwk

[1 + 3(ek · u)− 3

2(u · u) +

92(ek · u)2

], (5)

6

Page 7: Lattice Boltzmann method - University of Ljubljanamafija.fmf.uni-lj.si/.../Lattice_Boltzmann_method.pdfthe lattice Boltzmann method (LBM). In the last 20 years, LBM developed into

where k runs from 0 to M and represents available directions in the lattice, and wk are weighting factors(look §6). The complete procedure of deriving equation (5) can be seen in [10].

4 Macroscopic quantitiesWe live in a macroscopic world and macroscopic quantities are of interest to us, whereas distribution func-tions are not as meaningful. Macroscopic quantities (velocity u, pressure p, mass density ρ, momentumdensity ρu, . . . ) are directly obtained by solving the Navier-Stokes equation. In the LBM, macroscopicquantities are obtained by evaluating the hydrodynamic moments of the distribution function f [9].Connections of the distribution function to macroscopic quantities for the density and momentum fluxare defined as follows

ρ(x, t) = m

∫f(x, e, t)de,

ρ(x, t)u(x, t) = m

∫f(x, e, t)ede.

In the discretized velocity space, the density and momentum fluxes can be evaluated as

ρ =8∑

k=0

fk =8∑

k=0

fEQk , (6)

ρu =8∑

k=1

ekfk =8∑

k=1

ekfEQk . (7)

Macroscopic fluid density (6) is defined as the sum of the distribution functions. Macroscopic velocity(7) is an average of the microscopic velocities ek weighted by the directional densities fk. Mass m ofparticles is set to 1.

5 Reynolds numberWhen we deal with incompressible flow, we cannot pass by the Reynolds number Re. Reynolds number isnon-dimensional unit and is used to characterize different flow regimes. Laminar at low Re and turbulentat high Re. It is defined as

Re =U0L0

ν0,

where U0 is characteristic velocity, L0 is characteristic length and ν0 is kinematic viscosity. Kinematicviscosity is obtained by dividing viscosity µ0 with mass density ρ0: ν0 = µ0

ρ0. It is convenient to rewrite

macroscopic quantities (length x0, velocity u0, kinematic viscosity ν0) in dimensionless form:

xD =x0

L0, uD =

u0

U0, νD =

ν0

L0U0.

With dimensionless quantities Reynolds number is of form

Re =UDLD

νD

.

The final step is to discretize time and space. We denote ∆tLBM as the time step and ∆xLBM as the spacestep in the lattice Boltzmann method. Dimensionless quantities in lattice units are written as

∆xLBM =LD

N, uLBM =

∆tLBM

∆xLBM

uD, νLBM =∆tLBM

∆x2LBM

νD,

where N is number of nodes along characteristic direction. Reynolds number in lattice units is

Re =ULBMN

νLBM

.

7

Page 8: Lattice Boltzmann method - University of Ljubljanamafija.fmf.uni-lj.si/.../Lattice_Boltzmann_method.pdfthe lattice Boltzmann method (LBM). In the last 20 years, LBM developed into

f1

f2

f4

f3 f3

f2

f1

f4

f0

f1f4

f6

f2

f0

f3

f5

f1

f2

f3

f4

f5f6

f7 f8

f0

Figure 4: Two-dimensional lattice models. From left to right: D2Q4, D2Q5, D2Q7 and D2Q9.

As said before, ∆xLBM is lattice spacing. How do we choose ∆tLBM? Error in the LBM because ofcompressibility scales like Mach number squared M2, where M = uLBM/cs. It follows that ε(M) ≈(∆tLBM/∆xLBM)2. LBM is also second-order accurate in space ε(∆xLBM) ≈ ∆xLBM

2. If we keep both errorsat the same order ε(M) ≈ ε(∆xLBM) then we obtain relation between time and space step ∆t ≈ ∆x2

[11].In practical applications, the macroscopic Re should be equal to the LBM Re number. For better

understanding, let’s make an example with the driven cavity problem (see §8). Square cavity of 1 mside is filled with honey at room temperature. Kinematic viscosity of honey is ν0 = 0.03 m2/s. Flowis driven by a moving top wall with a velocity of 3 m/s. We calculate Reynolds number Re = 100. Indimensionless representation, length and velocity of the top wall become 1, kinematic viscosity is thenνD = 0.01. Next we discretize cavity by a N × N = 100 × 100 mesh. Velocity of the top wall in thelattice units is ULBM = 0.01 and the kinematic viscosity νLBM = 0.01. Re number in the LBM remainsat a value of 100. If we use a mesh with more nodes (for example 200 × 200), then we have to rescalevelocity or viscosity in order to keep Re constant.

6 Lattice arrangementsIn this section two-dimensional lattice arrangements used in the LBM will be presented. The commonterminology is to refer to the dimension of the problem and the number of velocity vectors - DnQm.Where n represents the dimension of a problem and m refers to the speed model (number of linkages ofa node) [2].

It is also worth mentioning, that nodes in different positions regarding to the central node haveappropriate weighting factors wk. Values of these factors depend on the distance from central node,which has the highest value. Weighing factors are an important part in the calculation of equilibriumdistribution function. The normalization condition for the weights is∑

k

wk = 1.

6.1 Two-dimensional lattice arrangementsD2Q9 has been widely and successfully used for simulations of two-dimensional flows. We can describeit as nine-velocity square lattice model. It is a bit more demanding from a computational aspect thanthe hexagonal D2Q7 model, but it is more accurate. It has to be stressed, that for fluid flow problems,where non-linear term in Navier-Stokes equation is important, the D2Q4 or D2Q5 model is not appro-priate because of insufficient lattice symmetry. It fails to achieve basic symmetry of the NS equation -rotational invariance. In plain words, hexagon is ’good enough’ to replace a circle, whereas a square isnot. Consequently the lattice Boltzmann equation cannot recover the correct Navier-Stokes equation oninappropriate lattices [1, 2, 6].

7 Boundary conditionsBoundary conditions are an important part in computational fluid dynamics and no application can bediscussed without specifying them. In the Navier-Stokes equation, boundary conditions are relatively

8

Page 9: Lattice Boltzmann method - University of Ljubljanamafija.fmf.uni-lj.si/.../Lattice_Boltzmann_method.pdfthe lattice Boltzmann method (LBM). In the last 20 years, LBM developed into

Model e fk (wk)

D2Q4 (±1, 0), (0,±1) f1,2,3,4

(14

)D2Q5 (0, 0), (±1, 0), (0,±1) f0

(46

), f1,2,3,4

(112

)D2Q7 (0, 0), (±1, 0), (± 1

2 ,±√

32 ) f0

(12

), f1,...,6

(112

)D2Q9 (0, 0), (±1, 0), (0,±1), (±1,±1) f0

(49

), f1,2,3,4

(19

), f5,6,7,8

(136

)Table 2: Two-dimensional lattice models with corresponding velocity vectors e, distribution functions fk

and weighting factors wk.

easy to implement. This is not the case for LBM, where we have to determine appropriate equations forcalculating distribution functions f at the boundaries for a given boundary condition [2]. Bouncebackscheme for the D2Q9 model will be presented in the next subsection.

7.1 BouncebackBounceback is used to model solid stationary or moving boundary condition, non-slip condition, or flowover obstacles. Name implies that a particle coming towards the solid boundary bounces back into theflow domain [2]. Two different schemes are suggested regarding the position of the solid wall. One suggestto place a solid in the middle of the lattice nodes. Other suggest placing a solid on the nodes. It hasbeen shown, that the first scheme is second-order in numerical accuracy, whereas the second scheme isonly first-order [12]. If we want particles to bounce back from a solid, we have to change certain values of

FLUID

SOLID

f4f7

f5

f1

f8

f8

f6 f2 f5

f6

f3

f7

SOLID

FLUID

Figure 5: Unknown f ’s on all four walls.

distribution functions fk. For example, we focus on the bottom boundary. There is no streaming from asolid, so we have three unknown distribution functions f5, f2 and f6. Bounce-back is simply performedwith next equations

f5 = f7, f2 = f4, f6 = f8.

Particles bounce back to the node from which they were originally streamed. It is important, thatstreaming process is executed before applying boundary conditions. Conservation of mass and momentumat the boundary is ensured [2]. Bounce-back works great in complicated geometries, for example flowover obstacle. All we need to do, is specify a particular node as solid and apply boundary conditions.

9

Page 10: Lattice Boltzmann method - University of Ljubljanamafija.fmf.uni-lj.si/.../Lattice_Boltzmann_method.pdfthe lattice Boltzmann method (LBM). In the last 20 years, LBM developed into

FLUID

SOLID

FLUID

SOLID

f8

f7

f7

f8

f6

f6

f5

Bounce-back [t]Post-stream [t]Pre-stream [t]

Post-stream [t + ∆t]

f5

f2

f2

f4

f4

Figure 6: Bounce back on south boundary with boundary in the middle of the lattice nodes. Adaptedafter [8].

8 Driven cavity 2D

u = 1.0, v = 0.0

u = 0.0, v = 0.0

u=

0.0,

v=

0.0

u=

0.0,

v=

0.0

Figure 7: Geometry of lid driven cavity .

Lid driven cavity is one of the most common benchmark test problems. Benchmark tests are used totest CFD codes for their accuracy, numerical efficiency, . . . The simplicity of the geometry of the cavityflow makes the problem easy to code and apply boundary conditions [13]. A square cavity is filled withan incompressible fluid, which is governed by the Navier-Stokes equations. Flow is driven by the movingtop wall. Velocities at other boundaries are set to zero. Non-slip boundary conditions are applied onall four walls. A characteristic of the two dimensional cavity flow is emergence of primary vortex in thecentre of cavity. With higher Re, secondary vortices appear in the lower corners.

8.1 Driven cavity with LBMIn the beginning, we set all velocities to zero, except for the x-component velocity on the north boundary.Collision and streaming step are performed at every node of the grid. Next we apply boundary conditions.Simple bounceback is used on all walls except on the north wall, where we use following equations formoving boundaries proposed by Zou and He [14]

ρN = f0 + f1 + f3 + 2(f2 + f6 + f5),f4 = f2,

f7 = f5 +12(f1 − f3)−

12ρNuN,

f8 = f6 +12(f3 − f1) +

12ρNuN.

Last step is to calculate macroscopic quantities. Iteration is performed until the stationary state isachieved. If we increase lattice size, more iteration steps are required.

10

Page 11: Lattice Boltzmann method - University of Ljubljanamafija.fmf.uni-lj.si/.../Lattice_Boltzmann_method.pdfthe lattice Boltzmann method (LBM). In the last 20 years, LBM developed into

RESULT

COLLISION

QUANTITIESMACROSCOPIC

INITIALIZEfk(xk, t + ∆t)

BOUNDARYCONDITIONS

fk(xk + ek∆t, t + ∆t)STREAMING

Figure 8: Scheme of the LBM algorithm.

8.2 ResultsThe results presented here, were obtained with the lattice Boltzmann method and finite differencemethod. The main goal was to test LBM’s numerical accuracy on a lid driven cavity problem. Nu-merical simulations were carried out for Re=10, 100, 400, 1000, 2000 and 7500. For these Re numbers,steady-state solutions exist.

Figures 9(a)-9(f) show plots of the stream function for different Re numbers. These plots give a clearpicture of the overall flow pattern and the effect of the Re number on the structure of the steady vorticesin the cavity. The large primary vortex appear near the centre of the cavity. In the lower corners, twocounter-rotating secondary vortices of much smaller strength also appear. With higher Re, secondaryvortices start to grow. At Re=2000, the third secondary vortex appears in the upper left corner. ForRe≥5000 the tertiary vortex in the lower right corner appears. It has again the same rotation as thecentral (primary) vortex.

We can also observe moving of the centre of the primary vortex. As Re increases, centre movestowards the geometrical centre of the cavity. After Re=5000, the centre movement stops and it becomesfixed.

Velocity profiles along a horizontal (figure 10(a)) and vertical (figure 10(b)) centreline are presented.We can see that for low Re numbers, the velocity profile is curved. At higher Re, curvature starts todisappear. The profile becomes linear in the most part of the cavity. Linear profiles in the central coreindicate the uniform vorticity region generated in the cavity at higher Re numbers [15].

Figures 11 and 12 show velocity a profile obtained by LBM and FDM. They show good agreementbetween two completely different methods. Maximal difference is around 1% at Re=1000 and around0,5% at Re=400. We can say that the difference is within the numerical uncertainty of the solutionsusing other numerical methods.

Since there is no analytical solution for the driven cavity problem, one has to compare results withother authors. It is difficult to give a detailed answer which method is more accurate.

Tables 3 and 4 give numerical comparison of vortex centre positions at different Reynolds numbers.Benchmark solutions in [16, 17] were obtained by solving Navier-Stokes equations, in [15] LBM was used.My values show good agreement with those reported in previous studies. Perhaps, at low Re numbersdifference is a bit larger. A possible reason is that number of iterations was too low and consequentlysystem did not reach a complete steady state.

9 ConclusionThe lattice Boltzmann method is a new and promising method for computational fluid dynamics. Inthis seminar, only the isothermal single phase problem (driven cavity) was presented. LBM can domuch more. For example non-isothermal problems, multiphase flows, granular flows, viscoelastic flows,simulations in porous media as example of complicated boundary conditions, ...

11

Page 12: Lattice Boltzmann method - University of Ljubljanamafija.fmf.uni-lj.si/.../Lattice_Boltzmann_method.pdfthe lattice Boltzmann method (LBM). In the last 20 years, LBM developed into

(a) Re=10. (b) Re=100.

(c) Re=400. (d) Re=1000.

(e) Re=2000. (f) Re=7500.

Figure 9: Stream function of driven cavity problem for different Reynolds numbers.

12

Page 13: Lattice Boltzmann method - University of Ljubljanamafija.fmf.uni-lj.si/.../Lattice_Boltzmann_method.pdfthe lattice Boltzmann method (LBM). In the last 20 years, LBM developed into

- 1 , 0 - 0 , 5 0 , 0 0 , 5 1 , 0

- 0 , 6

- 0 , 4

- 0 , 2

0 , 0

0 , 2

0 , 4

0 , 6

Vertic

al ve

locity,

Y=0.5

X

R e = 1 0 R e = 1 0 0 R e = 4 0 0 R e = 5 0 0 R e = 1 0 0 0 R e = 2 0 0 0 R e = 5 0 0 0 R e = 7 5 0 0

(a) Normalized vertical velocity vU0

.

- 1 , 0

- 0 , 5

0 , 0

0 , 5

1 , 0

- 0 , 4 - 0 , 2 0 , 0 0 , 2 0 , 4 0 , 6 0 , 8 1 , 0H o r i z o n t a l v e l o c i t y , X = 0 . 5

Y R e = 1 0 R e = 1 0 0 R e = 4 0 0 R e = 5 0 0 R e = 1 0 0 0 R e = 2 0 0 0 R e = 5 0 0 0 R e = 7 5 0 0

(b) Normalized horizontal velocity uUo

.

Figure 10: Velocity profiles for different Re numbers along the horizontal centreline (a) and along thevertical centreline (b).

0 , 0

0 , 2

0 , 4

0 , 6

0 , 8

1 , 0

- 0 , 4 - 0 , 2 0 , 0 0 , 2 0 , 4 0 , 6 0 , 8 1 , 0H o r i z o n t a l v e l o c i t y , X = 0 . 5

Y

R e = 4 0 0 L B M R e = 4 0 0 F D M R e = 1 0 0 0 L B M R e = 1 0 0 0 F D M

(a) Normalized horizontal velocity uU0

. Compari-son between LBM and FDM.

0 , 0

0 , 2

0 , 4

0 , 6

0 , 8

1 , 0

- 0 , 0 0 8 - 0 , 0 0 6 - 0 , 0 0 4 - 0 , 0 0 2 0 , 0 0 0 0 , 0 0 2 0 , 0 0 4 0 , 0 0 6 0 , 0 0 8D i f f e r e n c e L B M - F D M

Y R e = 4 0 0 R e = 1 0 0 0

(b) Difference between LBM and FDM.

Figure 11: Actual velocity profiles obtained from LBM and FDM (a) and difference between numericalvalues at two Reynolds numbers (b).

0 , 0 0 , 1 0 , 2 0 , 3 0 , 4 0 , 5 0 , 6 0 , 7 0 , 8 0 , 9 1 , 0

- 0 , 5

- 0 , 4

- 0 , 3

- 0 , 2

- 0 , 1

0 , 0

0 , 1

0 , 2

0 , 3

0 , 4

Vertic

al ve

locity,

Y=0.5

X

R e = 4 0 0 L B M R e = 4 0 0 F D M R e = 1 0 0 0 L B M R e = 1 0 0 0 F D M

(a) Normalized vertical velocity vU0

. Comparisonbetween LBM and FDM.

0 , 0 0 , 2 0 , 4 0 , 6 0 , 8 1 , 0- 0 , 0 1 0- 0 , 0 0 8- 0 , 0 0 6- 0 , 0 0 4- 0 , 0 0 20 , 0 0 00 , 0 0 20 , 0 0 40 , 0 0 60 , 0 0 80 , 0 1 00 , 0 1 2

Differ

ence

LBM-

FDM

X

R e = 4 0 0 R e = 1 0 0 0

(b) Difference between LBM and FDM.

Figure 12: Actual velocity profiles obtained from LBM and FDM (a) and difference between numericalvalues at two Reynolds numbers (b).

13

Page 14: Lattice Boltzmann method - University of Ljubljanamafija.fmf.uni-lj.si/.../Lattice_Boltzmann_method.pdfthe lattice Boltzmann method (LBM). In the last 20 years, LBM developed into

Primary vortex Lower left vortex Lower right vortex

Re x y x y x y

100 A 0.6188 0.7357 0.0375 0.0313 0.9375 0.0563B 0.6172 0.7344 0.0313 0.0391 0.9453 0.0625C 0.6196 0.7373 0.0392 0.0353 0.9451 0.0627D 0.6157 0.7411 0.0337 0.0342 0.9412 0.0588

400 A 0.5563 0.6000 0.0500 0.0500 0.8875 0.1188B 0.5547 0.6055 0.0508 0.0469 0.8906 0.1250C 0.5608 0.6078 0.0549 0.0510 0.8902 0.1255D 0.5490 0.6040 0.0470 0.0514 0.8784 0.1176

1000 A 0.5438 0.5625 0.0750 0.0813 0.8625 0.1063B 0.5313 0.5625 0.0859 0.0781 0.8594 0.1094C 0.5333 0.5647 0.0902 0.0784 0.8667 0.1137D 0.5216 0.5647 0.0877 0.0757 0.8510 0.1059

5000 A 0.5125 0.5313 0.0625 0.1563 0.8500 0.0813B 0.5117 0.5352 0.0703 0.1367 0.8086 0.0742C 0.5176 0.5373 0.0784 0.1373 0.8078 0.0745D 0.5137 0.5333 0.0725 0.1376 0.8000 0.0706

7500 B 0.5117 0.5322 0.0645 0.1504 0.7813 0.0625C 0.5176 0.5333 0.0706 0.1529 0.7922 0.0667D 0.5137 0.5333 0.0645 0.1536 0.7843 0.0627

Table 3: Locations of vortices of the lid-driven cavity flow at different Reynolds numbers. A, Vanka [17];B, Ghia et al [16]; C, Hou et al [15]; D present work.

Upper left

Re x y

5000 B 0.0625 0.9102C 0.0667 0.9059D 0.0644 0.9082

7500 B 0.0664 0.9141C 0.0706 0.9098D 0.0677 0.9110

Table 4: Locations of vortices of the lid-driven cavity flow at different Reynolds numbers. B, Ghia et al[16]; C, Hou et al [15]; D present work.

14

Page 15: Lattice Boltzmann method - University of Ljubljanamafija.fmf.uni-lj.si/.../Lattice_Boltzmann_method.pdfthe lattice Boltzmann method (LBM). In the last 20 years, LBM developed into

References[1] S. Chen, G. Doolen: Lattice Boltzmann method for fluid flows, Annu. Rev. Fluid Mech. 30, 329-364,

(1998).

[2] A. A. Mohamad: Lattice Boltzmann method, Springer-Verlag London, (2011).

[3] U. Frish, B. Hasslacher, Y. Pomeau: Lattice gas automata for the Navier-Stokes equation, Phys.Rev. Lett. 56, 1505-1508, (1986).

[4] http://en.wikipedia.org/wiki/Lattice_Boltzmann_methods (3. 9. 2012)

[5] B. Chopard, P. Luthi, A. Masselot: Cellular Automata and Lattice Boltzmann Techniques, Universityof Geneva, (1998).

[6] S. Succi: The lattice Boltzmann Equation for Fluid Dynamics and Beyond, Oxford University Press,(2001).

[7] P. L. Bhatnagar, E. P. Gross, M. Krook: A Model for Collision Processes in Gases. I. SmallAmplitude Processes in Charged and Neutral One-Component Systems, Phys. Rev. 94, 511-525,(1954).

[8] M. C. Sokup, D. T. Thorne: Lattice Boltzmann Modeling, Springer-Verlag Berlin Heidelberg, (2006).

[9] D. Yu, R. Mei, L. Luo, W. Shyy: Viscous flow computations with the method of lattice Boltzmannequation, Progress in Aerospace Sciences 39, 329-367, (2003).

[10] X. He, L. Luo: Theory of the lattice Boltzmann method: From the Boltzmann equation to the latticeBoltzmann equation, Phys. Rev. E 56, 6811-6817, (1997).

[11] J. Latt: Choice of Units in Lattice Boltzmann Simulations, technical report, LBMethod.org, (2008).

[12] D. P. Ziegler: Boundary conditions for lattice Boltzmann simulations, J. Stat. Phys. 71, 1171-1177,(1993).

[13] E. Erturk: Discussions On Driven Cavity Flow, Int. J. Numer. Meth. Fluids 60, 275-294, (2009).

[14] Q. Zou, X. He: On pressure and velocity flow boundary conditions and bounceback for the latticeBoltzmann BGK model, Phys. Fluids 9, 1591-1598, (1997).

[15] S. Hou, Q. Zou, S. Chen, G. Doolen, A. Cogley: Simulation of Cavity Flow by Lattice BoltzmannMethod, J. Comput. Phys. 118, 329-347, (1995).

[16] U. Ghia, K. N. Ghia, C. T. Shin: High-Re solutions for incompressible flow using the Navier-Stokesequations and a multigrid method, J. Comput. Phys. 48, 387-411, (1982).

[17] S. P. Vanka: Block-implicit multigrid solution of Navier-Stokes equations in primitive variables, J.Comput. Phys. 65, 138-158, (1986).

15