
Crashing Waves, Awesome Explosions, Turbulent Smoke, and Beyond: Applied Mathematics and Scientific Computing in the Visual Effects Industry Aleka McAdams, Stanley Osher, and Joseph Teran hether it’s an exploding fire- invaluable tool for creating realistic virtual worlds ball in Star Wars: Episode 3 or in movies and video games. a swirling maelstrom in Pirates Some of the physical phenomena commonly of the Caribbean: At World’s End, simulated in movie and video game special effects special effects leveraging numerical include water, fire, smoke, explosions, rigid body Wsimulations can be seen in a wide range of dynamics, and the deformation of elastic bodies. Hollywood blockbusters. Although previously The governing equations for these processes are considered too involved and prohibitively expen- most often in the form of a system of partial differ- sive for applications like movie special effects, ential equations. The development of algorithms as computers get faster and architectures evolve, for solving such equations with the computer is simulation of such phenomena is now much one of the cornerstones of applied mathematics more practical. Moreover, as the bar has been and scientific computing. In fact, some techniques raised for increasingly realistic effects and even (most notably, level set methods) have completely for computer-generated imagery to blend seam- revolutionized the industry and have even been lessly with live performances, physically based honored with technical Academy Awards. simulation has become not only tractable but an In this article we will describe some of the Aleka McAdams is a graduate student in applied math- most compelling applications of applied math and ematics at UCLA. Her email address is amcadams@math. scientific computing in the visual effects indus- ucla.edu. try. Specifically we will talk about the techniques Stanley Osher is professor of mathematics and director used to simulate every imaginable component of applied mathematics at UCLA. His email address is of the digital environment, as well as the in- [email protected]. teractions between these components within a Joseph Teran is assistant professor of mathematics at scene. Furthermore, we will discuss some of the UCLA. His email address is [email protected]. ways in which physical simulation techniques for 614 Notices of the AMS Volume 57, Number 5 special effects differ from those developed for stresses and those acting on the fluid from out- more classical applications in physics and engi- side (e.g., gravity). For an incompressible fluid, the neering. Particularly, there are many cases in which internal forces can be described by −∇p + µ∇2v. the artistic vision of a scene requires a high level The second equation can be derived from the of controllability in the outcome of a simulation. conservation of mass and the assumption that To this end, special effects simulation tools, while the fluid is incompressible. By the conservation of physically based, must be able to be dynamically mass, the material derivative of density, i.e., the controlled in an intuitive manner in order to en- change in density of a parcel of advected fluid sure both believability and the quality of the effect. through time, is zero: We will highlight techniques from computational ∂ρ + ∇ · (ρv) = 0. fluid dynamics, computational solid dynamics, ∂t rigid body simulation, and collision detection and However,foranincompressiblefluid, ρ isapositive resolution. constant, so this simplifies to ∇ · v = 0. A number of numerical schemes are used in Computational Fluid Dynamics CFD to solve these equations. We can classify many Computational fluid dynamics (CFD) techniques methods commonly used in computer graph- are used to simulate a number of phenomena. ics into two categories: splitting or projection Obviously, crashing waves and oceans can leverage methods typically solved on a grid, and grid- CFD, but explosions, fireballs, and smoke effects less methods typically solved using a smoothed all make use of CFD nowadays as well. Before particle hydrodynamics (SPH) algorithm. the use of CFD, computer generated (CG) special Smoothed particle hydrodynamics (SPH) were effects such as explosions were driven by force initially developed for simulation of astrophysical fields applied to passive unconnected particles, problems. Müller et al. introduced the notion of producing less than realistic results. However,with using SPH to simulate liquids to computer graph- the combination of improved hardware and faster ics [25]. Particle methods such as SPH are good algorithms, realistic CFD-based special effects for at simulating very active fluids (e.g., splashing smoke, fire, water, and other fluids have become water, smoke) in real time, making them excellent much more prevalent. candidates for video game simulations, and more The governing equations for fluid dynamics can complex and high resolution particle simulations be derived from the principle of the conservation can be used to create realistic effects for motion of mass and momentum. Although compressible pictures as well. Furthermore, this particle repre- fluid models have been used for some special sentation of the fluid makes it easy to determine effect applications (e.g., explosions and shock the boundary between the simulated fluid and air. waves), these models are more difficult to solve As the name suggests, SPH represents the fluid numerically. As such, practitioners tend to use as particles whose attributes (e.g., velocity, pres- incompressible fluid models whenever possible, sure, density) are spatially smoothed using a so we will overview their derivation here. radially symmetric smoothing kernel W (r). Any From an Eulerian frame of reference, i.e., a scalar quantity A is thus interpolated to a location reference frame which is independent of the x to produce the smoothed field fluid’s motion, an incompressible fluid’s velocity Aj A (x) = m W (|x − x |), is governed by the Navier-Stokes equations s j j Xj ρj ∂v (1) ρ + (v ·∇)v = −∇p + µ∇2v + f where j iterates over all of the particles, mj is the th ∂t mass of the j particle, xj is its location, ρj the ∇ · v = 0, density, and Aj the field value at xj . Derivatives on A can then be computed by differentiating W , where ρ is density, p is pressure, µ is viscosity, e.g., and f represents outside forces. A The first equation can be derived directly from ∇A (x) = m j ∇W (|x − x |). s j ρ j the conservation of momentum (with some sim- Xj j plifications from the conservation of mass and Applying SPH to the Navier-Stokes equations then incompressibility), but perhaps a more intuitive is a matter of representing the quantities in (1) derivation begins with Newton’s Second Law, ∂v + · with these weights. Furthermore, since ∂t (v F = ma. The left side of the equation can be ∇)v in fact represents the time derivative of thought of as the “mass times acceleration” term a fluid particle’s velocity in an Eulerian frame, ∂v + ·∇ we can simplify this expression when using a with ρ corresponding to mass and ∂t (v )v, or the material derivative of v, corresponding to particle representation with the material derivative Dv acceleration. The forces acting on the fluid can Dt . Some complications arise when using SPH, be divided into two types: those from internal particularly, the force terms (i.e., ∇p and ∇2v) May 2010 Notices of the AMS 615 are not symmetric, but these can be alleviated by and other interesting effects one would wish to using different approximations. (See [25] for one capture in smoke. While a higher-resolution grid such approximation.) may be able to capture some of these effects, Many grid-based methods use finite differenc- this would be computationally expensive. Instead, ing on a staggered grid where the pressure is Fedkiw et al. introduced vorticity confinement defined on cell centers and velocity components techniques (created by Steinhoff for extremely are defined on cell faces. The timestepping scheme turbulent flow fields about helicopters [35]) for then depends on the Helmholtz-Hodge decompo- smoke which are able to counteract this dissipa- sition, which states that any vector field v∗ can tion even on low-resolution grids [11]. Additional be decomposed into v∗ = v + ∇p where v is techniques to add even more turbulence or speed divergence-free and p is a scalar field. With this, up computations have also been explored [31, 23]. the problem can be broken into two basic steps. Examples of smoke CFD special effects can be seen In the first step, the velocity is advected (i.e., it in Terminator 3 [14] and Star Wars: Episode 3 [15]. is moved along the velocity field) and forces and diffusion are applied by solving Fire ∂v∗ In many cases, fire can be modeled as an incom- ρ + (v∗ ·∇)v∗ = µ∇2v∗ + f ∂t pressible fluid in a way very similar to smoke. Again, vorticity confinement can be used to pro- with initial data duce turbulent fireballs and swirling flames, and ∗ n v |t=tn = v . additional combustion particles can be added to the simulation to spark new flames [15]. This candidate velocity v∗ is then made While these combustion particles can produce divergence-free by solving gas expansion effects for fireballs and exploding (2) ∇2p = ∇ · v∗ spaceships, additional tools are necessary to simu- v = v∗ −∇p late true fuel-based combustion such as a burning building or a gas-powered blowtorch. Nguyen et ∗ for v, the projection of v onto the divergence- al. introduced the idea of modeling the gaseous free subspace. (See [34] for a frequently used fuel and the flaming gaseous products as separate discretization to these equations.) (but coupled) incompressible fluids. The reaction While the Navier-Stokes equations and these front where fuel turns into fire is defined by a level discretizations are enough to determine much of set function which evolves according to the fuel the behavior of a fluid, additional quantities must velocity [26] (more about level set functions and be solved for and specialized treatment is needed their evolution can be found in the section “The to better capture the behavior of different types Level Set Method”).
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages10 Page
-
File Size-