Skip to content

lealzhan/vortex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vortex Banner

Vortex

GPU-Accelerated Smoke and Flame Simulation built with NVIDIA Warp

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.

License Python Warp

🔥 Gallery

✨ Features

Core Simulation

  • 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

Combustion & Fire

  • 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

Forces & Turbulence

  • 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

Rendering Features

  • 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

🚀 Getting Started

Prerequisites

  • Python 3.8 or higher
  • NVIDIA GPU with CUDA support
  • Windows/Linux

Installation

  1. Clone the repository:
git clone https://github.com/lealzhan/vortex.git
cd vortex
  1. Install dependencies:
pip install -r requirements.txt

Requirements


warp-lang>=1.0.0
numpy>=1.20.0
PyOpenGL>=3.1.0
PyOpenGL-accelerate>=3.1.0
imgui[opengl3]>=2.0.0

Quick Start

Run the interactive simulation with UI:

python src/main.py

This launches a real-time viewer with a full ImGui control panel where you can adjust all simulation parameters on the fly.

🎮 Usage

Interactive Controls

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)

Keyboard Shortcuts

  • Space: Pause/Resume simulation
  • R: Reset simulation
  • ESC: Exit application

📁 Project Structure

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

🤝 Contributing

Contributions are welcome! Please feel free to submit pull requests or open issues for bugs and feature requests.

📄 License

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.

🙏 Acknowledgments

  • NVIDIA Warp: For the excellent GPU computing framework
  • ImGui: For the intuitive GUI library
  • GPUSmoke: Inspiration for GPU-based fluid simulation

📞 Contact

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages