Melting and Flowing
Total Page:16
File Type:pdf, Size:1020Kb
Melting and Flowing Mark Carlson, Peter J. Mucha, R. Brooks Van Horn III, Greg Turk Georgia Institute of Technology Abstract We present a fast and stable system for animating materials that melt, flow, and solidify. Examples of real-world materials that exhibit these phenomena include melting candles, lava flow, the hardening of cement, icicle formation, and limestone deposition. We animate such phenomena by physical simulation of fluids – in particular the incompressible viscous Navier-Stokes equations with free surfaces, treating solid and nearly-solid materials as very high viscosity fluids. The computational method is a modification of the Marker-and-Cell (MAC) algorithm in order to rapidly simulate fluids with variable and arbitrarily high viscosity. This allows the viscosity of the material to change in space and time according to variation in temperature, water content, or any other spatial vari- able, allowing different locations in the same continuous material to exhibit states ranging from the absolute rigidity or slight bending of hardened wax to the splashing and sloshing of water. We create detailed polygonal models of the fluid by splatting particles into a volumetric grid and we render these models using ray tracing with sub-surface scattering. We demonstrate the method with examples of several viscous materials including melting wax and sand drip castles. Keywords: melting, solidifying, animation, computational fluid dynamics. Figure 1: Melting wax. 1 Introduction approach allows us to take large time-steps even when the viscosity A major goal in animation research is to simulate the behavior of of the fluid is extreme. real-world materials, including such phenomena as draping cloth, breaking glass, and flowing and splashing liquids. The goals of Many materials exhibit variable viscosity depending on proper- the work presented in this paper are twofold: first, we develop a ties such as temperature and water content. Being able to simulate method for quickly simulating highly viscous liquids with free sur- a wide range of viscosities allows us to achieve our second goal, faces; second, we use this capability to animate materials that melt, which is to simulate materials that melt, flow, and harden. Many flow, and harden. natural materials exhibit these properties, including wax, glass, ce- ment, wet sand, stone (lava), and water (ice). We add several ca- The viscosity of a fluid describes how quickly the variations in pabilities to the MAC method in order to animate such phenomena. the velocity of the fluid are damped out. We find viscous fluids ev- First, we allow the viscosity of the animated material to vary from erywhere: toothpaste, hand lotion, yogurt, ketchup, tar, wet cement, one position to the next, and we change the material equations of and glue are just a few examples. The computer graphics literature motion to address this variability. Second, we tie material proper- contains several methods of simulating fluids with relatively low ties such as temperature or water content to the viscosity in order viscosity. Absent, to our knowledge, is a method for simulating to allow melting and hardening. We simulate heat diffusion, heat high viscosity liquids. The method that we present fills this gap sources and heat sinks for the animation of material such as molten in computer animation, allowing us to simulate material that varies wax. Third, we extract surface models from the simulation by splat- in both space and time from absolutely rigid (treated as very high ting particles into a high resolution volume and we then create poly- viscosity) to freely flowing (low viscosity). We have modified the gons from this volume. Finally, we use ray tracing with subsurface Marker-and-Cell method from the computational fluid dynamics lit- scattering to render these materials. erature to incorporate an implicit scheme for calculating the diffu- sion component of the equations for viscous fluids. This implicit The overarching theme of our work is that many materials that melt, flow and harden can be viewed always as a fluid, even when in solid form. This prevents us from ever having to set arbitrary thresholds when deciding whether a material should be treated as a solid or as a liquid. The methods that we use to implement this idea borrow from several techniques that have been published in the computer graphics and the computational fluid dynamics liter- ature. We believe that our main contribution is in bringing these separate threads together and in demonstrating that a system built from these components can produce believable animation of melt- ing and solidifying materials. Since the components of our system are based on well-understood numerical techniques, we anticipate that others will easily be able to replicate our results. 2 Previous Work uses a projection method to satisfy the zero divergence condition. Fedkiw and Stam improved upon this method using vortex confine- Animation of fluids have been approached in a number of ways in ment to allow vortices to swirl indefinitely, and by using clamped the computer graphics literature. We use the term fluids to encom- cubic interpolation to prevent the dissipation of fine features [Fed- pass the motion of gases such as air (including simulating smoke), kiw01]. Their improved technique allows solid boundaries, moving and liquids such as water. or stationary, but assumes a zero viscosity fluid [Fedkiw01]. Foster Several graphics researchers studied the large-scale motion of and Fedkiw recently re-visited the Marker-and-Cell method, and water in waves [Fournier86; Peachy86]. These methods used el- improved upon it in several ways [Foster01]. First, they replaced evation maps of the terrain underneath the water, and the line of the forward Euler convection calculations with a semi-Lagrangian waves were bent according to the variations in wave speed that the approach for greater stability. Second, and perhaps more important, elevation profile induces. The simulation of breaking waves occurs they introduced use of the level set approach to computer graphics at a particular sea floor elevation and wave velocity. for the purpose of fluid simulations. Their level set approach results Kass and Miller took a different approach to the simulation of in considerably more finely resolved details on the liquid’s surface. fluids [Kass90]. Like most of the earlier approaches, they used a We note that the CFD literature contains literally thousands of height field to model water. In contrast to other methods, however, papers on simulating fluids, and there are a number of approaches they used a partial differential equations formulation for the motion such as spectral methods and finite elements that are virtually un- of the water. Their PDE’s govern the amount of fluid that passes tried in computer graphics. The factors that guide researchers in se- between columns of water. O’Brien and Hodgins used a hybrid lecting fluid simulation methods include: ease of programming, low height field and particle-based representation to simulate splashing computational overhead, controllability, the incorporation of obsta- water [O’Brien95]. cles, and (in the case of water and other liquids) the representation Several groups of researchers have used physically-based par- of free surfaces. Spectral methods do not easily represent complex ticle models to represent fluids. Miller and Pearce create solids, boundaries or free surfaces, and finite element methods are compu- deforming objects and fluids by tuning the manner in which parti- tationally expensive. These factors are probably important for the cles interacted with one another [Miller89]. Their particle forces prevalence of finite differences methods used for computer graph- are similar to Lennard-Jones forces: particles very close together ics. The Marker-and-Cell method is a finite difference approach; repel one another, but at moderate distances they are attracted to we describe it now and then later examine how it may be modified each other, with the attraction falling off with greater distances. to handle high viscosity fluids. Tonnesen, in addition to calculating inter-particle forces, uses a dis- crete approximation to the general heat transfer equation in order to 3 MAC Method Overview modify a particle’s behavior according to its thermal energy [Ton- nesen91]. A similar approach is used by Terzopoulos et al., but In this section we describe the equations for fluid motion and de- they also allow pairs of particles to be explicitly attached to one an- scribe the MAC method of fluid simulation. In Sections 4 and 5 we other for modeling deformable objects [Terzopoulos89]. Desbrun will describe our modifications to this basic approach. and Gascuel also use Lennard-Jones style particle forces to create Our goal is to simulate incompressible, viscous fluids, and the soft materials, but they maintain an explicit blending graph and per- equations that govern such fluids are the Navier-Stokes equations. form particle size calculations in order to preserve volume [Des- In the following equations the vector-valued variable u represents brun95]. Stora et al. use particles and an approach to force calcula- the velocity of the fluid, and it may be a 2D or 3D vector depending tions called smoothed particle hydrodynamics in order to simulate on the dimensionality of our simulations. Pressure will be repre- the flow of lava [Stora99]. Their simulator models heat diffusion sented by p, the density of the fluid is ρ (which we always take to and variable viscosity, and they demonstrate animations that use up be 1), and the kinematic viscosity is v. Here are the Navier-Stokes to 3,000 particles. equations: The most recent trend in the animation of liquid is to discretize the fluid into compact cells, rather than into columns of water, and ∇ = ¡ u 0(1) then use PDE’s to drive the motion of fluid between cells. This is the finite differences approach, and it is a commonly used method in ∂ the computational fluid dynamics literature.