39
Animating Sand as a Fluid Yongning Zhu Robert Bridson Presented by KKt

Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

Animating Sand as a FluidYongning Zhu

Robert BridsonPresented by KKt

Page 2: Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

Korea UniversityComputer Graphics Lab. Seung-ho shin| 2009/ 01/12| # 2KUCG |

Abstract

• Physics-based simulation for animating sand

• Using inter-grain and boundary friction§ existing water simulator can be turned into a

sand simulator.• Cloud of particles

§ Accurate and flexible surface tracking and advection

§ Auxiliary grid to efficiently enforce boundary conditions and incompressibility

Page 3: Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

Korea UniversityComputer Graphics Lab. Seung-ho shin| 2009/ 01/12| # 3KUCG |

Introduction

• We wanted to animating granular materials § sand, gravel, grains, soil, rubble, flour, sugar

• Sand as a continuous material§ sand dune containing trillions of grains

• The purposes of plausible animation we simplify the exist water simulation models

• To combine grids and particles• Reconstructing a smooth surface

Page 4: Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

Korea UniversityComputer Graphics Lab. Seung-ho shin| 2009/ 01/12| # 4KUCG |

Related Work

• Miller and Pearce[1989]§ Simple particle system model

• Later Luciani et al.[1995]§ Particle system model specifically for granular materials

• Li and Moshell[1993]§ Dynamic height-field simulation of soil with Mohr-Coulomb

constitutive model

• Sumner et al.[1998]§ Height-field approach with simple displacement and erosion

rules

• Onoue and Nishita[2003]§ multi-valued height-fields

Page 5: Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

Korea UniversityComputer Graphics Lab. Seung-ho shin| 2009/ 01/12| # 5KUCG |

Particles for water simulation

• Desbrun and Cani[1996]§ Smooth Particle Hydrodynamics

• Müller et al.[2003]§ SPH further for water simulation

• Premoze et al.[2003]§ Used variation on SPH with an approximate

projection• Takeshita et al.[2003]

§ For fire

Page 6: Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

Korea UniversityComputer Graphics Lab. Seung-ho shin| 2009/ 01/12| # 6KUCG |

Grids for water simulation

• Foster and Metaxas[1996]§ Grid-based fully 3D water simulation in graphics

• Stam[1999]§ Semi-Lagrangian advection method for faster

simulation• Foster and Fedkiw[2001]

§ Level set and marker particles• Losasso et al.[2004]

§ Adapted octree grids• Hong and Kim[2003]

§ Volume-of-fluid algorithms

Page 7: Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

Korea UniversityComputer Graphics Lab. Seung-ho shin| 2009/ 01/12| # 7KUCG |

Plastic flow

• Terzopoulos and Fleischer[1988]§ First introduced plasticity to physics-based animation

• O’Brien et al.[2002]§ Fracture-capable tetrahedral-mesh finite element simulation

• Müller and Gross [2004]§ Real-time elastic simulation

• Jaeger et al.[1996]§ Scientific description of the physics of granular materials§ Elasto-plastic finite element formulation with Mohr-Coulomb

or Drucker-Prager yield conditions

Page 8: Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

Korea UniversityComputer Graphics Lab. Seung-ho shin| 2009/ 01/12| # 8KUCG |

PIC and FLIP

• Harlow[1963]§ Particle-in-cell(PIC) for compressible flow

• Harlow and Welch[1965]§ Marker-and-cell for incompressible flow

• Brackbill and Ruppel[1986]§ Fluid-Implicit-Particle (FLIP)

Page 9: Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

Korea UniversityComputer Graphics Lab. Seung-ho shin| 2009/ 01/12| # 9KUCG |

Sand Modeling

• Frictional Plasticity§ Mohr-Coulomb law§ Material will not yield§

• Von Mises equivalent shear stress

|..|F is Frobenius norm

• Mean stress

Page 10: Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

Korea UniversityComputer Graphics Lab. Seung-ho shin| 2009/ 01/12| # 10KUCG |

Basic mathematics

• Trace

• Frobenius norm

σ is the singular values of A

Page 11: Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

Korea UniversityComputer Graphics Lab. Seung-ho shin| 2009/ 01/12| # 11KUCG |

Stress Tensor

•Stress is consisted of

Normal stress σShearing stress τ

Page 12: Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

Korea UniversityComputer Graphics Lab. Seung-ho shin| 2009/ 01/12| # 12KUCG |

Terminologies

<Von Mises and Tresca Yield surfaces in principle stress coordinates>

Page 13: Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

Korea UniversityComputer Graphics Lab. Seung-ho shin| 2009/ 01/12| # 13KUCG |

• 전단변형에너지조건(von Mises 항복조건)

2213

232

221 2)()()( Y=-+-+- ssssss

단순인장 항복의 경우

213

232

221 )()()(

21 sssssss -+-+-=>> 유효응력(effective stress)

3/Yk =

( ) k=-= minmaxmax 21 sst

전단항복응력(재료상수)

크기순으로 주응력을 321 sss ³³ 이라 놓으면,

Page 14: Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

Korea UniversityComputer Graphics Lab. Seung-ho shin| 2009/ 01/12| # 14KUCG |

Yielding sand flow

• direction § That the shearing force is pushing§ Non associated to gradient of yielding

• Ignore dilation§ A little when it begins to flow§ Stops as soon as the sand is freely flowing

Page 15: Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

Korea UniversityComputer Graphics Lab. Seung-ho shin| 2009/ 01/12| # 15KUCG |

A Simplified Model

• Ignore the nearly imperceptible elastic deformation

• Tiny volume changes• Simulating decompose 2 regions

§ Rigid moving§ incompressible shearing flow

• Pressure required to make entire velocity field incompressible§ Certainly false but for plausible results

Page 16: Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

Korea UniversityComputer Graphics Lab. Seung-ho shin| 2009/ 01/12| # 16KUCG |

Frictional stress

• Neglecting elastic effects

• Frictional stress is simply

§ Strain rate :• At the yield surface

§ that most directly resists the sliding

Page 17: Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

Korea UniversityComputer Graphics Lab. Seung-ho shin| 2009/ 01/12| # 17KUCG |

Yield condition

• Without elastic stress and strain•

§

§

§

§ : Newton’s law§ Divide with area

Page 18: Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

Korea UniversityComputer Graphics Lab. Seung-ho shin| 2009/ 01/12| # 18KUCG |

Simulation algorithm

• Advection• Usual water solver

§ Gravity, boundary condition, pressure§ Subtract for incompressible

• Evaluate the strain rate tensor D, according to yield condition§ If < à rigid à store§ Else à solid à store

• According to regions§ Project connected rigid groups§ Others velocity

Page 19: Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

Korea UniversityComputer Graphics Lab. Seung-ho shin| 2009/ 01/12| # 19KUCG |

Frictional Boundary Conditions

§

§ Coulomb friction coefficient between the sand and the wall

§ Important behavior• Don’t sliding at vertical surfaces• Always allow sliding never be stable

Page 20: Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

Korea UniversityComputer Graphics Lab. Seung-ho shin| 2009/ 01/12| # 20KUCG |

Friction comparison

Page 21: Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

Korea UniversityComputer Graphics Lab. Seung-ho shin| 2009/ 01/12| # 21KUCG |

Cohesion

§ c > 0 is the cohesion coefficient§ Appropriate for soil or sticky materials§ Improving results

• With very small amount of cohesion

Page 22: Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

Korea UniversityComputer Graphics Lab. Seung-ho shin| 2009/ 01/12| # 22KUCG |

Fluid Simulation Revisited

• Grids and Particles• Grid-based methods (Eulerian grids)

§ Store on a fixed grid• velocity, pressure, some sort of indicator• Where the fluid is or isn’t• Staggered “MAC” grid is used

• Particle-based methods§ SPH(Smoothed Particle Hydrodynamics)§ Actual chunks and motion of fluid are achieved by

moving the particles themselves• Navier-Stokes equations

§ Governing equation

Page 23: Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

Korea UniversityComputer Graphics Lab. Seung-ho shin| 2009/ 01/12| # 23KUCG |

Grid-based methods

• Primary strength§ Simplicity of the discretization§ Incompressibility condition

• Weakness§ Difficult to advection

• Semi-Lagrangian• Excessive numerical dissipation• Interpolation error

§ Levelset and VOF(volume-of-fluid)• Advection and time consuming

Page 24: Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

Korea UniversityComputer Graphics Lab. Seung-ho shin| 2009/ 01/12| # 24KUCG |

Particle-based methods

• Strong point§ Advection with excellent accuracy§ With Ordinary Differential Equation (ODE)

• Weak point§ Pressure and incompressibility condition§ Time step

• Particle-level set method§ Highest fidelity water animations§ Particles can be exploited even further

• Simplifying and accelerating, affording new benefits

Page 25: Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

Korea UniversityComputer Graphics Lab. Seung-ho shin| 2009/ 01/12| # 25KUCG |

Particle-in-Cell Methods

• PIC§ Simulating compressible flow§ Handled advection with particles§ But everything else on a grid

• FLIP (Fluid Implicit Particle)§ Correct numerical dissipation

Page 26: Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

Korea UniversityComputer Graphics Lab. Seung-ho shin| 2009/ 01/12| # 26KUCG |

PIC steps

• Initialize particle positions & velocities• For each time step:

§ Interpolate particle velocity to grid§ Do all non-advection steps of water simulation§ Interpolate the new grid velocity to the particles§ Move particles with ODE, and satisfy boundary§ Output the particle position

• There is no grid-based advection, or vorticity confinement and particle-level

Page 27: Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

Korea UniversityComputer Graphics Lab. Seung-ho shin| 2009/ 01/12| # 27KUCG |

FLIP steps

• Initialize particle positions & velocities• For each time step:

§ Interpolate particle velocity to grid§ Save the grid velocities§ Do all non-advection steps of water simulation§ Subtract new grid vel. from saved vel., then add the

Interpolated difference to each particle§ Move particles with ODE, and satisfy boundary§ Output the particle position

Page 28: Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

Korea UniversityComputer Graphics Lab. Seung-ho shin| 2009/ 01/12| # 28KUCG |

Initializing Particles

• Every grid cell§ 8 particles

• Jittered at 2x2x2 sub-grid position• Avoid aliasing• For no gaps

§ For surface reconstruction• Reposition particles half a grid cell away at surface

Page 29: Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

Korea UniversityComputer Graphics Lab. Seung-ho shin| 2009/ 01/12| # 29KUCG |

Transferring to the Grid

• Weighted average of nearby particles§ Near : twice the grid cell with

• Trilinear weighting

• Future optimization§ Reconstructing a signed distance field on the grid

from distance values stored on the particles§ Second-order accurate free surface§ Adaptive grid

Page 30: Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

Korea UniversityComputer Graphics Lab. Seung-ho shin| 2009/ 01/12| # 30KUCG |

Solving on the Grid

• First, add gravity to grid velocities• Construct a distance field φ(x) in non-fluid and

extend with PDE ∇u ·∇φ = 0• Enforce boundary conditions and incompressibility• Extend the new velocity field again using fast

sweeping

Page 31: Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

Korea UniversityComputer Graphics Lab. Seung-ho shin| 2009/ 01/12| # 31KUCG |

Updating Particle Velocities

• Trilinearly interpolate§ The velocity (PIC) or change (FLIP)

• PIC for viscosity flow such as sand (additional numerical viscosity)

• FLIP for inviscid flow such as water

<FLIP VS PIC>

Page 32: Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

Korea UniversityComputer Graphics Lab. Seung-ho shin| 2009/ 01/12| # 32KUCG |

Moving Particles

• Move particles through velocity fields• Use a simple RK2 ODE solver

§ Limited by the CFL condition§ RK2 : Euler's half step method

• Detect when particles penetrated solid§ Move them just outside

Page 33: Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

Korea UniversityComputer Graphics Lab. Seung-ho shin| 2009/ 01/12| # 33KUCG |

Surface Reconstruction from Particles

• Fully particle-based reconstruction• Blobbies [Blinn 1982]

§ Works well with only a few particles§ Bad for flat plane, a cone, a large sphere§ Large quantity of irregularly spaced particles

Page 34: Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

Korea UniversityComputer Graphics Lab. Seung-ho shin| 2009/ 01/12| # 34KUCG |

Surface Reconstruction

“Animating Sand as a Fluid”Yongning Zhu et.al. 2005R : radius of neighborhood

(twice the average particle spacing)

Page 35: Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

Korea UniversityComputer Graphics Lab. Seung-ho shin| 2009/ 01/12| # 35KUCG |

Surface problem

• Artifacts in concave regions§ But this is very small§ Sampling φ(x) on a higher resolution§ Simple smoothing pass

• Radii to be accurate estimates of distance to the surface§ Fix all the particle radii to the constant average particle

spacing§ Adjust initial partial position like that§ Additional grid smoothing reduces bump artifacts

• Surface reconstruction§ Cost is low : full 2503 grid 40-50 seconds a frame

Page 36: Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

Korea UniversityComputer Graphics Lab. Seung-ho shin| 2009/ 01/12| # 36KUCG |

Examples

• Rendering§ pbrt[Pharr and Humphreys 2004]

• Textured sand shading§ Blended a volumetric texture around particle

• Figure 1 and 2 Simulation§ 269,322 particles on a 1003 grid§ 6 sec/frame on 2Ghz G5 workstation§ Surface reconstruction on a 2503 grid 40–50sec

• Figures 5 and 6§ 433,479 particles on a 100×60×60 grid : 12 sec

Page 37: Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

Korea UniversityComputer Graphics Lab. Seung-ho shin| 2009/ 01/12| # 37KUCG |

Figure 1

Page 38: Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

Korea UniversityComputer Graphics Lab. Seung-ho shin| 2009/ 01/12| # 38KUCG |

Figure 5 6

Page 39: Animating Sand as a Fluid - Korea Universitykucg.korea.ac.kr/seminar/2011/ppt/ppt-2011-02-22.pdf · 2002-01-17 · •Li and Moshell[1993] §Dynamic height-field simulation of soil

Korea UniversityComputer Graphics Lab. Seung-ho shin| 2009/ 01/12| # 39KUCG |

Conclusion

• Converting an existing fluid solver into granular materials

• Combines the strength of both particles and grids

• A new method for reconstructing implicit surfaces from particles