Fluid mechanics as a Discipline Scientific Computing I Prominent - - PDF document

fluid mechanics as a discipline scientific computing i
SMART_READER_LITE
LIVE PREVIEW

Fluid mechanics as a Discipline Scientific Computing I Prominent - - PDF document

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


slide-1
SLIDE 1

Scientific Computing I

Module 10: Case Study – Computational Fluid Dynamics Michael Bader

Lehrstuhl Informatik V

Winter 2007/2008

Fluid mechanics as a Discipline

Prominent discipline of application for numerical simulations: experimental fluid mechanics: wind tunnel studies, laser Doppler anemometry, hot wire techniques, ... theoretical fluid mechanics: investigations concerning the derivation of turbulence models, e.g. computational fluid mechanics (CFD): numerical simulations

Fluid mechanics – Fields of Applications

Many fields of application: aerodynamics: aircraft design, car design,. . . thermodynamics: heating, cooling,. . . process engineering: combustion material science: crystal growth astrophysics: accretion disks

Fluids and Flows

ideal or real fluids

ideal: no resistance to tangential forces

compressible or incompressible fluids

think of pressing gases and liquids

viscous or inviscid fluids

think of the different characteristics of honey and water

Newtonian and non-Newtonian fluids

the latter may show some elastic behaviour (e.g. in 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

typically: all require different models here: real, incompressible, viscous, Newtonian, laminar starting point: continuum mechanics basic conservation laws (remember the heat equation): conservation of mass and momentum

The Mathematical Model (2)

with the transport theorem and Newton’s second law, we get

mass conservation/continuity equation:

∂ ∂tρ +div(ρ

u) = 0 momentum conservation/momentum equations

∂ ∂t(ρ

u)+( u·grad)(ρ u)+(ρ u)div u−ρ g−divσ = 0

with the following quantities:

  • u = (u,v,w) three-dimensional velocity,

ρ density,

  • g gravity,

σ tension tensor, div( u) = ∂u

∂x + ∂v ∂y + ∂w ∂z ,

gradp =

  • ∂p

∂x , ∂p ∂y , ∂p ∂z

  • .
slide-2
SLIDE 2

The Mathematical Model (2)

What to do with the tensor σ? viscous case: not diagonal due to friction forces Newtonian case: isotrope, Stokes’ postulate hence: pressure p and viscosity ν appear divσ → gradp−ν∆ u Incompressible case: density is constant ∂ ∂tρ +div(ρ u) = 0 → div( u) = 0 ⇒ (ρ u)div( u) = 0

The Navier Stokes Equations

introducing the Reynolds number Re (dimensionless, essentially reciprocal of viscosity and some scaling), we finally get the famous Navier-Stokes equations: ∂ ∂t u+( u·grad) u+gradp = 1 Re∆ u+ g div u = two coupled PDE, nonlinear involving velocity and pressure, 1. and 2. spatial derivatives

Boundary Conditions

no-slip: The fluid can not penetrate the wall and sticks to it

  • u = 0.

free-slip: The fluid can not penetrate the wall but does not stick to it u

n = 0, ∂

u ∂ n = 0.

Boundary Conditions (2)

inflow: Both tangential and normal velocitiy components are prescribed

  • u =

uinflow.

  • utflow:

All velocity components do not change in normal direction ∂ u ∂ n = 0. periodic: Same velocity and pressure at inlet and outlet

  • uin =

uout.

Numerical Treatment – Spatial Derivatives

discretization scheme: Finite Differences can be shown to be equivalent to Finite Volumes, here grid:

strictly orthogonal, cartesian staggered grid

Numerical Treatment – Spatial Derivatives

Laplacian ∆ u: standard 5- or 7-point stencil 2D: ∆u(

  • xi,j) ≈ ui−1,j +ui,j−1 −4ui,j +ui+1,j +ui,j+1

h2 . 3D: ∆u(

  • xi,j,k) ≈

ui−1,j,k+ui,j−1,k+ui,j,k−1−6ui,j,k+ui+1,j,k+ui,j+1,k+ui,j,k+1 h2

.

slide-3
SLIDE 3

Finite Differences (continued):

first derivatives gradp,div u: central differences ∂p ∂x1 (xi,j,k) ≈ pi+ 1

2,j,k −pi− 1 2,j,k

h derivatives of nonlinear terms ( u·grad) u: mixture of central derivatives and upwind derivatives (one-sided derivatives, Donor-Cell-scheme)

Time Discretisation

explicit Euler scheme:

  • u(n+1)

= u(n) +dt

  • −gradp+ 1

Re∆ u(n) −

  • u(n) ·grad
  • u(n) +

g

  • Chorin’s projection method;
  • u(n+ 1

2) =

u(n)+dt· 1 Re∆ u(n) −

  • u(n) ·grad
  • u(n) +

g

  • ,

∆p = 1 dt ·div u(n+ 1

2),

  • u(n+1) =

u(n+ 1

2) −dt·gradp.

leads to a Poisson equation for the pressure (system

  • f linear equations)

Implementation

geometry representation as a flag field (Marker-and-Cell) flag field as an array of booleans:

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 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 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 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

input data (boundary conditions) and output data (computed results) as arrays

Implementation (2)

As in the CFD lab by SCCS: modular C-code parallelization:

simple data parallelism, domain decomposition straightforward MPI-based parallelization

target architectures:

(real) parallel computers clusters

possible extensions:

free-surface flows (“the falling drop”) simple multigrid solvers heat transfer or turbulence models