41
The Lattice Boltzmann method for hyperbolic systems Benjamin Graille October ,

The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

  • Upload
    others

  • View
    16

  • Download
    0

Embed Size (px)

Citation preview

Page 1: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

The Lattice Boltzmann methodfor hyperbolic systems

Benjamin GrailleOctober 19, 2016

Page 2: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

Framework

The Lattice Boltzmann method

1 Description of the lattice Boltzmann methodLink with the kinetic theoryClassical schemesAnalysis methodsBoundary conditions

2 pyLBM (collaboration with Loïc Gouarin)PresentationExamples

3 The vectorial schemesPresentationNumerical tests

4 Conclusion

2 / 36GRAILLE / NUMKIN2016

N

Page 3: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

Description of the lattice Boltzmann method

The Lattice Boltzmann method

1 Description of the lattice Boltzmann methodLink with the kinetic theoryClassical schemesAnalysis methodsBoundary conditions

2 pyLBM (collaboration with Loïc Gouarin)

3 The vectorial schemes

4 Conclusion

3 / 36GRAILLE / NUMKIN2016

N

Page 4: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

Description of the lattice Boltzmann method – Link with the kinetic theory

Different scales for modeling

microscopicmodels

macroscopicmodels

mesoscopicmodels

latticeBoltzmann

Chapman-Enskogε→ 0

Taylor expansion∆t → 0

particlespositions, velocities

statistical descriptionsmean distribution functions

observable quantitiesdensity, velocity, temperature

4 / 36GRAILLE / NUMKIN2016

N

Page 5: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

Description of the lattice Boltzmann method – Link with the kinetic theory

From mesoscopic to macroscopic

Mesoscopic scale: the Boltzmann equation

∂t f (t , x , c) + c·∇x f (t , x , c) =1

εQ(f ),

where ε is the Knudsen number.Chapman-Enskog method: formal asymptotic expansion according to ε⇒ the macroscopic equations on the moments.

ρ =

∫f (t , x , c) dc, (mass)

q =

∫cf (t , x , c) dc, (momentum)

E =

∫12c2f (t , x , c) dc, (energy)

5 / 36GRAILLE / NUMKIN2016

N

Page 6: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

Description of the lattice Boltzmann method – Link with the kinetic theory

Mimic the kinetic to simulate the macroscopicExample in 2 dimensions

a uniform cartesian mesh

on each spot, “particles” with adapted discret velocitiesthe transport phasethe relaxation phasedo it again !

6 / 36GRAILLE / NUMKIN2016

N

Page 7: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

Description of the lattice Boltzmann method – Link with the kinetic theory

Mimic the kinetic to simulate the macroscopicExample in 2 dimensions

a uniform cartesian meshon each spot, “particles” with adapted discret velocities

the transport phasethe relaxation phasedo it again !

6 / 36GRAILLE / NUMKIN2016

N

Page 8: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

Description of the lattice Boltzmann method – Link with the kinetic theory

Mimic the kinetic to simulate the macroscopicExample in 2 dimensions

a uniform cartesian meshon each spot, “particles” with adapted discret velocitiesthe transport phase

the relaxation phasedo it again !

6 / 36GRAILLE / NUMKIN2016

N

Page 9: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

Description of the lattice Boltzmann method – Link with the kinetic theory

Mimic the kinetic to simulate the macroscopicExample in 2 dimensions

a uniform cartesian meshon each spot, “particles” with adapted discret velocitiesthe transport phasethe relaxation phase

do it again !

6 / 36GRAILLE / NUMKIN2016

N

Page 10: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

Description of the lattice Boltzmann method – Link with the kinetic theory

Mimic the kinetic to simulate the macroscopicExample in 2 dimensions

a uniform cartesian meshon each spot, “particles” with adapted discret velocitiesthe transport phasethe relaxation phasedo it again !

6 / 36GRAILLE / NUMKIN2016

N

Page 11: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

Description of the lattice Boltzmann method – Link with the kinetic theory

Sketch of the collision phase

even nonconservedmoments

odd nonconservedmoments

conservedmoments

s > 1

s < 1

f

f eqf ?

The collision operator is a linear re-laxation of the vector f toward anequilibrium value f eq

f ? = f + M−1SM (f eq − f )).

The value of f eq isfunction of the con-served moments.

7 / 36GRAILLE / NUMKIN2016

N

Page 12: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

Description of the lattice Boltzmann method – Link with the kinetic theory

Sketch of the collision phase

even nonconservedmoments

odd nonconservedmoments

conservedmoments

s > 1

s < 1

f

f eqf ?

The collision operator is a linear re-laxation of the vector f toward anequilibrium value f eq

f ? = f + M−1SM (f eq − f )).

The value of f eq isfunction of the con-served moments.

7 / 36GRAILLE / NUMKIN2016

N

Page 13: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

Description of the lattice Boltzmann method – Link with the kinetic theory

Define a lattice Boltzmann schemeA lattice Boltzmann scheme is given by

a set of q velocities adapted to the mesh, c0, . . . , cq−1,an invertible matrixM that transforms the densities into the moments:

mk =

q−1∑j=0

Mkj fj =

q−1∑j=0

Pk (cj )fj , Pk ∈ R[X ],

functions defining the equilibrium meqk ,

relaxation parameters sk .

The nth first moments are necessary the unknowns of the PDEs: thesemoments are conserved, that is

meqk = mk , 0 6 k 6 n − 1.

The next moments are not conserved and their equilibrium value dependson the conserved moments:

meqk = meq

k (m0, . . . ,mn−1), n 6 k 6 q − 1.

8 / 36GRAILLE / NUMKIN2016

N

Page 14: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

Description of the lattice Boltzmann method – Classical schemes

Examples

D1Q2

advection, heat

0 12

D1Q3

advection, wave, heat

0 12

D1Q5

Euler

0 12 34

D2Q4

advection, heat

0 1

2

3

4

D2Q5

advection, wave, heat

0 1

2

3

4

D2Q9

Navier-Stokes

0 1

2

3

4

56

7 8

9 / 36GRAILLE / NUMKIN2016

N

Page 15: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

Description of the lattice Boltzmann method – Analysis methods

Example of the D1Q2

The D1Q2 can be used to simulate the mono-dimensional hyperbolicconservative equation

∂tu(t , x) + ∂xϕ(u)(t , x) = 0, t > 0, x ∈ R,

where u : R→ R is the unknown.The D1Q2 is given by

two velocities {−λ, λ} with λ = ∆x/∆t and the associated densities (f− , f+ )

the matrixM and it’s inverse

M =

(1 1−λ λ

)M−1 =

(1/2 −1/(2λ)1/2 1/(2λ)

)the conserved moment u and the non conserved moment v, where u = f− + f+and v = −λf− + λf+ .

the equilibrium value veq = veq(u) and the relaxation parameter s .

10 / 36GRAILLE / NUMKIN2016

N

Page 16: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

Description of the lattice Boltzmann method – Analysis methods

One time step of the linear D1Q2

In the linear case (veq = αu), one time step of the scheme reads

v?(x , t) = (1− s)v(x , t) + sαu(x , t), relaxation,f− (x , t + ∆t) = f ?− (x + ∆x , t), transport to the left,f+ (x , t + ∆t) = f ?+ (x −∆x , t), transport to the right.

In terms of densities, it reads

f− (x , t + ∆t) = 12(2− s − sα

λ)f− (x + ∆x , t) + 1

2(s − sα

λ)f+ (x + ∆x , t),

f+ (x , t + ∆t) = 12(s + sα

λ)f− (x + ∆x , t).+ 1

2(2− s + sα

λ)f+ (x + ∆x , t)

In terms of moments, it reads

un+1j = 1

2(1− s α

λ)unj+1 + 1

2(1 + s α

λ)unj−1 − 1−s

2λ(vnj+1 − vnj−1),

vn+1j = 1−s

2(vnj+1 + vnj−1)− λ

2(1− s α

λ)unj+1 + λ

2(1 + s α

λ)unj−1.

11 / 36GRAILLE / NUMKIN2016

N

Page 17: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

Description of the lattice Boltzmann method – Analysis methods

Equivalent equations (0)

Assuming that the densities are regular functions, the Taylor expansionmethod for small ∆t and ∆x yields

Zeroth order

At the order 0, the distribution are at equilibrium

fj = f eqj + O(∆t ), f ?j = f eqj + O(∆t ), j ∈ {−,+}.

We have

fj (t + ∆t , x) = f ?j (t , x − vj∆t), vj = jλ, j ∈ {−,+},fj + O(∆t ) = f ?j + O(∆t ),

v = v? + O(∆t ) = (1− s)v+ sveq + O(∆t ),

v = veq + O(∆t ) and v? = veq + O(∆t ).

12 / 36GRAILLE / NUMKIN2016

N

Page 18: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

Description of the lattice Boltzmann method – Analysis methods

Equivalent equations (1)

First orderThe first moment u satisfies the partialdifferential equation

∂tu+ ∂x veq = O(∆t ).

The choice veq = ϕ(u) is then done sothat u satisfies the conservative equa-tion at order 1.

Transition lemmaThe second moment v satisfies

v = veq − ∆tsθ + O(∆t2),

v? = veq + ∆t(1− 1

s

)θ + O(∆t2),

withθ = ∂tv

eq + λ2∂xu.

We have

fj (t + ∆t , x) = f?j (t , x − vj ∆t),

fj + ∆t∂t fj = f?j − vj ∆t∂x f

?j + O(∆t2),

fj + ∆t∂t feqj = f

?j − vj ∆t∂x f

eqj + O(∆t2).

Taking the first moment:

u+ ∆t∂tu = u−∆t∂x veq + O(∆t2).

Taking the second moment:

v+ ∆t∂tveq = v? − λ2∆t∂xu+ O(∆t2)

= (1− s)v+ sveq

− λ2∆t∂xu+ O(∆t2)

13 / 36GRAILLE / NUMKIN2016

N

Page 19: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

Description of the lattice Boltzmann method – Analysis methods

Equivalent equations (2)

Second order

The first moment u satisfies the second-order partial differentialequation

∂tu+ ∂xϕ(u) = ∆t σ ∂x[(λ2 − ϕ′(u)2)∂xu]+ O(∆t2),

with σ = 1/s − 1/2.

Taking the first moment at second order:

u+ ∆t∂tu+ 12∆t2∂ttu = u−∆t∂xv? + 1

2λ2∆t2∂xxu+ O(∆t3)

∂tu+ ∂xϕ(u) = ∂x (veq − v?) + 12∆t(λ2∂xxu− ∂ttu) + O(∆t2)

veq − v? = ∆t( 1s− 1)θ θ = ϕ′(u)∂tu+ λ2∂xxu = (λ2 − ϕ′(u)2)∂xxu

14 / 36GRAILLE / NUMKIN2016

N

Page 20: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

Description of the lattice Boltzmann method – Analysis methods

Maximum principle

Theorem

We assume that s ∈ [0, 1], u0j ∈ [α, β], v0

j = ϕ(u0j ), ∀j ,

and λ > maxα6u6β

|ϕ′(u)|.Then ∀n > 0 ∀j unj ∈ [α, β].

The functions h±(u) = λu±ϕ(u)2λ

are increasing. We then have

f 0±,j ∈ [h±(α), h±(β)].

The relaxation phase reads as a linear convex combination:

f n?±,j =λunj ± vn?j

2λ=λunj ± vnj

2λ±vn?j − vnj

2λ= f n±,j ± s

ϕ(unj )− vnj2λ

= (1− s)f n±,j + sh±(unj ) ∈ [h±(α), h±(β)].

And

unj = f n−,j + f n+,j ∈ [h−(α) + h+(α), h−(β) + h+(β)] = [α, β].

15 / 36GRAILLE / NUMKIN2016

N

Page 21: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

Description of the lattice Boltzmann method – Analysis methods

L2 stability

Theorem

We assume that veq = αu, λ > |α|, and s ∈ [0, 2].Then the D1Q2 scheme is stable for the L2-norm.

The amplification matrix of the linear D1Q2 scheme is given by

G(∆x , ξ) =

((1− s

2(1 + α

λ))e−i∆xξ s

2(1− α

λ)e−i∆xξ

s2(1 + α

λ)e i∆xξ

(1− s

2(1− α

λ))e i∆xξ

).

real part

1.00.5

0.00.5

1.0im

aginary p

art

1.0

0.5

0.0

0.5

1.0

s

0.0

0.5

1.0

1.5

2.0

Eigenvalues for α= 0. 25

real part

1.00.5

0.00.5

1.0im

aginary p

art

1.0

0.5

0.0

0.5

1.0

s

0.0

0.5

1.0

1.5

2.0

Eigenvalues for α= 0. 5

real part

1.00.5

0.00.5

1.0im

aginary p

art

1.0

0.5

0.0

0.5

1.0

s

0.0

0.5

1.0

1.5

2.0

Eigenvalues for α= 0. 75

16 / 36GRAILLE / NUMKIN2016

N

Page 22: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

Description of the lattice Boltzmann method – Boundary conditions

Bounce Back and anti Bounce Back

The black point has outside neigh-bors.For each one, we have to specify thedistribution functions with incomingvelocities.

17 / 36GRAILLE / NUMKIN2016

N

Page 23: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

Description of the lattice Boltzmann method – Boundary conditions

Bounce Back and anti Bounce Back

◦ When a fluid particle (discrete distri-bution function) reaches a boundarynode, the particle will scatter back tothe fluid along with its incoming direc-tion.For anti Bounce Back condition, thesign is changed.The bound of the domain is then pix-elized.

18 / 36GRAILLE / NUMKIN2016

N

Page 24: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

Description of the lattice Boltzmann method – Boundary conditions

Bouzidi type boundary conditions

In order to improve the accuracy of the boundary conditions, the interfaceneed to be localized more precisely.

s < 1/2� � �

xi−1 xi xi+1

s

1−s

s > 1/2� � �

xi−1 xi xi+1

s

1−s

19 / 36GRAILLE / NUMKIN2016

N

Page 25: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

Description of the lattice Boltzmann method – Boundary conditions

Bouzidi type boundary conditions

Case s < 1/2 (explicit interpolation).

s < 1/2� � �

xi−1 xi xi+1xi− 1

2

s

1−s 1−s

We havexi− 1

2= (1− 2s)xi−1 + 2sxi .

Thenf −i+1 = f̃ −i = f +

i− 12

= (1− 2s)f +i−1 + 2sf +

i .

20 / 36GRAILLE / NUMKIN2016

N

Page 26: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

Description of the lattice Boltzmann method – Boundary conditions

Bouzidi type boundary conditions

Case s > 1/2 (implicit interpolation).

s > 1/2� � �

xi−1 xi xi+1xi+1

2

s

1−s 1−s

We havexi =

1

2sxi+ 1

2+

2s − 1

2sxi−1.

Thenf −i+1 = f̃ −i =

1

2sf̃ −i+ 1

2+

2s − 1

2sf̃ −i−1 =

1

2sf +i +

2s − 1

2sf −i

21 / 36GRAILLE / NUMKIN2016

N

Page 27: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

pyLBM (collaboration with Loïc Gouarin)

The Lattice Boltzmann method

1 Description of the lattice Boltzmann method

2 pyLBM (collaboration with Loïc Gouarin)PresentationExamples

3 The vectorial schemes

4 Conclusion

22 / 36GRAILLE / NUMKIN2016

N

Page 28: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

pyLBM (collaboration with Loïc Gouarin) – Presentation

Motivations

pyLBMacademic and flexible code

to test and to compare the schemes: simple and brief implementationcan be used by non specialists or students

optimisations: mpi, openmp, cython (cuda and opencl in test)⇒ python: compromise efficiency / simplicity

fine management of the geometry built from simple objects2D: circle, ellipse, triangle, parallelogram3D: sphere, ellipsoid, parallelepiped, cylindrer

The user definesthe geometry of the domain and the scheme through a dictionary,initial conditions and boundary conditions through functions,parameters for the optimization (optional),

the code is then generated and executed.

23 / 36GRAILLE / NUMKIN2016

N

Page 29: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

pyLBM (collaboration with Loïc Gouarin) – Presentation

Structure of the code

Dictionnary

Simulation

Geometry

Circle

Ellipse

Parallelogram

Triangle

Sphere

Ellipsoid

Cylinder

Parallelepiped

Stencil Velocity

Domain Scheme Generator

Array : f , m Fonctions :transportrelaxationm2f f2m

Result

Initialization

Boundary conditions

24 / 36GRAILLE / NUMKIN2016

N

Page 30: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

pyLBM (collaboration with Loïc Gouarin) – Examples

D1Q2 for the advection

Geometryimport pyLBM

xmin , xmax = 0., 1. # domain

dic = {' box ' :{ 'x ': [xmin , xmax]},

}

geom = pyLBM.Geometry(dic)print(geom)geom.visualize ()

Geometry informations

spatial dimension: 1

bounds of the box:

[[ 0. 1.]]

25 / 36GRAILLE / NUMKIN2016

N

Page 31: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

pyLBM (collaboration with Loïc Gouarin) – Examples

D1Q2 for the advection

Stencilimport pyLBM

dic = {' dim ': 1,' schemes ' :[

{' velocities ': [1, 2],

}],

}

sten = pyLBM.Stencil(dic)print(sten)sten.visualize ()

Stencil informations

* spatial dimension: 1

* maximal velocity in each direction: [1]

* minimal velocity in each direction: [-1]

* Informations for each elementary stencil:

stencil 0

- number of velocities: 2

- velocities: (1: 1), (2: -1),

26 / 36GRAILLE / NUMKIN2016

N

Page 32: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

pyLBM (collaboration with Loïc Gouarin) – Examples

D1Q2 for the advection

Domainimport pyLBM

xmin , xmax = 0., 1. # domainN = 10 # number of points

dic = {' box ' :{ 'x ': [xmin , xmax]},' space_step ': (xmax -xmin)/N,' scheme_velocity ': 1.,' schemes ' :[

{' velocities ': [1, 2],

}],

}

dom = pyLBM.Domain(dic)print(dom)dom.visualize ()

Domain informations

spatial dimension: 1

space step: dx= 1.000e-01

27 / 36GRAILLE / NUMKIN2016

N

Page 33: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

pyLBM (collaboration with Loïc Gouarin) – Examples

D1Q2 for the advection

Schemeimport pyLBMimport sympy as sp

u, X = sp.symbols( 'u, X ')c = .25 # velocitys = 1. # relaxation parameterdic = {

' dim ': 1,' scheme_velocity ': 1.,' schemes ' :[

{' velocities ': [1, 2],' conserved_moments ': u,' polynomials ': [1, X],' equilibrium ': [u, c*u],' relaxation_parameters ': [0., s],' init ': {u: 0.}

}],

}scheme = pyLBM.Scheme(dic)print(scheme)

Scheme informations

spatial dimension: dim=1

number of schemes: nscheme=1

number of velocities:

Stencil.nv[0]=2

velocities value:

v[0]=(1: 1), (2: -1),

polynomials:

P[0]=Matrix([[1], [X]])

equilibria:

EQ[0]=Matrix([[u], [0.25*u]])

relaxation parameters:

s[0]=[0.0, 1.0]

moments matrices

M = [Matrix([

[1, 1],

[1, -1]])]

invM = [Matrix([

[1/2, 1/2],

[1/2, -1/2]])]

28 / 36GRAILLE / NUMKIN2016

N

Page 34: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

pyLBM (collaboration with Loïc Gouarin) – Examples

D1Q2 for the advection (numerical results)Sm

oothsolution

k s 2.000 1.900 1.750 1.000 0.750 0.500

3 1.536e-01 1.416e-01 1.256e-01 8.104e-02 7.881e-02 8.113e-02

4 1.733e-01 1.714e-01 1.712e-01 2.062e-01 2.288e-01 2.550e-01

5 1.319e-01 1.153e-01 1.073e-01 1.495e-01 1.757e-01 2.100e-01

6 4.897e-02 4.697e-02 5.138e-02 1.145e-01 1.405e-01 1.719e-01

7 1.254e-02 1.429e-02 2.162e-02 7.983e-02 1.049e-01 1.357e-01

8 3.113e-03 4.850e-03 9.913e-03 4.990e-02 7.081e-02 9.927e-02

9 7.761e-04 1.991e-03 4.836e-03 2.863e-02 4.329e-02 6.599e-02

10 1.943e-04 9.263e-04 2.412e-03 1.551e-02 2.448e-02 3.990e-02

11 4.863e-05 4.522e-04 1.208e-03 8.096e-03 1.311e-02 2.233e-02

12 1.216e-05 2.241e-04 6.041e-04 4.138e-03 6.794e-03 1.188e-02

13 3.039e-06 1.117e-04 3.022e-04 2.092e-03 3.461e-03 6.136e-03

14 7.598e-07 5.577e-05 1.512e-04 1.052e-03 1.747e-03 3.121e-03

15 1.900e-07 2.787e-05 7.559e-05 5.277e-04 8.778e-04 1.574e-03

16 4.749e-08 1.393e-05 3.780e-05 2.642e-04 4.400e-04 7.904e-04

slope 2.000e00 1.000e00 9.999e-01 9.979e-01 9.965e-01 9.937e-01

Discontinuoussolution k s 2.000 1.900 1.750 1.000 0.750 0.500

3 2.722e-01 2.657e-01 2.590e-01 2.649e-01 2.758e-01 2.893e-01

4 8.353e-02 8.611e-02 9.415e-02 1.696e-01 2.027e-01 2.389e-01

5 1.488e-01 1.372e-01 1.304e-01 1.434e-01 1.587e-01 1.832e-01

6 1.055e-01 9.036e-02 8.323e-02 1.066e-01 1.225e-01 1.444e-01

7 8.651e-02 7.416e-02 7.188e-02 9.591e-02 1.082e-01 1.251e-01

8 6.158e-02 4.995e-02 5.070e-02 7.838e-02 8.932e-02 1.038e-01

9 5.568e-02 4.470e-02 4.497e-02 6.609e-02 7.494e-02 8.675e-02

10 4.421e-02 3.434e-02 3.570e-02 5.515e-02 6.270e-02 7.268e-02

11 3.460e-02 2.684e-02 2.954e-02 4.657e-02 5.289e-02 6.125e-02

12 2.710e-02 2.089e-02 2.424e-02 3.909e-02 4.442e-02 5.146e-02

13 2.230e-02 1.732e-02 2.043e-02 3.288e-02 3.735e-02 4.326e-02

14 1.783e-02 1.406e-02 1.707e-02 2.763e-02 3.140e-02 3.637e-02

15 1.403e-02 1.151e-02 1.432e-02 2.324e-02 2.641e-02 3.059e-02

16 1.111e-02 9.517e-03 1.202e-02 1.954e-02 2.220e-02 2.572e-02

slope 3.374e-01 2.746e-01 2.527e-01 2.502e-01 2.501e-01 2.501e-01

29 / 36GRAILLE / NUMKIN2016

N

Page 35: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

The vectorial schemes

The Lattice Boltzmann method

1 Description of the lattice Boltzmann method

2 pyLBM (collaboration with Loïc Gouarin)

3 The vectorial schemesPresentationNumerical tests

4 Conclusion

30 / 36GRAILLE / NUMKIN2016

N

Page 36: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

The vectorial schemes – Presentation

Motivations

We focus on the numerical simulation of hyperbolic systems of pde’s by thelattice Boltzmann method. In this presentation, we deal with monodimensional conservation laws:

∂tu(t , x) + ∂xϕ(u)(t , x) = 0, t > 0, x ∈ R,

where u is the unknown vector of size n .

Goals:generic scheme for all flux functions ϕ,identifiable stability conditions,straightforward treatment of the boundary conditions.

31 / 36GRAILLE / NUMKIN2016N

Page 37: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

The vectorial schemes – Presentation

The vectorial D1Q2,...,2

For a system of n equations, we duplicate n times the D1Q2:the velocity of the scheme: λ = ∆x/∆t

the velocities of the particles: v0 = −λ, v1 = λ

the particles distributions: f1,0 , f1,1 , . . . , fn,0 , fn,1the moments: uk = fk,0 + fk,1 , vk = λ(−fk,0 + fk,1 ), 1 6 k 6 n

the relaxation phase: u?k = uk , v?k = vk + sk (veqk − vk ), 1 6 k 6 n

Theorem (Equivalent equation)

Taking veqk = ϕk (u), the vector of the first moments u satisfy

∂tu+ ∂xϕ(u) = ∆t S ∂x

((λ2In −

(dϕ(u)

)2)∂xu)

+ O(∆t2),

with S = diag(σ1, . . . , σn), σk = 1/sk − 1/2, 1 6 k 6 n .

32 / 36GRAILLE / NUMKIN2016

N

Page 38: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

The vectorial schemes – Presentation

The D1Q2,...,2 as a relaxation schemeThe relaxation system proposed by Jin and Xin reads

{∂tu

ε + ∂xvε = 0,

∂tvε + A∂xuε = 1

ε(ϕ(uε)− vε).

Denoting uni = u(xi , tn), vni = v(xi , tn), xi ∈ L, tn = n∆t , the D1Q2,...,2 can

be rewritten in the form (if all relaxation parameters are equal to s)

vn?i = vni − s(vni − ϕ(uni )),

un+1i = 1

2(uni+1 + uni−1)− ∆t

2∆x(vn?i+1 − vn?i−1),

vn+1i = 1

2(vn?i+1 + vn?i−1)− λ2 ∆t

2∆x(uni+1 − uni−1).

Splitting betweenthe relaxation part treated by the explicit Euler method with ε = ∆t/s ,the hyperbolic part treated by the Lax-Friedrichs method with A = λ2In .

33 / 36GRAILLE / NUMKIN2016

N

Page 39: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

The vectorial schemes – Numerical tests

Numerical tests done with pyLBM

dimension 1advection with constant velocityadvection-diffusion-reaction equationBurgersp-systemshallow water systemfull compressible Euler system

dimension 2advection with constant velocityshallow water systemincompressible thermo-hydrodynamic (Boussinesq approximation)magneto-hydro-dynamic system

dimension 3advection with constant velocityincompressible thermo-hydrodynamic (Boussinesq approximation)

34 / 36GRAILLE / NUMKIN2016

N

Page 40: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

Conclusion

The Lattice Boltzmann method

1 Description of the lattice Boltzmann method

2 pyLBM (collaboration with Loïc Gouarin)

3 The vectorial schemes

4 Conclusion

35 / 36GRAILLE / NUMKIN2016

N

Page 41: The Lattice Boltzmann method - for hyperbolic systems · Framework The Lattice Boltzmann method 1 Description of the lattice Boltzmann method Link with the kinetic theory Classical

Conclusion

The Lattice Boltzmann method

The lattice Boltzmann method and the Boltzmann equationvery rough discretization in term of velocitiesno claim to solve the Boltzmann equationa taylor expansion to mimic the Chapman-Enskog expansion

The software pyLBMflexible and simple interface to create a simulationperformances of a compiled langagesome features to add: optimization with grpahics cards, relative velocity schemes(Tony Février), mesh refinement...

The vectorial schemessimple way to simulate conservative hyperbolic problemslink with the relaxation methodsto do: obtain a convergence theorem with this restrictive framework

36 / 36GRAILLE / NUMKIN2016

N