fluid dynamics
play

Fluid dynamics Fields Domain R 2 Scalar field f : R Vector - PowerPoint PPT Presentation

Fluid dynamics Fields Domain R 2 Scalar field f : R Vector field f : R 2 Types of derivatives Derivatives measure how something changes due to its parameters f Temporal derivatives t


  1. Fluid dynamics

  2. Fields • Domain Ω ⊆ R 2 • Scalar field f : Ω → R • Vector field f : Ω → R 2

  3. Types of derivatives • Derivatives measure how something changes due to its parameters ∂ f • Temporal derivatives ∂ t • Spatial derivatives � T � ∂ f ∂ x, ∂ f • gradient operator ∇ f = ∂ y ∇ · f = ∂ f x ∂ x + ∂ f y • divergence operator ∂ y ∇ 2 f = ∇ · ( ∇ f ) = ∂ 2 f ∂ x + ∂ 2 f • Laplacian operator ∂ y

  4. Spatial derivatives • Gradient: a vector pointing at the steepest uphill of the function • Divergence: measures the net flux • Laplacian: measures the difference from the average of neighbors

  5. Quiz • What is the laplacian of f(x, y) = 2xy + y 2 ? • (2y, 2x+2y) • 2 • x + 2y • 4

  6. Quiz What’s the gradient at ( π 3 , − π 4 ) ? What about Laplacian?

  7. Representation Density ρ : Ω → [0 , 1] Domain Ω Velocity u : Ω → R 3

  8. Navier-Stoke equations Momentum ∂ t = − ( u · ∇ ) u − 1 ∂ u ρ ∇ p + s ∇ 2 u + f equation Mass equation u : velocity ∇ · u = 0 (Incompressibility p : pressure condition) s : kinematic viscosity f : body force ρ : fluid density

  9. Momentum equation • Each particle represents a little blob of fluid with mass m , a volume V , and a velocity u • The acceleration of the particle a ≡ D u Dt • The Newton’s law mD u Dt = F

  10. Forces acting on fluids • Gravity: m g • Pressure: - ∇ p • Imbalance of higher pressure • Viscosity: µ ∇ · ∇ u • Force that makes particle moves at average speed • dynamic viscosity coefficient: µ

  11. Momentum equation The movement of a blob of fluid mD u Dt = m g − V ∇ p + V µ ∇ · ∇ u Divide by volume ρ D u Dt = ρ g − ∇ p + µ ∇ · ∇ u Rearrange equation giving Navier-Stoke D u Dt + 1 ρ ∇ p = g + s ∇ · ∇ u

  12. Quiz • If we want to add an additional force F to the entire domain of the fluid, how does that change the momentum equation? D u Dt + 1 ρ ∇ p = g + s ∇ · ∇ u

  13. Lagrangian v.s. Eulerian • Lagrangian point of view describes motion as points travel around space over time • Eulerian point of view describes motion as the change of velocity field in a stationary domain • Lagrangian approach is conceptually easier, but Eulerian approach makes the spatial derivatives easier to compute/approximate

  14. Material derivative Dq Dt = ∂ q ∂ t + u ∂ q ∂ x + v ∂ q ∂ y + w ∂ q ∂ z dtq ( t, x ) = ∂ q d ∂ t + ∇ q · d x dt = ∂ q ∂ t + ∇ q · u = Dq Dt

  15. Advection • Advection describe how quantity, q , moves with the velocity field u • Density D ρ Dt = ∂ρ ∂ t + u · ∇ ρ • Velocity Dt = ∂ u D u ∂ t + u · ∇ u

  16. Advection momentum D u Dt + 1 ρ ∇ p = g + s ∇ · ∇ u equation Advection Projection Diffusion Body force ∂ t = − ( u · ∇ ) u − 1 ∂ u ρ ∇ p + s ∇ 2 u + f

  17. Density advection compute derivative of density field: ∂ρ ∂ t = − ( u · ∇ ) ρ integrate density field using ∂ρ ∂ t

  18. Velocity advection compute derivative of velocity field: ∂ u ∂ t = � ( u · r ) u integrate velocity field using ∂ u ∂ t compute derivative of density field: ∂ρ ∂ t = − ( u · ∇ ) ρ integrate density field

  19. Projection Advection Projection Diffusion Body force ∂ t = − ( u · ∇ ) u − 1 ∂ u ρ ∇ p + s ∇ 2 u + f ∇ · u = 0

  20. Divergence free ∇ · u > 0? ∇ · u < 0?

  21. Divergence free ∇ ∙ u = 0 ∇ ∙ u ≠ 0

  22. Projection ∂ t = − ( u · ∇ ) u − 1 ∂ u ρ ∇ p + s ∇ 2 u + f s.t. ∇ · u = 0

  23. Diffusion Advection Projection Diffusion Body force ∂ t = − ( u · ∇ ) u − 1 ∂ u ρ ∇ p + s ∇ 2 u + f ∇ · u = 0

  24. High viscosity fluids

  25. Dropping viscosity • Viscosity plays a minor role in most fluids • Numeric methods introduce errors which can be physically reinterpreted as viscosity • Fluid with no viscosity is called “inviscid”

  26. Body force Advection Projection Diffusion Body force ∂ t = − ( u · ∇ ) u − 1 ∂ u ρ ∇ p + s ∇ 2 u + f ∇ · u = 0

  27. External forces • Gravity • Heat • Surface tension • User-specified forces (stirring coffee)

  28. Boundary conditions • Solid walls • The fluid cannot go in and out of it • Control the normal velocity • Free surfaces • Air can be represented as a region where the pressure is zero • Do not control the velocity at the surface

  29. Solid boundary • Velocity at the boundary u · ˆ n = u solid · ˆ n • No-slip condition: u = u solid • Pressure at the boundary • Make the fluid incompressible AND enforce the solid boundary condition

  30. Physics recap • Physical quantity represented as fields • Navier-Stokes PDE describes the dynamics

  31. Practical challenges • What is the representation for fluids? • use grid structures to represent velocity, pressure, and other quantities of interest • What is the equation of motion for fluids? • approximate Navier-Stokes in a discrete domain • compute Navier-Stokes efficiently

  32. Simple grid structure ( i , j+1 ) p i,j ( i-1 , j ) ( i , j ) ( i+1 , j ) u i,j ( i , j-1 )

  33. Velocity field vector field: u scalar field: u u i,j u i,j scalar field: v v i,j u i,j = ( u i,j , v i,j )

  34. Computing divergence r · u i,j = u i,j +1 � u i,j − 1 + v i +1 ,j � v i − 1 ,j 2 ∆ x cell width: ∆ x v i +1 ,j horizontal vertical scalar field u i,j scalar field u i,j − 1 u i,j +1 v i,j v i − 1 ,j

  35. Derivative evaluation • Evaluating derivatives using scalar fields ∂ t = − ( u · ∇ ) u − 1 ∂ u ρ ∇ p + s ∇ 2 u + f ∂ t = � ( u · r ) u � 1 ∂ u ρ ( r p ) x + s r 2 u + f x ∂ t = � ( u · r ) v � 1 ∂ v ρ ( r p ) y + s r 2 v + f y

  36. MAC grid structure p i,j +1 v i,j +1 / 2 p i +1 ,j p i − 1 ,j p i,j u i − 1 / 2 ,j u i +1 / 2 ,j v i,j − 1 / 2 p i,j − 1

  37. Quiz How do you compute the divergence at u i,j using MAC grid? v i,j +1 / 2 u i − 1 / 2 ,j u i +1 / 2 ,j v i,j − 1 / 2

  38. Explicit integration • Solving for the differential equation explicitly, namely ∂ t = − ( u · ∇ ) u − 1 ∂ u ρ ∇ p + s ∇ 2 u + f u t +1 = u t + h ˙ u ( t ) • You get this...

  39. Explicit integration

  40. Stable fluids Invented by Jos Stam Simple, fast, and unconditionally stable

  41. Splitting methods • Suppose we had a system ∂ x ∂ t = f ( x ) = g ( x ) + h ( x ) • We define simulation function S f S f ( x, ∆ t ) : x ( t ) → x ( t ) + ∆ tf ( x ) • Then we could define S f ( x, ∆ t ) : x ( t + ∆ t ) = S g ( x, ∆ t ) ◦ S h ( x, ∆ t )

  42. Splitting methods ∂ t = − ( u · ∇ ) u − 1 ∂ u ρ ∇ p + s ∇ 2 u + f w 0 = u ( x , t ) add force Advect Diffuse Project w 0 ( x ) w 1 ( x ) w 2 ( x ) w 3 ( x ) w 4 ( x ) u ( x , t + Δ t ) = w 4

  43. Splitting methods ∂ t = − ( u · ∇ ) u − 1 ∂ u ρ ∇ p + s ∇ 2 u + f w 0 = u ( x , t ) add force Advect Diffuse Project w 0 ( x ) w 1 ( x ) w 2 ( x ) w 3 ( x ) w 4 ( x ) u ( x , t + Δ t ) = w 4

  44. Body forces

  45. Splitting methods ∂ t = − ( u · ∇ ) u − 1 ∂ u ρ ∇ p + s ∇ 2 u + f w 0 = u ( x , t ) add force Advect Diffuse Project w 0 ( x ) w 1 ( x ) w 2 ( x ) w 3 ( x ) w 4 ( x ) u ( x , t + Δ t ) = w 4

  46. Semi-Lagrangian Advection

  47. Numerical dissipation • Semi-Lagrangian advection tend to smooth out sharp features by averaging the velocity field • The numerical errors result in a different advection equation solved by semi-Largrangian ∂ x = u ∆ x ∂ 2 q ∂ q ∂ t + u ∂ q ∂ x 2 • Smooth out small vortices in inviscid fluids

  48. Splitting methods ∂ t = − ( u · ∇ ) u − 1 ∂ u ρ ∇ p + s ∇ 2 u + f w 0 = u ( x , t ) add force Advect Diffuse Project w 0 ( x ) w 1 ( x ) w 2 ( x ) w 3 ( x ) w 4 ( x ) u ( x , t + Δ t ) = w 4

  49. Diffusion • Solve for the effect of viscosity ∂ w 2 = ν ∇ 2 w 2 ∂ t • Use an implicit method for stable result ( I − ν ∆ t ∇ 2 ) w 3 ( x ) = w 2 ( x )

  50. Splitting methods ∂ t = − ( u · ∇ ) u − 1 ∂ u ρ ∇ p + s ∇ 2 u + f w 0 = u ( x , t ) add force Advect Diffuse Project w 0 ( x ) w 1 ( x ) w 2 ( x ) w 3 ( x ) w 4 ( x ) u ( x , t + Δ t ) = w 4

  51. Projection P( )

  52. Projection • Projection step subtracts off the pressure from the intermediate velocity field w 3 w 4 = w 3 − ∆ t 1 ρ ∇ p • project ( ∆ t, u ) must satisfies two conditions: ∇ · u t +1 = 0 • divergence free: • boundary velocity: u t +1 · ˆ n = u solid · ˆ n

  53. Divergence-free condition u t +1 − u t +1 + v t +1 − v t +1 p i,j +1 2 1 2 1 = 0 ∆ x ∆ x v 2 w 4 = w 3 − ∆ t 1 Replace (from ) u t +1 p i +1 ,j p i − 1 ,j p i,j ρ ∇ p 2 u 1 u 2 u 2 − ∆ t p i +1 ,j − p i,j with v 1 ∆ x ρ Interpolating u 2 = u i +1 ,j + u i,j p i,j − 1 2 − ∆ t = u i +1 ,j + u i,j p i +1 ,j − p i,j resulting in u t +1 2 ∆ x 2 ρ

Recommend


More recommend