LBSIM is a CUDA high-performance Computational Fluid Dynamics simulation code based on the Lattice Boltzmann Method. It's a code for simulating low-speed incompressible flows. It is currently in its first development steps, capable of running the two-dimensional Lid-Driven Cavity benchmark with different grid sizes and flow properties. The code can both run sequentially on the CPU and in parallel on the GPU.
In the LBM part of the code, we have calculated the equilibrium in each cell using the macroscopic quantities and then performed the collision according to the BGK-operator. We directly used the Zou-He scheme for the boundary condition in moving no-slip walls and pure bounce back for fixed walls.
We are creating two programs, and both are D2Q9 Lattice Boltzmann codes. The first one runs in series and is written in C++. The second one is parallelized with a GPU. Functions in the GPU are the initialization of distribution function, setting the boundary conditions, collision, and streaming. The code will be more noticeably faster when it is run for a high-resolution problem.
You can change different parameters such as Reynolds number, number of the cells, time steps, and wall velocities to get different results using the cases/LidDrivenCavity/LidDrivenCavity.dat file.
Ensure you have all requirements before you start building the code since it is written in C++ and CUDA. This code is designed to run on Linux. We strongly recommend using Linux for compilation, computation, and post-processing. Therefore, The following prerequisites are demanded:
- A supported version of Linux with a GCC compiler and tool-chain
- C++ and its editor, preferably Visual Studio Code
- C++ build system generator, Cmake
- You need a CUDA-capable GPU, which can be checked here (Link)
- To use your GPU, you’ll need NVIDIA CUDA Toolkit
- The Visualization Toolkit, VTK 7 or higher
git clone [email protected]:bamaratunga/lbsim.git
cd lbsim
mkdir build && cd build
cmake ..
make install
To run the code sequentially on the CPU, you can use the following command:
lbsim_cpp ../cases/LidDrivenCavity/LidDrivenCavity.dat
To run the code in parallel on GPU, you can use the following command:
lbsim_cuda ../cases/LidDrivenCavity/LidDrivenCavity.dat
Binu Amaratunga, Erfan Mashayekh, Hessel Juliust