β 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)."

Karl Fredrickson made more accurate Droplet demo.


Simulations on GPU
updated 9 Aug 2012