Fluid Simulation

Completed | October 2023 |
Summary
This smoothed particle hydrodynamics simulation on the CPU served as one of my first C++ projects. All rendering - except for the UI which uses Dear ImGui - is done exclusively with OpenGL.Journey
For years prior to this project I'd been fascinated by fluid simulations, beginning when I discovered GitHub user paveldogreat's.Previous experience with simulating gravitational bodies led to the creation of a particle simulation where each particle repelled all others (this was around 2022 and I used Love2D). It ended up looking awful.Later research led to the discovery that this particle simulation approach to fluid simulation had a name (smoothed particle hydrodynamics) and that a lot of the problems I'd encountered and were making it look awful had already been solved. This ultimately introduced me to the idea of time complexity and how it can be improved, as well as some famous papers like Jos Stam's. I ended up creating another simple particle gravity simulation which took advantage of the quad tree data structure - my first ever C++ project.Finally, Sebastian Lague released his Coding Adventure which revived my interest in fluid simulations and led to this project. If revisited, I'd be interested in moving particle calculations from the CPU to the GPU - an addition which I only partially implemented with compute shaders after struggling with OpenCL.