Realistic Animation of Fluids p. 1/2 Realistic Animation of Fluids Nick Foster and Dimitri Metaxas
Realistic Animation of Fluids p. 2/2 Overview Problem Statement Previous Work Navier-Stokes Equations Explicit solving Results
Realistic Animation of Fluids p. 3/2 Problem Statement Simulate fluids for graphics applications Scalability Usability Easy to setup Controllable
Realistic Animation of Fluids p. 4/2 Related Work Non-physics based Paramtric functions Sinusoidal phase functions Physics based CFD Too expensive Not controllable Kass and Miller Shallow water Chen and Lobo Navier-Stokes in 2-D Fluid zero depth Use instantaneous pressure
Realistic Animation of Fluids p. 5/2 Navier-Stokes Equation Conservation of Momentum ( u 2 t + u u x + v u y + w u z = p x + g u x + µ x 2 + 2 u y 2 + 2 u z 2 ( 2 v v t + u v x + v v y + w v z = p y + g y + µ w t + u w x + v w y + w w z = p z + g z + µ Conservation of Mass u x + v y + w z = 0 ) ) x 2 + 2 v y 2 + 2 v z 2 ( 2 ) w x 2 + 2 w y 2 + 2 w z 2
Realistic Animation of Fluids p. 6/2 Conservation of Momentum Vector form ρ DV Dt = p + ρg + µ 2 V
Realistic Animation of Fluids p. 6/2 Conservation of Momentum Vector form Normalize for ρ ρ DV Dt = p + ρg + µ 2 V
Realistic Animation of Fluids p. 6/2 Conservation of Momentum Vector form Normalize for ρ DV Dt = p + g + µ 2 V
Realistic Animation of Fluids p. 6/2 Conservation of Momentum Vector form Normalize for ρ LHS Intertial force DV Dt = p + g + µ 2 V
Realistic Animation of Fluids p. 6/2 Conservation of Momentum Vector form Normalize for ρ LHS Intertial force DV Dt = p + g + µ 2 V RHS Surface forces due to pressure differences
Realistic Animation of Fluids p. 6/2 Conservation of Momentum Vector form Normalize for ρ LHS Intertial force DV Dt = p + g + µ 2 V RHS Surface forces due to pressure differences Gravity
Realistic Animation of Fluids p. 6/2 Conservation of Momentum Vector form Normalize for ρ LHS Intertial force DV Dt = p + g + µ 2 V RHS Surface forces due to pressure differences Gravity Sheer force due to viscosity
Realistic Animation of Fluids p. 7/2 LHS Begin with Newton s Second Law F = m dv dt
Realistic Animation of Fluids p. 7/2 LHS Begin with Newton s Second Law Using the Chain Rule F = m dv dt dv dt = V x dx dt + V y dy dt + V z dz dt + V t
Realistic Animation of Fluids p. 7/2 LHS Begin with Newton s Second Law Using the Chain Rule F = m dv dt dv dt = V x dx dt + V y dy dt + V z dz dt + V t = u V x + v V y + w V z + V t
Realistic Animation of Fluids p. 8/2 RHS Pressure Gravity Sheer forces F yx = µ 2 u y 2 dy F xx = µ 2 u x 2 dx
Realistic Animation of Fluids p. 8/2 RHS Pressure Gravity Sheer forces F yx = µ 2 u y 2 F xx = µ 2 u x 2
Realistic Animation of Fluids p. 8/2 RHS Pressure Gravity Sheer forces F yx = µ 2 u y 2 F xx = µ 2 u x 2
Realistic Animation of Fluids p. 8/2 RHS Pressure Gravity Sheer forces F yx = µ 2 u y 2 F xx = µ 2 u x 2
Realistic Animation of Fluids p. 8/2 RHS Pressure Gravity Sheer forces F yx = µ 2 u y 2 F xx = µ 2 u x 2
Realistic Animation of Fluids p. 8/2 RHS Pressure Gravity Sheer forces F yx = µ 2 u y 2 F xx = µ 2 u x 2
Realistic Animation of Fluids p. 8/2 RHS Pressure Gravity Sheer forces F yx = µ 2 u y 2 F xx = µ 2 u x 2
Realistic Animation of Fluids p. 8/2 RHS Pressure Gravity Sheer forces F yx = µ 2 u y 2 F xx = µ 2 u x 2 In 3-D: ( 2 ) u F x = µ x 2 + 2 u y 2 + 2 u z 2
Realistic Animation of Fluids p. 9/2 Conservation of Mass Incompressible fluid Divergence should be zero
Realistic Animation of Fluids p. 9/2 Conservation of Mass Incompressible fluid Divergence be zero should ρ t + ρu x + ρv y + ρw z = 0
Realistic Animation of Fluids p. 9/2 Conservation of Mass Incompressible fluid Divergence be zero should ρ t + ρu x + ρv y + ρw z = 0 u x + v y + w z = 0
Realistic Animation of Fluids p. 10/2 Solving Navier-Stokes Specify obstacle/boundaries Discretize on a rough grid Solve equations Interpolate surface of fluid
Realistic Animation of Fluids p. 11/2 Discretization Rectangular Cartesian grid Finite differences Velocity defined on cell faces Pressure defined in cell Stability 1 > max [ u δt ] δt δt,v,w δx δy δz
Realistic Animation of Fluids p. 11/2 Discretization Rectangular Cartesian grid Finite differences Velocity defined on cell faces Pressure defined in cell Stability 1 > max [ u δt ] δt δt,v,w δx δy δz
Realistic Animation of Fluids p. 11/2 Discretization Rectangular Cartesian grid Finite differences Velocity defined on cell faces Pressure defined in cell Stability 1 > max [ u δt ] δt δt,v,w δx δy δz dy dx
Realistic Animation of Fluids p. 11/2 Discretization Rectangular Cartesian grid Finite differences Velocity defined on cell faces Pressure defined in cell Stability 1 > max [ u δt ] δt δt,v,w δx δy δz
Realistic Animation of Fluids p. 12/2 Types of Cells Empty A cell containing no particles Surface A cell containing at least 1 particle that is adajacent to an Empty cell Full A cell containing at least 1 particle and not a Surface cell
Realistic Animation of Fluids p. 13/2 Calculating Velocities Velocities from momentum equations u t = p t + g x u u ( 2 ) x v u y w u z + µ u x 2 + 2 u y 2 + 2 u z 2 Pressure from continuity equations δp is proportional to D D = u x + v y + w z
Realistic Animation of Fluids p. 14/2 Consistency Velocity and pressure are updated Iterate until D < ǫ δp = βd u i+1/2,j,k u i 1/2,j,k v i,j+1/2,k v i,j 1/2,k w i,j,k+1/2 w i,j,k 1/2 p i,j,k = u i+1/2,j,k + (δt/δx)δp = u i 1/2,j,k (δt/δx)δp = u i,j+1/2,k + (δt/δy)δp = u i,j 1/2,k (δt/δy)δp = u i,j,k+1/2 + (δt/δz)δp = u i,j,k 1/2 (δt/δz)δp = p i,j,k + δp
Realistic Animation of Fluids p. 15/2 Boundary Conditions Stationary Obstacles Non-slip Free-slip Infow and outflow Free Surfaces u 0 = 0 p 0 = p 1 w 0 = w 1 w 0 = w 1
Realistic Animation of Fluids p. 16/2 Free Surface Free faces set so divergence zero Surface pressure set to atmospheric pressure Cases 3-D: 64 configurations
Realistic Animation of Fluids p. 16/2 Free Surface Free faces set so divergence zero Surface pressure set to atmospheric pressure Cases 3-D: 64 configurations
Realistic Animation of Fluids p. 16/2 Free Surface Free faces set so divergence zero Surface pressure set to atmospheric pressure Cases 3-D: 64 configurations
Realistic Animation of Fluids p. 17/2 Recap 1. Set boundary conditions 2. Classify cells 3. Calculate velocities for Full cells 4. Calculate pressures for Full cells 5. Update velocities for Surface cells 6. Iterate
Realistic Animation of Fluids p. 18/2 Problem Stability condition Limited spatial resolution Computational complexity Main contribution Interpolating methods for displaying the surface 3 methods for tracking fluid positions
Realistic Animation of Fluids p. 19/2 Marker Particles Convect massless particles with local fluid velocity Use weighted average of 4 nearest velocities Weighting based on area Multiplied by timestep Labeling done based on particles 1 particle test
Realistic Animation of Fluids p. 20/2 Free Surface Particles Only keep particles at surface Rules for adding and removing particles If far apart: Insert a particle If close: remove and connect neighbors Region growing algorithm
Realistic Animation of Fluids p. 21/2 Height Field Scalar function h t = w u h x v h y Cell configuration trivial Need other methods Overturning wave Spray Foam
Realistic Animation of Fluids p. 21/2 Height Field Scalar function h t = w u h x v h y Cell configuration trivial Need other methods Overturning wave Spray Foam
Realistic Animation of Fluids p. 22/2 Buoyancy Rigid object Force formula f ni = p i dv i + m i g f fluid = i f ni Lagrange equations of motions M q + D q = f q + g q Do not affect water flow Collisions treated separately
Realistic Animation of Fluids p. 23/2 Control Inflow and Outflow Instead of atmospheric pressure, apply surface pressure history Constant Time-depedent Height of surface P P P P P P p applied (z) = A + B cos(cz wt) δt
Results Realistic Animation of Fluids p. 24/2
Results Realistic Animation of Fluids p. 25/2
Results Realistic Animation of Fluids p. 26/2
Results Realistic Animation of Fluids p. 27/2
Results Realistic Animation of Fluids p. 28/2