Fluid mechanics as a Discipline Scientific Computing I Prominent discipline of application for numerical Module 10: Case Study – Computational Fluid simulations: Dynamics experimental fluid mechanics: wind tunnel studies, laser Doppler anemometry, hot wire techniques, ... Michael Bader theoretical fluid mechanics: investigations concerning the derivation of turbulence models, e.g. Lehrstuhl Informatik V computational fluid mechanics (CFD): numerical Winter 2007/2008 simulations Fluid mechanics – Fields of Applications Fluids and Flows ideal or real fluids ideal: no resistance to tangential forces compressible or incompressible fluids Many fields of application: think of pressing gases and liquids aerodynamics: aircraft design, car design,. . . viscous or inviscid fluids thermodynamics: heating, cooling,. . . think of the different characteristics of honey and process engineering: combustion water Newtonian and non-Newtonian fluids material science: crystal growth the latter may show some elastic behaviour (e.g. in astrophysics: accretion disks liquids with particles like blood) laminar or turbulent flows turbulence: unsteady, 3D, high vorticity, vortices of different scales, high transport of energy between scales The Mathematical Model The Mathematical Model (2) with the transport theorem and Newton’s second law, we get mass conservation/continuity equation: typically: all require different models ∂ ∂ t ρ + div ( ρ � u ) = 0 here: real, incompressible, viscous, Newtonian, momentum conservation/momentum equations laminar ∂ ∂ t ( ρ � u )+( � u · grad )( ρ � u )+( ρ � u ) div � u − ρ � g − div σ = 0 starting point: continuum mechanics with the following quantities: basic conservation laws (remember the heat � u = ( u , v , w ) three-dimensional velocity, equation): conservation of mass and momentum ρ density, � g gravity, σ tension tensor, u ) = ∂ u ∂ x + ∂ v ∂ y + ∂ w div ( � ∂ z , � � ∂ p ∂ x , ∂ p ∂ y , ∂ p grad p = . ∂ z
The Mathematical Model (2) The Navier Stokes Equations What to do with the tensor σ ? introducing the Reynolds number Re (dimensionless, essentially reciprocal of viscosity and viscous case: not diagonal due to friction forces some scaling), we finally get the famous Newtonian case: isotrope, Stokes’ postulate Navier-Stokes equations: hence: pressure p and viscosity ν appear div σ → grad p − ν ∆ � u ∂ 1 ∂ t � u +( � u · grad ) � u + grad p = Re ∆ � u + � g Incompressible case: density is constant div � u = 0 ∂ ∂ t ρ + div ( ρ � u ) = 0 → div ( � u ) = 0 two coupled PDE, nonlinear ⇒ ( ρ � u ) div ( � u ) = 0 involving velocity and pressure, 1. and 2. spatial derivatives Boundary Conditions Boundary Conditions (2) inflow: Both tangential and normal velocitiy components no-slip: are prescribed The fluid can not penetrate the wall and sticks to it � u = � u inflow . � u = 0 . outflow: All velocity components do not change in normal free-slip: direction ∂ � u The fluid can not penetrate the wall but does not n = 0 . ∂ � stick to it n = 0 , ∂ � u �� periodic: u � n = 0 . ∂ � Same velocity and pressure at inlet and outlet � u in = � u out . Numerical Treatment – Spatial Derivatives Numerical Treatment – Spatial Derivatives Laplacian ∆ � u : standard 5- or 7-point stencil discretization scheme: Finite Differences 2D: can be shown to be equivalent to Finite Volumes, here grid: strictly orthogonal, cartesian x i , j ) ≈ u i − 1 , j + u i , j − 1 − 4 u i , j + u i + 1 , j + u i , j + 1 staggered grid ∆ u ( � . h 2 3D: u i − 1 , j , k + u i , j − 1 , k + u i , j , k − 1 − 6 u i , j , k + u i + 1 , j , k + u i , j + 1 , k + u i , j , k + 1 ∆ u ( � x i , j , k ) ≈ . h 2
Finite Differences (continued): Time Discretisation explicit Euler scheme: � − grad p + 1 u ( n ) + dt u ( n + 1 ) u ( n ) � = � Re ∆ � first derivatives grad p , div � u : central differences � � u ( n ) · grad � u ( n ) + � − � � g p i + 1 2 , j , k − p i − 1 ∂ p 2 , j , k ( x i , j , k ) ≈ ∂ x 1 h Chorin’s projection method; � 1 � derivatives of nonlinear terms ( � u · grad ) � u : u ( n + 1 2 ) = � u ( n ) − � u ( n ) · grad � u ( n ) + � u ( n ) + dt · � Re ∆ � � � g , mixture of central derivatives and upwind derivatives (one-sided derivatives, ∆ p = 1 u ( n + 1 2 ) , dt · div � Donor-Cell-scheme) u ( n + 1 ) = � u ( n + 1 2 ) − dt · grad p . � leads to a Poisson equation for the pressure (system of linear equations) Implementation Implementation (2) geometry representation as a flag field As in the CFD lab by SCCS: (Marker-and-Cell) modular C-code parallelization: simple data parallelism, domain decomposition straightforward MPI-based parallelization flag field as an array of booleans: target architectures: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 (real) parallel computers 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 clusters 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 possible extensions: 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 free-surface flows (“the falling drop”) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 simple multigrid solvers input data (boundary conditions) and output data heat transfer or turbulence models (computed results) as arrays
Recommend
More recommend