https://github.com/erkaman/fluid_sim
Flashy 2D fluid simulations experiments.
https://github.com/erkaman/fluid_sim
2d cpp fluid opengl simulation
Last synced: 6 months ago
JSON representation
Flashy 2D fluid simulations experiments.
- Host: GitHub
- URL: https://github.com/erkaman/fluid_sim
- Owner: Erkaman
- License: mit
- Created: 2018-04-28T15:37:25.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-05-21T12:27:16.000Z (over 5 years ago)
- Last Synced: 2025-04-06T23:14:15.924Z (7 months ago)
- Topics: 2d, cpp, fluid, opengl, simulation
- Language: C
- Size: 27.3 MB
- Stars: 105
- Watchers: 7
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fluid_sim - Some flashy 2D fluid simulations



An implementation of the article "Fast Fluid Dynamics Simulation on the GPU", using
C++ and OpenGL 3.3. This implementation implements the "advection", and "projection" steps from the
article. The "diffusion" and "boundary conditions" steps of the article are not implemented.
Finally, note that the primary focus was on making flashy simulations, and not on physical realism.**The code is minimalistic and is written in only ~1000LOC of C++, and uses only OpenGL and no frameworks whatsoever,
so the code should be readable. The source code can be found in `src/main.cpp`**# Video
Longer video of fluid simulations:
[](https://www.youtube.com/watch?v=FDX-9gTC48o)
## Building
The only dependencies are [GLFW](https://github.com/glfw/glfw) and [stb_image](https://github.com/nothings/stb).
Both of which are included within this repository.We use CMake for building. If on Linux or OS X, you can build it in the terminal by doing something like:
```
mkdir build && cd build && cmake .. && make
```If on Windows, create a `build/` folder, and run `cmake ..` from
inside that folder. This will create a visual studio solution(if you
have visual studio). Launch that solution, and then simply compile the
project named `fluid_sim`.