(2008) - Multiple - Interacting - Liquids

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/220184456

Multiple interacting liquids

Article in ACM Transactions on Graphics · July 2006


DOI: 10.1145/1179352.1141960 · Source: DBLP

CITATIONS READS
193 421

4 authors, including:

Andrew Selle
Disney Research
34 PUBLICATIONS 2,865 CITATIONS

SEE PROFILE

All content following this page was uploaded by Andrew Selle on 03 April 2015.

The user has requested enhancement of the downloaded file.


Multiple Interacting Liquids
Frank Losasso∗ Tamar Shinar∗ Andrew Selle∗ Ronald Fedkiw†
Stanford University Stanford University Stanford University Stanford University
Industrial Light + Magic Intel Corporation Industrial Light + Magic

Figure 1: (Left) Rayleigh-Taylor instability, 4 phases. (Center) liquids of varying viscosity, 5 phases. (Right) burning oil in water, 4 phases.

Abstract 2001; Enright et al. 2002]. More recently, researchers have con-
sidered more complex phenomena including fire [Lamorlette and
The particle level set method has proven successful for the simu- Foster 2002; Nguyen et al. 2002], bubbles [Hong and Kim 2005],
lation of two separate regions (such as water and air, or fuel and viscoelasticity [Goktekin et al. 2004], etc. Although the level set
products). In this paper, we propose a novel approach to extend this method allows for the simulation of two distinct fluids, such as fuel
method to the simulation of as many regions as desired. The various and products [Nguyen et al. 2002] or water and air [Hong and Kim
regions can be liquids (or gases) of any type with differing viscosi- 2005], it does not handle the complex phenomena associated with
ties, densities, viscoelastic properties, etc. We also propose tech- the interactions of more than two fluids. In this paper, we propose a
niques for simulating interactions between materials, whether it be novel method that allows one to simulate multiple (more than two)
simple surface tension forces or more complex chemical reactions liquids (and gases), including complex interactions between the dif-
with one material converting to another or two materials combin- ferent fluids.
ing to form a third. We use a separate particle level set method for
each region, and propose a novel projection algorithm that decodes A few researchers have begun to tackle the difficulties associated
the resulting vector of level set values providing a “dictionary” that with using multiple level sets (without particles) to represent mul-
translates between them and the standard single-valued level set tiple regions. One approach is to use a different level set for each
representation. An additional difficulty occurs since discretization region as in [Merriman et al. 1994; Ruuth 1998; Smith et al. 2002].
stencils (for interpolation, tracing semi-Lagrangian rays, etc.) cross Each level set is independently evolved forward in time leading to
region boundaries naively combining non-smooth or even discon- contradictions in the representation of the interface, which are re-
tinuous data. This has recently been addressed via ghost values, e.g. solved via projection (or slowly, via a penalty method as in [Zhao
for fire or bubbles. We instead propose a new paradigm that allows et al. 1996]) eliminating points that have been classified as inside
one to incorporate physical jump conditions in data “on the fly,” more than one region or not inside any region. The other main ap-
which is significantly more efficient for multiple regions especially proach uses n level sets to represent up to 2n regions [Vese and
at triple points or near boundaries with solids. Chan 2002]. For example, two level sets can be used to repre-
sent four regions classified via all possible sign combinations (i.e.
CR Categories: I.3.5 [Computer Graphics]: Computational Ge- “++”, “+−”, “−+” and “−−”). This approach intrinsically re-
ometry and Object Modeling—Physically based modeling; moves the need for projection, but typically suffers from biasing ar-
tifacts especially where more than two regions intersect. So while
Keywords: multiphase fluids, liquids, gases, level sets it is quite useful in computer vision especially when there are many
regions, it has not enjoyed similar success in physics-based appli-
cations where the number of distinct materials is typically small
enough that it is not inefficient to use a separate level set for each
1 Introduction allowing for a non-biased simulation of the underlying physics. In
Earlier works on fluid simulation focused on single phase flows fact, level set methods are typically only applied in a lower dimen-
such as smoke [Foster and Metaxas 1997b; Stam 1999; Fedkiw sional band near the interface making them cheap as compared to
et al. 2001] or free surface flows such as water [Foster and Fedkiw the physical equations that need to be solved everywhere. More-
over, regardless of the number of level sets used, the particle level
∗ e-mail: {losasso,shinar,aselle}@stanford.edu set method still requires one set of particles for each region, so its
† e-mail: [email protected] cost remains unchanged. Finally, we note that all these approaches
are predated by [Gascuel 1993], which proposed a method for re-
Copyright © 2006 by the Association for Computing Machinery, Inc. moving overlaps of implicitly represented deformable objects, al-
Permission to make digital or hard copies of part or all of this work for personal or though gaps between objects were not addressed making the work
classroom use is granted without fee provided that copies are not made or distributed inapplicable to fluids where vacuum regions need to be properly
for commercial advantage and that copies bear this notice and the full citation on the
first page. Copyrights for components of this work owned by others than ACM must be
addressed.
honored. Abstracting with credit is permitted. To copy otherwise, to republish, to post on
servers, or to redistribute to lists, requires prior specific permission and/or a fee.
At each point in the domain, we have a vector ~φ (~x) =
Request permissions from Permissions Dept, ACM Inc., fax +1 (212) 869-0481 or e-mail (φ1 (~x), . . . , φn (~x)). Since the individual level set functions (the φi ’s)
[email protected].
© 2006 ACM 0730-0301/06/0700-0812 $5.00

812
will generally give contradictory geometric information, a consis-
tent approach to interpreting the vector-valued level set function is
needed. We do this by creating a level set “dictionary” that trans-
lates between the vector ~φ and the traditional single level set repre-
sentation at each point in the domain. Our novel projection method
makes this translation straightforward for both theoretical and prac-
tical purposes (e.g. allowing the incorporation of previous level set
simulation techniques). Moreover, our method is purely geometric
and thus does not interfere with the underlying physics. It also pre-
serves the signed distance property of the various level set functions Figure 3: A kinematically controlled sphere splashing into a multi-
(unlike for example [Merriman et al. 1994]). layer pool (300 × 300 × 200 grid, 4 phases).

Our method provides for the straightforward simulation of multiple ing multiple fluids from the SPH standpoint.
liquids (and air) with varying densities, viscosities, or viscoelastic
properties. We also consider complex interactions between fluids
such as surface tension forces and reactions (e.g. the burning of a 3 Multiple Level Sets
premixed fuel as in [Nguyen et al. 2002]). Such interactions typi-
cally involve discontinuous material properties across the interface, Each level set function is independently evolved in time, after
e.g. pressure jumps due to surface tension. [Nguyen et al. 2002] which the interface locations do not agree (because of numerical er-
and [Hong and Kim 2005] advocated using the ghost fluid method rors) as shown for example in Figure 2. We propose a novel method
(GFM) to avoid the visual errors associated with nonphysically for fixing the level set functions removing overlaps and vacuums
smearing out these discontinuities. We propose a novel paradigm while preserving an accurate interface location.
that automatically detects when discontinuous information is com-
bined across (any number of) interfaces, computes jump conditions 3.1 Projection Method
and ghost values “on the fly,” and returns appropriate values. This
reduces the memory requirements associated with storing ghost val- We first make the following observations about an arbitrary vector
ues for multiple region interactions, and furthermore makes the im- ~φ of level set values at a point~x. (O1) If φ j is the smallest element,~x
plementation of the algorithms straightforward. We note that it also is in region j. This assigns~x to the region it is deepest inside when it
simplifies the treatment of complex solid objects (see e.g. [Guen- is inside more than one region (overlap), or the region it is closest to
delman et al. 2005]). when it is outside every region (vacuum). (O2) If O1 holds and φk
is the second smallest element, only φ j and φk are needed to locally
represent the interface. Basically, ~x is in region j, and the closest
2 Previous Work point on an interface lies between region j and region k. Region k
is the region ~x is closest to not counting the region it is in.
Besides the works already mentioned above, earlier computer
graphics research on the Navier-Stokes equations includes [Kass Given these observations, we desire the following properties for nu-
and Miller 1990; Chen and Lobo 1994; Foster and Metaxas 1996; merical robustness and backward compatibility with the standard
Foster and Metaxas 1997a]. There has also been work on explo- single level set function for two phases. (P1) If φ j is the smallest
sions [Neff and Fiume 1999; Yngve et al. 2000; Feldman et al. element, it is the only negative element and its magnitude represents
2003; Rasmussen et al. 2003], flow on surfaces [Stam 2003], chem- the distance to the interface. This is consistent with observation 1,
ically reacting gases [Ihm et al. 2004], octree implementations but also makes φi a signed distance function in region i for all i.
[Losasso et al. 2004], RLE implementations [Houston et al. 2006], Moreover, it removes overlaps since only one φi is negative, and
tetrahedral meshes [Feldman et al. 2005] hybridized vortex particle removes vacuums since the smallest φi is negative. (P2) If P1 holds
approaches [Selle et al. 2005] and sand [Zhu and Bridson 2005]. and φk is the second smallest element, φk = −φ j . This is consistent
Various authors have also addressed viscosity [Carlson et al. 2002; with observation 2, and it makes the level set for the region a point
Rasmussen et al. 2004; Hong and Kim 2005], surface tension [En- is closest to but not inside a signed distance function as well. More-
right et al. 2003; Hong and Kim 2003; Losasso et al. 2004; Hong over, all other φi are positive and bigger than φk and not relevant.
and Kim 2005] and fire [Stam and Fiume 1995; Lamorlette and Fos- These observations and properties are consistent with the standard
ter 2002; Nguyen et al. 2002; Melek and Keyser 2005]. Some of the single level set function methodology. A standard single level set
most recent interesting areas include control [Treuille et al. 2003;
McNamara et al. 2004; Fattal and Lischinski 2004; Rasmussen et al.
2004; Mihalef et al. 2004; Shi and Yu 2005], solid fluid coupling
[Carlson et al. 2004; Guendelman et al. 2005; Wang et al. 2005;
Losasso et al. 2006], and SPH [Premoze et al. 2003; Keiser et al.
2005]. In fact, [Müller et al. 2005] tackles the problem of interact-

region 1 region 2
good overlap

vacuum region 3
(a) (b)
Figure 2: Each of the three regions is independently evolved in Figure 4: (Left) Two level sets initialized so that properties 1 and
time, after which the interface locations do not agree. There are 2 hold. (Right) After evolving in time, we obtain the solid lines
vacuums where all φi are positive, and overlaps where more than with overlap (both negative in the middle). The dotted lines show
one φi is negative. The dotted black line shows the new interface an example result after projection. Not only has the overlap been
locations after our projection step. removed, but the interface location is preserved.

813
(a) (b)
Figure 5: (Left) The solid lines have overlap on the left (two φi
negative) and a vacuum on the right (all φi positive). The aver-
age of the smallest two level sets at any point is subtracted from
~φ to obtain the dotted lines. Not only has the overlap and vacuum
been removed, but the smallest φi is preserved and negative at each
point preserving interface locations and inside/outside information.
(Right) Results after reinitializing each level set to a signed distance
function.
Figure 6: Rayleigh-Taylor instability (3003 grid, 4 phases).
function φ can be broken into two separate functions φ1 =φ and φ2 =
−φ , and be shown to satisfy the above observations and properties. introducing biasing into the algorithm.
This readily gives us a dictionary that translates between ~φ and φ . For two regions (hence two level sets) the result produced by our
That is, once we take an arbitrary level set vector ~φ and project method is identical to that of the traditional single level set (or par-
it to satisfy properties 1 and 2, we can use φ j and φk as if they ticle level set) method. If the two level set functions at time n are
were φ1 and φ2 in the appropriate order. The only discrepancy lies negatives of each other, i.e. φ1n = −φ2n , after advection we still have
in how the exact interface is handled where φ j = φk = 0. For the φ1∗ = −φ2∗ because they are evolved with the same method. Then
standard level set function, this is equivalent to φ1 = φ2 = φ = 0 projection leaves φ1∗ and φ2∗ unchanged, since their identically zero
and is typically nominally assigned to the negative level set, i.e. average is subtracted off. This is also true for more than two regions
we define the regions via φ ≤ 0 and φ > 0. This is equivalent to away from multiple junctions (e.g., triple points).
assigning the point to region 1 when φ1 and φ2 are both zero. To
extend this to multiple level sets, we assign a point where both φ j
and φk are zero to region j or k depending on whether j < k. 3.2 Particle Level Set Method
Each level set has an associated set
We illustrate our method in one spatial dimension. Figure 4a shows of particles that are seeded near the
two level set functions that satisfy properties 1 and 2, and Figure boundary of its interior region as shown
4b shows a property violating version after evolving in time. Based in the figure to the right. Following the
on property 1, the interface location is defined as the point where standard particle level set algorithm, for
the minimum φi changes from one level set to the other. This is each level set function we rebuild φ −
the location where the two level sets intersect in the figure, and using that level set’s particles, and re-
we want our projection method to preserve the interface location to build φ + using all the particles from all
avoid biasing. Thus, our projection method computes the average other regions. For efficiency, we ignore
value of the two level set functions and subtracts this average from particles that are far from the interface of the region in question.
both of them. At points where the two level sets intersect, their av- Typically, particles are used to correct the level set function both
erage equals their individual values, and thus subtracting off their after advection and after reinitialization. We apply our projection
averages sets them both to zero preserving the interface location. method to every grid point after each of these particle correction
Otherwise, at points where one level set is larger than the other, steps. Then for each grid point, all geometric information can be
subtracting their average makes them the same magnitude but op- computed from the level set function that is negative at that point.
posite sign preserving the region a given point is inside. The result When level set values are needed in between grid points, we inter-
is shown as dotted lines in the figure. If both level sets are reini- polate ~φ to that location and apply our projection method on the fly
tialized to signed distance functions, we obtain the result shown in to find the resulting negative φi . Note that the first projection step
Figure 4a which satisfies all desired properties. The same projec- is important because reinitialization preserves the interface location
tion method can be generalized to an arbitrary vector of level sets of each level set individually, but not their intersections which cor-
by subtracting the average of the smallest two φi from all of the φi . respond to the pre-projected interface locations. The second pro-
An example of this is shown in Figure 5. jection removes any numerical drift introduced by reinitialization,
and we note that a method such as [Merriman et al. 1994] could not
be used for this step because it does not preserve signed distance.
Notably our method is unbiased preserving signed distance infor-
mation. For example, consider Figure 4a and Figure 5b where the Advancing the incompressible velocity field to the next time step
level sets are all signed distance functions to begin with. Because and particle advection are the most expensive parts of our algo-
property 2 holds, the two smallest φi are equal and opposite in sign rithm. These steps depend mostly on the fluid volume and surface
making their average identically zero at every point. Thus, subtract- area, respectively, rather than the number of regions. The cost of
ing the average leaves all the the φi unchanged preserving signed advecting and reinitializing the level set functions remains fixed at
distance. This surprisingly simple algorithm has all the proper- twice the usual cost, since two level sets are updated locally near
ties we desire. Notably, [Merriman et al. 1994] is similar in spirit each interface instead of one. Thus, the cost of updating the level
to our own, but while they preserve the interface location and in- set function scales with the surface area just as in the standard single
side/outside information, they do not preserve signed distance thus level set method regardless of the number of regions.

814
Figure 7: Viscous letters splash into a pool of water, then change into low density inviscid fuel bubbling up and burning when they hit the
surface (350 × 200 × 350 grid, 10 phases).

4 Multiple Liquids the left or the right hand side of equation (8) to obtain β̂ (pi+1 −
pi )/∆x where β̂ = (β − β + )/(θ β + + (1 − θ )β − ). Thus, the dis-
We model the fluids using the incompressible Navier-Stokes equa- continuity between grid nodes i and i + 1 is readily handled by re-
tions
placing βi+1/2 with β̂ in equation (6). βi−1/2 is treated similarly.
∇ ·~u = 0 (1)
~ut + (~u · ∇)~u + ∇p/ρ = (∇ · τ)/ρ + f ~ (2)
4.2 Viscosity
where ~u = (u, v, w) is the velocity, ρ is the density, τ is the viscous
stress tensor, and ~f accounts for body forces, e.g. gravity, vorticity The viscous stress tensor for incompressible flow is τ = µ(∇~u +
confinement, etc. For simplicity, we first consider the inviscid case. (∇~u)T ). As discussed in [Rasmussen et al. 2004], a spatially con-
First, an intermediate velocity field ~u? is computed stant µ (within each region) implies that ∇ · τ = µ∆~u. Renaming
~un+1 in equation (5) to be ~u?? , we next solve the three systems of
(~u? −~un )/∆t + (~un · ∇)~un = ~f (3) linear equations given by
using a semi-Lagrangian advection scheme as in [Stam 1999]. ~u??? = ~u?? + ∆t∇ · (ν∇~u??? ) (9)
Next, we compute the pressure via
∇ · (∇p/ρ) = ∇ ·~u? /∆t. (4) where ν = µ/ρ. Note that we moved ρ under the divergence opera-
tor, under the assumption that it is spatially constant in each region.
and use it to make the velocity field divergence free Since the viscosity to density ratio is discontinuous across the inter-
face, we replace ν with ν̂ for differences that cross the interface in
(~un+1 −~u? )/∆t + ∇p/ρ = 0. (5) the same manner as β is adjusted to β̂ when solving equation (4).
Then, we again solve for the pressure and make the flow divergence
free using ~u??? in place of ~u? in equations (4) and (5).
4.1 Poisson Equation
We follow the method of [Nguyen et al. 2002]. For multiple fluid
regions, equation (4) is a Poisson equation with discontinuous coef-
ficients. The equation is separable so we can consider each dimen-
sion independently. A standard second order accurate discretization
of the left hand side in one spatial dimension at a grid node i is
 
βi+1/2 (pi+1 − pi )/∆x − βi−1/2 (pi − pi−1 )/∆x /∆x (6)

where β = 1/ρ. For inviscid flow, [Kang et al. 2000] showed that
the flux in equation (4) is continuous across the interface satisfying
β − p− + +
x = β px (7)
where the − and + superscripts represent values from different
sides of the interface. Thus if ρ (and hence β ) varies across the
interface then so must px . Consider the case where an interface
lies between nodes xi and xi+1 . We define θ = |φ (xi )|/(|φ (xi )| +
|φ (xi+1 )|) and approximate equation (7) with one-sided differences
as
β − (pI − pi )/(θ ∆x) = β + (pi+1 − pI )/((1 − θ )∆x) (8)
and solve for the interface pressure pI = (θ β + pi+1 + (1 − Figure 8: Different viscosity liquids interacting on an inclined
θ )β − pi )/(θ β + + (1 − θ )β − ) which can be substituted into either plane. (300 × 150 × 240 grid, 5 phases).

815
Figure 9: (Left) One way coupling from liquid to air. (Right) Two
way coupling of liquid and air. Note the surface ripples and the
unstable stream of liquid in the fully coupled simulation.

Each component of equation (9) should conserve momentum, so


we require a unique flux between every two velocity values. The
physically correct flux in the incompressible flow context is rather
complicated (see its derivation in [Kang et al. 2000]). However,
considering equation (9) in isolation admits a simple approxima-
tion which [Hong and Kim 2005] showed was sufficient for visual Figure 10: Two drops with high surface tension collide. Green has
accuracy. In isolation, the flux is given by ν∇~u, and we assume low density, red high density (3503 grid, 3 phases).
ν − ∇~u− = ν + ∇~u+ which is not actually true.1 Instead, correction
terms should be added for stencils that cross the interface, but these non-liquid regions. The animator may wish to simulate air, but not
terms couple the u, v, and w diffusion equations together making have the air affect the liquid. This requires one way coupling from
them difficult to solve with a fully implicit method. For example, liquid to air, but not vice versa. Figure 9 shows one way coupling
see [Rasmussen et al. 2004] where variable viscosity couples the (left) as compared to two way coupling (right). One way coupling
three equations together.2 They explicitly add correction terms be- is accomplished by using extrapolated velocities from the liquid to
fore solving for the velocity implicitly. We could take a similar ap- the gas as boundary conditions for the liquid region, while gas ad-
proach allowing for a larger time step than a fully explicit method, vection is carried out normally. In addition, these extrapolated ve-
but it is still less efficient than a fully implicit method. [Kang et al. locities are used to overwrite the gas velocity at any grid points that
2000] showed that the viscosity jump causes a jump in the pressure become liquid as the interface moves. The Poisson equation is first
and its derivatives as well3 , but [Hong and Kim 2005] showed that solved for the liquid region setting Dirichlet boundary conditions in
these too can be ignored for graphical purposes. the gas so that it has no effect (as is usual for empty regions), and
then a second Poisson equation is solved for the gas using Neumann
4.3 Viscoelasticity fixed velocity boundary conditions in the liquid so that it properly
drives the gas.
[Goktekin et al. 2004] incorporated viscoelastic effects by adding
(µe /ρ)∇ · ε to the Navier-Stokes equations, where µe is the elastic In free surface flow, the air region is modeled as
modulus and ε is the elastic strain tensor evolved in time via εt + empty allowing it to vanish. Thus, characteristics co-
~u · ∇ε = (∇~u + (∇~u)T )/2 − εtPlastic . They solved this last equation alesce as shown in the single grid cell in the figure to
by first using semi-Lagrangian advection, and then incorporating the right. Eventually, liquid rushes into the cell from
the right hand side which is the total strain rate minus the plastic all sides, and the air should disappear. However, air
strain rate. [Irving 2007] points out that this ignores the rotation of particles faithfully follow these characteristics ending up trapped in
the strain tensors, yielding incorrect results when the fluid rotates. the center of the cell. Since this cell should be a sink for air, we sim-
Thus, [Irving 2007] proposes rotating the strain tensor by the curl ply delete the air particles as they approach the center of the sink.
of the velocity field after the advection step. This is accomplished Note that these sinks are easily detected by finding local minima
by computing an explicit rotation matrix in the center of each cell, level set values in empty regions.
and using it to rotate the strain tensor also stored in the center of
each cell. This has enabled high quality detailed viscoelastic fluid
computations, see e.g. Figure 13.
6 Surface Tension
The ghost fluid method (GFM) of [Fedkiw et al. 1999] uses the
5 Adding Air or Empty Regions physically correct interfacial jump conditions to define ghost val-
Often times, only the liquid region is of interest and the gas flow can ues for discontinuous quantities which are then incorporated into
be ignored. Our system allows for the standard treatment of this by finite difference or interpolation stencils. [Hong and Kim 2005]
setting an entire region to be empty, and subsequently extrapolating used the GFM to discretize the jumps in pressure caused by surface
velocity into that region from the liquid regions and using Dirich- tension effects, and [Hong 2005]4 showed that the method produces
let boundary conditions during the pressure solve (see e.g.[Enright far better visual results than a smeared out delta function approach.
et al. 2002]). However, when the gas flow is important, our method Surface tension causes a jump in pressure across the interface equal
trivially extends to simulate gas regions just as though they were to σ κ, where σ is a surface tension coefficient (defined pairwise
other liquid regions. This allows for straightforward incorporation for the regions) and κ = −∇ · (∇φ /|∇φ |) is the interface curvature.
of smoke, fire, and even reactive gases as in [Ihm et al. 2004]. Be- Consider the case where an interface lies between xi and xi+1 . We
sides empty regions and air regions, there is yet a third way to model adjust pi+1 in equation (6) to account for the jump in pressure,
 
1 [Kang et al. 2000], equation (30) gives the jump across the interface β̂ ((pi+1 + σ κΓ ) − pi )/∆x − βi−1/2 (pi − pi−1 )/∆x /∆x
2 [Rasmussen et al. 2004], equations (5)-(7)
3 [Kang et al. 2000], equations (19) and (32)-(34) 4 page 36

816
Figure 11: Two submerged liquids meeting and reacting to create air (1503 grid, 4 phases).

where κΓ = θ κi+1 + (1 − θ )κi is computed with respect to the re- [Nguyen et al. 2002] used only the normal component of the veloc-
gion containing xi , and βi+1/2 has been replaced by β̂ as explained ity to advect the fuel level set, which is sufficient for their WENO
scheme that was applied without particles. We instead use semi-
in section 4.1. The (β̂ σ κΓ )/∆x2 term can be moved to the right
Lagrangian advection for the level set equation, and this requires
hand side, so that the resulting matrix is unaffected allowing for the
the tangential component of velocity as well in order to properly
use of fast symmetric linear system solvers such as the precondi-
trace characteristics. Since the tangential component is continuous
tioned conjugate gradient method.
across the interface, we form the normal component as usual and
simply add the tangential component from the local fluid velocity.
The tangential component is required for particle advection as well.
7 Surface Reactions
Our method incorporates surface reactions allowing one material
to turn into another. One example of this is the work on fire by 8 Examples
[Nguyen et al. 2002], but our framework allows for a more gen-
eralized treatment, e.g. Figure 11 shows two materials (submerged To demonstrate the effectiveness of our approach, we simulated a
beneath a third) coming together and reacting to form a fourth. number of examples that range in resolution from 1503 to 3503 on a
number of 4 processor Opteron machines. The computational cost
[Nguyen et al. 2002] used the GFM to model fire where the ex- for the examples range from 5 to 50 minutes per frame. Surface
pansion of fuel into products admits jumps in both velocity and tension was the main cause for the examples with slower simula-
pressure.5 As in the surface tension case, the pressure jump is in- tion times. We augmented a standard ray tracer to use the same
corporated directly into the Poisson equation. The velocity jump projection based querying of the level set functions that the simula-
needs to be handled whenever information is combined from dif- tion uses, since rendering each level set independently can lead to
ferent sides of the interface. They implement this by storing two multiple intersections per interface (from numerical error).
velocity fields, one for fuel and one for products, that inherently
store the jump conditions. While this only doubles their storage,
the storage requirements would scale linearly with the number of
different materials. We instead compute ghost values on the fly by
generalizing the concept of a scalar or vector field to encapsulate the
application of the jump condition. Our implementation wraps the
data in a lookup class that maintains a state variable indicating the
region for which values are being looked up. For example, when us-
ing semi-Lagrangian advection to update a face velocity in region i,
we create a lookup class instance and set its internal state to indicate
that any queried values should be returned with respect to region i.
Then the lookup class ensures that any data used to construct the ray
or interpolate is retrieved with the proper jump conditions already
applied. In this manner, existing interpolation and discretization
code is generalized with relative ease to account for discontinuities.
The lookup classes can also be used to incorporate object intersec-
tions in the same manner as jump discontinuities. For example, for
thin objects, a nested lookup class can be used to check for object
intersections and return the appropriate object ghost velocity as de-
scribed in [Guendelman et al. 2005], simplifying object interaction
implementations significantly. Figure 12: Oil pouring into water, then catching on fire. Note that
the fiery ball is a separate phase of fluid, and that it deforms into the
5 See equations (2) and (3) for the jump conditions shape of a droplet as it falls (2003 grid, 4 phases).

817
Figure 13: An armadillo that starts out viscoelastic, becomes viscous and more dense than the water, then inviscid and lighter than the water,
and finally viscoelastic again before another viscoelastic liquid is dropped onto it (250 × 275 × 250 grid, 4 phases).

Figure 10 depicts two drops suspended in liquid. The lower drop 9 Conclusions and Future Work
has a lower density than the surrounding fluid and the upper drop
has a higher density. Both drops have surface tension. Figure 3 Notably, the new technique does exacerbate the limitations of the
depicts a kinematic sphere splashing into a number of liquids. The original particle level set method with regards to volume loss by
air region is simulated as a Dirichlet region, and the liquids are of facilitating increased scene complexity. This is evident in the
increasing density from top to bottom. Figure 6 shows four layers Rayleigh-Taylor simulation depicted in Figure 6. In that example,
of fluid where the lower middle liquid is lighter than the top middle the majority of the mass loss occurs away from triple points, in re-
liquid. This causes a Rayleigh-Taylor instability as the two liquids gions where our method is identical to the original particle level set
switch places. method (see section 3.1). Of course, this can be addressed by in-
creasing the particle count for the particle level set method or using
an adaptive octree or run length encoded type level set simulation,
Figure 8 shows a number of different fluids on an inclined plane. at the expense of increased code complexity and/or CPU time.
The liquid with the highest viscosity is blue, then green, then sil-
ver, and finally the clear water is simulated as inviscid. Figure 13
depicts a viscoelastic armadillo in a pool of water. The viscoelastic
property is then removed making it viscous only, then the viscosity 10 Acknowledgements
is turned off and the density is turned down making it bubble up
to the surface. The former armadillo is then changed back to vis- Research supported in part by an ONR YIP award and a PECASE
coelastic and a newly introduced viscoelastic liquid is dropped on award (ONR N00014-01-1-0620), a Packard Foundation Fellow-
top of it. ship, a Sloan Research Fellowship, ONR N00014-03-1-0071, ONR
N00014-02-1-0720, ONR N00014-05-1-0479 (for a SUN comput-
ing cluster), ARO DAAD19-03-1-0331, NSF IIS-0326388, NSF
Figure 12 depicts flammable oil being released into a tank of water. ITR-0205671, NSF ITR-0121288, NSF ACI-0323866 and NIH
The oil rises to make a layer on the surface, which is then ignited. U54-GM072970.
This example uses a temperature based ignition model where the
temperature in actively burning regions is Tmax , but a lower Tignition
is needed to cause ignition of surrounding fluid. Figure 11 shows
two viscous liquids that react with each other creating a third (air) References
that bubbles up to the surface. In Figure 7, eight letters with various
high densities and viscosities splash into a pool of water and sink C ARLSON , M., M UCHA , P., VAN H ORN , R., AND T URK , G. 2002. Melt-
to the bottom. The air is treated as an empty region. In the second ing and flowing. In ACM SIGGRAPH Symp. on Comput. Anim., 167–
part of the simulation, the letters are changed to be low density 174.
fuels with surface tension, and the air is fully simulated. The letters C ARLSON , M., M UCHA , P. J., AND T URK , G. 2004. Rigid fluid: Ani-
then rise through the water, bursting into flames as they break the mating the interplay between rigid bodies and fluid. ACM Trans. Graph.
surface. (SIGGRAPH Proc.) 23, 377–384.

818
C HEN , J., AND L OBO , N. 1994. Toward interactive-rate simulation of Proc.) 23, 457–462.
fluids with moving obstacles using the navier-stokes equations. Comput. L OSASSO , F., I RVING , G., G UENDELMAN , E., AND F EDKIW, R. 2006.
Graph. and Image Processing 57, 107–116. Melting and burning solids into liquids and gases. IEEE Trans. on Vis.
E NRIGHT, D., M ARSCHNER , S., AND F EDKIW, R. 2002. Animation and and Comput. Graph. 12, 3, 343–352.
rendering of complex water surfaces. ACM Trans. Graph. (SIGGRAPH M C NAMARA , A., T REUILLE , A., P OPOVI Ć , Z., AND S TAM , J. 2004.
Proc.) 21, 3, 736–744. Fluid control using the adjoint method. ACM Trans. Graph. (SIGGRAPH
E NRIGHT, D., N GUYEN , D., G IBOU , F., AND F EDKIW, R. 2003. Us- Proc.), 449–456.
ing the particle level set method and a second order accurate pressure M ELEK , Z., AND K EYSER , J. 2005. Multi-representation interaction for
boundary condition for free surface flows. In Proc. 4th ASME-JSME physically based modeling. In ACM Symp. on Solid and Physical Mod-
Joint Fluids Eng. Conf., no. FEDSM2003–45144, ASME. eling, 187–196.
FATTAL , R., AND L ISCHINSKI , D. 2004. Target-driven smoke animation. M ERRIMAN , B., B ENCE , J., AND O SHER , S. 1994. Motion of multiple
ACM Trans. Graph. (SIGGRAPH Proc.) 23, 441–448. junctions: A level set approach. J. Comput. Phys. 112, 334–363.
F EDKIW, R., A SLAM , T., M ERRIMAN , B., AND O SHER , S. 1999. A non- M IHALEF, V., M ETAXAS , D., AND S USSMAN , M. 2004. Anima-
oscillatory Eulerian approach to interfaces in multimaterial flows (the tion and control of breaking waves. In Proc. of the 2004 ACM SIG-
ghost fluid method). J. Comput. Phys. 152, 457–492. GRAPH/Eurographics Symp. on Comput. Anim., 315–324.
F EDKIW, R., S TAM , J., AND J ENSEN , H. 2001. Visual simulation of M ÜLLER , M., S OLENTHALER , B., K EISER , R., AND G ROSS , M. 2005.
smoke. In Proc. of ACM SIGGRAPH 2001, 15–22. Particle-based fluid-fluid interaction. In Proc. of the 2005 ACM SIG-
F ELDMAN , B. E., O’B RIEN , J. F., AND A RIKAN , O. 2003. Animating GRAPH/Eurographics Symp. on Comput. Anim., 237–244.
suspended particle explosions. ACM Trans. Graph. (SIGGRAPH Proc.) N EFF , M., AND F IUME , E. 1999. A visual model for blast waves and
22, 3, 708–715. fracture. In Proc. of Graph. Interface 1999, 193–202.
F ELDMAN , B., O’B RIEN , J., AND K LINGNER , B. 2005. Animating gases N GUYEN , D., F EDKIW, R., AND J ENSEN , H. 2002. Physically based
with hybrid meshes. ACM Trans. Graph. (SIGGRAPH Proc.) 24, 3, 904– modeling and animation of fire. ACM Trans. Graph. (SIGGRAPH Proc.)
909. 29, 721–728.
F OSTER , N., AND F EDKIW, R. 2001. Practical animation of liquids. In P REMOZE , S., TASDIZEN , T., B IGLER , J., L EFOHN , A., AND
Proc. of ACM SIGGRAPH 2001, 23–30. W HITAKER , R. 2003. Particle–based simulation of fluids. In Comp.
F OSTER , N., AND M ETAXAS , D. 1996. Realistic animation of liquids. Graph. Forum (Eurographics Proc.), vol. 22, 401–410.
Graph. Models and Image Processing 58, 471–483. R ASMUSSEN , N., N GUYEN , D., G EIGER , W., AND F EDKIW, R. 2003.
F OSTER , N., AND M ETAXAS , D. 1997. Controlling fluid animation. In Smoke simulation for large scale phenomena. ACM Trans. Graph. (SIG-
Comput. Graph. Int., 178–188. GRAPH Proc.) 22, 703–707.
F OSTER , N., AND M ETAXAS , D. 1997. Modeling the motion of a hot, R ASMUSSEN , N., E NRIGHT, D., N GUYEN , D., M ARINO , S., S UMNER ,
turbulent gas. In Proc. of SIGGRAPH 97, 181–188. N., G EIGER , W., H OON , S., AND F EDKIW, R. 2004. Directible pho-
G ASCUEL , M.-P. 1993. An implicit formulation for precise contact mod- torealistic liquids. In Proc. of the 2004 ACM SIGGRAPH/Eurographics
eling between flexible solids. In Proc. SIGGRAPH 93, 313–320. Symp. on Comput. Anim., 193–202.
G OKTEKIN , T. G., BARGTEIL , A. W., AND O’B RIEN , J. F. 2004. A RUUTH , S. 1998. A diffusion-generated approach to multiphase motion. J.
method for animating viscoelastic fluids. ACM Trans. Graph. (SIG- Comput. Phys. 145, 166–192.
GRAPH Proc.) 23, 463–467. S ELLE , A., R ASMUSSEN , N., AND F EDKIW, R. 2005. A vortex particle
G UENDELMAN , E., S ELLE , A., L OSASSO , F., AND F EDKIW, R. 2005. method for smoke, water and explosions. ACM Trans. Graph. (SIG-
Coupling water and smoke to thin deformable and rigid shells. ACM GRAPH Proc.) 24, 3, 910–914.
Trans. Graph. (SIGGRAPH Proc.) 24, 3, 973–981. S HI , L., AND Y U , Y. 2005. Taming liquids for rapidly changing targets. In
H ONG , J.-M., AND K IM , C.-H. 2003. Animation of bubbles in liquid. Proc. of the ACM SIGGRAPH/Eurographics Symp. on Comput. Anim.,
Comp. Graph. Forum (Eurographics Proc.) 22, 3, 253–262. 229–236.
H ONG , J.-M., AND K IM , C.-H. 2005. Discontinuous fluids. ACM Trans. S MITH , K., S OLIS , F., AND C HOPP, D. 2002. A projection method for
Graph. (SIGGRAPH Proc.) 24, 3, 915–919. motion of triple junctions by level sets. Interfaces and Free Boundaries
H ONG , J.-M. 2005. Visual Simulation of Fluids with Discontinuous State 4, 3, 263–276.
Variables. PhD thesis, Korea University. S TAM , J., AND F IUME , E. 1995. Depicting Fire and Other Gaseous Phe-
H OUSTON , B., N IELSEN , M., BATTY, C., N ILSSON , O., AND M USETH , nomena Using Diffusion Process. In Proc. of SIGGRAPH 1995, 129–
K. 2006. Hierarchical RLE level set: A compact and versatile de- 136.
formable surface representation. ACM Trans. Graph. 25, 1, 1–24. S TAM , J. 1999. Stable fluids. In Proc. of SIGGRAPH 99, 121–128.
I HM , I., K ANG , B., AND C HA , D. 2004. Animation of reactive gaseous S TAM , J. 2003. Flows on surfaces of arbitrary topology. ACM Trans.
fluids through chemical kinetics. In Proc. of the 2004 ACM SIG- Graph. (SIGGRAPH Proc.) 22, 724–731.
GRAPH/Eurographics Symp. on Comput. Anim., 203–212. T REUILLE , A., M C NAMARA , A., P OPOVI Ć , Z., AND S TAM , J. 2003.
I RVING , G. 2007. PhD thesis, Stanford University. Keyframe control of smoke simulations. ACM Trans. Graph. (SIG-
K ANG , M., F EDKIW, R., AND L IU , X.-D. 2000. A boundary condition GRAPH Proc.) 22, 3, 716–723.
capturing method for multiphase incompressible flow. J. Sci. Comput. V ESE , L., AND C HAN , T. 2002. A multiphase level set framework for im-
15, 323–360. age segmentation using the mumford and shah model. Int. J. of Comput.
K ASS , M., AND M ILLER , G. 1990. Rapid, stable fluid dynamics for com- Vision 50, 3, 271–293.
puter graphics. In Comput. Graph. (Proc. of SIGGRAPH 90), vol. 24, WANG , H., M UCHA , P., AND T URK , G. 2005. Water drops on surfaces.
49–57. ACM Trans. Graph. (SIGGRAPH Proc.) 24, 3, 921–929.
K EISER , R., A DAMS , B., G ASSER , D., BAZZI , P., D UTR É , P., AND Y NGVE , G., O’B RIEN , J., AND H ODGINS , J. 2000. Animating explosions.
G ROSS , M. 2005. A unified lagrangian approach to solid-fluid ani- In Proc. SIGGRAPH 2000, vol. 19, 29–36.
mation. In Eurographics Symp. on Point-Based Graph. Z HAO , H.-K., C HAN , T., M ERRIMAN , B., AND O SHER , S. 1996. A
L AMORLETTE , A., AND F OSTER , N. 2002. Structural modeling of natural variational level set approach to multiphase motion. J. Comput. Phys.
flames. ACM Trans. Graph. (SIGGRAPH Proc.) 21, 3, 729–735. 127, 179–195.
L OSASSO , F., G IBOU , F., AND F EDKIW, R. 2004. Simulating water and Z HU , Y., AND B RIDSON , R. 2005. Animating sand as a fluid. ACM Trans.
smoke with an octree data structure. ACM Trans. Graph. (SIGGRAPH Graph. (SIGGRAPH Proc.) 24, 3, 965–971.

819

View publication stats

You might also like