A C++/CUDA/NVCC implementation of the Lattice Boltzmann Method for computational fluid dynamics (CFD), utilizing an NVIDIA H100 GPU on a high-performance computing (HPC) resource, with provided Makefiles and executables. Specifically, we investigate the Kármán Vortex Street.
This project is licensed by the GNU GPLv3 License: Copyright © 2026 RandomKiddo.
For more in-depth analysis and details on this project, see the project PDF file.
Below is an example visualization from the simulation output from visualize.py:
vortex_street_zoomed.mp4
We do analysis to prior results, yielding the following 
The JSON file config.json holds the simulation parameters:
{
"domain": {
"nx": 4000,
"ny": 1000
},
"physics": {
"tau": 0.6,
"u_inlet": 0.1,
"steps": 150000
},
"output": {
"base_filename": "vortex_street",
"interval": 1000
}
}The domain nx and ny define the xy-domain size. The variable u_inlet controls the inlet velocity (velocity of the incoming fluid) and tau controls the kinematic viscosity. The steps is the total number of steps to take. In output, the base_filename is the base filename for the output (minus the addendums that give simulation parameters in the filename) and the interval is the output interval for the main file output (not the probe or the last step).
Warning
For simulation parameters, decreasing nan return values. This is a restriction of the code itself.
The analysis is done through the Python files strouhal.py and visualize.py. The former compares to numerical numbers important to these kind of simulations, the Strouhal number and Reynolds number. The latter creates the visualizations from the simulation output.
This code is built for NVIDIA H100 GPUs. As such the Makefile utilizes the following compile line:
nvcc -O3 -arch=sm_90 main.cu -o lbm_solverThe architecture line -arch=sm_90 is required for the NVIDIA H100 Hopper GPUs.
Important
The architecture line will depend on the GPU being used. The flag -arch=sm90 works for NVIDIA H100 GPUs. For a consumer-level GPU like the NVIDIA RTX 3060, typically the architecture flag -arch=sm_70 works. You will need to look at your specific NVIDIA GPU architecture to know which flag to use.
The file load_osc.sh can be used to source necessary files for compilation and running.
source load_osc.shIt is specifically designed to work on the Ohio Supercomputer Center on the Cardinal cluster. Doing so will load necessary modules like Miniconda and CUDA. This also loads or installs the necessary Conda environment to use the Python analysis files. The environment for Linux HPC usage is in environment.yml. The Conda environment is called lbm and has the necessary packages and versions to run strouhal.py or visualize.py.
Note
If not able to run on the OSC or similar HPC systems, the necessary modules will need to be loaded and linked, and the Python version used will require the necessary installs.
This project utilizes Nlohmann's JSON C++ package to read JSON files into C++ for dynamic simulation variables.
It is licensed by the MIT License: Copyright © 2013-2026 Niels Lohmann.
The inferno palette (inferno.pal file) for Gnuplot was accessed from the Gnuplot palette repository.
This page was last edited on 04.24.2026