MSAFluid is an opensource library for solving and displaying real-time fluid simulations based on Navier-Stokes equations and Jos Stam’s paper Real-Time Fluid Dynamics for Games. It was inspired by the brilliant Plasma Pong (even with some advice by the author, Steve Taylor)..
You can play with an online interactive Java version here.
Get the Java version (for processing) here.
Get the C++ version (for openFrameworks or Cinder) here.
It has also been ported to Flash AS3 by Eugene Zatepyakin. Get it here.
The javadoc reference can be found here. A copy of the reference is also included in the .zip.
This library is released under the new BSD License
A lot of the fluid solving algorithms are from Jos Stam’s paper. I tried to wrap it up in an easy to use API to provide methods for adding & getting forces and color at any position. Other useful resources and implementations I looked at while building this lib are:
* Mike Ash (C) - http://mikeash.com/?page=pyblog/fluid-simulation-for-dummies.html
* Alexander McKenzie (Java) - http://www.multires.caltech.edu/teaching/demos/java/stablefluids.htm
* Pierluigi Pesenti (AS3 port of Alexander’s) - http://blog.oaxoa.com/2008/01/21/actionscript-3-fluids-simulation/
* Gustav Taxen (C) - http://www.nada.kth.se/~gustavt/fluids/
* Dave Wallin (C++) - http://nuigroup.com/touchlib/ (uses portions from Gustav’s)
and some other Stam solver implementations I’ve come across since writing this are:
* Chris Sugrue & Arturo Castro (C++) - http://csugrue.com/code/?p=15
* Alain Ramos (C++) - http://code.google.com/p/ofxding/downloads/list
* Mick West - http://www.gamasutra.com/view/feature/1549/practical_fluid_dynamics_part…
* Mick West - http://www.gamasutra.com/view/feature/1615/practical_fluid_dynamics_part…
* NVidia (C / Cg) - http://developer.download.nvidia.com/SDK/9.5/Samples/gpgpu_samples.html - gpgpu is the future
…and you can find a brilliant AS3 port of this library at blog.inspirit.ru/?p=248
An opensource library for solving and displaying real-time fluid simulations based on Navier-Stokes equations and Jos Stam’s paper Real-Time Fluid Dynamics for Games