Skip to main content

Module gpu_lbm

Module gpu_lbm 

Source
Expand description

GPU-accelerated Lattice Boltzmann Method (D2Q9) — CPU mock backend.

Implements the D2Q9 velocity set with BGK collision, periodic streaming, macroscopic quantity recovery, and diagnostic utilities for vorticity and divergence fields.

Structs§

D2Q9Weights
Lattice weight set and direction set for the D2Q9 velocity model.
GpuLbmDispatch
High-level dispatcher that couples a GpuLbmGrid with per-cell boundary conditions and orchestrates time-stepping.
GpuLbmGrid
2-D D2Q9 LBM grid (CPU mock of a GPU backend).
LbmCell
A single D2Q9 LBM cell holding incoming and outgoing distribution functions.
LbmDiagnostics
Diagnostic utilities for LBM simulations.

Enums§

LbmBoundary
Boundary condition type for a cell or face.

Constants§

D2Q9_DIRS
D2Q9 discrete velocity directions [cx, cy].
D2Q9_OPPOSITE
Opposite (bounce-back) indices for D2Q9.
D2Q9_Q
Number of discrete velocities in the D2Q9 velocity set.
D2Q9_WEIGHTS
Standard D2Q9 lattice weights.

Functions§

bgk_equilibrium
Compute the BGK equilibrium distribution for one velocity direction.
relaxation_from_viscosity
Compute the BGK relaxation parameter ω from kinematic viscosity and cs².