1 / 32

Intro to Computational Fluid Dynamics

Intro to Computational Fluid Dynamics. Brandon Lloyd COMP 259 April 16, 2003. Image courtesy of Prof. A. Davidhazy at RIT. Used without permission. . Overview. Understanding the Navier-Stokes equations Derivation (following [Griebel 1998]) Intuition Solving the Navier-Stokes equations

Jims
Download Presentation

Intro to Computational Fluid Dynamics

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Intro to Computational Fluid Dynamics Brandon Lloyd COMP 259 April 16, 2003 Image courtesy of Prof. A. Davidhazy at RIT. Used without permission. 

  2. Overview • Understanding the Navier-Stokes equations • Derivation (following [Griebel 1998]) • Intuition • Solving the Navier-Stokes equations • Basic approaches • Boundary conditions • Tracking the free surface

  3. Foundations Operators  - gradient div - divergence 2 - Laplacian … - Hand waving / Lengthy math compression

  4. Transport Theorem

  5. Conservation of Mass Transport theorem Integrand vanishes • is constant for incompressible fluids Continuity equation

  6. Conservation of Momentum

  7. Conservation of Momentum Transport theorem Divergence theorem … Momentum equation

  8. Navier-Stokes Equations external forces convection pressure viscosity

  9. Solving the equations Basic Approach • Create a tentative velocity field. • Finite differences • Semi-Lagrangian method (Stable Fluids [Stam 1999]) • Ensure that the velocity field is divergence free: • Adjust pressure and update velocities • Projection method

  10. Finite differences – mechanical translation of equations. Tentative Velocity Field

  11. Limits on time step CFL conditions – don’t move more than a single cell in one time step Diffusion term Tentative Velocity Field

  12. Stable Fluids Method Add forces: Advection Diffusion Tentative Velocity Field

  13. Advection Finite differences is unstable for large Δt. Solution: trace velocities back in time. Guarantees that the velocities will never blow up. Tentative Velocity Field

  14. Tentative Velocity Field Diffusion Discretizing the viscosity term spreads velocity among immediate neighbors. Unstable when time step too small, grid spacing too large, or viscosity is high. Solution: Instead of using an explicit time step use an implicit one. This leads to a large but sparse linear system.

  15. Satisfying the Continuity Eq. The tentative velocity field is not necessarily divergence free and thus does not satisfy the continuity equation. Three methods for satisfying the continuity equation: • Explicitly satisfy the continuity equation by iteratively adjusting the pressures and velocities in each cell. • Find a pressure correction term that will make the velocity field divergence free. • Project the velocities onto their divergence free part.

  16. Explicitly Enforcing u=0 Since we have not yet added the pressure term, we can use pressure to ensure that the velocities are divergence free. u>0 increased pressure and subsequent outflux u<0 decreased pressure and subsequent influx Relaxation algorithm • Correct the pressure in a cell • Update velocities • Repeat for all cells until each has u<ε

  17. Solving for pressure Another approach involves solving for a pressure correction term over the whole field such that the velocities will be divergence free and then update the velocities at the end. Discretize in time Rearrange terms Satisfy continuity eq.

  18. Solving for pressure We end up with the Poisson equation for pressure. This is another sparse linear system. These types of equations can be solved using iterative methods. Use pressures to update final velocities.

  19. Projection Method The Helmholtz-Hodge Decomposition Theorem states that any vector field can be decomposed as: where u is divergence free and q is a scalar field defined implicitly as: We can define an operator P that projects a vector field onto its divergence free part:

  20. Projection Method Applying P to both sides of the momentum equation yields a single equation only in terms of u: Thus for the last step : Look familiar? The scalar field q is actually related to pressure!

  21. The Bottom Line All three methods are equivalent!

  22. Boundary Conditions • No slip: Set velocity to 0 on the boundary. Good for obstacles. • Free slip: Set only the velocity in the direction normal to the boundary to zero. Good for setting up a plane of symmetry. • Inflow: Specified positive normal velocity. Good for sources. • Outflow: Specified negative normal velocity. Good for sinks. • Periodic: Copy the last row and column of cells to first row and column. Good for simulating an infinite domain.

  23. Staggered Grid The staggered grid provides velocities immediately at cell boundaries, is convenient for finite differences, and avoids oscillations. Consider problem of a 2D fluid at rest with no external forces. The continuous solution is: On a discretized non-staggered grid you can have:

  24. Tracking the Free Surface The movement of the free surface is not explicit in the Navier-Stokes equations. Three methods for tracking the free surface: • Marker and cell (MAC) method • Front tracking • Particle level set method

  25. MAC Due to [Harlow and Welch 1965]. Track massless marker particles to determine where the free surface is located. Markers are transported according to the velocity field. Cells with markers are fluid cells. Fluid cells bordering empty cells are surface cells. There are boundary conditions that must be satisfied at the surface. Extended by [Chen et al. 1997] to track particles only near the surface.

  26. MAC Problems: • Can lead to mass dissipation, especially with stable fluid style advection. • No straight forward way to extract a smooth surface. Image from [Griebel 1998].

  27. Front Tracking Proposed by [Foster and Fedkiw 2001] Front tracking uses a combination of a level set and particles to track the surface. The particles are used to define an implicit function. An isocontour of this function represents the liquid surface. The isocontour yields a smoother surface than particles alone.

  28. Front Tracking Using the level set method, the isocontour can be evolved directly over time by using the fluid velocities. Particles and level set evolution have complementary strengths and weaknesses • Level set evolution suffers volume loss • Particles can cause visual artifacts • Level sets are always smooth. • Particles retain details.

  29. Front Tracking Combine the two techniques by giving particles more weight in areas of high curvature. Particles escaping the level set are rendered directly as splashing droplets.

  30. Particle Level Set Method Presented by [Enright et al 2002]. Implicit surface loses detail on coarse grids. Particles keep the surface from crossing them but can’t keep it from drifting away. Add particles to both side of the implicit surface. Escaped particles indicate the location of errors in the implicit surface so it can be rebuilt.

  31. Particle Level Set Method Extrapolated velocities at the surface give more realistic motion.

  32. References CHEN, J., AND LOBO, N. 1994. Toward interactive-rate simulation of fluids with moving obstacles using the navier-stokes equations. Computer Graphics and Image Processing, 107–116. CHEN, S., JOHNSON, D., RAAD, P. AND FADDA, D. 1997. The surface marker and micro cell method. International Journal of Numerical Methods in Fluids, 25, 749-778. FOSTER, N., AND METAXAS, D. 1996. Realistic animation of liquids. Graphical Models and Image Processing, 471–483. FOSTER, N., AND FEDKIW, R. 2001. Practical animation of liquids. In Proceedings of SIGGRAPH 2001, 23–30. GRIEBEL, M., DORNSEIFER, T., AND NEUNHOEFFER, T.1998. Numerical Simulation in Fluid Dynamics: A Practical Introduction. SIAM Monographs on Mathematical Modeling and Computation. SIAM KASS, M., AND MILLER, G. 1990. Rapid, stable fluid dynamics for computer graphics. In Computer Graphics (Proceedings of SIGGRAPH 90), vol. 24, 49–57. O’BRIEN, J., AND HODGINS, J. 1995. Dynamic simulation of splashing fluids. In Proceedings of Computer Animation 95, 198–205. STAM, J. 1999. Stable fluids. In Proceedings of SIGGRAPH 99, 121-128.

More Related