53
Introduction to the lattice Boltzmann method Física dos Meios Contínuos – Faculdade de Ciências da Universidade de Lisboa

Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

  • Upload
    others

  • View
    40

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

Introduction to the lattice Boltzmann method

Física dos Meios Contínuos – Faculdade de Ciências da Universidade de Lisboa

Page 2: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

2

Computational fluid dynamics

● Solve the Navier-Stokes equation in the macroscopic limit;

● Finite differences, finite volumes, lattice-Boltzmann (LBM), smoothed particles hydrodynamics (SPH), …

Page 3: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

3

Finite differences

● Regular grids;● Easy to implement;● Direct implementation of the differential equations;● Runge-Kutta metods;● Lack of stability;● Difficult to treat complex boundaries.

Page 4: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

4

Finite volumes

● Irregular grids;● Professional software;● Fine grids close to corners;● Complicated for moving parts, complex geometries and interfaces.

Page 5: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

5

Example of application: Gearbox

● Moving parts● Complex geometry● Free surface● Fluid-structure

interaction● Turbulence

Page 6: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

6

Applications

Porous media Hydraulic pumps

Multiphase fluids Medical research

Page 7: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

7

Introduction

● Do not discretize the Navier-Stokes directly;

● Modeling a gas from a mesoscopic point of view;

● High performance in parallel architectures;

● Simple mesh generation: cartesian grid;

● Many physical models;

Ludwig Eduard Boltzmann

(1844-1906)

The lattice Boltzmann method

Page 8: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

8

Introduction

Molecular dynamics Lattice Boltzmann Finite volumes

Page 9: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

9

Introduction

Lattice Boltzmann

Page 10: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

10

Introduction

Lattice Boltzmann

Gaussian quadrature

Numerical method to calculate integrals

Ex.: density

Page 11: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

11

Introduction

Lattice Boltzmann

Gaussian quadrature Boltzmann equation

Numerical method to calculate integrals

Gives the time evolution of the

distribution function

Ex.: density

Important concepts: Distribution function, Boltzmann equation, Gaussian quadrature

Page 12: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

12

Distribution function

Page 13: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

13

Distribution function

Total number of particles Distribution of number of particles

Page 14: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

14

Distribution function

Total number of particles Distribution of number of particles

Total mass

Page 15: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

15

Distribution function

Total number of particles Distribution of number of particles

Total mass

= (⍴( x,t)

Page 16: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

16

Macroscopic fields (moments)

Density

Momentum -> velocity

Energy -> temperature

Connection between microscopic and macroscopic

Page 17: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

17

Equilibrium distribution

Maxwell-Boltzmann distribution function: used in the classical LBM

Probability density to find a particle with velocity u in a gas with density ρ and temperature θ.

Fields at equilibrium

Page 18: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

18

Equilibrium distribution

Maxwell-Boltzmann distribution function: used in the classical LBM

Probability density to find a particle with velocity u in a gas with density ρ and temperature θ.

Fields at equilibrium

Second order expansion in Hermite polynomials (to use the Gauss-Hermite quadrature)

Approximation: small Mach number

Page 19: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

19

Hermite polynomials

Hermite weight function

Orthogonalization

Rodrigues’ formula

The Hermite polynomials are the mathematical basis of the LBM: Gauss-Hermite quadrature and expansion of the equilibrium distribution function. In D dimensions they are:

where

Page 20: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

20

Expansion of the EDF

Maxwell-Boltzmann distribution

Page 21: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

21

Expansion of the EDF

Expansion in Hermite polynomials

Maxwell-Boltzmann distribution

Projections of the distribution function on the Hermite polynomials

Page 22: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

22

Expansion of the EDF

Expansion in Hermite polynomials

Maxwell-Boltzmann distribution

Hermite polynomials

Hermite weight function

Order of the expansion

Projections of the distribution function on the Hermite polynomials

Page 23: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

23

Expansion of the EDF

Expansion in Hermite polynomials

Maxwell-Boltzmann distribution

Hermite polynomials

Hermite weight function

Order of the expansion

Projections of the distribution function on the Hermite polynomials

Ex.: expansion up to second order (K=2)

Page 24: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

24

Time evolution

Without collisions and external force

Page 25: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

25

Time evolution

Without collisions

Page 26: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

26

Time evolution

Page 27: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

27

Time evolution

Page 28: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

28

Boltzmann equation

Now considering collisions...

All the physics of the scattering process is contained in the collision operator

Page 29: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

29

Collision operator

Two-body collision term

● Tricky to calculate computationally● Not efficient for simulating macroscopic fluids● Unnecessary complexity from the macroscopic point of view

Page 30: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

30

Collision operator

Bhatnagar-Gross-Krook (BGK) collision operator: The distribution function f tends exponentially to the equilibrium distribution feq with a characteristic time 𝜏

Page 31: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

31

Collision operator

Lattice-BGK equation

Bhatnagar-Gross-Krook (BGK) collision operator: The distribution function f tends exponentially to the equilibrium distribution feq with a characteristic time 𝜏

Related to the kinematic viscosity

Page 32: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

32

Collision operator

Lattice-BGK equation

Does it describe the macroscopic equations?

Bhatnagar-Gross-Krook (BGK) collision operator: The distribution function f tends exponentially to the equilibrium distribution feq with a characteristic time 𝜏

Related to the kinematic viscosity

Page 33: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

33

Macroscopic equations

Ex.: Equation for density (mass conservation). Integration of the Boltzmann equation

Page 34: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

34

Macroscopic equations

Ex.: Equation for density (mass conservation). Integration of the Boltzmann equation

Page 35: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

35

Macroscopic equations

General procedure: Chapman-Enskog method.Recovers continuity, Navier-Stokes and energy equations.

Ex.: Equation for density (mass conservation). Integration of the Boltzmann equation

Page 36: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

36

Macroscopic equations

Perturbation theory: Expansion for small Knudsen number

Distribution function

Chapman-Enskog method

In the limit of small Knudsen number, the statistics of a fluid is described by the equilibrium distribution function. Off-equilibrium effects (viscosity, heat flux)

appear at non-vanishing Knudsen number.

Page 37: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

37

Macroscopic equations

Mass conservation (continuity): recovered with a first order expansion

Momentum conservation (Navier-Stokes): recovered with a second order expansion

Viscosity stress tensor

Energy conservation: recovered with a fourth order expansion (thermal models)

Page 38: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

38

Gauss-Hermite quadrature

How to calculate the integrals?

Density Momentum

Lattice Boltzmann:● The equilibrium distribution function (Maxwell-

Boltzmann) is expanded in Hermite polynomials up to order N (usually N=2);

● The phase (velocity and position) space is discretized.

● Regular lattices

Gaussian quadrature: ● Approximate integrals by sums:

● The integrand is needed just at few points ξ𝛼;● The method is exact if the function g(ξ) is polynomial up to a maximum order given by the

quadrature (e.g.: for the D2Q9 lattice, the integration is exact for monomials up to fifth order).

where

Page 39: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

39

D2Q9 lattice

Nomenclature DdQq: “d” spatial dimensions and “q” lattice vectorsEx.: D2Q9 - two dimensions and nine velocity vectors

Page 40: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

40

D2Q9 lattice

Quadrature equations

where

Nomenclature DdQq: “d” spatial dimensions and “q” lattice vectorsEx.: D2Q9 - two dimensions and nine velocity vectors

For the D2Q9 lattice

where

Up to the fifth moment of the weight function

The MB distribution is expanded up to second order

Solution

Page 41: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

41

3D lattice

3D lattices

D3Q19 D3Q27

D3Q27

D3Q19

Page 42: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

42

Discrete space

Discrete distribution function

Macroscopic quantities (density and velocity) D2Q9 lattice

Boltzmann equation

Collision step

Streaming step

Δxx

where

Lattice-Boltzmann: Quadrature + Boltzmann Eq.

Page 43: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

43

Algorithm

Page 44: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

44

Boundary conditions

Bounce back BC

● Used for complex and static obstacles (e.g., porous media);

● No-slip condition;● Do not treat moving boundaries.

● Initial and BC conditions are necessary to solve partial differential equations (e.g., N-S);

● Problem: Calculate the distributions from the macroscopic fields.

Periodic BC● Simulates an infinite periodic system;● Conserves the macroscopic quantities.

Page 45: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

45

Forcing scheme

Continuum Boltzmann equation

Discrete form

● External forces (e.g., gravity)● Boundary conditions (e.g., IBM)● Multiphase methods (e.g., Shan-

Chen)

Page 46: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

46

Forcing scheme

Method 1 (Guo): calculate the forcing term explicitly (second order accurate)

Method 2 (Shan-Chen): shift the macroscopic velocity in the equilibrium distribution(first order accurate)

Newton’s law

These two methods are equivalent up to first order in Δxt

Page 47: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

47

Multiphase model

Interaction potential between the particles

Strength of the interaction (repulsive if G is positive)

Force implemented through the velocity:

Multicomponent fluid: more distributions

Page 48: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

48

Conclusion

• Lattice-Boltzmann = Gauss-Hermite quadrature + Boltzmann equation;

• Mesoscopic scale: the LBM numerically solves the Boltzmann equation and “extracts” the macroscopic fields from the distribution functions;

• LBM solves the Navier-Stokes equations (simple mesh generation);

• Naturally treats complex geometries;• Many physical models: multiphase, supersonic, relativistic ...

Page 49: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

49

• Kruger et al, The Lattice Boltzmann Method. Springer (2017);

• Sukop and Torme, Lattice Boltzmann Modeling. Springer (2006);

• Landau and Lifshitz, Fluid Mechanics. Elsevier (2013).

Page 50: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

Units conversion

Three independent conversion factors are required to generate the dimension of mechanical quantities:

Law of similarity: two incompressible flow systems are dynamically similar if they have the same Reynolds number and geometry

Page 51: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

Units conversion

Lattice units● Time step (for one LBM cycle): Δxt = 1● Lattice spacing: Δxx = 1● Fluid density: = 1⍴(

Page 52: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

Thermal models

Energy conservation● Fourth order expansion of the equilibrium distribution function;● Higher order lattices (e.g., D2Q37);● Usually less stable than the isothermal models due to the complexity of the lattices.

Advection-diffusion model: treats temperature as a concentration.

Ex.: smoke

Advection Diffusion Advection-Diffusion(convection)

Page 53: Introduction to the lattice Boltzmann method · Introduction Molecular dynamics Lattice Boltzmann Finite volumes. 9 Introduction Lattice Boltzmann. 10 Introduction Lattice Boltzmann

Advection-diffusion model

Advection-diffusion equation for a concentration C (similar to the NS equation)

The concentration is calculated through the distribution and the velocity is taken from another solver

Evolution

Boussinesq approximation: the effect of a small density change creates a buoyancy force density

The density is changed only in the force term, not in the equilibrium distribution