Modeling and Rendering Viscous Liquids
ABSTRACT We present a particle-based algorithm for modeling highly viscous liquids. Using a numerical time-integration of particle acceleration and velocity, we apply external forces to particles and use a convenient organization, the adhesion matrix, to represent forces between different types of liquids and objects. Viscosity is handled by performing a momentum exchange between particle pairs such that momentum is conserved. Volume is maintained by iteratively adjusting particle positions after each time step. We use a two-tiered approach to time stepping that allows particle positions to be updated many times per frame while expensive operations, such as calculating viscosity and adhesion, are done only a few times per frame. The liquid is rendered using an implicit surface polygonization algorithm, and we present an implicit function that convolves the liquid surface with a Gaussian function, yielding a smooth liquid skin.
Conference Proceeding: A simple model of ocean waves.[show abstract] [hide abstract]
ABSTRACT: We present a simple model for the surface of the ocean, suitable for the modeling and rendering of most common waves where the disturbing force is from the wind and the restoring force from gravity.It is based on the Gerstner, or Rankine, model where particles of water describe circular or elliptical stationary orbits. The model can easily produce realistic waves shapes which are varied according to the parameters of the orbits. The surface of the ocean floor affects the refraction and the breaking of waves on the shore. The model can also determine the position, direction, and speed of breakers.The ocean surface is modeled as a parametric surface, permitting the use of traditional rendering methods, including ray-tracing and adaptive subdivision. Animation is easy, since time is built into the model. The foam generated by the breakers is modeled by particle systems whose direction, speed and life expectancy is given by the surface model.To give designers control over the shape of the ocean, the model of the overall surface includes multiple trains of waves, each with its own set of parameters and optional stochastic elements. The overall "randomness" and "short-crestedness" of the ocean is achieved by a combination of small variations within a train and large variations between trains.Rendered examples of oceans waves generated by the model are given and a 10 second animation is described.Proceedings of the 13st Annual Conference on Computer Graphics and Interactive Techniques, SIGGRAPH 1986; 01/1986
Conference Proceeding: A Cellular Texture Basis Function.[show abstract] [hide abstract]
ABSTRACT: Solid texturing is a powerful way to add detail to the surface of rendered objects. Perlin's "noise" is a 3D basis function used in some of the most dramatic and useful surface texture algorithms. We present a new basis function which complements Perlin noise, based on a partitioning of space into a random array of cells. We have used this new basis function to produce textured surfaces re- sembling flagstone-like tiled areas, organic crusty skin, crumpled paper, ice, rock, mountain ranges, and craters. The new basis func- tion can be computed efficiently without the need for precalculation or table storage. In this paper, we propose a new set of related texture basis func- tions. They are based on scattering "feature points" throughout and building a scalar function based on the distribution of the local points. The use of distributed points in space for texturing is not new; "bombing" is a technique which places geometric fea- tures such as spheres throughout space, which generates patterns on surfaces that cut through the volume of these features, forming polkadots, for example. (9, 5) This technique is not a basis func- tion, and is significantly less useful than noise. Lewis also used points scattered throughout space for texturing. His method forms a basis function, but it is better described as an alternative method of generating a noise basis than a new basis function with a different appearance.(3) In this paper, we introduce a new texture basis function that has interesting behavior, and can be evaluated efficiently without any precomputation. After defining the function and its implementation, we show some applications demonstrating its utility.01/1996
- [show abstract] [hide abstract]
ABSTRACT: Connected particle systems can depict many objects difficult to model in any other fashion. We present a method for animating viscous fluids by simulating the forces of such particles interacting with each other. This method allows for collision detection between the particles and obstacles, both stationary and mobile, and it allows solid objects to break and melt. An approximate method for covering the particles with an isosurface for efficient rendering is also presented.Computers & Graphics. 01/1989;
Modeling and Rendering Viscous Liquids
Kevin Steele, David Cline, Parris K. Egbert, and Jonathan Dinerstein
Brigham Young University
3366 TMCB, Provo, Utah 84602, USA
Tel. 1(801)422-4029Fax. 1(801)422-0169
email: email@example.com, firstname.lastname@example.org, email@example.com
We present a particle-based algorithm for modeling highly viscous liquids. Using a numerical time-integration of particle
acceleration and velocity, we apply external forces to particles and use a convenient organization, the adhesion matrix, to
represent forces between different types of liquids and objects. Viscosity is handled by performing a momentum exchange
between particle pairs such that momentum is conserved. Volume is maintained by iteratively adjusting particle positions after
each time step. We use a two-tiered approach to time stepping that allows particle positions to be updated many times per
frame while expensive operations, such as calculating viscosity and adhesion, are done only a few times per frame. The liquid
is rendered using an implicit surface polygonization algorithm, and we present an implicit function that convolves the liquid
surface with a Gaussian function, yielding a smooth liquid skin.
Keywords: computer animation, physically-based animation, fluid modeling
Many early attempts to animate fluids in computer graphics have used a Lagrangian description of motion [1, 2, 3]. Lagrangian motion
focuses on individual particles and their properties such as position, velocity, and acceleration, and the influence particles have on one
another . In contrast, much of the recent fluid animation research has used an Eulerian description of motion  in which groups of
particles participate in flow fields, and the flow properties are observed or specified at fixed spatial points in a Cartesian grid [5, 6, 7, 8],
usually by employing the Navier-Stokes equations for incompressible fluids. The Eulerian model has the advantage of being able to
accurately model liquids of lower viscosity. However it has a bounded simulation space due to the discrete nature of the flow sampling. In
contrast, the Lagrangian model has an unbounded simulation space (the particles are free to go anywhere), and may more easily simulate
non-Newtonian effects such as the stringiness exhibited by honey or the bounciness of egg white.
The purpose of this paper is to show that modeling and animating highly viscous liquids such as oil, liquid soap or honey can be done
efficientlyusingaLagrangianmodel, andbyovercomingtheproblemsof numericalinstabilityandvolumelossitcanyieldvisuallyaccurate
results and convincing behavior (see figure 1). In this paper we model large collections of liquid molecules as single particles, and compute
the interaction between particles in such a way as to behaviorally simulate an amount of liquid that a human might realistically interact
with. We employ particle systems to directly model the body of the liquid; individual particles represent a fixed region of liquid and are
given initial locations and velocities. A time-stepped simulation is then run and each particle’s position and velocity are updated according
to an Euler-step solution to the set of differential equations governing Newtonian motion.
Though simple, explicit Euler step integration tends to exhibit numerical instability. Another method for accurately computing particle
movement that guarantees stability for large time steps is implicit integration [9, 10]. Unfortunately, standard solutions to implicit integra-
tion require solving large, sparce matrices, where the sparseness is related to the particle neighborhood. In our system a typical particle
neighborhood may include sixty or more particles. We therefore use an explicit numerical solution to compute particle movement, and we
employ dampening strategies to reduce numerical instability.
numerical stability of our explicit integration scheme. We model multiple liquids interacting in the same simulation simply by assigning
to each particle a material type and then varying its interaction behavior with other particles based on their types. Liquids of different
Figure 1: A spherical drop of simulated honey falls onto a suspended ball.
viscosities not only exhibit differing flow rates, but also behave differently when in contact with objects in their environment. To efficiently
accommodate the varying properties of different liquids, we define an adhesion matrix, a matrix of functions that control liquid behavior.
The adhesion matrix contains a row and column entry for each type of liquid and solid object in the simulation environment. Each matrix
cell contains a function that determines how velocities are modified when the materials in that cell’s row and column come into contact.
When using particles to model fluids in a CFD simulation, volume preservation is a continuing problem. We present a method to preserve
volume in our liquid simulation, and we optimize both the velocity computation and the volume preservation using adaptive timesteps.
To render the particle system we use a traditional implicit surface rendering method to generate surface triangles that can then be
rasterized or raytraced, and we present an implicit function that utilizes particle locality to define a smooth skin around the system. The
function is convolved to effectively eliminate local surface features produced from individual particles while still maintaining the larger
surface features of the liquid.
Collisions with objects in the simulation environment are detected and handled by embedding object particles in the surfaces of environ-
ment objects. Liquid particles respond to forces originating from collisions with object particles, so the same framework used to modify
liquid particle velocities can be used to resolve collisions of the liquid with scene objects. Additionally, interactions and collisions with
moving objects happen automatically without the need for handling special cases.
Particles are stored in a 3D spatial partitioning grid, and grid cells are indexed by location and stored in a hash table, permitting an
unbounded partitioning, near constant-time lookup for grid cells and constant time lookup for individual particles. Since all operations on
particle locations and velocities depend only on local particle neighbors, each iteration of the simulation takes O(n) time for a system of n
The goal of accurately describing the behavior of liquid is not new. In the early 1800’s, Navier and Stokes jointly developed a set of
equations using conservation of momentum and mass that accurately describe fluid flow (see, for example ). Over the past two decades,
several approaches have been devised to graphically simulate fluid flow. The work that has been done can coarsely be divided into three
approaches. The first is a strictly surface-based approach where a parametric surface is used to model the surface of a liquid. The second
is a Lagrangian description of motion in which particles are used to represent the fluid. The third is an Eulerian approach in which the
Navier-Stokes equations are approximated or simulated to produce fluid flow.
Some of the early attempts at simulating fluid flow used parametric functions to approximate fluid surfaces. Schachter  used this
approach to model cresting waves. Fournier and Reeves  and Peachey  expanded this technique into a more general method for
modeling waves and surf. Kass and Miller  computed a height field for a fluid surface using 2D shallow water equations. Chen and
Lobo  extended their approach to include a contribution from the Navier-Stokes equations to the elevation of the height field.
Reeves introduced the idea of particle systems for the simulation of fluid . This system provided particles with positions and
velocities, and then tracked the movement of those particles through time. Miller and Pearce  extended the particle system idea by
adding viscosity. They did this by attaching viscous springs to the particles to provide for inter-particle relationships. Terzopoulos, Platt
and Fleischer  used particles in a molecular dynamics approach to simulate object melting. Desbrun and Gascuel  introduced a
system to simulate soft objects using a particle system to define large-scale motion. They employed an isosurface defined by the particles to
determine contact forces and local deformations. Later, drawing on formalisms from physics literature, Desbrun and Gascuel  extended
Smoothed Particle Hydrodynamics (SPH) to simulate deformable bodies. Stora, et. al.,  simulated lava flow using smoothed particles
with a temperature-based viscosity. More recently, Tasdizen, et al.  used SPH to simulate realistic liquid flow, and Muller, Charypar
and Gross  use SPH to achieve interactive flow for a few thousand fluid particles.
In an attempt to model fluid flow in a more physically accurate manner, researchers have developed techniques to approximate or simulate
the Navier-Stokes equations. These techniques often give more accurate physical results, but have other problems such as burdensome
computation times or mass dissipation. Foster and Metaxas  use a finite-difference approximation to the Navier-Stokes equations to
determine gross liquid transport, then use local velocities to simulate finer fluid detail. They later refined their technique to simulate hot
gases . Stam produced a numerically stable version using a semi-Lagrangian method instead of finite differences . This technique
guaranteed stable results at relatively large time steps, but did not accurately handle dissipation. Fedkiw, Stam, and Jensen  extend this
technique to accurately model vorticities and interactions between smoke and moving objects. Foster and Fedkiw  use a semi-Lagrangian
method derived from Stam’s technique to solve for liquid motion using the Navier-Stokes equations. To prevent the mass dissipation typical
of this method, they use a level-set surface in conjunction with inertialess particles. This level set allows liquid movement but preserves
visual continuity of the liquid’s mass. Enright, Marschner and Fedkiw  refined the surface tracking of Foster and Metaxis, allowing
finer liquid details to be modeled. Carlson et al.  use the incompressible Navier-Stokes equations to simulate effects such as melting of
wax and the flow of highly viscous fluids.
We approach the problem of liquid animation from a Lagrangian description of motion. Our method differs from earlier particle-based
models [1, 18, 2] by providing more flexibility in the inter-particle forces controlling the animation, allowing us to simulate a wider variety
of viscous liquids. We also utilize a more aggressive density preservation model, enhancing the visual continuity of the animation.
Viscous Liquid Model
We use a particle system to model and animate liquid motion throughout the simulation. Each particle of the system represents a globule,
or a finitely small volume of liquid. The particle data structure contains the necessary data to accurately track the liquid through time
and space; it stores the location of the globule, its velocity, size, mass, and other data to facilitate rendering, such as its color properties,
proximity to the liquid surface, and surface normal. The entire system is stored in an array of particle structures.
Within the constraints of the simulation, the liquid is free to occupy any position in space independent of its containing data structure.
This is less restrictive than the Eulerian motion model where the liquid must stay within the predefined bounds of the sampled flow fields.
To accomplish this, we subdivide Cartesian space into fixed-sized cells indexed by their corner location. Only cells containing particles are
allocated in memory, and once a cell no longer contains particles it is deallocated. Cells are stored in a hash table and keyed by hashing
their corner locations with an array mapping function as in :
hash key = 541i + 79j + 31k mod table size.
Hashing cell locations permits very fast, near constant-time lookup. This is critical since many computations on individual particles
involve accessing a list of particle neighbors. Hence a single iteration through the array of particles is an O(n) operation even when a list
of particle neighbors is fetched for each particle.
We begin with a simple particle transport model and apply viscosity and friction. For any particle, the instantaneous force applied is the
sum of all forces from neighboring particles plus the gravitational force:
f(pi) + g.
We start the simulation at time t0and successively apply forces at regular intervals of δt, where δt is the duration of one frame divided
by the number of substeps per frame. New velocities are computed from the applied forces and particle locations are subsequently updated
from the new velocities.
When a particle is processed in the simulation, forces are applied to the particle’s velocity and the particle is moved. We separate these
forces into three types: adhesion forces that attract particles to each other and to other objects, viscosity forces that limit shear movement
of particles in the liquid, and friction forces that dampen movement of particles in contact with objects in the environment. Each force type
is derived separately and applied in succession.
Figure 2: Examples of adhesion functions used in our system. The function domains are specified in particle radius units so that a simulation
can be run with larger or smaller numbers of particles by just changing the standard particle radius. Generally, we define adhesion
functions with a support of 4 particle radii.
The size of the timestep δt greatly influences the accuracy of the simulation. Unfortunately, increasing the number of substeps per frame
so that the simulation is stable and accurate can be inefficient. Stora et al.  found that some simulations needed as many as 64 substeps
per displayed frame to maintain stability. Our experiments showed similar results.
One approach that has been taken to alleviate this computational burden is to use adaptive time steps for each particle in the simulation.
We tried this, but were only able to achieve a two-fold speedup over the naive approach. We found that a better approach for simulations
of viscous fluids was to separate operations that had to be performed every time a particle moved from those that did not. Thus, instead of
dozens of substeps per frame, we only use a few, 2 to 8 typically, but within each substep the particle positions are updated iteratively and
a collision model is applied to keep the particles properly separated. This simple innovation increased the speed of our simulations by four
to ten times.
The Adhesion Matrix
The adhesion force is an inter-particle force that attracts or repels other particles or objects in the environment. Since a liquid will flow
differently when in contact with different materials and when mixed with other liquids, the inter-particle force function may be different
for each unique type of particle pair. To organize and represent these forces we define a matrix of functions, the adhesion matrix, whose
cells contain the functions governing the adhesion of particle pair types. For example, an oil particle in the vicinity of steel particle would
receive an adhesion force Fsteel−oil(distance from steel).
Entries in the adhesion matrix include liquid types as well as materials with which liquids will interact. The shapes of the adhesion
functions in the adhesion matrix in large part determine the behavior of a simulated liquid. The force functions are user-definable in
our system; we use piecewise-linear functions. We found that defining complex functions with many sample points did not work better
than using simple ones with only a few sample points; only the overall shapes of the functions mattered. In addition, the results of our
simulations were similar whether the adhesion functions tapered off to zero or not. Noting this fact, we were able to reduce the support of
the adhesion functions, decreasing computation.
Although we experimented with a number of different adhesion functions, our animations only use three function types. The first
function type mimics a Leonard-Jones potential (repulsion at close distance and attraction at a greater distance) with the repulsion force
capped at about 10 times the maximum attractive force to help prevent numerical instability. This function type was used as the adhesive
force between particles of the same or similar fluids. The other two types of functions were either purely attractive or purely repulsive.
Attractive functions were used to make liquids cling to solid objects, and repulsive functions were useful when we wanted different fluid
types to repel each other or not mix. Figure 2 shows some functions from a typical adhesion matrix.
As the viscosity of a liquid increases, the momenta of a liquid’s constituent particles increasingly tend toward that of their neighborhood
average. We model the viscosity of the liquid in a similar way. The resistance to shear particle movement due to viscosity, which we call
the viscous force, is applied to a particle indirectly through an algorithmic momentum exchange between particles. Given a particle p, and
a viscosity constant v, which we define to be the percentage of momentum that a particle will exchange with its neighbors in one second,
the momentum exchange can be calculated. The momentum exchange proceeds by scaling the difference in momentum between the two
particles by a normalizing factor and a weighting function k, then adding the result Pexchto p’s momentum Ppand subtracting it from pn’s
momentum Ppn. Note that since the same amount of momentum is being exchanged between any two particles, the total momentum of the
system is conserved.
Pp = Pp+ Pexch,
Ppn = Ppn− Pexch.
The normalizing factor in the equation is half of the viscosity constant divided by the total weight of the weighting function k, and diis
the distance from the particle being processed. This weighting function gives the user more flexibility in deciding how much momentum is
exchanged between two particles based on their separation distance. Similar to the adhesion functions, we found that subtle differences in
the weighting function did not significantly affect fluid behavior, but increasing the support of the weighting function increased the stiffness
of the material being simulated. In our simulations, we used a piece-wise approximation of a gaussian function for k with a support of
between 4 and 6 particle radii.
Once the forces have been accumulated and applied to each particle’s velocity vector, the particles are translated in an Euler-step fashion
for a numerical time-integration of its acceleration and velocity. Two problems commonly encountered with this type of simulation are
that Euler step integration is often numerically unstable, and when particles represent piecewise masses of a larger substance, the volume
of the substance does not remain constant. In our system the first problem is avoided by application of the viscous force computation. By
averaging each particle’s neighborhood velocity, the numerical instability of the timestep-integration is mitigated.
Friction and Interpenetration Prevention
Friction is only applied to particles that are in contact with scene objects. Rather than use the standard friction model for solid objects
with separate coefficients for static and kinetic friction forces, we use a simplified model more suitable for liquids. Each particle that is on
the surface of the liquid and that is in contact with an object will have its velocity dampened by a factor specific to that object type. To
avoid confusion with conventional friction coefficients, we refer to this term as the friction factor. The friction factor f is defined to be
the percentage of velocity dampening a particle experiences per second. If the current simulation iteration has 1/δt substep intervals per
second, then the velocity vt+δtwill be dampened each substep by
ˆ vt+δt= fδtvt+δt.
In practice, defining the friction as the percentage of velocity dampening per second required inconveniently small numbers, so we
instead define it as the percentage of velocity dampening per 1/30 of a second.
Inter-penetration prevention is essential to maintaining stability in the simulation and to help in the final volume preservation process. To
correct for particle inter-penetration, the particle system is again iteratively traversed and particles that are inter-penetrating are separated
to their contact distance. Figure 3 summarizes our complete liquid dynamics algorithm.
Volume preservation is perhaps the most difficult problem to solve. We assume a constant volume, and we take an iterative approach to
maintain the correct density at each particle location. First, a desired density for single particles is established. Then the particle positions
are adjusted after each substep of the simulation to correct for differences between the current liquid density and the desired density. This
process is performed iteratively after each sub-timestep until the density is within a specified tolerance of the desired density. Correcting to
within 2% of the desired density can be done with less than three density corrections per sub-timestep on average, totaling approximately
15% of the total simulation time. Additional accuracy can be achieved at a higher computational cost, however, if the density error threshold
is set too stringently, some instability in the system can result. Also, we note here that the volume correction procedure only corrects our
measure of density, not the actual volume enclosed by a rendered isosurface.