Download presentation
Presentation is loading. Please wait.
Published byMargaret Baker Modified over 9 years ago
1
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics1 Water Computational Fluid Dynamics Volumes Lagrangian vs. Eulerian modelling Navier-Stokes equations Solving Navier-Stokes Papers only… Foster and Fedkiw, 2001
2
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics2 Computational Fluid Dynamics CFD Describes the characteristics of fluids in a volume Animation vs. CFD – CFD – Initial conditions, let it run – Animation – Looks real and we have control – CFD – correctness – Animation – efficiency
3
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics3 Describing volumes We need to describe the volume and what’s in it Volumes are typically described using regular voxels (3D cells) (128 x 128 x 128 is common) – Boolean for each voxel Foster and Metaxas, 2000
4
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics4 Describing what’s in the volume How do we describe water? – Ideas?
5
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics5 Two approaches Derives from Computational Fluid Dynamics – Lagrangian models What happens at points in space – Eulerian models Where does stuff go
6
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics6 Lagrangian Models Break space into volumes – Describe what is in each volume Example: Incompressibility – What goes in must match what goes out
7
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics7 Eulerian Models We track motion of actual things over time – Particles are usually used to represent water Example: Incompressibility – Particles must adhere to some packing rule
8
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics8 Navier-Stokes equation Describes the motion of incompressible fluids – Water, oil, mud, etc.
9
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics9 Divergence u is the liquid velocity field Operator is called the “divergence” operator. – Divergence of a vector field F, denoted div(F) or as above is a scalar field – When equal to zero (zero vector), we have a divergenceless field
10
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics10 Gradient vs. Divergence I hate operator overloading
11
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics11 Divergenceless field Implies incompressiblity – Mass is conserved – What goes out a point equals what goes in Note: This is “inside” the water, not what happens when air mixes in
12
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics12 More equation parts viscosity viscous dragconvection Gravity and force pressure velocity density pressure
13
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics13 Problems with Navier-Stokes Acceleration is associated with moving elements, so Eulerian models make sense Pressure and boundary conditions are at locations, so Lagrangian models make sense Some methods use semi-Lagrangian models
14
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics14 Foster and Fedkiw method 1. Model environment as a voxel grid 2. Model liquid volume using particles and implicit surface 3. Update velocity field by solving Navier-Stokes using finite differences and a semi-Lagrangian method 4. Apply velocity constraints from moving objects 5. Enforce incompressibility 6. Update the liquid volume using new velocity field
15
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics15 The volume representation Each cell has – Flag for filled or available for water – Pressure variable at center (optional) – Velocity vectors on 3 sides Shared with adjacent cell
16
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics16 Particles Water is represented by particles – Introduced from source or initially placed – Motion for particle is determined by tri-linear interpolation
17
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics17 Isocontour Imagine each particle with a sphere around it Isocontour
18
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics18 Practical system issues The isocontour is all we need for creating the image High particle densities are needed to make good isocontours, but create lots of complexity Create initial isocontour at high density, then use lower density motion fields to deform the isocontour Other option: dynamically create/destroy particles
19
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics19 Solving Navier-Stokes Step 1: Choose a time step Good rule of thumb: Nothing can jump over any cells – ???
20
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics20 Solving Step 2: Solve for the velocity This is so much fun Let w 0 (x) be a solution at location x at time t 1 – We’ll move to a solution at time t 2 using four steps
21
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics21 Getting to w 1 : Add force w 1 (x) = w 0 (x) + t f
22
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics22 Getting to w 2 : Add convection At each time step, all particles are moved by the velocity of the fluid The particle at location x was at location p(x,t- t) before Let w 2 (x)=w 1 (p(x,t- t)) All that is required is a way to track particles and some linear interpolation.
23
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics23 Getting to w 3 : Viscosity Can be shown that:
24
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics24 Finite differences How do we get from or to code on arrays? Finite differences:
25
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics25 Solving for viscosity This is a standard problem formulation called the Poisson Problem and can be solved using numerous solving packages like FISHPAK.
26
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics26 From FISHPAK C Subroutine POIS3D solves the linear system of equations C C C1*(X(I-1,J,K)-2.*X(I,J,K)+X(I+1,J,K)) C + C2*(X(I,J-1,K)-2.*X(I,J,K)+X(I,J+1,K)) C + A(K)*X(I,J,K-1)+B(K)*X(I,J,K)+C(K)*X(I,J,K+1) = F(I,J,K) C
27
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics27 Getting to w4: Incompressiblity Our solution will have a divergence part and a divergence-free part. We need to solve for the divergence part and subtract it out.
28
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics28 Estimating the divergence of the velocity field
29
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics29 Cont… Again, we have a Poisson Problem.
30
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics30 What about pressure? Issues of incompressibility Stam claims that pressure drops out in his solution. This would be a consequence of the way he deals with incompressibility.
31
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics31 Boundary conditions What about where we run out of space? – Set velocity to zero? (paper says this) – Or what other option?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.