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
simple rigid body rotationvortex stretching Problem: Bad Mass Conservation Even with high order solvers!
Solution Lagrangian marker particles Eulerian level set COMBINE
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 Rigid Body Original shape Level set onlyOne-sided particlesParticle 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)
Error Quantification Particles behave like little level set spheres
Error Correction Compute corrections to >0 and <0 regions Merge into final corrected level set – Take minimum magnitude
Particle Level Set Update Advect particles & level set Particle correction Reinitialize Particle correction Adjust radii
simple rigid body rotationvortex stretching Reduced Mass Loss
Fast and Accurate PLS Original PLS: – 3 rd order RK; 5 th order HJ-WENO [Enright et al. ‘04]: Good results with lower order methods – Semi-Lagrangian (advection) – Fast marching method (redistancing) – 2 nd 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 FlowVorticity ConfinementVortex Particle Method
Vorticity Confinement 2. Compute vorticity 4. Compute a force 1. Start with a velocity field 3. Compute vectors directed toward local maxima in vorticity magnitude [Steinhoff & Underhill ’94; Fedkiw et al. ’01] [Andrew Selle]
Confinement Parameter =0.25 =0.50
Limitations of Vorticity Confinement Uniformly amplifies vorticity ) grid artifacts Can only amplify vorticity already on the grid Unstable with larger =2
Vortex Equations of Flow Navier-Stokes Equations Vortex Equations of Flow
Vortex Particle Method Hybrid method: – Vortex particles & grid-based fluid solver – Evolve both and u Easier than trying to compute u from [Selle et al. ’05]
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 Blue core Blackbody radiation Soot & smoke Heating Cooling Emission due to chemical reaction Assumed premixed with air Yellowish/orange glow Visible after cooling ignition
Fire Simulation 2 phase flow – Gaseous fuel – Hot gaseous product Level set captures interface (blue core) Incompressible & inviscid Model gas expansion [Nguyen et al. ’01,’02]
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: Shorthand: Mass flux entering flame front Mass flux exiting flame front
Jump Conditions Conservation of mass and momentum:
Jump Conditions Can rewrite as
Varying Density Ratio Larger f / h on right
Ghost Values Fuel Ghost Value Hot Gas Ghost Fluid Method: [Fedkiw et al. ’99]
Velocity Jump Solve for fuel phase Solve for products phase
Pressure Jump Incorporate into pressure solve (projection step) e.g. In 1D:
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 Good for solids Bad for fluids – Significant deformation and topology change Eulerian (static) mesh Good for fluids Bad for solids – Harder to track moving material quantities
Strong vs. Weak Coupling Strong coupling (simultaneous solution) Monolothic system More stable Weak coupling (staggered solution) Use existing simulators Less stable SOLIDS SIM FLUIDS SIM SOLIDS + FLUIDS SIM e.g. [Chentanez et al. ’06]
Volumetric vs. Thin Solids VolumetricThin shell
256x256x192 effective octree; 30k triangles Coupling to Thin Solids [Guendelman et al. ’05]
Preventing Leaks: Visibility
Check visibility of interpolation nodes Use replacement ghost value when interpolating One-Sided Interpolation
One-Sided Advection Clip semi-Lagrangian rays
Additional Considerations Crossed-over nodes Preventing particles from crossing solid Redistancing & velocity extrapolation
Simulation Step un,nun,n Advance particle level set ! n+1 Advect u n and add gravity ! u* Project u* ! u n+1 u n+1, n+1 One-sided advection ( and particles) One-sided advection (u)
Solid Affecting Fluid Rasterize solid onto grid faces Enforce solid velocity with Neumann boundary conditions Project u* ! u n+1
One-Way Coupling Step un,nun,n Advance particle level set ! n+1 Advect u n and add gravity ! u* Project u* ! u n+1 u n+1, n+1 Advance solid Enforce solid velocities at solid-fluid interface
160x192x160 effective octree One Way Coupling Example
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 p c
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
Computing Force on Solid Net force is proportional to pressure jump [ p c ]
Computing Force on Solid Rasterize solidCompute coupling pressurePressure jumps on facesAverage to nodes ExtrapolateInterpolate at centroid Compute force
Two-Way Coupling Step un,nun,n Advance particle level set ! n+1 Advect u n and add gravity ! u* Advance solid Project u* ! u n+1 u n+1, n+1 Compute coupling pressure and apply force to solid
148x148x111 uniform; 2.5k triangles Rigid Shell
200x200x200 effective octree; 30k triangles Water-Cloth Coupling
210x140x140 uniform; 30k triangles Coupling to Smoke
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 Extrapolate fluid values [Houston et al. ’03; Rasmussen et al. ’04] Need grid values in solid
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