Simulating Smoke
Mesh-based vs. Particle-based Methods
Mark Baumann
Mesh-based Methods
In this project, I have implemented Jos Stam's Stable Fluids approach.
I then augmented that approach with techniques from Visual Simulation of Smoke by Fedkiw, Stam, and Jensen, such as tracking temperature to apply buoyancy forces and computing flows around interior obstacles.
The advantage of this approach is that it's fast to compute.
A major disadvantage that I wish to address is the fact that, since this is a
mesh-based approach, any features (for instance, in the obstacles or boundaries)
that are smaller than a grid cell cannot be resolved by the method.
For example, smoke could not seep through a small hole that is smaller than a grid cell.
Particle-based methods do not have this limitation, which brings us to...
Particle-based Methods
For a particle-based method, I implemented Smoothed Particle Hydrodynamics (SPH), closely
following a paper by Muller et al.
In SPH, the fluid itself is "discretized" rather than discretizing space. The fluid then consists of
smoothed particles, which are moving centers of interpolation that follow the flow. Interpolated quantities
include density and pressure.
Some advantages of this method are:
- Mass is automatically conserved, since the total mass is the sum of the particle masses, and the
particle masses are fixed.
- Obstacles and boundary conditions are easy to handle; the particles simply "bounce" off of obstacles.
- There is no limit to your resolution since there is no grid.
A major disadvantage of this method is that it is computationally expensive. For example, to determine
a quantity such as the pressure at some point in space, one must interpolate from all particles that contribute at that
point in space.
In order to mitigate this drawback somewhat, I used the ANN library, which builds a kd-tree structure from
the particle locations which allows for quick determination of all particles that are nearest some point.
Alright enough already, let's see some movies!
Movies
This is a two-dimensional stable fluids simulation of smoke rising around a disk.
Notice some unwanted divergence as the disk "pushes" the smoke away. Also, the "turbulence" at the bottom
is unphysical.
|
|
This is another stable fluids simulation of smoke rising, this time without an obstacle.
This implementation is more sophisticated in that it incorporates gravity and temperature.
Unlike the previous simulation, where the smoke rose because it was given an initial push, in this
simulation the smoke rises only because it is hot. It then cools as it rises. There are vents in the top two corners to let some of the smoke escape, but otherwise it is trapped in the box.
|
|
In this simulation, we see that a stable column of smoke will occur (the spurious turbulence at the base is
gone) if the buoyancy force due to temperature isn't too large compared to gravity.
Notice how diffusion causes the smoke to spread into a mushroom, and gravity further smears out the cloud.
|
|
This movie combines all of the above: gravity, temperature, and an obstacle.
The resolution is also higher.
The internal boundaries seem to be correct now. However, pressure correction still isn't being handled correctly, as the smoke
doesn't reconnect after passing over the sphere.
|
|
This is an SPH simulation. Instead of rising smoke, I tested this implementation with pouring water.
The fluid is discretized into particles which "splash" around when they hit the ground and eventually
settle into a uniform configuration.
|
|
Future Work
A hybrid method
Naturally, we would like to have the best of both worlds: the speed and efficiency of a mesh-based method, with the
unlimited resolution of a particle-based method. The proposal in this work is to combine them into a hybrid method.
A mesh will be used throughout most of space. But, in regions of interesting features, such as an object with a hole
or a boundary with a detailed surface, SPH particles will replace the grid. Undoubtedly many challenges will arise,
some foreseen and some not. One foreseen challenge will be the "conversion" from grid-based values to particles and
back again at the interface.