FlameSim — CPU-based Eulerian Fluid Solver 1.0 2D Tools 4.5 Community
Submitted by user software.twins; MIT; 2026-09-14
FlameSim is a real-time, CPU-based Eulerian fluid solver implemented as a GDExtension for the Godot Engine. Written in C++23, it provides a robust mathematical core for simulating incompressible continuous media directly on the CPU. By utilizing a fractional step (projection) method on a Staggered Grid (MAC), the library guarantees mass conservation and completely eliminates "checkerboard pressure" artifacts. This approach makes it a potential candidate for real-time applications, such as embedded systems.
**Key Features:**
- **CPU-Driven Core:** The simulation core is independent of Godot and can be connected to any other C++ project or embedded platform.
- **Dynamic Obstacles:** Applies Dirichlet boundary conditions (No-Slip condition) to the cell. Obstacles can be placed and removed "on the fly" without recalculating the entire grid.
- **Flow Visualization:** Injects a local concentration of a passive scalar (smoke, dye, flame marker) into the grid cell. The density field is transported by the calculated fluid velocity field.
- **Interactive Demo:** The Control Panel contains two sliders linked to flame intensity and wind strength, and switches that enable and disable two obstacles on the fly.
**Important Tips:**
- **Grid Optimization:** Keep the grid small (tens, not hundreds of cells per axis) and use the node's scale to stretch a small grid over the entire screen.
- **CFL Condition:** At too high flow velocities, a violation of the CFL condition is possible, leading to numerical instability. Balance the cell size, the time step, and the power of external forces.
- **Self-Managing:** The density/smoke gradually fades over time by itself — there is no need to manually extinguish it.
**Full Documentation:**
Godot Integration is distributed under the MIT License. For the complete list of methods and setup instructions, please read the full README.md in the GitHub repository.
View files Download Submit an issue Recent Edits