3. Kernels
3.1. Macro Variables
3.1.1. Formula for Density (array named m0)
The density \(m0[idx]\) is computed as the sum of the distribution function values over all directions (from 0 to \(Q-1\)):
Where:
\(s_i = pf(idx, i)\) is the distribution function for lattice direction \(i\).
3.1.2. Formula for Velocity (array of 3D Vector named m1)
The velocity components \(u_x\), \(u_y\), and \(u_z\) are calculated as the weighted sum of the distribution functions and the corresponding lattice velocity components \(e_{x,i}\), \(e_{y,i}\), and \(e_{z,i}\):
Where:
\(s_i = pf(idx, i)\) is the distribution function for lattice direction \(i\).
\(e_{x,i}, e_{y,i}, e_{z,i}\) are the components of the lattice velocities for direction \(i\).
After computing the velocity components, they are normalized by the density \(\rho\) (if \(\rho \neq 0\)):
Finally, the velocity vector \(m1[idx]\) is stored as:
Where Vec3d represents the 3D velocity vector.
Operator name:
macro_variables
Description: A functor for computing macroscopic variables (densities and flux) for lattice Boltzmann method.
Parameters: No parameters but you need to define
lbm_parameters
.
Yaml example:
- macro_variables
3.2. Collision BGK
Operator name:
bgk
Description: This operator implements the Bhatnagar-Gross-Krook (BGK) collision model for the Lattice Boltzmann Method (LBM). This model assumes a single relaxation time approach to approximate the collision process, driving the distribution functions toward equilibrium.
Parameters: No parameters but you need to define
lbm_parameters
.Formula:
With:
\(f_i(\mathbf{x}, t)\) is the distribution function in the i-th direction at position x and time t,
\(f_i^{\text{eq}}(\mathbf{x}, t)\) is the equilibrium distribution function for the i-th direction at position x and time t,
\(\tau\) is the relaxation time parameter (LBMParameters).
Yaml example:
- bgk
3.3. Collision MRT
Operator name:
mrt
Description: This operator implements the MRT collision model for the Lattice Boltzmann Method (LBM). This model assumes a single relaxation time approach to approximate the collision process, driving the distribution functions toward equilibrium.
Parameters: No parameters but you need to define
lbm_parameters
.
Yaml example:
- mrt
3.4. Streaming
The streaming step is divided into two parts (step1 and step2), and synchronization is required between these two steps to correctly update the ghost halos.”
Operator name:
streaming
Description: TO DO
Parameters:
asynchrone
: The asynchrone option controls the execution style: when true, it allows asynchronous operations with overlapping computation and communication, improving parallel performance. When false, it runs synchronously, ensuring sequential execution of operations and data updates.
Yaml example:
- streaming:
asynchrone: false
Note
asynchrone
option is disabled.