Home > ActionScript 3.0, Mathematics, Physics > Fluid Dynamics

Fluid Dynamics

February 6th, 2009

This was something I did a while ago and never got around to posting about. It’s a simulation of an incompressible fluid- when you render the density and apply temperature by adding an upward force, it looks like smoke!

It’s fairly computationally intensive. The state of the system has to be solved simultaneously. But because it uses an iterative solver to approximate a solution, it’s easy to tune for performance to realism.

Click and drag to knock the smoke around, release to add density (more smoke).

My implementation is based on this paper by Joe Stam. The leap from the Navier Stokes equations to this compact form is pretty radical. Mr. Stam’s a pretty smart guy.

drew ActionScript 3.0, Mathematics, Physics

  1. February 6th, 2009 at 20:16 | #1

    I graduated with a degree in Chemical Engineering and I used Navier Stokes all the time in class, it is neat seeing this app! After graduation I become a flash developer because I enjoyed doing that soooo much more. :) Other neat ideas might be Quantum Chemistry problems such as particles in a box or expand this project and solve for non-Newtonian fluids and REALLY make it computationally intensive.

  2. February 7th, 2009 at 15:03 | #2

    Well you definitely know more about it than I do, so I think YOU should try some of that physics-y goodness!

  3. February 10th, 2009 at 12:18 | #3

    nice one,

    i´ve seen something similar done with Pixel Bender and Flash10 on http://www.derschmale.com/demo/smoke/smoke-v3/smoke.html

    cheers
    -frank

  4. Alan
    April 7th, 2009 at 21:11 | #4

    Nice… this is cool as well. This is with DisplacementMapFilter: He was inspired by the derschmale example as well.

    http://rmd.com.au/archives/flash-smoke-effect-using-displacementmapfilter

  1. No trackbacks yet.