Fluid dynamic simulation in C++ and Vulkan, with a Qt graphical user interface.

Main page

Features

  • Vulkan compute shaders written in Slang that implement a fluid dynamics solver and model the Navier-Stokes equations
    • with additional vorticity confinement
  • Qt graphical user interface for customizing shader parameters with instant feedback

Set fuel

Compute Stages

Fire is modeled as a density field and a velocity field, with the density field representing fuel temperature and the velocity field representing movement velocity due to buoyancy or wind. Each update is broken down into these steps:

  1. Add source
  2. Diffuse
  3. Compute curl
  4. Add vorticity confinement
  5. Project velocity
  6. Advect velocity
  7. Project velocity
  8. Advect density

Velocity projection enforces the velocity field to be mass-conserving, leading to more realistic dynamics. It is further broken down into these steps:

  1. Compute divergence
  2. Compute pressure field
  3. Adjust velocity based on pressure field