Fluid Simulation SPH #
An interactive, real-time fluid simulation written in C++. This project models how liquids behave, move, and interact using the Smoothed Particle Hydrodynamics (SPH) method.
Simulating physics particle by particle can be incredibly demanding for a computer. Therefore, the core focus of this project was balancing realistic fluid dynamics with high-performance optimization.
Features & Implementation #
- Realistic Physics: Accurately simulates real-world fluid properties, including pressure, viscosity, and density, to create natural-looking liquid movement.
- GPU Rendering: Utilizes OpenGL for hardware-accelerated rendering, ensuring the visual output is handled efficiently by the graphics card.
- Algorithmic Optimization: The most computationally expensive part of fluid simulation is calculating how particles interact with each other. To solve this, the project implements spatial hashing, a technique that drastically speeds up neighbor searches by grouping nearby particles, reducing overall computational complexity.
- Real-Time Performance: Thanks to these structural optimizations, the simulation achieves interactive, real-time frame rates (well over 60 FPS) while handling hundreds of particles simultaneously.

