I’m still working on this but as I see some of you have downloaded it I might as well just post about it. I am finishing work on a 2d fluid dynamics addon called ofx2dFluid. It is found here:
I am going to go thru memo’s optimized solver and see if I can find something to get a few more fps. Plus since I just figured out how to add alpha channel support I still haven’t implemented it in the wind and gravity parts so if you use it with alpha channels wing and gravity might not display properly. Also I am still researching if this is the best method for wind and gravity. I got the gravity/wind method from here:
about the wind and gravity, I did them and don’t really like very much how they’re implemented, specially gravity doesn’t looks very good, although it gets more interesting when you increase viscosity. I tried putting forces in every cell in the direction of the wind or gravity but it was too much so I decided to put them just in a few cells in the upper part of the array.
Also, in memo’s code there’s some methods to add force and fluid objects that generate force or density in a point. In my original code there was something similar but for updating the whole array so they can be a good solution for making plugable force generators like wind and gravity and not include them in the fluid solver. I think this methods aren’t in the code chris posted but you can find them in the laser tag fluid brushes I posted some days ago:
That way you can change the implementation of wind and gravity without touching the extension code and plug some other things, for example I’ve used that to plug an optical flow force generator.
That fluid solver is also threaded so perhaps you can use parts of that code to make yours faster.