Methods for the Physically Based Simulation of Solids and Fluids Geoffrey Irving Stanford University May 16, 2007.

Slides:



Advertisements
Similar presentations
My First Fluid Project Ryan Schmidt. Outline MAC Method How far did I get? What went wrong? Future Work.
Advertisements

Christopher Batty and Robert Bridson University of British Columbia
Isoparametric Elements Element Stiffness Matrices
Continuity Equation. Continuity Equation Continuity Equation Net outflow in x direction.
1cs533d-term Notes  No lecture Thursday (apologies)
The University of North Carolina – Chapel Hill COMP Finite Elements A Theory-lite Intro Jeremy Wendt April 2005.
Some Ideas Behind Finite Element Analysis
Section 4: Implementation of Finite Element Analysis – Other Elements
1D linear elasticity Taking the limit as the number of springs and masses goes to infinity (and the forces and masses go to zero): If density and Young’s.
1cs533d-winter-2005 Notes  Please read O'Brien and Hodgins, "Graphical modeling and animation of brittle fracture", SIGGRAPH '99 O'Brien, Bargteil and.
Notes Assignment questions… cs533d-winter-2005.
1cs533d-term Notes  Assignment 2 is up. 2cs533d-term Modern FEM  Galerkin framework (the most common)  Find vector space of functions that.
1cs533d-winter-2005 Notes  Read “Physically Based Modelling” SIGGRAPH course notes by Witkin and Baraff (at least, rigid body sections) An alternative.
Hierarchical Multi-Resolution Finite Element Model for Soft Body Simulation Matthieu Nesme, François Faure, Yohan Payan 2 nd Workshop on Computer Assisted.
Combating Dissipation. Numerical Dissipation  There are several sources of numerical dissipation in these simulation methods  Error in advection step.
More Accurate Pressure Solves. Solid Boundaries  Voxelized version works great if solids aligned with grid  If not: though the error in geometry is.
1cs533d-winter-2005 Notes  Please read Fedkiw, Stam, Jensen, “Visual simulation of smoke”, SIGGRAPH ‘01.
1cs533d-winter-2005 Notes  More optional reading on web for collision detection.
Interactive Animation of Structured Deformable Objects Mathieu Desbrun Peter Schroder Alan Barr.
CSE351/ IT351 Modeling and Simulation
University of North Carolina - Chapel Hill Fluid & Rigid Body Interaction Comp Physical Modeling Craig Bennetts April 25, 2006 Comp Physical.
Verification of GIMP with Manufactured Solutions Philip Wallstedt – Jim Guilkey –
1cs533d-winter-2005 Notes  More reading on web site Baraff & Witkin’s classic cloth paper Grinspun et al. on bending Optional: Teran et al. on FVM in.
1cs533d-term Notes  list Even if you’re just auditing!
1cs533d-winter-2005 Notes  Some example values for common materials: (VERY approximate) Aluminum: E=70 GPa =0.34 Concrete:E=23 GPa =0.2 Diamond:E=950.
Modeling Fluid Phenomena -Vinay Bondhugula (25 th & 27 th April 2006)
Coupling Water and Smoke to Thin Deformable and Rigid Shells Eran Guendelman 1,2 Andrew Selle 1,3 Frank Losasso 1,2 Ronald Fedkiw 1,2 1 Stanford University,
1cs533d-term Notes. 2 Poisson Ratio  Real materials are essentially incompressible (for large deformation - neglecting foams and other weird composites…)
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Intro to Computational Fluid Dynamics Brandon Lloyd COMP 259 April 16, 2003 Image courtesy of Prof. A.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Introduction to Modeling Fluid Dynamics 1.
Meshless Animation of Fracturing Solids Mark Pauly Leonidas J. Guibas Richard Keiser Markus Gross Bart Adams Philip Dutré.
Modeling, Simulating and Rendering Fluids Thanks to Ron Fediw et al, Jos Stam, Henrik Jensen, Ryan.
Fluid Simulation for Computer Animation Greg Turk College of Computing and GVU Center Georgia Institute of Technology.
Computer graphics & visualization Rigid Body Simulation.
Motivation  Movie  Game  Engineering Introduction  Ideally  Looks good  Fast simulation  Looks good?  Look plausible  Doesn’t need to be exactly.
Writing a Hair Dynamics Solver Tae-Yong Kim Rhythm & Hues Studios
Fluid Animation CSE 3541 Matt Boggus. Procedural approximations – Heightfield fluids Mathematical background – Navier-Stokes equation Computational models.
Department of Aerospace and Mechanical Engineering A one-field discontinuous Galerkin formulation of non-linear Kirchhoff-Love shells Ludovic Noels Computational.
Lecture VII Rigid Body Dynamics CS274: Computer Animation and Simulation.
Hybrid WENO-FD and RKDG Method for Hyperbolic Conservation Laws
A Look at High-Order Finite- Volume Schemes for Simulating Atmospheric Flows Paul Ullrich University of Michigan.
A Hybrid Particle-Mesh Method for Viscous, Incompressible, Multiphase Flows Jie LIU, Seiichi KOSHIZUKA Yoshiaki OKA The University of Tokyo,
Animation of Fluids.
Page 1 JASS 2004 Tobias Weinzierl Sophisticated construction ideas of ansatz- spaces How to construct Ritz-Galerkin ansatz-spaces for the Navier-Stokes.
Haptics and Virtual Reality
Dr. Wang Xingbo Fall , 2005 Mathematical & Mechanical Method in Mechanical Engineering.
Taming a Wild River Jeff Lander Darwin 3D
Stable, Circulation- Preserving, Simplicial Fluids Sharif Elcott, Yiying Tong, Eva Kanso, Peter Schröder, and Mathieu Desbrun.
11/11/20151 Trusses. 11/11/20152 Element Formulation by Virtual Work u Use virtual work to derive element stiffness matrix based on assumed displacements.
Ale with Mixed Elements 10 – 14 September 2007 Ale with Mixed Elements Ale with Mixed Elements C. Aymard, J. Flament, J.P. Perlat.
Parallel Solution of the Poisson Problem Using MPI
HEAT TRANSFER FINITE ELEMENT FORMULATION
Optical Flow. Distribution of apparent velocities of movement of brightness pattern in an image.
CHAP 3 WEIGHTED RESIDUAL AND ENERGY METHOD FOR 1D PROBLEMS
Discretization Methods Chapter 2. Training Manual May 15, 2001 Inventory # Discretization Methods Topics Equations and The Goal Brief overview.
CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Lecture VII Rigid Body Dynamics CS274: Computer Animation and Simulation.
Partial Derivatives Example: Find If solution: Partial Derivatives Example: Find If solution: gradient grad(u) = gradient.
Efficient Simulation of Large Bodies of Water by Coupling Two and Three Dimensional Techniques SIGGRAPH 2006 Geoffrey Irving Eran Guendelman Frank Losasso.
Efficient Simulation of Large Bodies of Water by Coupling Two and Three Dimensional Techniques Geoffrey Irving Stanford University Pixar Animation Studios.
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics1 Water Computational Fluid Dynamics Volumes Lagrangian vs. Eulerian modelling Navier-Stokes equations.
Efficient Simulation of Large Bodies of Water by Coupling Two and Three Dimensional Techniques Geoffrey Irving Stanford University Pixar Animation Studios.
Animating smoke with dynamic balance Jin-Kyung Hong Chang-Hun Kim 발표 윤종철.
1 CHAP 3 WEIGHTED RESIDUAL AND ENERGY METHOD FOR 1D PROBLEMS FINITE ELEMENT ANALYSIS AND DESIGN Nam-Ho Kim.
Fluid Animation CSE 3541 By: Matt Boggus.
Convergence in Computational Science
Objective Numerical methods Finite volume.
Introduction to Fluid Dynamics & Applications
Computer Animation Algorithms and Techniques
Comparison of CFEM and DG methods
Ph.D. Thesis Numerical Solution of PDEs and Their Object-oriented Parallel Implementations Xing Cai October 26, 1998.
Presentation transcript:

Methods for the Physically Based Simulation of Solids and Fluids Geoffrey Irving Stanford University May 16, 2007

Outline Three topics – Robust finite element simulation – Incompressible deformable solids – Large scale water simulation Solids go first so I get more questions

Invertible Finite Elements for Robust Simulation of Large Deformation with Joseph Teran and Ron Fedkiw

Goal: Keep Lagrangian Simulations from breaking Finite element method: volumetric objects tessellated with tetrahedra. Simulation only as robust as the worst element. One inversion can halt the simulation.

Previous work Mass-spring systems: – Palmerio psuedopressure term – Cooper 1997, Molino altitude springs Rotated linear finite elements: – Etzmuss 2003, Muller 2004 – used polar decomposition to fix rotation errors from linearization ALE and remeshing: – Hirt 1974, Camacho 1997, Espinoza 1998

Why not masses and springs? Altitude springs or psuedopressure terms work well: fast and robust. Unless you want to change the material behavior. Harder to add plasticity, biphasic response for flesh, etc. No intuitive relationship between different force components.

Our approach: Invertible finite elements Start with standard finite elements. Forces on nodes result from stress in each tetrahedron. Modify stress to behave correctly through inversion. Resulting forces reasonable for all possible configurations (inverted, flat, line, point, etc.).

Example

Outline State of each tetrahedron given by deformation gradient F (3x3 matrix). Diagonalize F to remove rotations: F = UF D V T Use first Piola-Kirchhoff stress: P = UP D V T Forces on nodes are linear in P: G = PB m

Deformation Gradient: F Maps vectors in material space to world space. deformed (world coordinates) undeformed (material coordinates)

Standard approach: Green Strain We could write stress in terms of Green strain 1/2(F T F-I). Bad for two reasons: – Already nonlinear in deformation. – Can’t detect inversion! Instead, we write stress P directly in terms of F, and ignore strain.

Diagonalization of F Isotropic materials are invariant under rotations of material and world space, but not under reflections. Standard SVD gives F = UF D V T with – V a pure rotation – U a pure rotation or a reflection – Diagonal F D with all positive entries If U is a reflection, we negate an entry of F D and the corresponding column of U. Heuristic: choose smallest entry of F D to make tetrahedron recover as quickly as possible.

Diagonalization of F SVD must be robust to zero or duplicate singular values.

First Piola-Kirchhoff Stress For an isotropic model, diagonal F D gives a diagonal stress P D. Can consider one stress component at a time. St. Venant-Kirchhoff useless for large compression.

First Piola-Kirchhoff Stress Better models have a singularity at the origin Adds severe stiffness Still dies if numerical errors cause inversion.

First Piola-Kirchhoff Stress We fix this by extrapolating the curve through inversion after a threshold. Diagonalization makes this easy for any model.

Constant vs. linear extrapolation In practice, constant extrapolation fails. Energy function not strictly convex. Slightly deformed tetrahedra can improve at the cost of inverted tetrahedra. Tangling results in incoherent inversion directions. Model explodes slowly.

Force Computation Given a correct diagonal stress P D, the forces can be computed as G = PB m = UP D V T B m B m is a matrix depending only on the rest state of the tetrahedron. Since forces are linear in P, robust P means robust forces.

Element inversion is physical continuous deformation by grey colored object discrete version illustrates element inversion

Results Elastic sphere compressed between two gears.

Results Buddha model compressed between two gears.

Results Buddha model colliding with kinematic sphere.

Damping and anisotropy Damping forces computed analogously to elastic forces. Difficult to conserve angular momentum during damping for flat or inverted elements, but no visual artifacts from lack of conservation. For anisotropic constitutive models, use V to rotate anisotropic terms into diagonal space.

Results: anisotropy Anisotropic constitutive model for muscles.

Plasticity We use multiplicative plasticity: F = F e F p Elastic forces computed from elastic deformation F e. Plastic deformation F p clamped away from inversion to ensure robustness. Plasticity can be controlled by accepting only deformations that move towards a target shape.

Results: plasticity Plastic sphere controlled towards a disk shape.

Results: plasticity A more obvious example of plasticity control

Results: plasticity Plastic shell compressed between two gears.

Generalization to other elements Inversion fixes modify underlying PDE. Any (Lagrangian) discretization can be applied to the new PDE. For other element types, modified P(F) is evaluated at each Gauss point.

Results: hexahedra Hexahedral mesh collapsing into a puddle.

Conclusions Simple method for robust FEM: – Diagonalize F to remove rotations. – Modify first Piola-Kirchhoff stress P for inversion. Diagonal setting helps intuition. Works for arbitrary constitutive models, including anisotropy. Easy to add plasticity and plasticity control.

Volume Preserving Finite Element Simulations of Deformation Models with Craig Schroeder and Ron Fedkiw

Motivation Virtual humans increasingly important – Stunt doubles – Virtual surgery Most biological tissues incompressible – Muscles, skin, fat Volume preservation is local – Conserving total volume insufficient

Motivation Important principle of animation Lasseter 1987: “The most important rule to squash and stretch is that, no matter how squashed or stretched out a particular object gets, its volume remains constant.”

Three main challenges Volumetric locking – Incompressibility aliases with other modes – Turns entire object rigid Volume preservation infinitely stiff – Implicit integration necessary – Might introduce oscillations in other modes Not the only infinite force (collisions)

Our approach Volumetric locking – Caused by too many constraints – Conserve volume per node (one-ring) – Fewer constraints: no locking Volume preservation stiffness – Use separate implicit solves for position and velocity – Cancels errors without introducing oscillations – Analogous to projection method in fluids Incorporate collisions into linear solves

Example

Previous work Spring-like forces for volume preservation – Cooper and Maddock 1997, many others Quasi-incompressibility – Simo and Taylor 1991 – Weiss et al. 1996, Teran et al. 2005: muscle simulation Per-node pressure variables – Bonet and Burton 1998: averaged nodal pressure – Lahiri et al. 2005: variational integrators – Cockburn et al. 2006: discontinuous Galerkin

Basic setup Start with linear tetrahedral elements – Position, velocity located at each node – Elastic forces computed per tetrahedron Preserve volume of each one-ring

Outline Time Discretization Spatial Discretization Collisions and Contact Discussion and Results

Outline Time Discretization Spatial Discretization Collisions and Contact Discussion and Results

Time discretization Start with any time integration scheme Add two new steps: – When updating position, solve for pressure to correct volume loss – After updating velocity, solve for pressure to correct divergence Correspond to elastic and damping forces

Volume correction Add volume correction  to position step Set final volume equal to rest volume

Volume correction Want to linearize Time derivative of volume is divergence: Linearization is div is integrated divergence

Volume correction Volume correction is gradient of pressure Gives Poisson equation for pressure Solve with conjugate gradient

Volume correction All volume error corrected in one step O(  x) errors give O(1) values of  x Do not use  x to update v!

Divergence correction Once volume error is removed, adjust velocity to avoid future change Same as before except no volume term This is a pure projection

Outline Time Discretization Spatial Discretization Collisions and Contact Discussion and Results

Volumetric locking Obvious approach: preserve volume of each tetrahedron This approach fails – Mesh has N nodes, 4-5N tetrahedra – 3N degrees of freedom – At least 4N constraints – 4N > 3N – Excessive artificial stiffness

Volumetric locking Poisson’s ratio 0.3, volume forces per-tetrahedron

Volumetric locking Poisson’s ratio 0.499, volume forces per-tetrahedron

One-rings: no locking Could use higher order elements – Loses simplicity Instead, just preserve volume at each node – 3N degrees of freedom – N constraints – No locking

One-rings: no locking Poisson’s ratio 0.5, volume preserved per one-ring

Spatial discretization Poisson equation is Need to define V, div, grad

Divergence Measuring one-ring volume is easy Define volume-weighted divergence as the gradient of the volume function Equivalent to integrating pointwise divergence over each one-ring

Gradient Can’t define gradient with volume integral – Single tetrahedron would have constant gradient – Wrong boundary conditions – Violates momentum conservation Instead, define – div maps velocity to pressure – grad maps pressure to velocity Results in symmetric linear systems

Outline Time Discretization Spatial Discretization Collisions and Contact Discussion and Results

The problem Incompressibility is infinitely strong Collisions are infinitely stronger Volume correction tries to cause large interpenetration every time step Self-collisions fight back… …Jagged, tangled surfaces

Contact constraints Make pressure forces collision-aware Projection matrix P removes normal component of velocity at each contact New pressure solves coupled between colliding objects

Contact constraints Particle-object, point-triangle, edge-edge Common form:

Enforcing contact constraints Projecting out one normal component is easy N constraints C T v = 0 hard Need to invert NxN matrix C T M -1 C Much too slow for every CG iteration

Gauss-Seidel Luckily, don’t need exact answer A few Gauss-Seidel sweeps is sufficient But Gauss-Seidel breaks symmetry – don’t commute – Can’t use in CG

Symmetric Gauss-Seidel Solution: alternate sweeps Symmetric even if it doesn’t converge 4 iterations sufficed Fast enough for use inside CG

Outline Time Discretization Spatial Discretization Collisions and Contact Discussion and Results

Results: varying stiffness High stiffness

Results: varying stiffness Medium stiffness

Results: varying stiffness Low stiffness

Results: rigid body collisions

Results: self-collisions

Singularities Pressure matrix not always positive definite Too many collisions can cause singularities Solution: use MINRES instead of CG Doesn’t require definiteness Stable for large examples

Results: 100 tori

Conclusions Keep simplicity of constant strain tetrahedra Enforce volume preservation per node – Avoids locking Separate treatment of volume and divergence – Position errors don’t cause huge velocities Make pressure solve collision aware – Symmetric Gauss-Seidel usable inside MINRES

Efficient Simulation of Large Bodies of Water by Coupling Two and Three Dimensional Techniques with Eran Guendelman, Frank Losasso, and Ron Fedkiw

Motivation Large scale water phenomena important – Rivers, lakes, oceans, floods Fast option: height field methods – Nice wave propagation – Can’t handle overturning Accurate option: 3D Navier Stokes – Captures three dimensional behavior – Slow at high resolutions: O(N 4 )

Solution: use both Uniform 3D Navier-Stokes near interface Coarsen elsewhere using tall cells uniform tall cells

Solution: use both

Related work: 2D Deep water – Fournier and Reeves 1986, Peachy 1986 – Recent: Thon et al. 2000, Hinsinger 2002 Shallow Water – Kass and Miller 1990, O’Brien and Hodgins 1995 Rivers and streams – Chen and Lobo 1994, Thon and Ghazanfarpour 2001

Related work: 3D Uniform Navier-Stokes water – Foster and Metaxas 1997, Foster and Fedkiw 2001 – Enright et. al 2002: Particle level set method Large bodies of water – Takahashi et al. 2003: spray and foam – Mihalef et al. 2004: breaking waves Adaptive simulation – Losasso et al. 2004: Octree grids – Houston et al. 2006: Run-Length Encoded (RLE) grids

Why height fields work Water likes to stay flat Only water-air interface is visible Vertical structure simpler than horizontal

Mixing height fields and 3D Specify “optical depth” where we expect turbulent motion Use uniform 3D cells within optical depth Use height field model elsewhere optical depth

Outline Grid structure Uniform solver Advection on tall cells Pressure solver on tall cells Parallel implementation Discussion and Results

Outline Grid structure Uniform solver Advection on tall cells Pressure solver on tall cells Parallel implementation Discussion and Results

Grid structure Start with uniform MAC grid Keep cells within optical depth of the interface Outside optical depth, merge vertical sequences of cells into single tall cells

Grid structure: storing values Start with MAC grid storage – Level set values in cell centers near interface – Pressure values in cell centers – Velocity components on corresponding faces

Grid structure: pressure Two pressure samples per tall cell Linear interpolation between Allows

Grid structure: velocity Velocity corresponds to pressure gradients Horizontal velocity (u and w)Vertical velocity (v)

Grid structure: velocity Velocity corresponds to pressure gradients Horizontal velocity (u and w)Vertical velocity (v)

Refinement and coarsening Grid is rebuilt whenever fluid moves based on current level set Linear time (Houston et al. 2006) Velocity must be transferred to new grid – optionally transfer pressure as initial guess

Transferring velocity InterpolateLeast squares Main criterion: conserve momentum

Transferring velocity (cont) Interpolate: Least squares:

Outline Grid structure Uniform solver Advection on tall cells Pressure solver on tall cells Parallel implementation Discussion and Results

Uniform solver Navier-Stokes equations for velocity: Level set equation: Standard uniform MAC grid within uniform band Level set exists only in uniform cells

Uniform solver (cont) Advect velocity and add gravity – use semi-Lagrangian for uniform cells (Stam 1999) Solve Laplace equation for pressure Apply pressure correction to velocity

Outline Grid structure Uniform solver Advection on tall cells Pressure solver on tall cells Parallel implementation Discussion and Results

Tall cell advection Can’t use semi-Lagrangian for tall cells Use conservative method for plausible motion Simplest option: first order upwinding Ignored by semi-Lagrangian

First order upwinding (uniform) Average to control volume face Compute flux based on upwind velocity Adjust velocities based on flux

First order upwinding (tall cells) Pretend to do the following – Refine to uniform grid – Advect – Coarsen back to original grid Simulate this by applying least squares directly to uniform discretization Same answer but faster

Advection issues Occasional instabilities near steep terrain Fix by clamping to affine combination

Outline Grid structure Uniform solver Advection on tall cells Pressure solver on tall cells Parallel implementation Discussion and Results

Pressure solve on tall cells Pressure projection is Need to define two operations: – Gradient (pressure to velocity) – Divergence (velocity to pressure)

Pressure solve: gradient Gradient is easy:

Pressure solve: divergence

Pressure solve: Laplacian Compose divergence and gradient to get linear system Symmetric and positive definite since we used the same weights in both Solve using preconditioned conjugate gradients

Outline Grid structure Uniform solver Advection on tall cells Pressure solver on tall cells Parallel implementation Discussion and Results

Parallelize only along horizontal dimensions – No harder than parallelizing a uniform code – Vertical dimension already cheap Exchange data with neighbors every step Solve for pressure on all processors globally Parallel implementation

Results: splash (300 x 200) Optical depth equal to water depth

Results: splash (300 x 200) Optical depth 1/4 th water depth

Results: splash (300 x 200) fully refined 1/4 th refined

Results: splash (300 x 200) Optical depth 1/16 th water depth

Results: deep splash Water depth doubled

Results: boat (1500 x 300) Vortex particles from Selle et al. 2005

Matching bottom topography Tall cells match ground for free Octrees would require extra refinement Less important in very deep water

Results: river (2000 x 200)

Comparison with octrees Advantages over octrees: – Easy to parallelize – Reduces to MAC discretization with refinement – Matches bottom topography for free Main disadvantage: relies on vertical simplicity for efficiency Not applicable for all flows – rising bubbles, colliding droplets, etc.

Conclusion Want high resolution near interface – Uniform interface resolution sufficient Plausible bulk motion enough elsewhere Many flows have simple vertical structure Use this to create hybrid 2D/3D method

Future work Improved advection scheme – Match ENO/WENO schemes for shallow water Better parallelism – Remove global linear system solve Find optimal adaptive structure – Hybrid RLE / octree grid?

Acknowledgements Weronika Ron Fedkiw My committee: Adrian Lew, Leo Guibas, Matt West, Michael Kass Co-authors: Joey Teran, Eftychis Sifakis, Frank Losasso, Eran Guendelman Craig Schroeder, Tamar Shinar, Andrew Selle, Jonathan Su Stanford Physically-Based Modeling group Neil, Josh, Igor, Duc, Fred, Sergey, Rachel, Avi, Jerry, Nipun Pixar Research Group John Anderson, Tony DeRose, Michael Kass, Andy Witkin, Mark Meyer Funding agencies – NSF, ONR, ARO, Packard and Sloan Foundations

The End Questions?