| |
|
| |
Dev Diary:

8th August 2010
Experimental animation of a smoke plume around the Utah teapot. The opacity of the smoke varies linearly with temperature. Varying the colour, albedo and emissive properties of the fluid would allow a flame effect to be simulated using the same dataset with relatively little modification.

16th August 2006
Finally got around to expanding the fluid solver to 3D in preparation for integration with Igneus. Hit a minor glitch with the vorticity confinement code which took hours to debug thanks to the fact that a 3D fluid is much harder to interact with than its 2D analogue.
 |
|
In order to visualise the fluid flow I cobbled together a very basic isometric renderer that layers each slice of the volume from the bottom up, alpha blending each one according to the density so as to create a passable 3D volume. The results were unexpectedly good, especially given that there are no lighting computations whatsoever.
Simulation times for a 100 x 100 x 100 volume dataset ran to about 2 seconds per frame on an AMD Athlon 3000+ processor, with rendering running at about 0.5Hz. Although not even passably real-time, processing speeds were sufficient to make tweaks and adjustments without having to wait too long to see the results.
• Turbulent flow with vorticity confinement - 567Kb (Click thumbnail to download movie. DivX 5.2.1 required) |
Until I implement a geometry importer to create boundaries from arbitrary polygon meshes I'm using a simple test scene which uses a basic sphere around which the fluid can flow. While unsophisticated, I think it's quite aesthetically pleasing! I experimented with different methods of visualising the flow including pressure, divergence, curl and velocity. In the end however, the velocity field was the only one which looked any good. The visualisation of the velocity field uses colour coding to represent rates of flow (blue and green being slow, yellow, orange and red being fast). Unfortunately vorticity confinement doesn't appear to like slow-moving, completely invicid flow and introduces "creep" whereby the fluid moves by itself around the edges of the bounding box. I'm guessing this is due to round-off errors from the vorticity calculations, however the effect can be damped out by making the flow slightly viscous.
Turbulent flow without vorticity confinement - 448Kb • |
|

|

|
|
The two comparisons above (one with vorticity confinement and one without) show just how much the discretisation process damps the flow. I'd like to experiment with vortex particles at a later date to see if I can render explosions.
Kevin Beason has already produced some marvelous examples of this technique using his solver which are really worth checking out.
Next up will be exporting the datasets to Igneus and rendering them using the new volume renderer extension. It should be interesting to see how much more realistic the smoke appears when rendered correctly using multiple-scattered global illumination.
• Colour-coded visualisation of flow velocity - 980Kb |

2nd June 2006
Adapted the interface of the 2D solver to work on a tablet PC (i.e. with a stylus and no proper keyboard input). To accomplish this, I designed a new XML-based user interface which is fully animated, skinnable and completely configurable. All the UI components (buttons, etc) can be tweaked, modified and even removed completely via a configuration file.
Download the latest version and check it out. |
|
|
|
 |
Current Features:
|
| |
• Stable solution even in high-velocity/high-viscosity flows using Semi-Lagrangian methods
• 2D and 3D simulation (2D runs at interactive framerates)
• Vorticity confinement
• Boundary conditions
• Buoyancy
• Configurable viscosity, diffusion, dissipation, time-step, vorticity and friction parameters
• Clean XML and keyboard interface
• Force advection, solute injection and boundary setting via mouse input
• Imprintable bitmaps for custom boundary and solute fields
• Pretty colours and window translucency :-)
|
|
|
Future Features:
|
| |
• Integration with Igneus ray tracer to produce volumetric gas, fire and smoke
• Vortex particles
• Multi-grid solution to pressure equation
• Polygon mesh boundaries |
|
 |
Screenshots:
These screenshots are from the downloadable 2D version running in transparent mode. The images behind the fluid simply provide contrast and depend on your own desktop.
Hot gas rising then breaking and tumbling around a diamond wedge-shaped partition:

Cold liquid propagating through a graduated tube:

Imprinted bitmap on solution field, advected by buoyancy.

|
 |
Download 2D version:
You can download an interactive demo of Aqueus to experiment with fluid characteristics such as viscosity and buoyancy. This program requires a modern PC running Windows 2000 or XP (it might run on older versions although I've not tested it). You can adjust the parameters in the XML configuration file to the spec of your machine however, a fast processor is highly recommended to get the best visuals.

The following is a list of keyboard and mouse commands.
Key/Button |
|
Action |
|
|
|
1 |
|
Reset velocity field to zero |
2 |
|
Reset force field to zero |
3 |
|
Reset solution field to zero |
4 |
|
Reset boundary conditions to default values |
Tab |
|
Reset all fields |
|
|
|
R |
|
Toggle apply force field to every frame |
V |
|
Toggle render velocity field |
S |
|
Toggle render scalar field |
Z |
|
Set solvent colour |
X |
|
Set solution colour |
U |
|
Imprint solute with bitmap |
I |
|
Imprint boundary field with bitmap |
C |
|
Toggle console |
B |
|
Toggle buoyancy |
|
|
|
L .. K |
|
Decrease/increase buoyancy |
M .. N |
|
Decrease/increase timestep |
Comma .. Period |
|
Decrease/increase friction over objects |
Insert .. Delete |
|
Decrease/increase brush size |
Home .. End |
|
Decrease/increase viscosity |
Pg Up .. Pg Down |
|
Decrease/increase vorticity confinement |
Space |
|
Invert brush weight |
Pause |
|
Toggle pause simulation |
A |
|
Advance frame (when paused) |
|
|
|
Left Mouse |
|
Apply force to velocity field |
Middle Mouse |
|
Draw boundary (erases boundary if brush weight is negative; press spacebar to invert brush) |
Right Mouse |
|
Injects solute into solution field |
Mouse Wheel |
|
Decrease/increase brush weight |
|
 |
Bibliography:
Visual Simulation of Smoke - Ronald Fedkiw, Jos Stam, Henrik Wann Jensen
A Simple Fluid Solver based on the FFT -
Jos Stam
Stable Fluids - Jos Stam
A Vortex Particle Method for Smoke, Water and Explosions -
Andrew Selle,
Nick Rasmussen,
Ronald Fedkiw
Modeling the Motion of a Hot, Turbulent Gas - Nick Foster, Dimitris Metaxas
A Multigrid Solver for the Steady-State Navier-Stokes Equations using the Pressure-Poisson Formulation
A Particle Tracer for Time-Dependent Flow Fields - David Lane
Numerical Computation of Internal and External Flows - Charles Hirsch
Links:
Kevin Beason's Fluid Simulator
Andrew Selle's Fluid Simulator
Smoke - By Ryan Geiss. A music visualiser for Winamp based on a fluid simulator
FFTW - An excellent and freely available Fast Fourier Transform library
|
|
|
|