Skip to content

Kylerace/fluid_sim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fluid Simulator

This is one of my attempts at fluid simulation in C++. It simulates an incompressible inviscid fluid using an eulerian representation. It uses a GLFW window and rendering graphics via OpenGL.

UI

Esc closes the window. 1 sets the scenario to "tank". 2 sets it to "wind tunnel" (default). 3 sets it to "paint".

p toggles whether the fluid will be colored according to its pressure (default true on wind tunnel). s toggles whether smoke will be rendered (default true). Smoke is used to occlude parts of the world for certain scenarios in order to show advection. T toggles whether the fluid will be colored according to its temperatue (default false). = (So you don't have to press shift + if you don't have a numpad) and - both change the number of incompressability iterations by 10 in their respective directions. Space pauses and unpauses the simulation.

Building

You need MINGW to run on windows, this has not been tested on linux. In a mingw shell run the make file with mingw32-make with this codebase being the current directory. Then enter ./output.exe to run

About

Multithreaded eulerian incompressible 2d fluid simulation in C++ and OpenGL.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published