# Theory and Implementation¶

## Introduction¶

The M-Star Solver is a lattice-Boltzmann-based computational fluid dynamics tool used to solve the time-dependent Navier-Stokes equations. Unlike conventional CFD tools, which describe the variation and transport of macroscopic flow variables (e.g. velocity and pressure) across a flow domain, lattice-Boltzmann is a mesoscopic modeling tool that describes the space-time dynamics of a probability distribution function across phase-space. This mesoscopic approach, which is inherently time-dynamic, enables superior turbulence modeling capabilities, faster run times, and scales more favorably with increasing system complexity. The purpose of this section is to summarize the physics governing fluid transport in the solver.

## The Boltzmann Equation¶

M-Star CFD solves the Boltzmann transport equation, which describes the time-evolution of the molecular probability density function \(f\) in phase space [1,2]:

where \(f(x,t)\) is the probability function, \(\zeta\) are the microscopic velocities, \(K\) is any external body force, and \(Q(f,f)\) is a collision operator.

The probability density here corresponds to an ensemble of molecules. As such, \(f dx d\zeta\) is the number of molecules with molecular velocity \(\zeta\) at location \(x\) at time \(t\). Macroscopic variables can be recovered from moments of the distribution function, such as density

and momentum

The collision operator \(Q(f,f)\) is very complex for an n-body molecular system. But, as argued by Bhatnagar, Gross, Krook (1954), the net effect of this many-body collision should be to drive the local distribution function towards an equilibrium distribution.

where \(f^0\) is the so-callled equilibrium probability function and \(\tau\) is the relaxation time.

The relaxation time describes how quickly the distribution relaxes to its equilibrium state over time. This relaxation time, along with the simulation time-step and resolution, will be linked to the local fluid viscosity. Note that, although the external the body force has disappeared, it will return to inform the equilibrium distribution.

## Discretization¶

In Sec\(.\) [1], we assumed that the distribution functions are continuous across \(\zeta\) and \(x\). That is, molecules can assume any position and any velocity vector (quantum limits notwithstanding). In order to make the algorithm tractable, we choose to discretize the molecular velocities into a finite number of velocity vectors. That is, instead of being able to assume arbitrary velocity vectors, individual molecules can only realize velocities defined from a pre-defined set [1-3]:

where the \(i\) subscript implies a specific velocity vector. Although individual velocities are discretized, the ensemble average velocity can assume any value.

The choice of discrete vectors is not arbitrary. Only specific groups of velocity vectors will maintain isotropic flow conditions and, in the macroscopic limit, recover the Navier-Stokes equations. One suitable set of velocity vectors, called the D3Q19 basis. Other stable basis sets, including D3Q15 and D3Q27 are also available. We find that the D3Q19 lattice provides the best balance between stability and speed.

Using a forward Euler expansion along each of these discrete velocity vectors, we can re-cast Eqn\(.\) [5] into:

where \(\Delta x\) is a discrete lattice spacing, \(\Delta t\) is a time-step.

Non-dimensionalizing the molecular velocity by these discretization parameters then gives:

where \(\tau\) has become non-dimensional and \(c_i\) is the non-dimensional lattice velocity, defined by:

- As presented in Eqns\(.\) [2] and [3],
we can recover macroscopic variables from:

\[\label{9} \rho\left({x},t\right)=\sum_{i=0}^N f_i\]

and momentum

\[\label{10} \rho {u}\left({x},t\right)=\sum_{i=0}^N c_i f_i\]

## Equilibrium Distribution Function¶

Since fluid molecules follow Maxwellian statistics, the equilibrium distribution function follows from the Maxwell distribution:

where \(m\) is the molecular mass, \(R\) is the gas constant, \(T\) is the temperature, \({\zeta}\) is the molecular velocity, and \({u}\) is the macroscopic flow velocity. In the limit of low Mach numbers, we can use a third-order Taylor expansion to recast Eqn\(.\) [11] as:

which, for systems with discrete velocity vectors becomes:

where \(i\) is an index over the discrete velocity space, \(t_i\) is a weighting index for each vector, and \(c_i\) represent the allowable velocity vectors.

Following Fig\(.\) 1, the weights for the D3Q19 model are:

## The Algorithm¶

### Streaming¶

Time integration involves two components: (i) streaming and (ii) collision. The streaming process is illustrated in Fig\(.\) 2: the orange distribution at the center lattice point moves to the nearest neighbor lattice sites, while red distributions come from the nearest neighbor lattice to occupy the velocity vectors at the center lattice. By design, the allowable velocity vectors point to directly nearest neighbors. The processes is representative of molecules streaming between neighboring domains. Because this process occurs on a lattice with characteristic spacing \(\Delta x\) over a characteristic time step \(\Delta t\), it defines a lattice velocity, \(u_{LB}\):

Mathematically, \(u_{LB}\) is the speed at which information (probability) moves through the domain. Physically, \(u_{LB}\) can be interpreted as the speed of sound and will inform the compressibility of the fluid.

### Collisions¶

Following the streaming exchange between nearest neighbor lattice points, the newly arrived distributions at each lattice site undergo a collision process. The collision process, as illustrated in Fig\(.\) 3, drives the molecular distribution function towards the equilibrium distribution function at rate defined by \(\tau\) (see Eqn\(.\) [5]). The equilibrium distribution function is unique to each lattice site and is informed by the local (and instantaneous) macroscopic density and velocity (see Eqn\(.\) [13]). Although the relaxation process modifies the distribution of molecules across the velocity basis vectors, it does not change the macroscopic density and velocity.

Mathematically, the time scale associated with the collision process is assumed to be short compared to the time scale associated with streaming. Physically, this implies that the fluid is operating in low Knudsen number regime (a continuum).

Recall that a low Mach number assumption was evoked when expanding the Maxwell distribution to arrive Eqn\(.\) [12]. Thus, the algorithm presented here is strictly valid in low Knudesen number, low Mach number regimes. Alternative Boltzmann-based approaches for modeling fluids at higher Knudsen numbers and Mach numbers are available in the literature.

### Process Flow¶

The origins of the name “lattice-Botlzmann” should by now be apparent: the Boltzmann transport equation is solved acros

## Scalar Transport¶

### The Convection-Diffusion Equation¶

Species transport at each lattice point \(i\) is modeled via the convection-diffusion equation:

where \(c\) is the concentration of the scalar field, \(D\) is the diffusion coefficient, \({v}\) is the macroscopic velocity field, and \(R\) is a source/sink term.

Equation [48] is solved using a flux conserving scheme. Within this scheme, each lattice point defines the center of a cubic cell that exchanges species with neighboring cells through its six cell walls. If the total volume, \(V\), of each cell is defined as:

then the amount of scalar field defined each cell is defined as:

For each cubic cell, the change in \(Q_i\) over time is governed by the flux exchange between neighbor cells:

where the \({i,x-1/2}\) subscript indicates the position of the interface relative to the cell center, \(f\) is the flux, and \(S\left(=\Delta x \Delta x \right)\) is the surface area of the cell.

Recognizing that this update is done at the half-time, and linearizing the time-derivative gives:

Per the Lax Equivalence Theorem, the functional form of \(f\) in Eqn\(.\) [51] is not arbitrary; the algorithm used to define \(f\) must be both stable and consistent. [8] One option for ensuring stability, called the Lax-Wendroff algorithm, is to add precisely enough artificial viscosity to keep the algorithm stable. A second option for ensuring stability is to define a van Leer flux limiter, which performs second-order advection in regions where the flow field is smooth, and donor-cell advection near gradients. For highly turbulent systems dominated by scalar advection, the behavior of both algorithms is similar. For laminar or transitional systems, where diffusion must be controlled, the van Leer flux limiter should be used.

### Particle Transport¶

Particles are modeled as discrete point masses with trajectories governed by Newton’s Second Law:

where \(m_i\) is the mass of particle, \({v}\) is the velocity, \({F}_g\) is the gravity force, \({F}_b\) is the buoyancy force, \({F}_d\) is the drag force with the fluid, and \({F}_p\) is the inter-particle collision force. The local drag force is valuated using literature sphere drag data [8]. Although inter-particle collisions are modeled as hard-sphere interactions by default, it is straightforward to extend these interactions to model aggregation and break-up. Note that particle dynamics are not confined to the lattice, and they can occupy arbitrary positions and velocity vectors.

## References¶

[1] S. Succi. *The lattice Boltzmann equation for fluid dynamics and
beyond*, Oxford: Oxford University Press, 2001.

[2] C. Shu and Z. Guo. Lattice Boltzmann method and its applications in engineering. New Jersy: World Scientific, 2013.

[3] T. Kruger, H. Kusumaatmaja, A. Kuzmin, O. Shardt, G. Silva, and E. Viggen. The lattice Boltzmann method: principles and practice. Switzerland: Springer, 2017.

[4] Z. Feng and E. Michaelides. *J. Comp. Phys.*, 195(2):602-628, 2005

[5] C. Peskin. *Acta Math.*, 11:479-517, 2002

[6] M. Sukop and D. Thorne. *Lattice Boltzmann Modeling: an Introduction for
Geoscientists and Engineers*, Heidelberg: Springer, 2006

[7] R. LeVeque. *Finite Volume Methods for Hyperbolic Problems*, Cambridge
University Press, 2002

[8] A. Morrison. *An Introduction to Fluid Mechanics*, Cambridge University
Press, 2013