_|_|_|_| _| _| _| _| _| _|_| _| _|_| _|_|_| _| _| _| _|_|_|_| _|_| _| _| _| _| _| _| _|_|_|_| _|_|_| _| _|_|_| _|
An ASCII art fluid simulator
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX X X X X X X X X X X X X X X X X X X X oO0O000 X X o0O0000000000 X X Oo0o00000000000O000 X Xo o0O00000O00O000000000o000 X X00000000o000000O000000000000O0o0OO X X000000O00000000000o0000000000O0o0000OOo0oo X X00000000000000000000000000000000o000O0000000O00oooo oX X00000000000000000000000000000O000000o0000000000000000000000000X X00000000000000000000000000000O0000OO00000000000000000000000000X X0000000000000000O0000000o000000000OOO0O000000000000O00000000O0X XO0000000000000O0O0000000000000O0000O0o000000000000000000000000X X000O0O00O0O0O00000000000000000000000000000O00000000000000O0000X XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Euler is a basic Eulerian fluid simulator based on the first edition of "Fluid Simulation for Computer Graphics" by Robert Bridson. The book is an improved version of his SIGGRAPH 2007 Course Notes, which were developed in conjunction with Matthias Müller-Fischer.
The project aim is to be minimal, correct and fun. It runs on Linux and OSX, but unfortunately not on Windows. Sorry! If you're not able to run Euler, the next best alternative is watching a replay.
How to Build
cmake -H. -Bbuild && cmake --build build
How to Run
Just pass a scenario file as an argument. Scenario files are plain text files,
0 represents fluid,
X represents a solid wall,
? represents a fluid
= represents a fluid sink. Maybe check out one of the
sample scenarios for ideas.
Don't tell anyone, but I heard there's also a secret
I wonder what that does...
There are some pretty cool simulators out there. GridFluidSim3D by Ryan Guy and WebGL-PIC-FLIP-Fluid by Austin Eng appear to be based off the second edition of Bridson's book. They are more featureful and much faster than Euler due to GPU acceleration, but the underlying fluid simulation is similar.
Bugs and Limitations
- Fluid volume is not conserved. This can be corrected for, but conservation of volume, mass and momentum are not inherent properties of the simulation.
- This implementation uses marker particles to track the fluid. They are rather noisy in comparison to level set methods and they tend to cluster.
- Bridson recommends using RK2 integration for advection but this simulation only uses RK1 integration, which necessitates smaller timesteps.