4A2 Computational Fluid Dynamicsjl305/4A2/4A2SlidesIntrod.pdf · •Computation + Fluid Dynamics...
Transcript of 4A2 Computational Fluid Dynamicsjl305/4A2/4A2SlidesIntrod.pdf · •Computation + Fluid Dynamics...
4A2 Computational Fluid Dynamics
Jie Li CUED 2020
• Computation + Fluid Dynamics
• Fluid Dynamics or Fluid Mechanics?
• Course Content
• Numerical Methods for Compressible Flows
Courtesy of Prof. Tucker, CUED
CFD
MEASUREMENTS THEORY
TRIAD (Available Tools)
• Making measurements
• Use of analytical solutions
• Use of Computer simulations (CFD- aerospace – 1960s)
• provide a significant amount of detail about a flow situation
• provide an effective means for the rapid evaluation of what-if design scenarios
• Geometry changes easy
• Safe for dangerous experiments
CFD Advantages
• Turbulence modelling a big problem
• Geometry handling and meshing can be time consuming
• Needs careful validation
CFD Problems
Course Structure
• Introduction
• Numerical Basics
• Writing a Basic Euler Solver
• Advanced concepts and Test Cases
• Total Variation Diminishing (TVD) Methods
• High Resolution Methods
• Riemann solver and shock capturing
Coursework Example: Subsonic Flow over a Bump
Mesh
Mach Contours
Course Information
Online Demonstration Sessions (Oct 15 - Dec 2)
▪ Mondays (2pm - 4pm)
▪ Tuesdays (2pm - 4pm)
▪ Wednesdays (2pm - 4pm)
▪ Thursdays (2pm - 4pm)
Documents (on Linux Dept. Teaching System)
Submission of 2 Reports
▪ ls /public/teach/4A2/
▪ cp -r /public/teach/4A2/Reading .
▪ cp -r /public/teach/4A2/2020_4A2 .
▪ Interim report: before 4pmThursday 12th Nov
▪ Final report: before 4pm Friday 11th Dec
Interim Report (due Nov 14)
• 4A2 Basic Euler Solve for Internal Flow
• F90 Programming Language
• More Explanation
Final Report (due Dec 13)
▪ 4A2 Euler Extensions
▪ More Explanation
• Test Cases
• Examples
Course Work (note on Moodle)
Access to Linux Teaching System
For Windows Platform, first install MobaXterm
https://mobaxterm.mobatek.net/download-home-edition.html
From Linux Platform
▪ ssh –X [email protected]
▪ ssh –X CRSid@ts-access
DATA Transfer▪ scp [email protected]:2020_4A2/SaveSrc.tar.gz .
▪ scp SaveSrc.tar.gz [email protected]:2020_4A2/.
Use of MobaXterm
Launch MobaXterm
Start local terminal
Oblique Shock & Prandtl-Meyer Expansion Wave(Compressible Flows)
high order method simulation
Shock Wave Reflection from a Wedge(Compressible Flows)
Ma = 1.7, wedge 25 degree
high order method simulation experiment (Prof. Takayama)
Diffraction of a Shock Wave By a Finite Wedge
Photographs by H. Schardin, in Oertel
Diffusion, Dissipation and High Order Method
(From LeVeque, CUP)
Diffusion, Dissipation and TVD Method
(From LeVeque, CUP)
TVD method
• Flow around NACA0012
Re = 1000
• Von Karman
Vortex Street
experiment (Shen et al.) high order method simulation
Incompressible Flows(Pressure based Solver)
Compressible Flows vs Incompressible Flows
Mach Number: U/a, a =: sound speed
Courant–Friedrichs–Lewy (CFL) condition:
Incompressible flow:
This course focuses on compressible flows
Explicit Methods, not suitable for incompressible flows
F/A-18, Sound barrierCourtesy of wiki
Hypersonic and High-Temperature Flows
• Ma > 5.0?
• High temperature
• Plasma flows
Sir Horace Lamb : ‘I am an old man now, and when I die and go to heaven there are two matters on which I hope for enlightenment. One is quantum electrodynamics and the other is the turbulent motion of fluids. About the former I am rather optimistic’
4A12 Module
Photograph by Werle, Courtesy of Delery
• aluminium wall of 3 meter thick
• 37 m high and 30 m in diameter
Space Power Facility (NASA, 1969)
Continuum Hypothesis vs Rarefied Gas Effect
Continuum Hypothesis vs Rarefied Gas Effect
• Mean free path: (100 nm at 1 atm)
• Characteristic Length:
• Knudson number:
• Rarefied gas flow:
Boltzmann Equation (Module 3A9):
Aspects of CFD
• Mesh Generators
• Structured/Unstructured mesh methods
• Numerical Methods (FDM, FVM, FEM…)
• Turbulence Modelling
• Compressible Flows (shock capturing)
• Incompressible Flows (pressure based methods)
• Eulerian/Lagrangian (moving/fixed methods)
• Adaptive Mesh Methods
• Parallel Computing
Journal of Computational Physics (Journal)
Conservation Equations of Compressible Flows
Cauchy Stress Tensor:
Stokes:
Fourier heat flux:
Mass:
Momentum (f body forces) :
Energy (Q heat sources):
Navier-Stokes Eqns for Compressible Flows
Polytropic gas:
Total Energy:
Ideal gas:
Stokes Viscous stress:
Fourier heat flux:
Constitutive Laws:
Boundary Conditions:
Mass:
Momentum:
Energy:
no-slip on wall, ….
DNS, LES and RANS
• Direct Numerical Simulations (DNS)
• Kolmogorov scale:
• 3D DNS requires mesh points :
• Large Eddy Simulations (LES)
• Reynolds Average Navier-Stokes Eqns (RANS)
Euler Equations
In 4A2:
Tensorial Product:
Boundary conditions: slip condition on wall, ….
4A2: Euler Equations in 2D
Speed of Sound:
Ideal gas:
Polytropic gas:
Energy:
Momentum:
Mass:
Conforming Boundary and Non-Conforming methods(no-slip condition on wall)
• Cut-cell methods
• Immersed boundary methods
• Flow passing a cylinder • Body fitting methods
Structured and Unstructured Meshes
• Structured : fixed neighbour relations, efficient
• Unstructured: variable neighbour relations, flexible
• Mixed type meshes
Delaunay Mesh Generation
Edge Flip:
Mesh Generators in Public Domain
• Triangle (Prof. J. Shewchuk)
• TetGen (Dr. Hang Si)
Lagrangian and Eulerian Approaches
Bouncing of Colliding Tetradecane Droplets
(Fixed or Moving Mesh Methods)
Adaptive Mesh Refinement (AMR)
AMRexperiment
Berger & Colella (1989). "Local adaptive mesh
refinement for shock hydrodynamics". J. Comput.
Phys. 82: 64–84
Moving Adaptive Mesh Techniques
• Conforming Moving Adaptive
Mesh Methods
• Adaptive Mesh Refinement
using quad-tree
Software Packages in Public Domain
• FENICS
• OpenFoam
• Gerris
• Fludity
• FreeFEM
(Oct-Tree)
Moore’s Law Moore's law: the number of transistors in a dense
integrated circuit doubles about every two years.
Parallel Computing • Memory Limitation & Computation Time
• Message Passing Interface (MPI)
• ParMetis: Mesh Partition
• Linear Solver: PETSc
Partitioned into 16 Parts
using ParMetis
• Summit(Oak Ridge National Lab, 2018)
• 4608 nodes
• 9,216 CPUs & 27,648 GPUs
• speed: 200 petaflops
Parallel Computation of 64 Rising Bubbles
Rising bubbles computed
on 16 cores by Shidi Yan
• Limit of Memory of a Single Machine
• Duration of computing time
• Partition of Mesh by ParMetis
• Incompressible Flows
• Pressure based method (implicit on pressure)
• Linear Solver PETSc
Euler Equations in 2D
Enthalpy:
Ideal gas:
Polytropic gas:
Energy:
Momentum:
Mass:
• Finite Element methods are based on weak form
of PDE, require a lot of maths (module 3D7)
Conservation Laws and Finite
Volume method
Writing the basic
solver Pt 1
Tom Hynes
Task at Hand
Initial Calls
program euler
call read_data
call inguess
call generate_grid
call check_grid
call crude_guess !flow_guess
call set_timestep
Main Loop Calls
do nstep = 1,nsteps
ro_start = ro
call set_others
call apply_bconds
call set_fluxes
call sum_fluxes
ro = ro_start + ro_inc
call smooth
call check_conv
end do
Read Data
Generate Grid
Generate Grid
Generate grid
Generate Grid
Generate Grid
Check Grid
Set Time Step
Set Time Step
Set Others
Apply Boundary Conditions
Set Fluxes
Sum Fluxes
del_prop(i,j) = (deltat/area(i,j))*(iflux(i,j) – iflux(i+1.j) +jflux(i,j)-
jflux(i,j+1))
Sum Fluxes
del_prop(i,j) = (deltat/area(i,j))*(iflux(i,j) – iflux(i+1.j) +jflux(i,j)-
jflux(i,j+1))
prop_inc(i,j) =
Smooth
Flow Guess
Flow Guess
Summary