All projects

01 / 06 · Simulation

RustFluid

GPU Lattice Boltzmann Fluid Solver

A GPU-accelerated lattice Boltzmann solver in Rust + wgpu that reaches 85% of FluidX3D's throughput on the same laptop GPU.

RustFluid preview
85.1%
of FluidX3D throughput
1,161.73
median MLUPS
9.4M
lattice cells
25,000
Reynolds number

FluidX3D cylinder case (768×192×64, D3Q19 BGK, FP16 storage) on an RTX 3050 4GB Laptop GPU, run October 2, 2026. FluidX3D reference: 1,365.17 MLUPS.

Overview

RustFluid is a GPU lattice Boltzmann method (LBM) solver written in Rust with wgpu compute shaders. It uses the lattice Boltzmann method because it computes much quicker than solving the Navier–Stokes equations directly. It provides independent D2Q9 and D3Q19 solvers, runtime-selectable collision and boundary components, headless diagnostics and benchmarks, and an interactive 3D wind-tunnel renderer that can voxelize STL models like a Ferrari or an F-35.

Highlights

  • D2Q9 and D3Q19 lattices with WGSL shader source assembled from Rust traits — no trait-object branching inside a GPU step
  • BGK/SRT and MRT collision in 2D; BGK/SRT, MRT, TRT and Smagorinsky LES in 3D
  • FP16 population storage with FP32 arithmetic when the adapter supports SHADER_F16
  • Rotated, scaled STL voxelization for 3D geometry and SVG rasterization for 2D obstacles
  • Mesh, wireframe, particle flow, ribbon streamline and Q-criterion marching-cubes rendering with interactive clipping
  • GPU diagnostics for equilibrium preservation, closed-box conservation, Taylor–Green decay and wake behavior