Table of Contents
1.1 Introduction
β’
If we can solve the Boltzmann equation numerically, this may also indirectly give us a solution to the Navier-Stokes Equation (NSE).
β’
The numerical scheme for the Boltzmann equation somewhat paradoxically turns out to be quite simple, both to implement and to parallelise.
β¦
A simple hyperbolic equation which essentially describes the advection of the distribution function with the particle velocity .
β¦
The ource term depends only on the local value of and not on its gradients.
1.2 The Lattice Boltzmann Equation in a Nutshell
1.2.1 Overview
β’
The basic quantity of the Lattice Boltzmann Method (LBM) is the discrete-velocity distribution function .
β¦
It represents the density of particles with velocity at position and time .
β¦
Mass density and momentum density can be expressed as:
β’
The time step and lattice spacing respectively represent a time resolution and a space resolution in any set of units.
β¦
The most common choice in the LB (Lattice Boltzmann) literature is lattice units β and .
β¦
We can convert quantities between lattice units and physical units. β Law of Similarity: only ensure that the relevant dimensionless numbers.
β’
The discrte velocities and weighting coefficients form velocity sets .
β¦
Different velocity sets are used for different purposes.
β¦
These velocity sets are usually denoted by , where is the number of spatial dimensions the velocity set covers and is the setβs number of velocities.
β¦
Commonly used velocity sets: , , , , and . β In 3D, the most commonly used velocity set is .
β’
In the basic isothermal LBE (Lattice Boltzmann Equation), determines the relation between pressure and density .
β¦
Because of this relation, it can be shown that represents the isothermal modelβs speed of sound.
β¦
In all the velocity sets, this constant is .
β’
By discretising the Boltzmann equation in velocity space, physical space, and time, we find the LBE:
β¦
This expresses that particles move with velocity to a neighbouring point at the next time step .
β¦
At the same time, particles are affected by a collision operator .
β’
The simplest collision operator that can be used for Navier-Stokes simulations is the BGK (Bhatnagar-Gross-Krook) operator:
β¦
It relaxes the populations towards an equilibrium at a rate determined by the relaxation time .
β¦
This equilibrium is given by:
β¦
The equilibrium is such that its moments are the same as those of , i.e. and .
β¦
The equilibrium depends on the local quantities density and fluid velocity only.
β’
The link between the LBE and the NSE can be determined using the Chapman-Enskog analysis.
β¦
The LBE results in macroscopic behaviour according to the NSE, with the kinematic shear viscosity given by the relaxation time as:
β¦
The kinematic bulk viscosity given as
1.2.2 The Time Step: Collision and Streaming
β’
The Lattice BGK (LBGK) equation reads:
β¦
We can decompose this equation into two distinct parts: Collision (or Relaxation) & Streaming (or Propagation).
β’
The first part is collision:
β¦
represents the distribution function after collisions
β¦
is found from:
β¦
If β
β’
The second part is streaming:
β’
Overall, the LBE concept is straightforward.
β¦
Collision: one calculates the density and the macroscopic velocity to find the equilibrium distributions and the post-collision distribution .
β¦
Streaming: we stream the resulting distribution to neighbouring nodes.
1.3 Implementation of the Lattice Boltzmann Method in a Nutshell
1.3.1 Initialization
β’
The simplest approach to initializing the populations at the start of a simulation is to set them to:
via:
β’
Often, the values and are used.
1.3.2 Time Step Algorithm
β’
The core LBM algorithm consists of a cyclic sequence of substeps, with each cycle corresponding to one time step.
β¦
The dark grey boxes show sub-steps that are necessary for the evolution of the solution.
β¦
The light grey box indicates the optional output step.
β¦
The pale boxes indicate steps with details provided in later sections (Boundary Conditions & Forces).
1.
Compute the macroscopic moments and from via:
2.
Obtain the equilibrium distribution from:
3.
If desired, write the macroscopic fields , , and/or to the hard disk for visualisation or post-processing. The viscous stress tensor can be computed from:
4.
Perform collision (relaxation) as shown in:
5.
Perform streaming (propagation) via:
6.
Increase the time step, setting to , and go back to step 1 until the last time step or convergence has been reached.
1.3.3 Notes on Memory Layout and Coding Hints
β’
Initialisation
β¦
In a 2D simulation,
βͺ
Macroscopic fields (2D arrays) β , ,
βͺ
Populations (3D array) β
βͺ
and are the number of lattice nodes in x- and y-directions and is the number of velocities.
β’
Streaming
β¦
The streaming step must be implemented carefully to prevent overwriting population data before it has been streamed from the source node.
β¦
Three common strategies exist to handle this:
1.
Opposite-Direction Sweep: Use a temporary buffer for a single population while sweeping through memory in the direction opposite to streaming.
β’
Helper functions like circshift (Matlab), numpy.roll (Python), and CSHIFT (Fortran) can simplify this approach.
2.
Two-Array (Swap) Method: Allocate two full population arrays (, ).
β’
Read from and write the streamed populations to .
3.
Combined Stream-and-Collide: Perform streaming and collision in a single, fused step.
β’
This reads required populations from adjacent nodes directly into the collision calculation at the current node.
β’
Updating Macroscopic Variables
β¦
Instead of using loops, unroll the summations for calculating macroscopic moments like density and velocity . β Increase the CPUβs computing efficiency.
β¦
For the velocity set, the unrolled implementations would be:
β’
Equilibrium
β¦
It is recommended to unroll the loops for the equilibrium computation ( ), writing separate expressions for each direction of the distributions.
β¦
Pre-calculate constants to avoid expensive divisions inside the main loop ( , ).
β’
Collision
β¦
To optimize the collision step , pre-calculate the relaxation frequency.
βͺ
Define constants like and once before the main loop.
βͺ
The collision step then becomes a more efficient calculation: .
1.4 Discretization in Velocity Space
1.4.1 Non-Dimensionalization
β’
To simplify the derivation, the governing equations are non-dimensionalized.
β’
The continuous and force-free Boltzmann equation in its non-dimensional form is:
β¦
: Particle distribution function.
β¦
: Components of the spatial coordinate vector .
β¦
: Components of the particle velocity vector .
β¦
: Collision operator.
β’
The corresponding non-dimensional equilibrium distribution function is:
β¦
: Equilibrium distribution function.
β¦
: Non-dimensional temperature.
β¦
: Number of spatial dimensions.
1.4.2 Hermite Polynomials
β’
Hermite Polynomials (HPs) are used for the discretization of integrals and form the mathematical basis of the Hermite series expansion.
β’
They are a set of orthogonal polynomials constructed from a Gaussian weight function .
β’
The multidimensional HP of rank is defined as:
β¦
: Hermite Polynomial tensor of rank .
β¦
: Gaussian weight function.
β¦
: th order gradient operator.
1.4.3 Hermite Series Expansion of the Equilibrium Distribution
β’
The equilibrium distribution function is expanded into an infinite Hermite series.
β¦
A key insight is that the expansion coefficients are directly related to the macroscopic moments of the fluid (density, momentum, energy, etc.).
β’
The equilibrium distribution function has the same mathematical form as the Hermite weight function , allowing it to be expressed as:
β¦
: The equilibrium distribution function.
β¦
: Macroscopic density.
β¦
: Macroscopic velocity.
β¦
: Non-dimensional temperature.
β¦
: Particle velocity vector.
β¦
: Number of spatial dimensions.
β¦
: The Hermite weight function (a Gaussian).
β’
Key Conclusion: To recover the correct macroscopic conservation laws for hydrodynamics, it is sufficient to truncate the Hermite series expansion after the second-order term.
β¦
This is a crucial simplification that makes the LBM computationally feasible.
1.4.4 Discretisation of the Equilibrium Distribution Function
β’
The Gauss-Hermite quadrature rule is used to replace continuous integrals over velocity space with discrete, weighted sums.
β This rule allows for the exact integration of polynomials by sampling them at a few specific points called abscissae .
β’
To obtain velocity sets with simple integer components, the abscissae are rescaled to define the discrete particle velocities :
β’
This procedure yields the final form of the discrete equilibrium distribution function. This equation is a cornerstone of the LBM, shown here for an isothermal () system:
β¦
The Greek letters and are indices representing the Cartesian coordinate components ( , , ).
βͺ
The Einstein summation convention is applied. β (the vector dot product).
βͺ
is the Kronecker delta, which is 1 if and 0 if .
β¦
: The discrete equilibrium distribution for the th velocity direction.
β¦
: The lattice weight associated with direction .
β¦
: The macroscopic fluid density.
β¦
: The macroscopic fluid velocity vector ( and are its components).
β¦
: The discrete velocity vector for direction ( and are its components).
β¦
: The lattice speed of sound, a constant determined by the velocity set.
1.4.5 Discretisation of the Particle Distribution Function
β’
The same discretization process used for the equilibrium function is now applied to the non-equilibrium particle distribution function .
β¦
This projects the continuous function onto the discrete velocity set , resulting in a finite set of populations .
β¦
These populations become the fundamental variables of the LBM.
β’
The evolution of these discrete populations is governed by the discrete-velocity Boltzmann equation:
β¦
: The discrete particle distribution (or population) for direction at position and time .
β¦
: The component of the discrete velocity . The repeated implies summation over all spatial components.
β¦
: The discrete collision operator acting on the th population.
β’
A major consequence of this discretization is that macroscopic quantities are now computed through simple, computationally efficient summations over the discrete populations:
1.4.6 Discretisation of the Particle Distribution Function
β’
A key component of the Lattice Boltzmann Method is the choice of the discrete velocity set and its corresponding weights .
β’
General Comments and Definitions
β¦
Velocity sets are commonly named using the notation, where is the number of spatial dimensions and is the number of discrete velocities.
β¦
Implementation Warning: The numbering of velocity vectors (ββ vs. ββ) is not consistent across the literature.
β¦
Here follows the convention of using index for the rest velocity () if one exists.
β’
Construction and Requirements of Velocity Sets
β¦
To correctly solve the NSE, a velocity set and its weights must satisfy certain isotropy conditions.
β¦
The key conditions are:
β¦
Additional Constraints for Standard LBM:
βͺ
All weights must be non-negative: .
βͺ
For simple streaming on a uniform grid, the velocity components are typically integer multiples of .
β In lattice units where and , the velocity vectors have integer components.
β’
Common Velocity Sets for Hydrodynamics
β¦
The most common velocity sets used for hydrodynamic simulations are , , , , and .
β¦
Practical Guidance for 3D Simulations:
βͺ
is generally a good compromise for simulating laminar flows.
βͺ
offers better rotational invariance and is preferred for high Reynolds number or turbulent flows, although it is more computationally expensive.
β’
Equilibrium Distributions
β¦
To improve computational performance, it is highly recommended to use the "unrolled" form of the equilibrium equation for each direction rather than calculating it in a loop.
β¦
Example for (using and in lattice units):
β’
Macroscopic Moments
β¦
The velocity sets are designed such that the moments of the equilibrium distribution can be expressed simply in terms of macroscopic variables.
β These relations are fundamental to the Chapman-Enskog analysis that proves the LBM-to-NSE correspondence.
β¦
The key equilibrium moments are:
1.5 Discretization in Space and Time
1.5.1 Method of Characteristics
β’
Core Idea:
β¦
The method transforms the partial differential equation (PDE) for the discrete populations into a simpler ordinary differential equation (ODE) that is valid along specific trajectories in spacetime, known as "characteristics."
β’
Starting Equation:
β¦
The starting point is the discrete-velocity Boltzmann equation.
β¦
: The discrete population for direction .
β¦
: The discrete velocity vector for direction ( is its component).
β¦
: The discrete collision operator.
β’
The Transformation to an ODE (The Characteristic Trajectory):
β¦
The advection operator on the left , is converted into a total derivative along a characteristic trajectory defined by:
β¦
This simplifies the original PDE to an ODE along this trajectory:
β’
The Integral Form (Key Result):
β¦
By integrating the ODE along the characteristic trajectory over a single time step from to , we obtain the integral form of the LBE.
β¦
The integration of the left-hand side is exact, according to the fundamental theorem of calculus.
β¦
The resulting equation, generalized for any arbitrary starting point is:
β¦
This equation is central because it reveals the discretization pattern:
1.
Left-hand side: An exact, discrete update rule for propagation, showing that during a time step , the population moves from to .
2.
Right-hand side: An integral of the collision term along the trajectory, which must be approximated in subsequent steps.
1.5.2 First- and Second-Order Discretization
β’
First-Order Discretization
β¦
The simplest approximation uses a first-order (rectangular) rule, which evaluates the collision operator at the beginning of the time step .
β¦
This approximation of the integral results in the explicit discretized LBE:
β’
Second-Order Discretization
β¦
A more accurate approximation uses the second-order trapezoidal rule to evaluate the collision integral:
β¦
This scheme is initially implicit because the collision term at time depends on the unknown populations at that same time.
β¦
However, through a specific change of variables (), this implicit equation can be transformed into an explicit equation that has the same form as the one derived from the first-order rule.
β’
The fact that the second-order accurate trapezoidal scheme can be rewritten into the same form as the first-order scheme proves that the standard LBE is second-order accurate in time.
1.5.3 BGK Collision Operator
β’
To complete the LBE, the collision operator must be specified.
β The simplest and most widely used choice is the Bhatnagar-Gross-Krook (BGK) model, also known as the single-relaxation-time (SRT) model.
β’
Definition
β¦
The BGK operator models the complex process of particle collisions as a simple linear relaxation of each population towards its corresponding local equilibrium state :
β¦
: The discrete particle population for direction .
β¦
: The discrete equilibrium population.
β¦
: A characteristic time scale known as the relaxation time, which controls the rate of equilibration.
β’
The Lattice BGK (LBGK) Equation
β¦
Substituting the BGK operator into the discretized LBE (first-order discretization) yields the full Lattice BGK (LBGK) equation:
β¦
This simple form is capable of reproducing the full Navier-Stokes equations, which is a primary reason for the popularity of the LBM.
β¦
Note on Accuracy and Other Operators:
βͺ
Although the LBGK equation above can be derived from a first-order time integration, it is actually second-order accurate in time.
βͺ
More advanced operators like the Two-Relaxation-Time (TRT) and Multiple-Relaxation-Time (MRT) models exist to overcome some of its limitations.
β’
Relaxation Regimes and Stability
β¦
The behavior of the discrete LBGK equation depends on the dimensionless ratio .
βͺ
Under-Relaxation (): decays exponentially towards , similar to the continuous-time case.
βͺ
Full-Relaxation (): relaxes directly to in a single step.
βͺ
Over-Relaxation (): oscillates around with an exponentially decreasing amplitude.
β¦
This analysis reveals a necessary condition for the numerical stability of the LBGK model:
βͺ
If , the populations will oscillate with an exponentially increasing amplitude, leading to instability.
1.5.4 Streaming and Collision
β’
The Lattice BGK (LBGK) equation can be logically and algorithmically separated into two distinct substeps that are performed: collision (or relaxation) and streaming (or propagation).
1.
Collision (Relaxation) Step:
β’
This is a purely local operation where the particle populations at each lattice site relax towards their local equilibrium .
β’
The state of the population after collision , is calculated as:
β’
For computational efficiency, this is often implemented as:
β¦
The choice is particularly efficient as it simplifies the collision to .
2.
Streaming (Propagation) Step:
β’
This is a non-local operation; the post-collision populations move along their associated velocity vectors to the neighboring lattice sites.
β’
This updates the populations for the next time step :






