animation of fluids l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Animation of Fluids PowerPoint Presentation
Download Presentation
Animation of Fluids

Loading in 2 Seconds...

play fullscreen
1 / 47

Animation of Fluids - PowerPoint PPT Presentation


  • 265 Views
  • Uploaded on

Animation of Fluids. Animating Fluid is Hard…. Too complex to animate by hand Surface is changing very quickly Lots of small details In short, a nightmare! Need automatic simulations…. Ad-Hoc Methods. Some simple algorithms exist for special cases Mostly waves… What about water glass?

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Animation of Fluids' - Mia_John


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
animating fluid is hard
Animating Fluid is Hard…
  • Too complex to animate by hand
    • Surface is changing very quickly
    • Lots of small details
    • In short, a nightmare!
  • Need automaticsimulations…
ad hoc methods
Ad-Hoc Methods
  • Some simple algorithmsexist for special cases
    • Mostly waves…
  • What about water glass?
  • Too much work to comeup with empirical algorithmsfor each case…
physically based approach
Physically-Based Approach
  • Look to Fluid Dynamics
    • Long history. Back to Newton…
    • Equations that describe fluid motion
  • Use numerical methods to approximate fluid equations, simulating fluid motion
    • Like mass-spring systems
current state of the art in cg
Current State-of-the-art in CG
  • Marker-And-Cell (MAC) Method
    • fedkiw_fluid\glass00.avi
    • fedkiw_fluid\splash-640.avi
  • Smoothed Particle Hydrodynamics (SPH)
    • muller_particles\sph.avi
    • muller_particles\pool.avi
applications
Applications
  • Mostly Hollywood
    • Shrek
    • Antz
    • Terminator 3
    • Many others…
  • Games
  • Engineering…
fluid dynamics

Fluid Dynamics

(with as little math as possible)

what do we mean by fluid
What do we mean by ‘Fluid’?
  • liquids or gasses
  • Mathematically:
    • A vector field u (represents the fluid velocity)
    • A scalar field p (represents the fluid pressure)
    • fluid density (d) and fluid viscosity (v)
vector fields
Vector Fields
  • 2D Scalar function:
    • f(x,y) = z
    • z is a scalar value
  • 2D Vector function:
    • u(x,y) = v
    • v is a vector value
      • v = (x’, y’)
  • The set of valuesu(x,y) = v is called avector field
fluid velocity vector field
Fluid Velocity == Vector Field
  • Can model a fluid as a vector field u(x,y)
    • u is the velocity of the fluid at (x,y)
    • Velocity is different at each point in fluid!
  • Need to compute change in vector field
conceptual leap
Conceptual Leap
  • Particle Simulation:
    • Track particle positionsx = (x,y)
    • Numerically Integrate: change in position
  • Fluid Simulation :
    • Track fluid velocitiesu = (u,v) atall pointsx in some fluid volume D
    • Numerically Integrate: change in velocity
equations of fluid dynamics
Equations of Fluid Dynamics
  • Navier-Stokes Equation:
    • Non-linear Partial Differential Equation
    • Models fluid transport
    • Derived from Newton’s second law
      • conservation of momentum – all the forces go “somewhere”
  • Mass-Conservation condition:
    • If we have a liter of water at the beginning of the solution, we have a liter at the end…
change in velocity
Change in Velocity
  • Derivative of velocity with respect to time
  • Change in velocity, or acceleration
    • So this equation models acceleration of fluids
advection term

Change inVelocity

Advection Term
  • Advection term
    • Force exerted on a particleof fluid by the other particlesof fluid surrounding it
    • How the fluid “pushes itself around”
diffusion term

Change inVelocity

Advection

Diffusion Term
  • Viscosity constant controls velocity diffusion
  • Essentially, this term describes how fluid motion is damped
  • Highly viscous fluids stick together
    • Like maple syrup
  • Low-viscosity fluids flow freely
    • Gasses have low viscosity
pressure term

Change inVelocity

Advection

Diffusion

p = 0

p = 1

p = 0.5

Pressure Term
  • Pressure follows a diffusion process
    • Fluid moves from high-pressureareas to low-pressure areas
  • Moving == velocity
    • So fluid moves in direction oflargest change in pressure
    • This direction is the gradient

Time…

weather pressure
Weather: Pressure
  • “Fronts” are the boundaries between regions of air with different pressure…
  • “High Pressure Zones” will diffuse into “Low Pressure Zones”
fluid example
Fluid Example
  • Fast moving fluid is “pulled” towards slower-moving fluid
body force

Change inVelocity

Advection

Diffusion

Pressure

Body Force
  • Body force term represents external forces that act on the fluid
    • Gravity
    • Wind
    • Etc…
summary

Change inVelocity

Advection

Diffusion

Pressure

Summary
  • And 1 liter == 1 liter constraint:
  • Need to simulate these equations…
intermission
Intermission
  • Smoke
    • fedkiw_octree\smoke_octree.avi
  • Fire
    • fedkiw_fire\flammable.avi
fluid representation
Fluid Representation
  • Want to simulate motion of some fluid body
    • fluid is represented by a vector field
  • Two problems:
    • Need to compute change invector field (using Navier-Stokes equation)
    • Need to track fluid position
solution discretization
Solution: Discretization
  • Create regular grid
solution discretization27
Solution: Discretization
  • Create regular grid
  • Discretize fluid into grid cells
solution discretization28
Solution: Discretization
  • Create regular grid
  • Discretize fluid into grid cells
  • Track single velocityvector in eachgrid cell
simulation step

u

1

=

-

×

Ñ

+

Ñ

×

Ñ

-

Ñ

+

(

u

)

u

(

v

u

)

p

f

t

d

Simulation Step
  • “Solve” Navier-Stokes equation for each grid cell to compute change in velocity:

Body Force is just like mass-spring systems

non-linear Advection term is difficult. Can finite-difference, but is not robust…

finite-difference Diffusion and Pressure terms are linear systems of equations

free surface tracking with marker particles
Free Surface Tracking with Marker Particles
  • Want higher-resolution surface for rendering
  • Add a bunch of particles
  • Passively Advect thembased on fluid velocity
so the rest is easy right
So the rest is easy, right?
  • No
  • Still have to enforce mass-conservation constaint:
  • Standard equation does not take boundary conditions into account
    • Boundary conditions are things like walls, fluid/air boundaries, rubber duckies, and so on
    • Have to ‘hack’ the equations…this is hard…
  • Numerical Stability is elusive…
intermission 2
Intermission 2
  • Melting
    • carlson_melting\bunnyside.mpg
  • Rigid Body + Fluid
    • carlson_rigidfluid\rigidfluid.avi
water or vegetable oil
Water or Vegetable Oil?
  • fedkiw_fluid\glass00.avi
  • Oh, and it’s very, very slow
    • 7 minutes per frame forwater glass…
hard to control
Hard to Control
  • Animators want to control fluid behavior
  • Fluid simulation has a lot of free variables
  • There has been limited success so far…
what does fluid effects support
What does fluid effects support?
  • Naver-Stokes-based Fluids:
    • Smoke
    • Clouds
    • Explosions
    • Fire
    • “Goo” type-stuff
  • Ad-Hoc / Mass-Spring fluids:
    • Oceans
    • Ponds
fluid effects algorithms
Fluid Effects Algorithms
  • Unconditionally Stable Navier-Stokes simulation
    • Means they never explode, even with large timesteps
    • Jos Stam, “Stable Fluids”, SIGGRAPH 99
  • Do not preserve volume very well
    • Ok for smoke
    • Problematic for water glass…
    • Gets worse w/ larger timestep
maya smoke
Maya Smoke
  • Smoke demo
maya fire
Maya Fire
  • Looks like smoke…
maya ocean
Maya Ocean
  • 2D height field – no crashing waves
  • Can attach ‘bouyant’ objects
maya pond
Maya Pond
  • 2D height field
    • No splashing
  • Mass-spring system
  • Bouys, Boats, Wakes
  • Can run in real-time
slide47

Fin

(questions?)