computational fluid dynamics cfd chd
play

Computational Fluid Dynamics (CFD, CHD)* PDE (Shocks 1st); Part I: - PowerPoint PPT Presentation

Computational Fluid Dynamics (CFD, CHD)* PDE (Shocks 1st); Part I: Basics, Part II: Vorticity Fields Rubin H Landau Sally Haerer, Producer-Director Based on A Survey of Computational Physics by Landau, Pez, & Bordeianu with Support from


  1. Computational Fluid Dynamics (CFD, CHD)* PDE (Shocks 1st); Part I: Basics, Part II: Vorticity Fields Rubin H Landau Sally Haerer, Producer-Director Based on A Survey of Computational Physics by Landau, Páez, & Bordeianu with Support from the National Science Foundation Course: Computational Physics II 1 / 1

  2. Problem: Placement of Boulders for Migrating Salmon Wake Block “Force” of River? River River surface surface y y H L x x L bottom bottom Deep, wide, fast-flowing streams “Boulder” = long rectangular beam, plates Objects not disturb surface/bottom flow Problem: large enough wake for 1m salmon 2 / 1

  3. Theory: Hydrodynamics Assumptions; Continuity Equation River River surface surface y y H L x x L bottom bottom ∂ρ ( x , t ) + � ∇ · j = 0 (1) ∂ t def j = ρ v ( x , t ) (2) (1): Continuity equation ⇒ ρ = constant Friction (viscosity) 1st eqtn hydrodynamics Incompressible fluid Steady state, v � = v ( t ) 3 / 1

  4. Navier–Stokes: 2nd Hydrodynamic Equation Hydrodynamic Time Derivative D v ∇ ) v + ∂ v def ( v · � = (1) Dt ∂ t For quantity within moving fluid Rate of change wrt stationary frame Velocity of material in fluid element Change due to motion + explicit t dependence D v / Dt : 2nd O v ⇒ nonlinearities ∼ Fictitious (inertial) forces Fluid’s rest frame accelerates 4 / 1

  5. Now Really the Navier–Stokes Equation Transport Fluid Momentum Due to Forces & Flow D v = ν ∇ 2 v − 1 � ∇ P ( ρ, T , x ) (Vector Form) (1) Dt ρ z z ∂ 2 v x ∂ v x v j ∂ v x ∂ P − 1 � � ∂ t + = ν (x component) (2) ∂ x j ∂ x 2 ρ ∂ x j j = x j = x ν = viscosity, P = pressure ν ∇ 2 v : due to viscosity Recall d p / dt = F P ( ρ, T , x ) : equation state def = ( v · � D v / Dt ∇ ) v + ∂ v /∂ t Assume = P ( x ) v · ∇ v : transport via flow Steady-state ⇒ ∂ t v i = 0 v · ∇ v : advection Incompressible ⇒ ∂ t ρ = 0 � ∇ P : change due to ∆ P 5 / 1

  6. Resulting Hydrodynamic Equations Assumed: Steady State, Incompressible, P = P ( x ) ∂ v i � � ∇ · v ≡ = 0 (Continuity) (1) ∂ x i i ∇ ) v = ν ∇ 2 v − 1 ( v · � � ∇ P (Navier–Stokes) (2) ρ (1) Continuity equation: Incompressibility, in = out Stream width ≫ beam z dimension ⇒ ∂ z v ≃ 0 ⇒ ∂ v x ∂ x + ∂ v y = 0 (3) ∂ y � ∂ 2 v x ∂ x 2 + ∂ 2 v x � = v x ∂ v x ∂ x + v y ∂ v x ∂ P ∂ y + 1 ν (4) ∂ y 2 ρ ∂ x � ∂ 2 v y ∂ x 2 + ∂ 2 v y � = v x ∂ v y ∂ x + v y ∂ v y ∂ y + 1 ∂ P ν (5) ∂ y 2 ρ ∂ y 6 / 1

  7. Boundary Conditions for Parallel Plates Physics Determines BC ⇒ Unique Solution L H Constant stream velocity + Upstream unaffected Low V 0 , high viscosity ⇒ Solve rectangular region Laminar: smooth, no cross L , H ≪ R stream ⇒ uniform down ⇒ streamlines of motion Far top, bot ⇒ symmetry Thin plates ⇒ laminar flow 7 / 1

  8. Analytic Solution for Parallel Plates (See Text) Bernoulli Effect: Pressure Drop Through Plates River River surface surface y y H L x x L bottom bottom 1 ∂ P ∂ x ( y 2 − yH ) v x ( y ) = (1) 2 ρν ∂ P = known constant (2) ∂ x V 0 = 1 m/s , ρ = 1 kg/m 3 , ν = 1 m 2 / s , H = 1 m (3) ⇒ ∂ P = − 12 , v x ( y ) = 6 y ( 1 − y ) (4) ∂ x 8 / 1

  9. Finite-Difference Navier–Stokes Algorithm + SOR Rectangular grid x = ih , y = jh 3 Simultaneous equations → 2 ( v y ≡ 0) v x i + 1 , j − v x i − 1 , j + v y i , j + 1 − v y i , j − 1 = 0 (1) v x i + 1 , j + v x i − 1 , j + v x i , j + 1 + v x i , j − 1 − 4 v x (2) i , j = h + h + h 2 v x v x i + 1 , j − v x 2 v y v x i , j + 1 − v x � � � � 2 [ P i + 1 , j − P i − 1 , j ] i , j i − 1 , j i , j − 1 i , j Rearrange as algorithm for Successive Over Relaxation i , j − 1 − h 4 v x i , j = v x i + 1 , j + v x i − 1 , j + v x i , j + 1 + v x 2 v x v x i + 1 , j − v x � � i , j i − 1 , j − h − h 2 v y v x i , j + 1 − v x � � 2 [ P i + 1 , j − P i − 1 , j ] (3) i , j − 1 i , j Accelerate convergence + SOR; ω > 2 unstable 9 / 1

  10. End Part I: Basics River River surface surface y y H L x x L bottom bottom 10 / 1

  11. Part II: Vorticity Form of Navier–Stokes Equation 2 HD Equations in Terms of Stream Function u ( x ) � ∇ · v = 0 Continuity (1) ∇ ) v = − 1 ( v · � ∇ P + ν ∇ 2 v � Navier–Stokes (2) ρ Like EM, simpler via (scalar & vector) potentials Irrotational Flow: no turbulence, scalar potential Rotational Flow: 2 vector potentials; 1st stream function def = � v ∇ × u ( x ) (3) � ∂ u z � ∂ u x ∂ y − ∂ u y � ∂ z − ∂ u z � = ˆ ǫ x + ˆ ǫ y (4) ∂ z ∂ x ∇ · ( � � ∇ × u ) ≡ 0 ⇒ automatic continuity equation 11 / 1

  12. 2 HD Equations in Terms of Stream Function (cont) 2-D flow: u = Constant Contour Lines = Streamlines def = � ∇ × u ( x ) v (1) � ∂ u z � ∂ u x ∂ y − ∂ u y � ∂ z − ∂ u z � = ˆ ǫ x + ˆ ǫ y (2) ∂ z ∂ x v z = 0 ⇒ u ( x ) = u ˆ ǫ z (3) v x = ∂ u v y = − ∂ u ⇒ ∂ y , (4) ∂ x 12 / 1

  13. Introduce Vorticity w ( x ) ∼ � ω Vortex: Spinning, Often Turbulent Fluid Flow def = � w ∇ × v ( x ) (1) � ∂ v y ∂ x − ∂ v x � w z = (2) ∂ y Measure of � v ’s rotation w = 0 ⇒ uniform RH rule fluid element Moving field lines w = 0 ⇒ irrotational Relate to stream function: 13 / 1

  14. Introduce Vorticity w ( x ) ∼ � ω ∼ Poisson’s equation ∇ 2 φ = − 4 πρ w(x,y) 0 12 y -1 6 20 0 y 0 40 80 x x 50 0 = � def w ∇ × v ( x ) (1) w = � ∇ × v = � ∇ × ( � ∇ × u ) = � ∇ ( � ∇ · u ) − ∇ 2 u (2) ǫ z ⇒ � yet u = u ( x , y ) ˆ ∇ · u = 0 (3) ⇒ � ∇ 2 u = − w (4) Like Poisson with ea w component = source 14 / 1

  15. Vorticity Form of Navier–Stokes Equation Take Curl of Velocity Form ∇ ) v = ν ∇ 2 v − 1 � � � ( v · � � ∇ × ∇ P (Navier–Stokes) (1) ρ ν ∇ 2 w = [( � ∇ × u ) · � ∇ ] w (2) In 2-D + only z components: ∂ x 2 + ∂ 2 u ∂ 2 u ∂ y 2 = − w (3) � ∂ 2 w ∂ x 2 + ∂ 2 w � = ∂ u ∂ w ∂ x − ∂ u ∂ w ν (4) ∂ y 2 ∂ y ∂ x ∂ y Simultaneous, nonlinear, elliptic PDEs for u & w ∼ Poisson’s + wave equation + friction + variable ρ 15 / 1

  16. Relaxation Algorithm (SOR) for Vorticity Equations x = ih , y = jh CD Laplacians, 1st derivatives u i , j = 1 � � u i + 1 , j + u i − 1 , j + u i , j + 1 + u i , j − 1 + h 2 w i , j (1) 4 w i , j = 1 4 ( w i + 1 , j + w i − 1 , j + w i , j + 1 + w i , j − 1 ) − R 16 { [ u i , j + 1 − u i , j − 1 ] × [ w i + 1 , j − w i − 1 , j ] − [ u i + 1 , j − u i − 1 , j ] [ w i , j + 1 − w i , j − 1 ] } (2) R = 1 ν = V 0 h (in normal units ) (3) ν R = grid Reynolds number ( h → R pipe ); measure nonlinear Small R : smooth flow, friction damps fluctuations Large R ( ≃ 2000): laminar → turbulent flow Onset of turbulence: hard to simulate (need kick) 16 / 1

  17. Boundary Conditions for Beam Surface G vx = du/dy = V0 w = 0 vy = -du/dx = 0 H F vx = du/dy = V0 du/dx = 0 Outlet Inlet u = 0 dw/dx = 0 w = 0 C Half u = 0 Beam vy = -du/dx = 0 y w = u = 0 D B w = u = 0 x E A center line Well-defined solution of elliptic PDEs requires u , w BC Assume inlet, outlet, surface far from beam Freeflow: No beam NB w = 0 ⇒ no rotation Symmetry: identical flow above, below centerline, not thru 17 / 1

  18. Boundary Conditions for Beam (cont) See Text for More Explanations Centerline: = streamline, u = const =0 (no v ⊥ No flow in, out beam to it ⇒ u = 0 all beam surfaces Symmetry ⇒ vorticity w = 0 along centerline Inlet: horizontal fluid flow, v = v x = V 0 : Surface: Undisturbed ⇒ free-flow conditions: Outlet: Matters little; convenient choice: ∂ x u = ∂ x w Beamsides: v ⊥ = u = 0; viscous ⇒ v � = 0 Yet, over specify BC ⇒ only no-slip vorticity w : Viscosity ⇒ v x = ∂ u ∂ y = 0 (beam top) Smooth flow on beam top ⇒ v y = 0 + no x variation: ∂ y = − ∂ 2 u ∂ v y ∂ x = 0 ⇒ w = − ∂ v x (1) ∂ y 2 18 / 1 Taylor series ⇒ finite-difference top BC:

  19. Implementation & Assessment:SOR on a Grid Basic soltn vorticity form Navier–Stokes: Beam.py NB relaxation = simple, BC � = simple Separate relaxation of stream function & vorticity Explore convergence of up & downstream u Determine number iterations for 3 place with ω = 0 , 0 . 3 Change beam’s horizontal position so see wave develop Make surface plots of u , w , v with contours; explain Is there a resting place for salmon? 19 / 1

  20. Results w(x,y) 12 0 y -1 6 20 0 0 y 40 80 x x 50 0 20 / 1

Recommend


More recommend