A high-performance, GPU-accelerated smoke and flame simulation system built with NVIDIA Warp. This project provides real-time interactive fluid dynamics with advanced rendering features including volumetric shadows, external lighting, and production-quality combustion modeling.
- GPU-Accelerated Physics: Leverages NVIDIA Warp for high-performance computation
- Navier-Stokes Solver: Accurate incompressible fluid dynamics
- Advanced Advection:
- Tricubic B-Spline interpolation for smooth fluid motion
- MacCormack scheme for second-order accuracy
- RK3 time integration
- Multiple Pressure Solvers:
- Jacobi iteration
- Gauss-Seidel Red-Black (GSRB)
- Multigrid V-cycle for fast convergence
- Advanced Combustion Model:
- Oxygen fraction modeling
- Fuel-oxygen premix
- Progressive extinction and ignition
- Temperature-dependent reactions
- Realistic Fire Effects:
- Dynamic flame propagation
- Heat release and smoke generation
- Temperature-based color mapping
- Buoyancy: Temperature-based upward forces
- Vorticity Confinement: Enhanced turbulent motion with dynamic masking
- Shredding Forces: Temperature-dependent velocity distortion
- Wind Forces: Configurable directional forces
- Viscous Diffusion: Optional viscosity modeling
- Volumetric Ray Marching: High-quality smoke and flame visualization
- Volumetric Shadows: Ray-traced shadow casting through participating media
- External Lighting: Directional light propagation with scattering
- Phase Function: Henyey-Greenstein anisotropic scattering
- Multiple Render Modes:
- Full composite rendering
- Smoke only
- Flame only
- Fuel visualization
- Temperature visualization
- External light only
- Gaussian Blur: Optional post-processing for quantities and lighting
- Python 3.8 or higher
- NVIDIA GPU with CUDA support
- Windows/Linux
- Clone the repository:
git clone https://github.com/lealzhan/vortex.git
cd vortex- Install dependencies:
pip install -r requirements.txt
warp-lang>=1.0.0
numpy>=1.20.0
PyOpenGL>=3.1.0
PyOpenGL-accelerate>=3.1.0
imgui[opengl3]>=2.0.0
Run the interactive simulation with UI:
python src/main.pyThis launches a real-time viewer with a full ImGui control panel where you can adjust all simulation parameters on the fly.
The ImGui UI provides comprehensive controls for:
- Simulation: Grid size, time step, frame control
- Advection: Algorithm selection (Tricubic, MacCormack, RK3)
- Pressure Solver: Solver type, iterations, relaxation
- Combustion: Fire parameters, fuel efficiency, heat release
- Forces: Buoyancy, vorticity, wind, shredding
- Rendering: View modes, density scale, shadow quality
- Lighting: External light direction, color, scattering
- Emitters: Add/remove smoke and fuel sources
- Obstacles: Enable collision objects (when implemented)
- Space: Pause/Resume simulation
- R: Reset simulation
- ESC: Exit application
vortex/
├── src/
│ ├── main.py # Main entry point with UI
│ ├── main_process.py # Core simulation loop
│ ├── config.py # Configuration presets
│ ├── advection.py # Advection schemes
│ ├── pressure.py # Pressure solvers
│ ├── diffusion.py # Diffusion solvers
│ ├── forces.py # Force calculations
│ ├── rendering.py # Ray marching renderer
│ ├── external_lighting.py # Light propagation
│ ├── emitters.py # Emission sources
│ ├── obstacles.py # Collision handling
│ ├── multigrid_solver.py # Multigrid implementation
│ ├── realtime_viewer.py # OpenGL viewer
│ ├── ui_panel.py # ImGui interface
│ ├── utilities.py # Helper functions
│ └── debug_drawing.py # Debug visualization
├── requirements.txt # Python dependencies
└── README.md # This file
Contributions are welcome! Please feel free to submit pull requests or open issues for bugs and feature requests.
This project is licensed under the MIT License - see below for details:
MIT License
Copyright (c) 2025
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
- NVIDIA Warp: For the excellent GPU computing framework
- ImGui: For the intuitive GUI library
- GPUSmoke: Inspiration for GPU-based fluid simulation
For questions or discussions, please open an issue on GitHub.
Email: [email protected]
Note: This is a research and educational project. For production use, consider performance profiling and optimization for your specific use case.

