more accurate pressure solves

23
More Accurate Pressure Solves

Upload: connor-black

Post on 02-Jan-2016

30 views

Category:

Documents


2 download

DESCRIPTION

More Accurate Pressure Solves. Solid Boundaries. Voxelized version works great if solids aligned with grid If not: though the error in geometry is O(∆x), translates into O(1) error in velocities! The simulation physics sees stair-steps, and gives you motion for the stair-step case. Quick Fix. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: More Accurate Pressure Solves

More Accurate Pressure Solves

Page 2: More Accurate Pressure Solves

Solid Boundaries

Voxelized version works great if solids aligned with grid

If not: though the error in geometry is O(∆x), translates into O(1) error in velocities!

The simulation physics sees stair-steps, and gives you motion for the stair-step case

Page 3: More Accurate Pressure Solves

Quick Fix

Measure accurate normals

Before pressure solve, on boundary, fix

Then do voxelized pressure, set up to not modify boundary

vu ← vu+ n ng(vuSOLID −vu)( )

Page 4: More Accurate Pressure Solves

Quick Fix Fails

This is equivalent for grid-aligned solids

Works great for highly dynamic splashing etc.

Fails miserably in steadier situations

Page 5: More Accurate Pressure Solves

Quick Fix Fails

This is equivalent for grid-aligned solids

Works great for highly dynamic splashing etc.

Fails miserably in steadier situationsGRAVITY

Page 6: More Accurate Pressure Solves

Quick Fix Fails

This is equivalent for grid-aligned solids

Works great for highly dynamic splashing etc.

Fails miserably in steadier situationsBOUNDARY FIX

Page 7: More Accurate Pressure Solves

Quick Fix Fails

This is equivalent for grid-aligned solids

Works great for highly dynamic splashing etc.

Fails miserably in steadier situationsPRESSURE SOLVE

Page 8: More Accurate Pressure Solves

Quick Fix Fails

This is equivalent for grid-aligned solids

Works great for highly dynamic splashing etc.

Fails miserably in steadier situations

Fictitious currents emerge and unstably grow

Page 9: More Accurate Pressure Solves

Rethinking the problem

See Batty et al. (tomorrow)

If we keep our fluid blobs constant volume, incompressibility constraint means:blobs stay in contact with each other (no interpenetration, no gaps)

Staying in contact == inelastic, sticky collision

Page 10: More Accurate Pressure Solves

Inelastic, sticky collisions

Take two particles. Interaction force update:

(F is like pressure gradient) Contact constraint is:

(like divergence-free condition)

vu1 ←

vu1 +1m1

vF

vu2 ← vu2 −1m2

vF

vu1 −

vu2 =0

Page 11: More Accurate Pressure Solves

Inelastic, sticky collisions (2)

Can solve for F to satisfy kinematic constraint

Equivalently, find F that minimizes kinetic energy of system:

Kinematics comes for free…

F =argmin

12

m1vu1

2 +12

m2vu2

2⎛⎝⎜

⎞⎠⎟

Page 12: More Accurate Pressure Solves

Variational Pressure Solve

Pressure update is fluid particle interaction

Incompressible means no stored energy:fully inelastic

Thus it must minimize kinetic energy + work

with constraint p=0 on free surface

Can prove it’s equivalent to regular PDE form!

p =argmin 1

2 ρ unew2

∫∫∫ − p(−n)gΔtusolidsolid∫∫

Page 13: More Accurate Pressure Solves

Variational goodness

The solid wall boundary condition vanishes!(automatically enforced at minimum)

Discretizing kinetic energy integral much simpler:

Just need average fluid density in each cell, and volume fraction of fluid inside cell

KE ≈

12ρi+ 1

2 jkVoli+1/2 jk ui+ 12 jk( )

2

ijk∑ +K

Page 14: More Accurate Pressure Solves

Linear System

Plug in discrete pressure update in discrete KE

Quadratic in pressures

Find discrete minimum == solve linear system

Linear system guaranteed to be symmetric, positive definite

In fact, it’s exactly the same as voxelized– except each term is weighted by volume fractions

Page 15: More Accurate Pressure Solves

Benefits

Actually converges! (error is O(∆x) or better)

Handles resting case perfectly:KE is minimized by zeroing out velocity, which we get from hydrostatic pressure field

Can handle sub-grid-scale geometry

E.g. particles immersed in flow, narrow channels, hair…

Just need to know volume displaced!

Page 16: More Accurate Pressure Solves

Extra goodness

Can couple solids in flow easily:

Figure out formula for discrete pressure update to solid velocity

Add solid’s kinetic energy to minimization

Automatically gives two-way “strong” coupling between rigid bodies and flow, perfectly compatible velocities at boundary, no tangential coupling…

Page 17: More Accurate Pressure Solves

Free Surfaces

The other problem we see with voxelization is free surface treatment

Physics only sees voxels: waves less than O(∆x) high are ignored

At least position errors will converge to zero… but errors in normal are O(1)!(rendering will always look awful)

Page 18: More Accurate Pressure Solves

Ghost Fluid Method

Due to Fedkiw and coauthors

pi pi+1

p=0

Page 19: More Accurate Pressure Solves

Ghost Fluid Method

Voxelized version:

pi pi+1

p=0

∂p∂x≈pi+1 − piΔx

Page 20: More Accurate Pressure Solves

Ghost Fluid Method

GFM version:

pi pi+1

p=0

∂p∂x≈pi+1 − piθΔx

Page 21: More Accurate Pressure Solves

GFM with solids

Complementary to variational solve:GFM just changes the pressure update

However, for triple junctions (solid+liquid+air) it gets difficult to make this just right

Page 22: More Accurate Pressure Solves

Reinterpret GFM

The multiple fluid (“two-phase”) jump conditions:

So take finite difference for

Use average fluid density for pressure update(average between liquid and air)

[p]=0

vugn[ ] =0 ⇒1ρ

∂p∂n

⎣⎢

⎦⎥=0

1

ρ∂p∂n

Page 23: More Accurate Pressure Solves

Variational free surface

Simply need volume fractions per cell(how much of cell is liquid+air),and average densities per cell(mix between liquid and air)

Use average density for pressure update, volume fraction for KE estime

Speed things up: all-air cells eliminated(set p=0 there)

This is the discrete free surface approximation!