Animating Sand as a Fluid

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

description

Animating Sand as a Fluid. Yongning Zhu Robert Bridson Presented by KKt. Abstract. Physics-based simulation method for animating sand Existing water simulator can be turned into a sand simulator Alternative method for simulating fluids Issue of reconstructing a surface from particle. - PowerPoint PPT Presentation

Transcript of Animating Sand as a Fluid

Page 1: Animating Sand as a Fluid

Animating Sand as a Fluid

Yongning ZhuRobert Bridson

Presented by KKt

Page 2: Animating Sand as a Fluid

Abstract

Physics-based simulation method for animating sandExisting water simulator can be turned

into a sand simulatorAlternative method for simulating

fluidsIssue of reconstructing a surface

from particle

Page 3: Animating Sand as a Fluid

Introduction

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

We think sand as a continuous material How should it respond to force?

The purposes of plausible animation we simplify the exist models

We combine grids and particles We reconstruct a smooth surface

Page 4: Animating Sand as a Fluid

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 con

stitutive 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

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

projectionTakeshita et al.[2003]

For fire

Page 6: Animating Sand as a Fluid

Grids for water simulation

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

Stam[1999] Semi-Lagrangian advection method for faster simula

tion 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

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

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

Sand Modeling

Frictional PlasticityMohr-Coulomb lawMaterial will not yield

|..|F is Frobenius norm φ is friction angle If is big enough, do not shearcf.

Page 10: Animating Sand as a Fluid

Basic mathematics

Trace

Frobenius norm

σ is the singular values of A

Page 11: Animating Sand as a Fluid

Stress

A measure of the average amount of force exerted per unit area

σ is the average stress P is the force, A is area

Stress is consisted ofNormal stress σShearing stress τ

Page 12: Animating Sand as a Fluid

Tensor

Page 13: Animating Sand as a Fluid

Terminologies

<Stress energy tensor>

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

<Von Mises stress in 2D>

Page 14: Animating Sand as a Fluid

Yielding sand flow

direction That the shearing force is pushing

Nonassociated to gradient of yieldingNormal ways are not proper hereBecause of lack of dilation

A little when it begins to flowStops as soon as the sand is freely flowing

Page 15: Animating Sand as a Fluid

A Simplified Model

Ignore the nearly imperceptible elastic deformation

Tiny volume changes Decompose regions two

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

Frictional stress

Neglecting elastic effectsAt sand is flowing area

Strain rate :At the yield surface

that most directly resists the sliding

Page 17: Animating Sand as a Fluid

Strain

ε 은 측정방향으로의 strain lo 은 물질의 기본 길이 , l 은 현재 길이

Shear strain

Strain tensor

Page 18: Animating Sand as a Fluid

Yield condition

Without elastic stress and strainStop all sliding motion in a time step

: Newton’s lawDivide with area

Page 19: Animating Sand as a Fluid

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 20: Animating Sand as a Fluid

Boundary

Frictional Boundary Conditions

Important behavior

Don’t sliding at vertical surfaces

Always allow sliding never be stable

u

nu·n

uT

Page 21: Animating Sand as a Fluid

Friction comparison

Page 22: Animating Sand as a Fluid

Cohesion

c > 0 is the cohesion coefficientAppropriate for soil or sticky materials Improving results

With very small amount of cohesion

Page 23: Animating Sand as a Fluid

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 24: Animating Sand as a Fluid

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 25: Animating Sand as a Fluid

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 26: Animating Sand as a Fluid

Particle-in-Cell Methods

PICSimulating compressible flowHandled advection with particlesBut everything else on a grid

FLIP (Fluid Implicit Particle)Correct numerical dissipation

Page 27: Animating Sand as a Fluid

PIC vs FLIP

Save difference & Correct ERROR!

Page 28: Animating Sand as a Fluid

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 29: Animating Sand as a Fluid

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 30: Animating Sand as a Fluid

Initializing Particles

Every grid cell8 particles

Jittered at 2x2x2 sub-grid positionAvoid aliasingFor no gaps

For surface reconstructionReposition particles half a grid cell away at

surface

Page 31: Animating Sand as a Fluid

Transferring to the Grid

Weighted average of nearby particlesNear : twice the grid cell with

Trilinear weightingFuture optimization

Second-order accurate free surfaceAdaptive grid

Page 32: Animating Sand as a Fluid

Solving on the Grid

First, add gravity to grid velocitiesConstruct a distance field φ(x) in non-flui

d and extend with PDE ∇u ·∇φ = 0Enforce boundary conditions and incompr

essibilityExtend the new velocity field again using

fast sweeping

Page 33: Animating Sand as a Fluid

Updating Particle Velocities

Trilinearly interpolateThe velocity (PIC) or change (FLIP)

PIC for viscosity flow such as sandFLIP for inviscid flow such as water

<FLIP VS PIC>

Page 34: Animating Sand as a Fluid

Moving Particles

Move particles through velocity fields

Use a simple RK2 ODE solverLimited by the CFL conditionRK2 : Euler's half step method

Detect when particles penetrated solidMove them just outside

Page 35: Animating Sand as a Fluid

Surface Reconstruction from Particles

Fully particle-based reconstructionBlobbies [Blinn 1982]

Works well with only a few particlesBad for flat plane, a cone, a large sphereLarge quantity of irregularly spaced particles

Page 36: Animating Sand as a Fluid

Surface Reconstruction

r0

x0

xx

x

r

“Animating Sand as a Fluid”Yongning Zhu et.al. 2005

R : radius of neighborhood (twice the average particle spacing)

Page 37: Animating Sand as a Fluid

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 spacin

g 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 38: Animating Sand as a Fluid

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 39: Animating Sand as a Fluid

Figure 1

Page 40: Animating Sand as a Fluid

Figure 5 6

Page 41: Animating Sand as a Fluid

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