Graphics Reference
In-Depth Information
with an initial value S i,j,k : this corresponds to an increase in smoke concen-
tration of ( ∂s/∂t ) i,j,k = r i,j,k S i,j,k /W . At inflow boundaries, where we're
injecting smoke through a surface, we could make this rate proportional to
u
n . If the rate is non-zero in the time step Δ t ,wetrytoemit m = r i,j,k Δ t
particles with value S i,j,k . That is, we for sure emit the integer part of m
and use the fractional part as the probability of emitting one extra particle
(i.e., emit the extra particle if a uniform random number from [0 , 1] is less
than the fractional part of m ). For each particle we emit, we choose a ran-
dom initial position within the cell and a random initial time within the
time step: we adjust that position by advecting it the rest of the time step.
Including the random time and advection is crucial for avoiding temporal
aliasing when velocities are high: without it, you get undesirable strobing
patterns.
There is one further small tweak we can add to simulate the effect
of a small amount of smoke diffusion. Some non-trivial stochastic cal-
culus shows that diffusing a quantity, i.e., including a Laplacian term
Dq/Dt = k
·
q , is equivalent in the limit to adding a component of
random Brownian motion to particle trajectories (i.e., solving Dq/Dt =0
with a randomly perturbed velocity field). That is, we can add an in-
dependent random-walk contribution to each particle's position each time
step, such as a random vector chosen uniformly from the sphere of radius
2 k Δ t . Obviously this is only an effective technique if the perturbations
are reasonably small compared to a grid cell.
Finally, there are several other quantities for which we can use this ma-
chinery. Temperature of course can go hand-in-hand with smoke concen-
tration, storing both quantities with each particle. Feldman et al. [Feldman
et al. 03] also include unburnt fuel as a particle variable for their volumetric
combustion model (see Chapter 7), albeit with a slightly more advanced
particle system that gives particles mass and inertia (see Chapter 11).
∇·∇
10.3 Vortex Particles
We now have enough machinery in place to actually build an interesting
alternative fluid simulation algorithm, using vorticity as the primary vari-
able. We'll focus on two dimensions, where the vorticity is a scalar and its
inviscid equation (from Chapter 9) is breathtakingly simple:
Dt
=0 .
Search WWH ::




Custom Search