Related Work Carlson et al. 2002, Roble et al –Viscous liquids with a simplified implicit solve Rasmussen et al –Variable viscosity liquids with IMEX integration Goktekin et al. 2004, Zhu & Bridson 2005 –Non-Newtonian liquids (viscoelastic, granular)
Fundamentals Viscosity is analogous to a fluid friction Nearby elements of fluid exchange velocity, affecting their flow Shear stress tensor,, is: –a measure of the resulting force per unit area –dependent on the gradient of velocity
Complete Form Shear stress is expressed as: To apply the resulting forces to the fluid: This is the full PDE form for viscosity
The Usual Simplification (Full form)
The Usual Simplification (Full form) (Constant viscosity)
The Usual Simplification (Full form) (Constant viscosity) (Expand)
The Simplified Form Looks like diffusion/smoothing of velocity –Velocity components are decoupled –3 implicit Poisson-like systems, solved with PCG Eg. [Carlson et al, 2002] –What about the free surface?
Air applies zero force on the liquid surface Free Surface Condition
Air applies zero force on the liquid surface The term is needed to enforce the constraint - it can’t simplify! –Free surfaces require the full stress expression even for constant viscosity
Incorrect Free Surfaces What are the side effects? –Neumann BC: Adds erroneous “ghost” forces halts rotation –Dirichlet BC: prevents viscosity from acting at the surface liquid seems less viscous Buckling fails to arise in either case.
Correct Free Surfaces …are very difficult to discretize directly. GENSMAC method (Tomé, McKee, et al.) is the only other MAC- based approach Velocity gradients aren’t naturally co-located The constraint should be applied only at the surface Difficult to avoid special cases Can it be solved implicitly? How is the linear system affected? (symmetry, definiteness, etc.)
Key Idea The free surface is actually a natural boundary condition in this setting –Using the proper variational form, it will fall out automatically Idea: Replace the viscosity solve with minimization of a variational principle.
Characterizing Viscous Flow Minimum Dissipation Theorem –The solution to a Stokes problem minimizes viscous dissipation [Helmholtz, 1868]
Characterizing Viscous Flow Minimum Dissipation Theorem –The solution to a Stokes problem minimizes viscous dissipation [Helmholtz, 1868] Viscous dissipation: –Kinetic energy dissipated by viscosity
Variational Form Minimize dissipation while perturbing velocity as little as possible This is equivalent to the full PDE form
Variational Form Benefits: –No need to enforce the free surface discretely Just estimate integrals and minimize –Fully implicit, SPD system Take large timesteps, solve with CG –Supports variable viscosity –Exhibits the correct behaviour Caveat… –Velocity components are no longer decoupled Get a single 3x larger linear system
Discretization Use the classic (MAC) staggered grid –Velocities at cell faces –Stress at cell centres and edges See [Goktekin et al, 2004] syncs up naturally with positions of velocity gradients
Discretization Compute terms at each sample point –Faces for 1 st integral, edges/centres for 2 nd integral –Use centred differencing for velocity gradients Scale by the liquid fraction in the surrounding cube
Linear System Identical to a MAC-based discretization of the full viscosity PDE… –but with new volume weights added! Before: After:
Results Artifact-free rotation and bending Viscous buckling and coiling Efficient, stable, highly variable viscosity
Future Work The linear system is no longer an M-matrix –Incomplete Cholesky may be less effective –Can we find better preconditioners? Full free surface condition involves pressure, viscosity & surface tension –Can we solve all three simultaneously? –Should we? (speed vs. accuracy tradeoff) Accuracy –Further analytical and ground truth comparisons
Conclusions Don’t solve the PDE – minimize the variational principle! For viscosity, this approach… –drastically simplifies complex boundary conditions –yields efficient, straightforward, robust code –produces convincing simulations of purely viscous liquids