Multi-Phase Fluid Flow
CS 493
Lecture, Dr. Lawlor
So far, we're using three color channels in our fluid simulations:
- Red (x) gives our fluid X velocity.
- Green (y) gives our fluid Y velocity.
- Blue (z) gives the current convergence at this pixel.
We can do interesting things with the fourth channel, alpha.
You don't even need any physics, just our backward-looking
advection, and you can suddenly see the swirling patterns much more
clearly:
Alpha
Channel Advection Demo
It's pretty, but it does blur out quite rapidly. This
"numerical dissipation" is caused by the repeated averaging effect
of the graphics card's bilinear filtering on the texture reads--a
higher order filter like bicubic
sampling would give less resampling error, if we were willing
to implement it.
Generally, you can do lots of interesting things with multiphase
flow:
- Add a "temperature" phase, and add a bouyancy force to drive
convection (try "C.y+=C.a*0.001;" above).
- Add a "propane" phase, and you could add physics to simulate
combustion.
- Add a "smoke" phase, and you could simulate a smoky explosion.
As a grad student, I helped build a solid rocket simulator, where
simulation cells on the interior of the solid rocket's core burning
zone kept track of XYZ velocity (via momentum), density, energy
(temperature), and suspended fuel (aluminum and oxidizer).
Fluid simulations of the Earth's molten core include magnetic terms,
radioactive heating, and convection to the freezing surface!