1cs533d-winter-2005 Notes  Please read Fedkiw, Stam, Jensen, “Visual simulation of smoke”, SIGGRAPH ‘01.

Slides:



Advertisements
Similar presentations
Stable Fluids A paper by Jos Stam.
Advertisements

My First Fluid Project Ryan Schmidt. Outline MAC Method How far did I get? What went wrong? Future Work.
Formal Computational Skills
Realistic Simulation and Rendering of Smoke CSE Class Project Presentation Oleksiy Busaryev TexPoint fonts used in EMF. Read the TexPoint manual.
Christopher Batty and Robert Bridson University of British Columbia
1 Maxwell’s Equations in Materials Electric field in dielectrics and conductors Magnetic field in materials Maxwell’s equations in its general form Boundary.
1cs533d-term Notes  No lecture Thursday (apologies)
Optimization of thermal processes
1cs533d-term Notes. 2 Fire  [Nguyen, Fedkiw, Jensen ‘02]  Gaseous fuel/air mix (from a burner, or a hot piece of wood, or …) heats up  When it.
Steepest Decent and Conjugate Gradients (CG). Solving of the linear equation system.
1D linear elasticity Taking the limit as the number of springs and masses goes to infinity (and the forces and masses go to zero): If density and Young’s.
Introduction to numerical simulation of fluid flows
1cs533d-winter-2005 Notes  How are projects going?
Notes Assignment questions… cs533d-winter-2005.
1cs533d-term Notes  Smoke: Fedkiw, Stam, Jensen, SIGGRAPH’01  Water: Foster, Fedkiw, SIGGRAPH’01 Enright, Fedkiw, Marschner, SIGGRAPH’02  Fire:
1cs533d-term Notes. 2 Shallow water equations  To recap, using eta for depth=h+H:  We’re currently working on the advection (material derivative)
1cs533d-winter-2005 Shallow water equations  From last time, using eta for depth=h+H:  We’ll discretize this using “splitting” Handle the material derivative.
1cs533d-winter-2005 Notes  Read “Physically Based Modelling” SIGGRAPH course notes by Witkin and Baraff (at least, rigid body sections) An alternative.
1cs533d-winter-2005 Notes  Final Project Please contact me this week with ideas, so we can work out a good topic.
1cs542g-term Notes  Make-up lecture tomorrow 1-2, room 204.
Combating Dissipation. Numerical Dissipation  There are several sources of numerical dissipation in these simulation methods  Error in advection step.
Jonathan Richard Shewchuk Reading Group Presention By David Cline
More Accurate Pressure Solves. Solid Boundaries  Voxelized version works great if solids aligned with grid  If not: though the error in geometry is.
Intro to Fluid Simulation (I) Jeff Pool COMP
1cs533d-winter-2005 Notes  More optional reading on web for collision detection.
1cs533d-term Notes. 2 Shallow water  Simplified linear analysis before had dispersion relation For shallow water, kH is small (that is, wave lengths.
University of North Carolina - Chapel Hill Fluid & Rigid Body Interaction Comp Physical Modeling Craig Bennetts April 25, 2006 Comp Physical.
1cs533d-winter-2005 Notes  Please read Enright et al., “Animation and rendering of complex water surfaces”, SIGGRAPH’02.
1cs533d-winter-2005 Notes  I’m now in X663 Well, sort of…  Questions about assignment 3?
1cs533d-winter-2005 Notes  Some example values for common materials: (VERY approximate) Aluminum: E=70 GPa =0.34 Concrete:E=23 GPa =0.2 Diamond:E=950.
Modeling Fluid Phenomena -Vinay Bondhugula (25 th & 27 th April 2006)
1cs533d-term Notes. 2 Poisson Ratio  Real materials are essentially incompressible (for large deformation - neglecting foams and other weird composites…)
Visual Simulation of Smoke SIGGRAPH’01 Ronald Fedkiw, Jos Stam and Henrik Wann Jensen Stanford University & Alias|wavefront.
Monica Garika Chandana Guduru. METHODS TO SOLVE LINEAR SYSTEMS Direct methods Gaussian elimination method LU method for factorization Simplex method of.
2. Solving Schrödinger’s Equation Superposition Given a few solutions of Schrödinger’s equation, we can make more of them Let  1 and  2 be two solutions.
1cs533d-winter-2005 Notes  Assignment 2 instability - don’t worry about it right now  Please read D. Baraff, “Fast contact force computation for nonpenetrating.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Intro to Computational Fluid Dynamics Brandon Lloyd COMP 259 April 16, 2003 Image courtesy of Prof. A.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Introduction to Modeling Fluid Dynamics 1.
Modeling, Simulating and Rendering Fluids Thanks to Ron Fediw et al, Jos Stam, Henrik Jensen, Ryan.
© 2011 Autodesk Freely licensed for use by educational institutions. Reuse and changes require a note indicating that content has been modified from the.
Motivation  Movie  Game  Engineering Introduction  Ideally  Looks good  Fast simulation  Looks good?  Look plausible  Doesn’t need to be exactly.
CS448f: Image Processing For Photography and Vision The Gradient Domain.
Tutorial 5: Numerical methods - buildings Q1. Identify three principal differences between a response function method and a numerical method when both.
Lecture Objectives Review SIMPLE CFD Algorithm SIMPLE Semi-Implicit Method for Pressure-Linked Equations Define Residual and Relaxation.
Systems of Linear Equations Iterative Methods
Chapter 9: Differential Analysis of Fluid Flow SCHOOL OF BIOPROCESS ENGINEERING, UNIVERSITI MALAYSIA PERLIS.
Page 1 JASS 2004 Tobias Weinzierl Sophisticated construction ideas of ansatz- spaces How to construct Ritz-Galerkin ansatz-spaces for the Navier-Stokes.
Scientific Computing Partial Differential Equations Poisson Equation.
Finite Element Method.
Lecture I of VI (Claudio Piani) Course philosophy, the Navier-Stokes equations, Shallow Water, pressure gradient force, material derivative, continuity,
Partial Differential Equations Finite Difference Approximation.
1 Discretization of Fluid Models (Navier Stokes) Dr. Farzad Ismail School of Aerospace and Mechanical Engineering Universiti Sains Malaysia Nibong Tebal.
A conservative FE-discretisation of the Navier-Stokes equation JASS 2005, St. Petersburg Thomas Satzger.
Linear Systems Iterative Solutions CSE 541 Roger Crawfis.
Grid or Mesh or Adaptive Procedure Fluid Dynamics is Made for This And this was developed in the Early 1970s.
Lecture Objectives Review Define Residual and Relaxation SIMPLE CFD Algorithm SIMPLE Semi-Implicit Method for Pressure-Linked Equations.
Parallel Solution of the Poisson Problem Using MPI
Lecture 21-22: Sound Waves in Fluids Sound in ideal fluid Sound in real fluid. Attenuation of the sound waves 1.
Lecture 21 MA471 Fall 03. Recall Jacobi Smoothing We recall that the relaxed Jacobi scheme: Smooths out the highest frequency modes fastest.
CIS/ME 794Y A Case Study in Computational Science & Engineering 2-D conservation of momentum (contd.) Or, in cartesian tensor notation, Where repeated.
Discretization Methods Chapter 2. Training Manual May 15, 2001 Inventory # Discretization Methods Topics Equations and The Goal Brief overview.
Efficient Simulation of Large Bodies of Water by Coupling Two and Three Dimensional Techniques SIGGRAPH 2006 Geoffrey Irving Eran Guendelman Frank Losasso.
Programming assignment # 3 Numerical Methods for PDEs Spring 2007 Jim E. Jones.
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics1 Water Computational Fluid Dynamics Volumes Lagrangian vs. Eulerian modelling Navier-Stokes equations.
Animating smoke with dynamic balance Jin-Kyung Hong Chang-Hun Kim 발표 윤종철.
Objective Numerical methods Finite volume.
Introduction to Fluid Dynamics & Applications
AE/ME 339 Computational Fluid Dynamics (CFD) K. M. Isaac 4/30/2019
Topic 8 Pressure Correction
Programming assignment #1 Solving an elliptic PDE using finite differences Numerical Methods for PDEs Spring 2007 Jim E. Jones.
Presentation transcript:

1cs533d-winter-2005 Notes  Please read Fedkiw, Stam, Jensen, “Visual simulation of smoke”, SIGGRAPH ‘01

2cs533d-winter-2005 Solving Full Equations  Let’s now solve the full incompressible Euler or Navier-Stokes equations  We’ll avoid interfaces (e.g. free surfaces)  Think smoke

3cs533d-winter-2005 Operator Splitting  Generally a bad idea to treat incompressible flow as conservation laws with constraints  Instead: split equations up into easy chunks, just like Shallow Water

4cs533d-winter-2005 Time integration  Don’t mix the steps at all - 1st order accurate  We’ve already seen how to do the advection step  Often can ignore the second step (viscosity)  Let’s focus for now on the last step (pressure)

5cs533d-winter-2005 Advection boundary conditions  But first, one last issue  Semi-Lagrangian procedure may need to interpolate from values of u outside the domain, or inside solids Outside: no correct answer. Extrapolating from nearest point on domain is fine, or assuming some far-field velocity perhaps Solid walls: velocity should be velocity of wall (usually zero)  Technically only normal component of velocity needs to be taken from wall, in absence of viscosity the tangential component may be better extrapolated from the fluid

6cs533d-winter-2005 Continuous pressure  Before we discretize in space, last step is to take u (3), figure out the pressure p that makes u n+1 incompressible: Want Plug in pressure update formula: Rearrange: Solve this Poisson problem (often density is constant and you can rescale p by it, also ∆t)  Make this assumption from now on:

7cs533d-winter-2005 Pressure boundary conditions  Issue of what to do for p and u at boundaries in pressure solve  Think in terms of control volumes: subtract pn from u on boundary so that integral of un is zero  So at closed boundary we end up with

8cs533d-winter-2005 Pressure BC’s cont’d.  At closed wall boundary have two choices: Set un=0 first, then solve for p with ∂p/∂n=0, don’t update velocity at boundary Or simply solve for p with ∂p/∂n=un and update un at boundary with -∂p/∂n Equivalent, but the second option make sense in the continuous setting, and generally keeps you more honest  At open (or free-surface) boundaries, no constraint on un, so typically pick p=0

9cs533d-winter-2005 Approximate projection  Can now directly discretize Poisson equation on a grid  Central differences - 2nd order, no bias

10cs533d-winter-2005 Issues  On the plus side: simple grid, simple discretization, becomes exact in limit for smooth u…  But it doesn’t work Divergence part of equation can’t “see” high frequency compression waves Left with high frequency oscillatory error Need to filter this out - smooth out velocity field before subtracting off pressure gradient Filtering introduces more numerical viscosity, eliminates features on coarse grids  Also: doesn’t exactly make u incompressible Measuring divergence of result gives nonzero  So let’s look at exactly enforcing the incompressibility constraint

11cs533d-winter-2005 Exact projection (1st try)  Connection use the discrete divergence as a hard constraint to enforce, pressure p turns out to be the Lagrange multipliers…  Or let’s just follow the route before, but discretize divergence and gradient first First try: use centred differences as before u and p all “live” on same grid: u ijk, p ijk This is called a “collocated” scheme

12cs533d-winter-2005 Exact collocated projection  So want  Update with discrete gradient of p  Plug in update formula to solve for p

13cs533d-winter-2005 Problems  Pressure problem decouples into 8 independent subproblems  “Checkerboard” instability Divergence still doesn’t see high-frequency compression waves  Really want to avoid differences over 2 grid points, but still want centred  Thus use a staggered MAC grid, as in last class

14cs533d-winter-2005 Staggered grid  Pressure p lives in centre of cell, p ijk  u lives in centre of x-faces, u i+1/2,j,k  v in centre of y-faces, v i,j+1/2,k  w in centre of z-faces, w i,j,k+1/2  Whenever we need to take a difference (grad p or div u) result is where it should be  Works beautifully with “stair-step” boundaries Not so simple to generalize to other boundary geometry

15cs533d-winter-2005 Exact staggered projection  Do it discretely as before, but now want  And update is

16cs533d-winter-2005 (Continued)  Plugging in to solve for p  This is for all i,j,k: gives a linear system to solve -Ap=d

17cs533d-winter-2005 Pressure solve simplified  Assume for simplicity that ∆x=∆y=∆z=h  Then we can actually rescale pressure (again - already took in density and ∆t) to get  At boundaries where p is known, replace (say) p i+1jk with known value, move to right-hand side (be careful to scale if not zero!)  At boundaries where (say) ∂p/∂y=v, replace p ij+1k with p ijk +v (so finite difference for ∂p/∂y is correct at boundary)

18cs533d-winter-2005 Solving the Linear System  So we’re left with the problem of efficiently finding p  Luckily, linear system Ap=-d is symmetric positive definite  Incredibly well-studied A, lots of work out there on how to do it fast

19cs533d-winter-2005 How to solve it  Direct Gaussian Elimination does not work well This is a large sparse matrix - will end up with lots of fill-in (new nonzeros)  If domain is square with uniform boundary conditions, can use FFT Fourier modes are eigenvectors of the matrix A, everything works out  But in general, will need to go to iterative methods Luckily - have a great starting guess! Pressure from previous time step [appropriately rescaled]

20cs533d-winter-2005 Convergence  Need to know when to stop iterating  Ideally - when error is small  But if we knew the error, we’d know the solution  We can measure the residual for Ap=b: it’s just r=b-Ap Related to the error: Ae=r  So check if norm(r)<tol*norm(b) Play around with tol (maybe 1e-4 is good enough?)  For smoke, may even be enough to just take a fixed number of iterations

21cs533d-winter-2005 Conjugate Gradient  Standard iterative method for solving symmetric positive definite systems  For a fairly exhaustive description, read “An Introduction to the Conjugate Gradient Method Without the Agonizing Pain”, by J. R. Shewchuk  Basic idea: steepest descent

22cs533d-winter-2005 Plain vanilla CG  r=b-Ap (p is initial guess)   =r T r, check if already solved  s=r (first search direction)  Loop: t=As  =  /(s T t) (optimum step size) x+=  s, r-=  t, check for convergence  new =r T r  =  new /  s=r+  s (updated search direction)  =  new