1 / 82

Fluid Animation

Fluid Animation. Christopher Batty November 17, 2011. What distinguishes fluids?. What distinguishes fluids?. No “preferred” shape Always flows when force is applied Deforms to fit its container Internal forces depend on velocities, not displacements. Watch fluid simulation clips.

kiona
Download Presentation

Fluid Animation

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Fluid Animation Christopher Batty November 17, 2011

  2. What distinguishes fluids?

  3. What distinguishes fluids? • No “preferred” shape • Always flows when force is applied • Deforms to fit its container • Internal forces depend on velocities, not displacements Watch fluid simulation clips

  4. Basic Theory

  5. Eulerian vs. Lagrangian Lagrangian: Point of reference moves with the material. Eulerian: Point of reference is stationary. e.g. Weather balloon (Lagrangian) vs. weather station on the ground (Eulerian)

  6. Eulerian vs. Lagrangian Consider an evolving temperature field. • Lagrangian: Set of movingparticles, each with a temperature value.

  7. Eulerian vs. Lagrangian Consider an evolving temperature field. • Eulerian: A fixed grid of temperature values, that temperature flows through.

  8. Relating Eulerian and Lagrangian Consider the temperature at a point following a given path, . Two ways temperature changes: • Heating/cooling occurs at the current point. • Following the path, the point moves to a cooler/warmer location.

  9. Time derivatives Mathematically: Chain rule! Definition of Choose

  10. Material Derivative This is called the material derivative, and denoted. Change at a point moving with the velocity field. Change due to movement. Change at the current (fixed) point.

  11. Advection To track a quantity T simply moving (passively) through a velocity field: This is the advection equation. Think of colored dye or massless particles drifting around in fluid. or equivalently Watch dye in fluid clip

  12. Equations of Motion • For general materials, we have Newton’s second law: F = ma. • Specialized for fluids: “Navier-Stokes Equations”

  13. Navier-Stokes Density Acceleration = Sum of Forces Expanding the material derivative…

  14. What are the forces on a fluid? Primarily for now: • Pressure • Viscosity • Simple “external” forces • (e.g. gravity, buoyancy, user forces) Also: • Surface tension • Coriolis • Possibilities for more exotic fluid types: • Elasticity (e.g. silly putty) • Shear thickening / thinning (e.g. “oobleck”, ketchup) • Electromagnetic forces • Sky’s the limit... Watch oobleck clip

  15. In full… Change in velocity at a fixed point Advection Forces (pressure, viscosity gravity,…)

  16. Operator splitting Break the equation into steps: • Advection: • Pressure: • Viscosity: • External:

  17. 1. Advection

  18. Advection Previously, we considered advection of a passive scalar quantity, , by velocity . In Navier-Stokes we saw: Velocity is advectedby itself!

  19. Advection i.e., The scalar components of the vector are each advected in the same way. We can reuse the same numerical method.

  20. 2. Pressure

  21. Pressure What does pressure do? • Enforces incompressibility. Typical fluids (mostly) do not compress. • Exceptions: high velocity, high pressure, …

  22. Incompressibility Compressible velocity field Incompressible velocity field

  23. Incompressibility Intuitively, net flow into/out of a given region is zero (no sinks/sources). Integrate the flow across the boundary of a closed region:

  24. Incompressibility By divergence theorem: But this is true for any region, so everywhere.

  25. Pressure How does pressure enter in? • Pressure is the force required to ensure that . • Pressure force has the following form:

  26. Helmholtz-Hodge Decomposition Input Velocity field Curl-Free (irrotational) Divergence-Free (incompressible) + =

  27. Aside: Pressure as Lagrange Multiplier Interpret as an optimization: Find the closest to where A Lagrange multiplier to enforce the constraint is exactly pressure.

  28. 3. Viscosity [Carlson et al. 2003]

  29. Viscosity What characterizes a viscous liquid? • “Thick”, damped behaviour • Higher resistance to flow Watch viscous honey clip

  30. Viscosity Loss of energy due to internal friction between molecules moving at different velocities. Interactions between molecules in different layers causes shear stressthat… • acts to oppose relative motion. • causes an exchange of momentum

  31. Viscosity Loss of energy due to internal friction between molecules moving at different velocities. Interactions between molecules in different layers causes shear stressthat… • acts to oppose relative motion. • causes an exchange of momentum

  32. Viscosity Loss of energy due to internal friction between molecules moving at different velocities. Interactions between molecules in different layers causes shear stressthat… • acts to oppose relative motion. • causes an exchange of momentum

  33. Viscosity Loss of energy due to internal friction between molecules moving at different velocities. Interactions between molecules in different layers causes shear stressthat… • acts to oppose relative motion. • causes an exchange of momentum

  34. Viscosity Imagine fluid particles with general velocities. Each particle interacts with nearby neighbours, exchanging momentum.

  35. Viscosity Amount of momentum exchanged is proportional to: • Velocity gradient, • Viscosity coefficient, For any closed region, net in/out flow of momentum: So the viscosity force is:

  36. Viscosity The end result is a smoothing of the velocity. This is exactly the action of the Laplacian operator, . For scalar quantities, the same operator is used to model diffusion.

  37. 4. External Forces

  38. External Forces Any other forces you may want. • Simplest is gravity: • for • Buoyancy models are similar, • e.g.,

  39. Numerical Methods

  40. 1. Advection

  41. Advection of a Scalar • First, we’ll consider advecting a scalar quantity, . • temperature, color, smoke density, … • The grid stores and .

  42. Eulerian Approximate derivatives with finite differences. FTCS = Forward Time, Centered Space: Unconditionally Unstable! Lax: Conditionally Stable! Many possible methods, stability can be a challenge.

  43. Lagrangian • Advect data forward from grid points by integrating position according to grid velocity. • Problem: New data position doesn’t necessarily land on a grid point. ?

  44. Semi-Lagrangian • Look backwards in time from grid points, to see where data is coming from. • Interpolate data at previous time.

  45. Semi-Lagrangian - Details • Determine velocity at grid point,. • Integrate position for a timestepof • e.g. • Interpolate at , call it . • Assign for the next time. Unconditionally stable!

  46. Advection of Velocity • This is great for scalars. What about velocity advection? • Same method: • Trace back with current velocity • Interpolate velocity (component) at that point • Assign it to the grid point at the new time. • Caution: Do not overwrite the velocity field you’re using to trace back!

  47. 2. Pressure

  48. Recall… Helmholtz-Hodge Decomposition Input Velocity field Curl-Free (irrotational) Divergence-Free (incompressible) + =

  49. Pressure Projection - Derivation (1) and (2) Discretize (1) in time… Then plug into (2)…

  50. Pressure Projection Implementation: 1) Solve a linear system for p: 2) Update grid velocity with:

More Related