Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Fluid Dynamics & Applications

Similar presentations


Presentation on theme: "Introduction to Fluid Dynamics & Applications"— Presentation transcript:

1 Introduction to Fluid Dynamics & Applications
Nitin Jain COMP 259 Class Presentation

2 Motivation Starting point for all simulation and animation that involves fluid flow : indispensable for physically based modeling

3 Overview Understanding & Deriving the Navier-Stokes equations
Solving the Navier-Stokes equations Basic approach Boundary conditions Applications Lid Driven Cavity flow Smoke

4 So, Let’s begin the journey…

5 Foundations Physical Quantities u : The velocity field P : Pressure
d : Density g : Gravity & other external forces

6 Foundations Operators  - gradient div - divergence 2 - Laplacian

7 Navier-Stokes Equations
external forces convection pressure viscosity

8 Navier-Stokes Equations
In two dimensions …

9 Boundary Conditions No-slip condition Free-slip condition
Inflow condition Outflow condition Periodic Boundary Condition

10 Derivation Transport Theorem Conservation of Mass
Conservation of Momentum

11 Transport Theorem

12 Conservation of Mass Continuity equation Transport theorem
Integrand vanishes is constant for incompressible fluids Continuity equation

13 Conservation of Momentum

14 Conservation of Momentum
Transport theorem Divergence theorem Momentum equation

15 Dynamic Similarity of flows
Dimensionless quantity = dimensional quantity/ reference quantity with same physical units The reference quantities used should possess certain properties : They should be constant for the problem They should be known in advance They should be characteristic for the problem

16 Dimensionless Variables
In a wind tunnel, L = length of the obstacle in the flow, u’,P’and p’ are the upstream velocity, pressure and density. x’’ = x/L t’’ = u’t/L u’’ = u/u’ P’’ = (P-P’) / (p’u’2)

17 Reynolds Number and Froude number
These numbers describe the properties of the flow Re = p’u’L/μ Fr = u’/sqrt(L*magnitude(g)) The Reynolds number represents the relative magnitude of the inertial and viscous forces The Froude number relates the velocity of object to velocity of fluid waves.

18 Let us now see how to solve the Navier Stokes equations…

19 Discretization Refers to passing from a continuous problem to one considered at only a finite number of points. Reduces differential equations to a system of algebraic equations. The solution is found only at a finite number of points in the domain.

20 Discretization Forward difference Backward difference
Derivative at grid point i = ((function value at i+1) – (function value at i)) / (grid spacing) Backward difference Derivative at grid point i = ((function value at i) – (function value at i-1)) / (grid spacing) Central difference Derivative at grid point i = ((function value at i+1) – (function value at i-1)) / (2*grid spacing)

21 Pros and Cons With forward and backward differencing, the order of approximation is first order. With central differencing, it is second order. For convection-diffusion problems, stability problems occur with central differencing when the grid spacing is too coarse. Maintaining stability hence requires restricting the grid spacing to be very small. A possible compromise is to use a weighted average of both discretizations : μ*forward difference + (1- μ)*backward difference

22 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

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 The algorithm Perform time discretization of momentum equations. Discretize in a manner explicit in the velocities and implicit in the pressure. Evaluate continuity equation at time t(n) + 1, to yield a poisson equation for pressure. Solve for the pressure. Use the pressure values to compute new velocities.

25 Solving for pressure Discretize in time Rearrange terms
Satisfy continuity eq.

26 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.

27 No-slip condition The velocities vanish at the boundaries to satisfy the no-slip condition. u0,j = 0, vi,o = 0, ui-max,j = 0, vi,j-max = 0

28 Free Slip Condition u0,j = 0, vi,o = 0, ui-max,j = 0, vi,j-max = 0,
The velocity component normal to the boundary should vanish along with the derivative of the velocity component tangent to the boundary. u0,j = 0, vi,o = 0, ui-max,j = 0, vi,j-max = 0, v0,j = v1,j , vi-max + 1,j = vi-max ,j , ui,0 = ui,1 , ui,j-max+1 = ui,j-max

29 Outflow Condition u0,j = u1,j , ui-max,j = ui-max -1 ,j ,
The normal derivatives of both velocity components are set to zero at the boundary u0,j = u1,j , ui-max,j = ui-max -1 ,j , vi-max+1,j= vi-max,j, v0,j = v1,j, ui,0 = ui,1 , ui,j-max+1 = ui,j-max vi,0 = v1,j , vi,j-max = vi,j-max-1 ,

30 Inflow Conditions The velocities are explicitly given
We impose this for velocities normal to the boundary by directly fixing the values on the boundary line For the velocity components tangential to the boundary, we achieve this by averaging the values on either side of the boundary.

31 Periodic boundary conditions
For periodic boundary conditions in the x-direction, the boundary values on the left and the right boundaries coincide. u0,j = ui-max-1,j , ui-max,j = u1,j v0,j = vi-max-1,j , vi-max,j = v1,j

32 Stability condition Limits on time step
CFL conditions – don’t move more than a single cell in one time step Diffusion term

33 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.

34 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<ε

35 Let’s move on to some applications now…

36 Lid Driven Cavity Flow We simulate a driven cavity flow in a square domain. The physical configuration consists of a square container filled with a fluid. The lid of the container moves at a given, constant velocity, thereby setting the fluid in motion.

37 Boundary Conditions No slip conditions on all four segments of the boundary, except the upper boundary. Vertical velocity at the upper boundary is zero. The horizontal velocity is set equal to the given lid velocity.

38 Lid Driven Cavity Flow Demo time :

39 Smoke (Fedkiw, Stam, Jensen 1999)
Uses Euler equations instead of the Navier Stokes equations since These are more appropriate for gas models Are less computationally expensive Uses “vorticity confinement” to reduce numerical dissipation

40 Euler Equations Incompressible Euler Equations
Solve the equation in two steps Compute intermediate velocity without the pressure term Forve the velocity field to be incompressible

41 Euler Equations Solve the second equation over a timestep, ignoring the pressure term : Compute the pressure from the following poisson equation

42 Euler equations The intermediate velocity is then made incompressible by subtracting the gradient of the pressure from it. The temperature and density of the smoke are then calculated by simply advecting along the velocity field.

43 Vorticity Confinement
Smoke usually consists of velocity field having a significant amount of rotational and turbulence components. Numerical dissipation damps out these phenomena, and so they are added back by a technique called vorticity confinement

44 Vorticity Confinement
Vorticity is the curl of the velocity field. First, calculate normalized vorticity location vectors. Then add vorticity terms at these locations.

45 Some Videos…


Download ppt "Introduction to Fluid Dynamics & Applications"

Similar presentations


Ads by Google