fluids_course_cutting_edge

Download Report

Transcript fluids_course_cutting_edge

Course 14
Fluid Simulation
Monday, Half Day, 8:30 am - 12:15 pm
Course Schedule
• The Basics of Fluid Flow (Robert, 105 min)
• Break (15 min)
• The Cutting-Edge in Film (Eran, 45 min)
• Real Time Fluids in Games (Matthias, 45 min)
• Non-Newtonian Fluids (Robert, 15 min)
Talk Outline
• Particle level set method
• Vorticity confinement & vortex particles
• Fire simulation
• Solid-fluid coupling
Particle Level Set Method
[Enright et al. ’02]
Level Sets
• We like level sets:
– Smooth surface for rendering
– Geometric information (normals, curvature)
– Handle topological changes
Problem: Bad Mass Conservation
• Even with high order solvers!
simple rigid body rotation
vortex stretching
Solution
COMBINE
Eulerian level set
 0
 0
Lagrangian marker particles
Particles
• Passively advected with flow
• Help correct interface
– Especially areas of high curvature
• Hybrid surface model [Foster & Fedkiw ’01]
– Particles inside water
• Particle level set method [Enright et al. ’02]
– Particles on both sides
Particles
Original shape
Level set only
One-sided
particles
Rigid Body
Particle level set method
Particles
• Seeded within band of interface
• Carry sign and radius
• Periodically reseed particles
– Add to under-resolved regions
– Delete unnecessary particles
Error Identification
• Escaped particles (on wrong side of interface)
 0
rp
 0
Error Quantification
• Particles behave like little level set spheres
rp
Error Correction
• Compute corrections to >0 and <0 regions
• Merge into final corrected level set
– Take minimum magnitude 
 0
 0
 0
 0
E
 0
 0
Particle Level Set Update
• Advect particles & level set
• Particle correction
• Reinitialize
• Particle correction
• Adjust radii
Reduced Mass Loss
simple rigid body rotation
vortex stretching
Fast and Accurate PLS
• Original PLS:
– 3rd order RK; 5th order HJ-WENO
• [Enright et al. ‘04]: Good results with lower order methods
– Semi-Lagrangian (advection)
– Fast marching method (redistancing)
– 2nd order RK for particles
• Easier for adaptive grids
Vorticity Confinement &
Vortex Particles
[Selle et al. ’05]
Vorticity
• Vorticity:
– Local rigid rotation
• Want to simulate turbulent phenomena
– Problem: numerical dissipation (boring flows)
Fixing Boring Flows
Boring Flow
Vorticity Confinement
Vortex Particle Method
Vorticity Confinement
[Steinhoff & Underhill ’94; Fedkiw et al. ’01]
1. Start with a velocity field
2. Compute vorticity
3. Compute vectors directed
toward local maxima in
vorticity magnitude
4. Compute a force
[Andrew Selle]
Confinement Parameter
e=0.25
e=0.50
Limitations of Vorticity Confinement
• Uniformly amplifies vorticity
) grid artifacts
• Can only amplify vorticity
already on the grid
• Unstable with larger e
e=2
Vortex Equations of Flow
Navier-Stokes Equations
Vortex Equations of Flow
Vortex Particle Method
[Selle et al. ’05]
• Hybrid method:
– Vortex particles & grid-based fluid solver
– Evolve both  and u
• Easier than trying to compute u from 
Vortex Particle Method
• Vortex particle update:
– Move particles (advection)
– Change vorticity (vortex stretching)
• Adding vorticity to flow:
– Apply analytic confinement force
– Ensures vorticity is conserved
Results - Smoke
Hybrid Method
(6000 particles)
Results - Smoke
Results - Water
[320x128x320 effective octree, 600 particles]
Fire Simulation
[Nguyen et al. ’02]
Fire
Gaseous fuel
Heating
ignition
Blue core
Blackbody radiation
Assumed premixed with air
Emission due to chemical reaction
Yellowish/orange glow
Cooling
Soot & smoke
Visible after cooling
Fire Simulation
[Nguyen et al. ’01,’02]
• 2 phase flow
– Gaseous fuel
– Hot gaseous product
• Level set captures interface (blue core)
• Incompressible & inviscid
• Model gas expansion
Flame Modeling
hot gaseous product
gaseous fuel
thin flame
Blue Core
• Track using level set (don’t need PLS)
Varying flame reaction speed S (smaller on right)
Jump Conditions
• Using:
• e.g. Conservation of mass:
Mass flux exiting
flame front
Shorthand:
Mass flux entering
flame front
Jump Conditions
• Conservation of mass and momentum:
Jump Conditions
• Can rewrite as
Varying Density Ratio
Larger f / h on right
Ghost Values
Ghost Fluid Method: [Fedkiw et al. ’99]
Hot Gas
Ghost Value
Fuel
Velocity Jump
Solve for fuel phase
Solve for products phase
Pressure Jump
• Incorporate into pressure solve (projection step)
• e.g. In 1D:
pi+2
pi+1
pi-1
pi
xi-1
xi xI xi+1
ghost
xi+2
When All is Said and Done…
• Still symmetric, positive definite!
Temperature & Smoke Density
Temperature
• Used for color map
Smoke Density
• Soot & smoke
Campfire
Flammable Solids
• Voxelize solid
• Track solid’s temperature (heat conduction)
• After ignition
– Change solid voxels to negative  (fuel)
– Set injection velocity on faces of solid voxels
Flammable Ball
Multiple Interacting Liquids
[2nd talk – “Fluids” papers session – Wed. 8:30-10:15]
Solid-Fluid Coupling
[Guendelman et al. ’05]
Lagrangian vs. Eulerian Meshes
Lagrangian (moving) mesh
Eulerian (static) mesh
• Good for solids
• Good for fluids
• Bad for fluids
• Bad for solids
– Significant deformation and
topology change
– Harder to track moving material
quantities
Strong vs. Weak Coupling
Strong coupling
Weak coupling
(simultaneous solution)
(staggered solution)
e.g. [Chentanez et al. ’06]
• Monolothic system
• Use existing simulators
• More stable
• Less stable
SOLIDS SIM
SOLIDS + FLUIDS SIM
FLUIDS SIM
Volumetric vs. Thin Solids
Volumetric
Thin shell
Coupling to Thin Solids
[Guendelman et al. ’05]
256x256x192 effective octree; 30k triangles
Preventing Leaks: Visibility
One-Sided Interpolation
Use replacement
ghost
value when interpolating
Check visibility
of interpolation
nodes
One-Sided Advection
• Clip semi-Lagrangian rays
u
x-ut
Additional Considerations
• Crossed-over nodes
• Preventing particles from crossing solid
• Redistancing & velocity extrapolation
Simulation Step
un,n
Advance particle level set ! n+1
One-sided advection
( and particles)
Advect un and add gravity ! u*
One-sided advection (u)
Project u* ! un+1
un+1,n+1
Solid Affecting Fluid
• Rasterize solid onto grid faces
• Enforce solid velocity with Neumann boundary conditions
Project u* ! un+1
One-Way Coupling Step
un,n
Advance particle level set ! n+1
Advect un and add gravity ! u*
Advance solid
Project u* ! un+1
un+1,n+1
Enforce solid velocities at
solid-fluid interface
One Way Coupling Example
160x192x160 effective octree
Fluid Coupling Force
• Want to use fluid pressure
• Incompressible pressure can be noisy
– Incompressibility = hard constraint
– Enforcing solid velocity = hard constraint
– Better for compressible fluids [Yngve et al. ‘00; Fedkiw ‘02]
Smoother Coupling Pressure
• Don’t enforce solid velocity
– Treat solid as fluid
• Solve variable density fluid for pc
Two Pressure Solves!
• Incompressible pressure (projection):
– Enforce incompressibility & solid velocity
– Essential for reducing mass loss
• Coupling pressure:
– Does not modify fluid velocity
– Essential for smoother coupling force on solid
Computing Force on Solid
• Fluid pressure pushes on both sides
p1
p2
Computing Force on Solid
• Net force is proportional to pressure jump [pc]
p1 - p2
Computing Force on Solid
Compute
Interpolate
Extrapolate
at force
centroid
Compute
Pressure
Average
Rasterize
coupling
jumps
to
nodes
solid
on
pressure
faces
Two-Way Coupling Step
un,n
Advance particle level set ! n+1
Advect un and add gravity ! u*
Advance solid
Project u* ! un+1
un+1,n+1
Compute coupling pressure
and apply force to solid
Rigid Shell
148x148x111 uniform; 2.5k triangles
Water-Cloth Coupling
200x200x200 effective octree; 30k triangles
Coupling to Smoke
210x140x140 uniform; 30k triangles
Coupling to Volumetric Solids
[Losasso et al. ’06]
Approach
• Rasterize solid onto fluid grid
– Compute object
• Fill with ghost fluid values
• Two-way coupling as for thin shells
Volumetric Solids
Need grid values in solid
Extrapolate fluid values
[Houston et al. ’03;
Rasmussen et al. ’04]
Volumetric Solids
• Velocity boundary conditions
– Model object friction (slip to no-slip)
•  boundary conditions
– Extrapolate fluid  into object
• Separation conditions
– Avoid pulling water out of solid
• Also collide fluid particles against objects
Two-Way Coupling
Solid Affecting Fluid
• Neumann boundary
conditions
Fluid Affecting Solid
• Compute coupling pressure
• Apply force
Ice Cubes Example
100x100x100 uniform grid
Summary
• Particle level set method
– Particles help conserve mass
• Vorticity confinement & vortex particles
– Help preserve “turbulence” in flow
• Fire simulation
– 2 phases with jump conditions
• Solid-fluid coupling
– Couple using solid velocity & fluid pressure