Preface
How to Read This Book
Acknowledgements
Contents
Acronyms
Frequently Asked Questions
Getting Started
Capabilities of the LBM
Boundary Conditions
Pressure and Compressibility
Advanced Questions
Part I Background
1 Basics of Hydrodynamics and Kinetic Theory
1.1 Navier-Stokes and Continuum Theory
1.1.1 Continuity Equation
1.1.2 Navier-Stokes Equation
1.1.3 Equations of State
1.2 Relevant Scales
1.3 Kinetic Theory
1.3.1 Introduction
1.3.2 The Distribution Function and Its Moments
1.3.3 The Equilibrium Distribution Function
1.3.4 The Boltzmann Equation and the Collision Operator
1.3.5 Macroscopic Conservation Equations
1.3.5.1 Mass Conservation Equation
1.3.5.2 Momentum Conservation Equation
1.3.5.3 Energy Conservation Equation
1.3.5.4 Discussion
1.3.6 Boltzmann's H-Theorem
References
2 Numerical Methods for Fluids
2.1 Conventional Navier-Stokes Solvers
2.1.1 Finite Difference Method
2.1.1.1 Finite Difference Approximations of Derivatives
2.1.1.2 Finite Difference Methods for CFD
2.1.1.3 Advantages and Disadvantages
2.1.2 Finite Volume Method
2.1.2.1 Finite Volume Approximation of Conservation Equations
2.1.2.2 Finite Volume Methods for CFD
2.1.2.3 Advantages and Disadvantages
2.1.3 Finite Element Methods
2.2 Particle-Based Solvers
2.2.1 Molecular Dynamics
2.2.2 Lattice Gas Models
2.2.2.1 Algorithm
2.2.2.2 Advantages and Disadvantages
2.2.3 Dissipative Particle Dynamics
2.2.4 Multi-particle Collision Dynamics
2.2.4.1 Algorithm
2.2.4.2 Advantages and Disadvantages
2.2.5 Direct Simulation Monte Carlo
2.2.6 Smoothed-Particle Hydrodynamics
2.3 Summary
2.4 Outlook: Why Lattice Boltzmann?
References
Part II Lattice Boltzmann Fundamentals
3 The Lattice Boltzmann Equation
3.1 Introduction
3.2 The Lattice Boltzmann Equation in a Nutshell
3.2.1 Overview
3.2.2 The Time Step: Collision and Streaming
3.3 Implementation of the Lattice Boltzmann Methodin a Nutshell
3.3.1 Initialisation
3.3.2 Time Step Algorithm
3.3.3 Notes on Memory Layout and Coding Hints
3.3.3.1 Initialisation
3.3.3.2 Streaming
3.3.3.3 Updating Macroscopic Variables
3.3.3.4 Equilibrium
3.3.3.5 Collision
3.4 Discretisation in Velocity Space
3.4.1 Non-dimensionalisation
3.4.2 Conservation Laws
3.4.3 Hermite Polynomials
3.4.3.1 Definition and Construction of Hermite Polynomials
3.4.3.2 Orthogonality and Series Expansion
3.4.4 Hermite Series Expansion of the Equilibrium Distribution
3.4.5 Discretisation of the EquilibriumDistribution Function
3.4.6 Discretisation of the Particle Distribution Function
3.4.7 Velocity Sets
3.4.7.1 General Comments and Definitions
3.4.7.2 Construction and Requirements of Velocity Sets
3.4.7.3 Common Velocity Sets for Hydrodynamics
3.4.7.4 Velocity Set Relations
3.4.7.5 Equilibrium Distributions
3.4.7.6 Macroscopic Moments
3.5 Discretisation in Space and Time
3.5.1 Method of Characteristics
3.5.2 First- and Second-Order Discretisation
3.5.2.1 First-Order Discretisation
3.5.2.2 Second-Order Discretisation
3.5.3 BGK Collision Operator
3.5.3.1 Under-, Full and Over-Relaxation
3.5.4 Streaming and Collision
References
4 Analysis of the Lattice Boltzmann Equation
4.1 The Chapman-Enskog Analysis
4.1.1 The Perturbation Expansion
4.1.2 Taylor Expansion, Perturbation, and Separation
4.1.3 Moments and Recombination
4.1.4 Macroscopic Equations
4.2 Discussion of the Chapman-Enskog Analysis
4.2.1 Dependence of Velocity Moments
4.2.2 The Time Scale Interpretation
4.2.3 Chapman-Enskog Analysis for Steady Flow
4.2.4 The Explicit Distribution Perturbation
4.2.5 Alternative Multi-scale Methods
4.3 Alternative Equilibrium Models
4.3.1 Linear Fluid Flow
4.3.2 Incompressible Flow
4.3.3 Alternative Equations of State
4.3.4 Other Models
4.4 Stability
4.4.1 Stability Analysis
4.4.2 BGK Stability
4.4.3 Stability for Advanced Collision Operators
4.4.4 Stability Guidelines
4.5 Accuracy
4.5.1 Formal Order of Accuracy
4.5.2 Accuracy Measure
4.5.3 Numerical Errors
4.5.3.1 Round-Off Error
4.5.3.2 Iterative (Steady-State) Error
4.5.3.3 Discretisation Error
4.5.4 Modelling Errors
4.5.5 Lattice Boltzmann Accuracy
4.5.6 Accuracy Guidelines
4.6 Summary
References
5 Boundary and Initial Conditions
5.1 Boundary and Initial Conditions in LBM in a Nutshell
5.1.1 Boundary Conditions
5.1.2 Initial Conditions
5.2 Fundamentals
5.2.1 Concepts in Continuum Fluid Dynamics
5.2.2 Initial Conditions in Discrete Numerical Methods
5.2.3 Boundary Conditions in Discrete Numerical Methods
5.2.4 Boundary Conditions for LBM: IntroductoryConcepts
5.2.4.1 Which Lattice Sites Should Be Subjected to Boundary Conditions?
5.2.4.2 What Differentiates Boundary Conditions in LBM from Other more Traditional Numerical Methods in Fluid Dynamics?
5.2.4.3 How Can Boundary Conditions Be Formulated for LBM?
5.2.4.4 What Determines the Numerical Accuracy of LB Boundary Conditions?
5.3 Boundary Condition Methods
5.3.1 Periodic Boundary Conditions
5.3.2 Periodic Boundary Conditions with PressureVariations
5.3.3 Solid Boundaries: Bounce-Back Approach
5.3.3.1 Principle of the Bounce-Back Method
5.3.3.2 Fullway Versus Halfway Bounce-Back Method
5.3.3.3 Resting Walls
5.3.3.4 Moving Walls
5.3.3.5 Advantages and Disadvantages
5.3.3.6 Numerical Evaluation of the Accuracy of the Bounce-Back Method
First-order analysis
Second-order analysis
5.3.4 Solid Boundaries: Wet-Node Approach
5.3.4.1 Finding the Density on Boundaries
5.3.4.2 Equilibrium Scheme
Accuracy benchmark of the equilibrium scheme
5.3.4.3 Non-equilibrium Extrapolation Method
Accuracy benchmark of the non-equilibrium extrapolation method
5.3.4.4 Non-equilibrium Bounce-Back Method
5.3.5 Open Boundaries
5.3.5.1 Velocity Boundary Conditions: Bounce-Back Approach
5.3.5.2 Pressure Boundary Conditions: Anti-bounce-Back Approach
5.3.5.3 Velocity Boundary Conditions: Wet-Node Approach
5.3.5.4 Pressure Boundary Conditions: Wet-Node Approach
5.3.6 Corners
5.3.6.1 Corners and the Bounce-Back Rule
5.3.6.2 Corners and the NEBB Method
5.3.7 Symmetry and Free-Slip Boundaries
5.4 Further Topics on Boundary Conditions
5.4.1 The Chapman-Enskog Analysis for Boundary Conditions
5.4.1.1 Bounce-Back Method
5.4.1.2 Non-equilibrium Bounce-Back Method
5.4.2 Mass Conservation at Solid Boundaries
5.4.2.1 Link-Wise Approach: Bounce-Back
5.4.2.2 Wet-Node Approach: Non-equilibrium Bounce-Back
5.4.3 Momentum Exchange at Solid Boundaries
5.4.3.1 Momentum Exchange in the Bounce-Back Method
5.4.3.2 Accuracy of the Momentum Exchange Method
5.4.4 Boundary Conditions in 3D
5.5 Initial Conditions
5.5.1 Steady and Unsteady Situations
5.5.2 Initial Conditions in LB Simulations
5.5.2.1 Role of Populations and Macroscopic Fields
5.5.2.2 Chicken or Egg? Order of Collision and Propagation
5.5.2.3 Consistent Initialisation via a Modified LB Scheme
5.5.3 Example: Decaying Taylor-Green Vortex Flow
References
6 Forces
6.1 Motivation and Background
6.2 LBM with Forces in a Nutshell
6.3 Discretisation
6.3.1 Discretisation in Velocity Space
6.3.2 Discretisation in Space and Time
6.3.2.1 First-Order Integration
6.3.2.2 Second-Order Integration
6.4 Alternative Forcing Schemes
6.4.1 General Observations
6.4.2 Forcing Schemes
6.4.2.1 Guo et al. (2002)
6.4.2.2 Shan and Chen (1993, 1994)
6.4.2.3 He et al. (1998)
6.4.2.4 Kupershtokh (2004)
6.4.2.5 Other, Less Accurate Approaches
6.5 Chapman-Enskog and Error Analysis in the Presenceof Forces
6.5.1 Chapman-Enskog Analysis with Forces
6.5.2 Errors Caused by an Incorrect Force Model
6.5.2.1 Discretisation of Velocity Space: The Issue of Unsteady and Steady Cases
6.5.2.2 Discretisation of Space and Time: The Issue of Discrete Lattice Effects
6.6 Boundary and Initial Conditions with Forces
6.6.1 Initial Conditions
6.6.2 Boundary Conditions
6.6.2.1 Bounce-Back
6.6.2.2 Non-equilibrium Bounce-Back
6.7 Benchmark Problems
6.7.1 Problem Description
6.7.2 Numerical Procedure
6.7.3 Constant Force
6.7.3.1 Bounce-Back
6.7.3.2 Non-equilibrium Bounce-Back
6.7.4 Constant Force and Pressure Gradient
6.7.4.1 Bounce-Back
6.7.4.2 Non-equilibrium Bounce-Back
6.7.5 Linear Force and Pressure Gradient
6.7.5.1 Bounce-Back
6.7.5.2 Non-equilibrium Bounce-Back
6.7.6 Role of Compressibility
6.7.6.1 Constant Force
6.7.6.2 Constant Force and Pressure Gradient
6.7.6.3 Linear Force and Pressure Gradient
References
7 Non-dimensionalisation and Choice of Simulation Parameters
7.1 Non-dimensionalisation
7.1.1 Unit Scales and Conversion Factors
7.1.2 Law of Similarity and Derived Conversion Factors
7.2 Parameter Selection
7.2.1 Parameters in the Lattice Boltzmann Method
7.2.1.1 Viscosity
7.2.1.2 Pressure, Stress and Force
7.2.2 Accuracy, Stability and Efficiency
7.2.2.1 Accuracy and Parameter Scaling
7.2.2.2 Stability
7.2.2.3 Efficiency
7.2.3 Strategies for Parameter Selection
7.2.3.1 Mapping of Dimensionless Physical Parameters
7.2.3.2 Parameter Selection Strategies
7.2.3.3 Small Reynolds Numbers
7.3 Examples
7.3.1 Poiseuille Flow I
7.3.2 Poiseuille Flow II
7.3.3 Poiseuille Flow III
7.3.4 Womersley Flow
7.3.5 Surface Tension and Gravity
7.4 Summary
References
Part III Lattice Boltzmann Extensions, Improvements, and Details
8 Lattice Boltzmann for Advection-Diffusion Problems
8.1 Lattice Boltzmann Advection-Diffusion in a Nutshell
8.2 Advection-Diffusion Problems
8.3 Lattice Boltzmann for Advection-Diffusion
8.3.1 Similarities of Advection-Diffusionand Navier-Stokes
8.3.2 Equilibrium Distribution
8.3.3 Lattice Vectors
8.3.4 Chapman-Enskog Analysis
8.3.4.1 Analysis Procedure
8.3.4.2 Error Term
8.3.5 Model Extensions
8.3.5.1 Source Term
8.3.5.2 Advanced Physical Models
8.3.5.3 Stability Improvements and Advanced Collision Operators
8.4 Thermal Flows
8.4.1 Boussinesq Approximation and Rayleigh-Bénard Convection
8.4.2 Non-dimensionalisation of the Temperature Field
8.4.3 LBM for Thermal Flows with Energy Conservation
8.4.3.1 Single-Population Model
8.4.3.2 Two-Population Model
8.4.4 LBM for Thermal Flows Without EnergyConservation
8.5 Boundary Conditions
8.5.1 Normal and Tangential Conditions
8.5.2 Dirichlet Boundary Conditions
8.5.2.1 Anti-Bounce-Back Scheme
8.5.2.2 Inamuro's Boundary Condition
8.5.3 Neumann Boundary Conditions
8.5.3.1 Inamuro's Flux Boundary Condition
8.5.3.2 Transformation of Neumann into Dirichlet Boundary Condition
8.6 Benchmark Problems
8.6.1 Advection-Diffusion of a Gaussian Hill
8.6.2 Diffusion from Cylinder Without Flow
8.6.3 Diffusion from Plate in Uniform Flow
8.6.4 Diffusion in Poiseuille Flow
References
9 Multiphase and Multicomponent Flows
9.1 Introduction
9.1.1 Liquid-Gas Coexistence and Maxwell Area Construction Rule
9.1.2 Surface Tension and Contact Angle
9.1.3 Sharp and Diffuse Interface Models
9.1.4 Surface Tension and Young-Laplace Test
9.2 Free-Energy Lattice Boltzmann Model
9.2.1 Liquid-Gas Model
9.2.1.1 Bulk Thermodynamics
9.2.1.2 Equations of Motion
9.2.1.3 The Lattice Boltzmann Algorithm
9.2.1.4 Galilean Invariance
9.2.1.5 A Practical Guide to Simulation Parameters
9.2.1.6 Surface Thermodynamics
9.2.1.7 Wetting Boundary Condition
9.2.2 Binary Fluid Model
9.2.2.1 Bulk Thermodynamics
9.2.2.2 Surface Thermodynamics
9.2.2.3 Equations of Motion
9.2.2.4 The Lattice Boltzmann Algorithm
9.2.2.5 A Practical Guide to Simulation Parameters
9.3 Shan-Chen Pseudopotential Method
9.3.1 General Considerations
9.3.2 Multiphase Model for Single Component
9.3.2.1 Physical Interpretation and Equation of State
9.3.2.2 Planar Interface and Thermodynamic Consistency
9.3.2.3 Boundary Conditions and Contact Angle
9.3.2.4 Algorithm and Forcing Schemes
9.3.2.5 Example: Young-Laplace Test
9.3.3 Multicomponent Method Without Phase Change
9.3.3.1 Shan-Chen Force and Algorithmic Implications
9.3.3.2 Fluid Velocity in the Multicomponent Model
9.3.3.3 Component Forces
9.3.3.4 Immiscible and (Partially) Miscible Fluids, Surface Tension
9.3.3.5 Boundary Conditions and Contact Angle
9.4 Limitations and Extensions
9.4.1 Spurious Currents and Multirange Forces
9.4.1.1 Shan-Chen Model
9.4.1.2 Free-Energy Model
9.4.2 Equation of State and Liquid-Gas Density Ratio
9.4.3 Restrictions on the Surface Tension
9.4.4 Viscosity Ratio and Collision Operator
9.4.5 What Else Can Be Done with These Models?
9.5 Showcases
9.5.1 Droplet Collisions
9.5.2 Wetting on Structured Surfaces
9.5.2.1 Chemical Patterning
9.5.2.2 Topographical Patterning: Superhydrophobic Surfaces
References
10 MRT and TRT Collision Operators
10.1 Introduction
10.2 Moment Space and Transformations
10.3 General MRT Algorithm
10.4 MRT for the D2Q9 Velocity Set
10.4.1 Hermite Polynomials
10.4.2 Gram-Schmidt Procedure
10.4.3 Discussion of MRT Approaches
10.5 Inclusion of Forces
10.6 TRT Collision Operator
10.6.1 Introduction
10.6.2 Implementation
10.7 Overview: Choice of Collision Models and Relaxation Rates
10.7.1 BGK Model
10.7.2 TRT Model
10.7.3 MRT Model
References
11 Boundary Conditions for Fluid-Structure Interaction
11.1 Motivation
11.2 Bounce-Back Methods
11.2.1 Simple Bounce-Back and Staircase Approximation
11.2.1.1 Revision of the Halfway Bounce-Back Method
11.2.1.2 Stationary Boundaries
11.2.1.3 Rigid Moving Particles
11.2.2 Interpolated Bounce-Back
11.2.2.1 Basic Algorithm
11.2.2.2 Moving Boundaries
11.2.2.3 Extended and Alternative Methods
11.2.3 Partially Saturated Bounce-Back
11.2.3.1 Basic Algorithm
11.2.3.2 Advantages and Limitations
11.2.4 Destruction and Creation of Fluid Nodes
11.2.5 Wall Shear Stress
11.3 Ghost Methods
11.3.1 Definitions
11.3.2 Filippova-Hänel (FH) and Mei-Luo-Shyy (MLS) Methods
11.3.2.1 Original Method by Filippova and Hänel (FH)
11.3.2.2 Improvements by Mei, Luo and Shyy (MLS)
11.3.3 Guo-Zheng-Shi (GZS) Method
11.3.4 Image-Based Ghost Methods
11.4 Immersed Boundary Methods
11.4.1 Introduction
11.4.2 Mathematical Basis
11.4.2.1 Eulerian and Lagrangian Systems
11.4.2.2 Continuous Governing Equations
11.4.2.3 Discretised Governing Equations
11.4.2.4 Kernel Functions
11.4.2.5 General IB-LBM Algorithm
11.4.2.6 Implications of the Combination of IBM and LBM
11.4.2.7 Distribution of Markers in Space
11.4.2.8 Accuracy and Convergence
11.4.3 Explicit Feedback IBM for Rigid Boundaries
11.4.3.1 Algorithm
11.4.3.2 Stationary Boundary: Poiseuille Flow
11.4.4 Direct-Forcing IB-LBM for Rigid Boundaries
11.4.4.1 Background
11.4.4.2 Implicit IB-LBM
11.4.4.3 Multi Direct-Forcing IB-LBM
11.4.4.4 Explicit, Non-iterative Direct-Forcing IB-LBM
11.4.5 Explicit IBM for Deformable Boundaries
11.4.5.1 Constitutive Models
11.4.6 Additional Variants and Similar BoundaryTreatments
11.5 Concluding Remarks
References
12 Sound Waves
12.1 Background: Sound in Viscous Fluids
12.1.1 The Viscous Wave Equation
12.1.2 The Complex-Valued Representation of Waves
12.1.3 Simple One-Dimensional Solutions: Free and Forced Waves
12.1.4 Time-Harmonic Waves: The Helmholtz Equation
12.1.5 Other Attenuation and Absorption Mechanisms
12.1.6 Simple Multidimensional Waves: The Green'sFunction
12.2 Sound Propagation in LB Simulations
12.2.1 Linearisation Method
12.2.2 Linearisation Results
12.2.2.1 Forced Waves
12.2.2.2 Free Waves
12.2.2.3 Discussion
12.3 Sources of Sound
12.3.1 Example: The Pulsating Sphere
12.3.2 The Inhomogeneous Wave Equation
12.3.3 Point Source Monopoles in LB Simulations
12.4 Non-reflecting Boundary Conditions
12.4.1 Reflecting Boundary Conditions
12.4.2 Characteristic Boundary Conditions
12.4.3 Absorbing Layers
12.5 Summary
References
Part IV Numerical Implementation of the Lattice Boltzmann Method
13 Implementation of LB Simulations
13.1 Introduction
13.1.1 Programming Languages and Development Tools
13.1.2 Floating Point Arithmetic
13.1.3 Taylor-Green Vortex Decay
13.2 Optimisation
13.2.1 Basic Optimisation
13.2.2 Automatic Optimisation During Compilation
13.2.3 Memory Caches
13.2.4 Measuring Performance
13.3 Sequential Code
13.3.1 Introductory Code
13.3.2 Optimising the Introductory Code
13.3.3 Data Output and Post-Processing
13.3.4 LBM Algorithm Optimisations
13.4 Parallel Computing
13.4.1 Multithreading and OpenMP
13.4.1.1 OpenMP Directives
13.4.1.2 Data Sharing
13.4.1.3 Compiling and Running OpenMP Code
13.4.1.4 Multithreaded LBM Implementation
13.4.1.5 Performance Results
13.4.2 Computing Clusters and MPI
13.4.2.1 MPI Concepts
13.4.2.2 MPI LBM Implementation
13.4.2.3 Blocking and Non-blocking Communications
13.4.2.4 Collective Communications
13.4.2.5 I/O
13.4.2.6 Compilation and Execution
13.4.2.7 Performance Results
13.4.3 General Purpose Graphics Processing Units
13.4.3.1 NVIDIA GPU Architecture
13.4.3.2 Programming Model
13.4.3.3 Code Compilation and Execution
13.4.3.4 GPU LBM Implementation
13.4.3.5 GPU Performance Optimisation and Results
13.4.3.6 Further Reading
13.5 Convergence Study
13.6 Summary
References
Appendix
A.1 Index Notation
A.2 Details in the Chapman-Enskog Analysis
A.2.1 Higher-Order Terms in the Taylor-Expanded LBE
A.2.2 The Moment Perturbation
A.2.3 Chapman-Enskog Analysis for the MRT Collision Operator
A.3 Taylor-Green Vortex Flow
A.4 Gauss-Hermite Quadrature
A.5 Integration Along Characteristics for the BGK Operator
A.6 MRT for D3Q15, D3Q19, and D3Q27 Velocity Sets
A.6.1 D3Q15
A.6.2 D3Q19
A.6.3 D3Q27
A.7 Planar Interface for the Free Energy Gas-Liquid Model
A.8 Planar Interface for the Shan-Chen Liquid-Vapour Model
A.9 Programming Reference
A.9.1 Comments
A.9.2 Expressions and Operators
A.9.3 Data Types
A.9.4 Composite Data Types
A.9.5 Variable Scope
A.9.6 Pointers
A.9.7 Dynamic Memory Allocation
A.9.8 Arrays
A.9.9 If Statement
A.9.10 While Loop
A.9.11 For Loop
A.9.12 Functions
A.9.13 Screen and File Output
A.9.14 Header Files
A.9.15 Compilation and Linking
References
Index