β It delay fps
2d ink droplet in water dynamics. Set a new buoyancy value β. This script makes 2 It iterations every time step to calculate pressure. Boundaries are periodic.

See 2D fluid dynamics for explanations.

Yang Chenglin sent my kindly this remark
"I think when you advect something on staggered grid, different velocities should be used for different values. The velocity used in your code is just suitable for the density. To advect ux or uy, different velocity is needed. This can explain why your droplet simulation does not perform symmetrically enough (it flows right slightly)."

It is a good explanation of the droplet asymmetry! Really, advection is not very accurate (e.g. predictor-corrector algorithm could be better). Don't you like to make more accurate fluid dynamics? Yang Chenglin sent me kindly link on his FFT-based Droplet Simulation.


Simulations on GPU
updated 9 Aug 2012