fluid dynamics
play

Fluid dynamics Math background Physics Simulation Related - PowerPoint PPT Presentation

Fluid dynamics Math background Physics Simulation Related phenomena Frontiers in graphics Rigid fluids Fields Domain R 2 Scalar field f : R Vector field f : R 2 Types of


  1. Fluid dynamics

  2. • Math background • Physics • Simulation • Related phenomena • Frontiers in graphics • Rigid fluids

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

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

  5. • Math background • Physics • Simulation • Related phenomena • Frontiers in graphics • Rigid fluids

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

  7. “Coffee cup” equation Navier-Stokes Momentum ∂t = − ( u · ∇ ) u − 1 ∂ u ρ ∇ p + s ∇ 2 u + f equation Incompressibility u : velocity ∇ · u = 0 condition p : pressure s : kinematic viscosity f : body force ρ : fluid density

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

  9. 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: µ

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

  11. 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 gradient easier to compute/approximate

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

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

  14. 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 ∇ · u = 0

  15. Density advection ∂ρ ∂ t = − ( u · ∇ ) ρ

  16. Velocity advection ∂ t = − ( u · ∇ ) u − 1 ∂ u ρ ∇ p + s ∇ 2 u + f s.t. ∇ · u = 0

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

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

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

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

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

  22. High viscosity fluids

  23. 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”

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

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

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

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

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

  29. • Math background • Physics • Simulation • Related phenomena • Frontiers in graphics • Rigid fluids

  30. Challenges • What is the representation for fluids? • represent velocity and pressure • What is the equation of motion for fluids? • approximate Navier-Stokes in a discrete domain • compute Navier-Stokes efficiently

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

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

  33. Explicit integration

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

  35. 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 )

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

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

  38. Body forces

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

  40. Advection

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

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

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

  45. Projection P( )

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

  47. Boundary conditions • Dirichlet boundary condition for free surfaces • Neumann boundary condition for solid walls i +1 / 2 ,j = u i +1 / 2 ,j − ∆ t 1 p i +1 ,j − p i,j u t +1 ∆ x ρ p i,j p i +1 ,j since u t +1 i +1 / 2 ,j = u solid u i +1 / 2 ,j p i +1 ,j = p i,j + ρ ∆ x ∆ t ( u i +1 / 2 ,j − u solid )

  48. Divergence-free condition p i,j +1 u t +1 i +1 / 2 ,j − u t +1 v t +1 i,j +1 / 2 − v t +1 i − 1 / 2 ,j i,j − 1 / 2 + = 0 ∆ x ∆ x v i,j +1 / 2 replace u t +1 i +1 / 2 ,j (and other terms) p i +1 ,j p i − 1 ,j p i,j u i − 1 / 2 ,j u i +1 / 2 ,j u i +1 / 2 ,j − ∆ t 1 p i +1 ,j − p i,j with v i,j − 1 / 2 ∆ x ρ p i,j − 1 result in a discrete Poisson equation � 4 p i,j − p i +1 ,j − p i,j +1 − p i − 1 ,j − p i,j − 1 � � u i +1 / 2 ,j − u i − 1 / 2 ,j � ∆ t + v i,j +1 / 2 − v i,j − 1 / 2 = − ∆ x 2 ∆ x ∆ x ρ

  49. The pressure equations p i,j +1 • If grid cell (i, j + 1) is in air and (i+1, j) is a solid v i,j +1 / 2 p i +1 ,j • replace p i , j +1 with zero p i − 1 ,j p i,j u i − 1 / 2 ,j u i +1 / 2 ,j • replace p i+ 1, j with the value v i,j − 1 / 2 from Neumann condition p i,j − 1 p i,j + ρ ∆ x ∆ t ( u i +1 / 2 ,j − u solid ) 0 � 4 p i,j − p i +1 ,j − p i,j +1 − p i − 1 ,j − p i,j − 1 � � u i +1 / 2 ,j − u i − 1 / 2 ,j � ∆ t + v i,j +1 / 2 − v i,j − 1 / 2 = − ∆ x 2 ∆ x ∆ x ρ

  50. Solve a linear system • Ap = b • Construct matrix A : • diagonal entry: # of non-solid neighbors • off-diagonal: 0 if the neighbor is non-fluid cell and -1 if the neighbor is fluid cell • A is symmetric positive definite • Use preconditioned conjugate gradient

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend