Navier-Stokes & Flow Simulation: Last Time?
Navier-Stokes & Flow Simulation: Last Time?
• Implicit Surfaces
Navier-Stokes • Marching Cubes/Tetras
• Collision Detection & Response
& • Conservative Bounding Regions
Flow Simulation
backtracking
fixing
1
Today Modeling the Water Surface
• Flow Simulations in Computer Graphics • Volume-of-fluid tracking
• Navier-Stokes Equations – a scalar saying how
“full” each cell is
• Fluid Representations
• Particle In Cell (PIC)
• Basic Algorithm
– the particles have mass
• Data Representation
• Marker and Cell (MAC)
– the particles don’t effect
computation, just identify
which cells the surface passes through
– Harlow & Welch, "Numerical calculation of time-dependent
viscous incompressible flow of fluid with free surface”,
The Physics of Fluids, 1965.
http://mme.uwaterloo.ca/~fslien/free_surface/free_surface.htm
2
Each Grid Cell Stores: Initialization
• Velocity at the cell faces (offset grid) • Choose a voxel resolution
• Pressure • Choose a particle density
• List of particles • Create grid & place the particles
• Initialize pressure & velocity of each cell
• Set the viscosity & gravity
• Choose a timestep & go!
Image from
Foster & Mataxas, 1996
3
At each Timestep: Adjusting the Velocities
• Identify which cells are Empty, • Calculate the divergence of the cell
Full, or on the Surface (the extra in/out flow)
• Compute new velocities • The divergence is used
• Adjust the velocities to maintain to update the pressure
an incompressible flow within the cell
• Move the particles • Adjust each face velocity
– Interpolate the velocities at the faces uniformly to bring the
• Render the geometry and repeat! divergence to zero
• Iterate across the entire Image from
Foster & Mataxas, 1996
grid until divergence is < ε
4
Efficient Smoke Simulation Solid/Liquid: Time-varying viscosity
• Enright, Marschner, & Fedkiw, “Animation and Rendering of • Cem Yuksel, Donald H. House, and John Keyser,
Complex Water Surfaces”, SIGGRAPH 2002.
“Wave Particles”, SIGGRAPH 2007
• Guendelman, Selle, Losasso, & Fedkiw, “Coupling Water and
Smoke to Thin Deformable and Rigid Shells”, SIGGRAPH 2005.