me614: c f dynamics - purdue universityscalo/menu/...spatial discretization python session:...

6
ME614: COMPUTATIONAL FLUID DYNAMICS Spring 2017, MWF 2:30 pm - 3:20 pm, WANG2579 & WANG2563 Instructors Dr. Carlo Scalo (left) Assistant Professor of Mech. Engineering Room ME2195, ME Building Email: [email protected] Mr. Danish Patel (middle) Email: [email protected] Office Hours: Tuesday’s, 1 PM – 3 PM Venue: Outside WANG 4564 Mr. Kukjin Kim (right) Email: [email protected] Office Hours: Wednesday’s, 3.30 PM – 5.30 PM Venue: Outside WANG 4564 Prerequisites Prerequisites for the course include basic knowledge of fluid mechanics, linear algebra, partial differential equations and average (not beginner!) programming skills. The use of Python is strongly recommended but not mandatory. The class content is structured in such a way to allow talented undergraduate students to successfully complete the coursework. Course Objectives The course will cover traditional aspects of Computational Fluid Dynamics (CFD) with focus on momentum and mass transfer applications, while providing exposure to the latest generation of high-level dynamic languages and version-control software. The course will cover the following topics: 1. Spatial & Temporal Discretizations 2. Linear Advection & Diffusion Equation 3. Poisson and Heat Equations 4. Navier-Stokes Solvers 5. Introduction to Compressible Flow Students will be expected to write their own complete Navier-Stokes solver from scratch as a final project. Density contours of supersonic flow past a cylinder confined in a duct (courtesy of Prof. Guido Lodato). 1

Upload: others

Post on 09-May-2020

11 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ME614: C F DYNAMICS - Purdue Universityscalo/menu/...Spatial Discretization Python Session: \Introduction to Python" Reading: Python Tutorial, Sections 1 { 5 16th MARTIN LUTHER KING

ME614: COMPUTATIONAL FLUID DYNAMICS

Spring 2017, MWF 2:30 pm - 3:20 pm, WANG2579 & WANG2563

Instructors

Dr. Carlo Scalo (left)Assistant Professor of Mech. EngineeringRoom ME2195, ME BuildingEmail: [email protected]

Mr. Danish Patel (middle)Email: [email protected] Hours: Tuesday’s, 1 PM – 3 PM

Venue: Outside WANG 4564

Mr. Kukjin Kim (right)Email: [email protected] Hours: Wednesday’s, 3.30 PM – 5.30 PM

Venue: Outside WANG 4564

Prerequisites

Prerequisites for the course include basic knowledge of fluid mechanics, linear algebra, partial differential equations andaverage (not beginner!) programming skills. The use of Python is strongly recommended but not mandatory. The classcontent is structured in such a way to allow talented undergraduate students to successfully complete the coursework.

Course Objectives

The course will cover traditional aspects of Computational Fluid Dynamics (CFD) with focus on momentum and masstransfer applications, while providing exposure to the latest generation of high-level dynamic languages and version-controlsoftware. The course will cover the following topics:

1. Spatial & Temporal Discretizations2. Linear Advection & Diffusion Equation3. Poisson and Heat Equations4. Navier-Stokes Solvers5. Introduction to Compressible Flow

Students will be expected to write their own complete Navier-Stokes solver from scratch as a final project.

Density contours of supersonic flow past a cylinder confined in a duct (courtesy of Prof. Guido Lodato).

1

Page 2: ME614: C F DYNAMICS - Purdue Universityscalo/menu/...Spatial Discretization Python Session: \Introduction to Python" Reading: Python Tutorial, Sections 1 { 5 16th MARTIN LUTHER KING

Grade Distribution

Homework assignments and final reports turned in LATEX and/or with supporting images generated in vector graphics arestrongly encouraged (points will be detracted from messy reports, with unclear figures and text). The grade distribution is:

(5%) Homework 0: Computing Environment Setup– workflow setup via git, ssh and Linux

(20%) Homework 1: Spatial Discretization– fundamentals of local/global 1D discretization schemes on uniform/non-uniform grids

(10%) HPC Homework: Introduction to MPI– getting to grips with Purdue’s supercomputing resources, first MPI code

(20%) Homework 2: Linear Advection & Diffusion Equation– compare different time advancement schemes, numerical stability

(20%) Homework 3: Poisson Equation and Navier-Stokes Solver– solve elliptical problems, compare iterative methods, first incompressible Stokes solver

(25%) Final Project– write a complete incompressible or compressible Navier-Stokes solver, pick one of the suggested final projects or

propose one yourself

Examples of source code will be provided in Python only. The use of Python is strongly recommended but not mandatory.Note that it is trivial to check whether parts of source code have been copied or shared.The grading scale for the course is:

97 ≤ score ⇒ A+ 80 ≤ score < 83 ⇒ B- 63 ≤ score < 67 ⇒ D93 ≤ score < 97 ⇒ A 77 ≤ score < 80 ⇒ C+ 60 ≤ score < 63 ⇒ D-90 ≤ score < 93 ⇒ A- 73 ≤ score < 77 ⇒ C score < 60 ⇒ F87 ≤ score < 90 ⇒ B+ 70 ≤ score < 73 ⇒ C-83 ≤ score < 87 ⇒ B 67 ≤ score < 70 ⇒ D+

Policy Regarding Plagiarism

Sharing of ideas on the homework assignments is encouraged but submitted reports and source codes need to be individuallyprepared. If established that two (or more) students have shared source code and/or parts of the write-up, a zero score willbe given those assignments. The instructor will send a report to the Office of Dean of Students (ODOS) for every instanceof plagiarism. Incidents reported to ODOS stay permanently on record.

Textbooks

With the exception of programming tutorials, all of the lecture material will be explained at the blackboard to facilitate adynamic discussion. Some of the course material will be based on selected pages from the following textbooks:• Ferziger, J., and M. Peric, Computational Methods for Fluid Dynamics, Third Edition, Springer, 2001• Pletcher, R. H., Tannehill, J. C., and Anderson, D., Computational Fluid Mechanics and Heat Transfer, Third Edition,

CRC Press, 2011.• R. Leveque, Finite Volume Methods For Hyperbolic Problems, Cambridge, 2004• Lloyd N. Trefethen, Finite Difference and Spectral Methods for Ordinary and Partial Differential Equations, unpublished

text, 1996, available at http://people.maths.ox.ac.uk/trefethen/pdetext.htmlThe first two will be the main reference textbooks for the course. The last two cover more theoretical and advanced topics.

2

Page 3: ME614: C F DYNAMICS - Purdue Universityscalo/menu/...Spatial Discretization Python Session: \Introduction to Python" Reading: Python Tutorial, Sections 1 { 5 16th MARTIN LUTHER KING

Tentative Schedule

A tentative schedule is included below. The instructor reserves the right to (frequently) update it.

Monday Wednesday Friday

Jan 9th Lecture 1

Introduction• Course Structure Overview

Review of Syllabus• Homework 0:

Python, Linux, Git

11th Lecture 2

Introduction to Supercomputing• HPC Session

by Dr. Xiao Zhu (RCAC)

13th Lecture 3

Spatial Discretization• Python Session:

“Introduction to Python”

Reading:Python Tutorial, Sections 1 – 5

16th

MARTIN LUTHER KING JR.DAY

18th Lecture 4

Principles of Discretization• Discrete Operators• Matrix Multiplication

Reading: review linear algebra (matrixmultiplications, eigenvalues, ...)

20th Lecture 5

Homework 0 Due

Spatial Discretization• Polynomial Fitting

Reading: review linear algebra;Pletcher, et al. (2011) pp. 43 – 75;Ferziger & Peric (2001) pp. 21 – 52.

23rd Lecture 6

Spatial Discretization• Homework 1 overview

25th Lecture 7

Introduction to Supercomputing• HPC Session

by Dr. Xiao Zhu (RCAC)

27th Lecture 8

Spatial Discretization• Python Session:

Homework 1 Starter

Reading:Python Tutorial, Sections 6 – 8

30th Lecture 9

Spatial Discretization• Taylor Expansion• Boundary Conditions:

periodic vs non-periodic

Reading: review linear algebra;Pletcher et al. (2011) pp. 43 – 75;Ferziger & Peric (2001) pp. 21 – 52.

Feb 1st Lecture 10

Spatial Discretization• Pade Approximants• Splines

Reading:Ferziger & Peric (2001) pp. 45 – 63;

3rd Lecture 11

Spatial Discretization• Modified Wavenumber• Spectral Discretization

Reading:Pletcher et al. (2011) pp. 329 – 337;Ferziger & Peric (2001) pp. 47 – 58;

6th Lecture 12

Homework 1 Due

Temporal Discretization• Explicit Euler & Upwind• Modified Equation

Reading:Pletcher et al. (2011) pp. 103 – 124;

8th Lecture 13

Introduction to Supercomputing• HPC Session

by Dr. Xiao Zhu (RCAC)

10th Lecture 14

Temporal Discretization• Modified Equation (cont’d)• Round Off Error

13th Lecture 15

Temporal Discretization• Fourier/Von Neumann Analysis• Implicit Euler, MacCormack,

Adams-Bashforth, Leap Frog,Crank-Nicholson

Reading:Pletcher et al. (2011) pp. 82– 95

15th

NO CLASS

17th Lecture 16

Temporal Discretization• Runge-Kutta schemes

Reading:Handouts, Chapter 4Pletcher et al. (2011) pp. 124 – 125

3

Page 4: ME614: C F DYNAMICS - Purdue Universityscalo/menu/...Spatial Discretization Python Session: \Introduction to Python" Reading: Python Tutorial, Sections 1 { 5 16th MARTIN LUTHER KING

Monday Wednesday Friday20th Lecture 17

Linear Advection & Diffusion• Python Session:

Homework 2 Starter

22nd Lecture 18

HPC Homework Due

Linear Advection & Diffusion• Homework 2 overview• Periodic vs non-periodic

boundary conditions

24th Lecture 19

Spatial Discretization• Non-uniform grid generation in

1D

27th Lecture 20

Poisson and Heat Equations• 2D spatial operators (DivGrad

operator)• Direct Methods

Reading:Pletcher et al. (2011) pp. 147 –152

Mar 1st

NO CLASS

3rd

NO CLASS

6th Lecture 21

Linear Systems of Equations• Iterative Methods: Jacobi,

Gauss-Seidel, Line Relaxation

Reading:Handouts, Chapter 3Pletcher et al. (2011) pp. 152 – 162

8th Lecture 22

Linear Systems of Equations• Iterative Methods:

Over-Relaxation, ADI,Multi-Grid

Reading:Handouts, Chapter 3Pletcher et al. (2011) pp. 152 – 162

10th Lecture 23

Homework 2 Due

Linear Systems of Equations• Iterative Methods: Multi-Grid

(cont’d), Conjugate Gradient

Reading:Handouts, Chapter 3Pletcher et al. (2011) pp. 166 – 175

13th

SPRING BREAK

15th

SPRING BREAK

17th

SPRING BREAK

20th

NO CLASS

22nd Lecture 24

Navier-Stokes Solvers• Incompressible Navier-Stokes

equations: conservative vsnon-conservative form,Lagrangian derivative

24th Lecture 25

Poisson and Heat Equations• Homework 3 overview (Part I)• Python Session: 2D

arrays/operators, fast indexing,Homework 3 Starter

27th Lecture 26

Navier-Stokes Solvers• Finite-Volume Approach,

Staggered Variable Collocation,Discretization for continuity andpressure gradient

Reading: Harlow & Welch (1965)

29th Lecture 27

Navier-Stokes Solvers• Suggested 2nd-order

discretization foradvection/diffusion terms

• Projection Method: FractionalStep Method

Reading:Chorin (1969), Kim & Moin (1985)

31st Lecture 28

Navier-Stokes Solvers• Vorticity-Streamfunction

(Ψ− ω) formulation (in 2D)

Apr 3rd

NO CLASS

5th Lecture 29

Navier-Stokes Solvers• Boundary conditions in Ψ− ω:

solenoidal condition(Mr. Danish Patel)

7th Lecture 30

Navier-Stokes Solvers• Compressible flow solvers• 1D Euler equations for

compressible flow

4

Page 5: ME614: C F DYNAMICS - Purdue Universityscalo/menu/...Spatial Discretization Python Session: \Introduction to Python" Reading: Python Tutorial, Sections 1 { 5 16th MARTIN LUTHER KING

Monday Wednesday Friday10th

NO CLASS

12th Lecture 31

Navier-Stokes Solvers“High-Order Block-SpectralMethods”Dr. Jean-Baptiste Chapelier

14th Lecture 32

Homework 3 Due

Navier-Stokes Solvers• Pseudo-spectral methods:

introduction to DFT

Reading: : Pope (2000), Section 6.4;Ferziger & Peric (2001), Section 3.10

17th Lecture 33

Navier-Stokes Solvers• Pseudo-spectral methods

(cont’d)• Python Session: Advection

diffusion equation with DFT

19th Lecture 34

Navier-Stokes Solvers“High-Order Block-SpectralMethods”Dr. Jean-Baptiste Chapelier

21st Lecture 35

Navier-Stokes Solvers• Fundamentals of Linear

Acoustics

24th Lecture 36

Navier-Stokes Solvers• Fundamentals of Linear

Acoustics (cont’d)

26th

NO CLASS

28th

NO CLASS

May 1st Lecture 37 3rd Lecture 38

CLASSES ENDApril 29th

5th Lecture 39

8th Lecture 40

Final Project Due(May 5, 2017)

10th Lecture 41

Grades Due:May 9th

12th Lecture 42

5

Page 6: ME614: C F DYNAMICS - Purdue Universityscalo/menu/...Spatial Discretization Python Session: \Introduction to Python" Reading: Python Tutorial, Sections 1 { 5 16th MARTIN LUTHER KING

References

A. J. Chorin (1969). ‘On the convergence of discrete approximations to the Navier-Stokes equations’. Math. Comp. 23:341– 353.

J. Ferziger & M. Peric (2001). Computational Methods for Fluid Dynamics. Springer.

Harlow & Welch (1965). ‘Numerical calculation of time-dependent viscous incompressible flow of fluid with free surfaces’8(21).

J. Kim & P. Moin (1985). ‘Application of a Fractional-Step Method to Incompressible Navier-Stokes Equations’. J. Comput.Phys. 59:308 – 323.

I. Orlanski (1976). Journal of Computational Physics 21:251 – 269.

U. Piomelli & C. Scalo (2010). ‘Subgrid-scale modelling in relaminarizing flows’. Fluid Dynamics Research 42(4):045510.

R. H. Pletcher, et al. (2011). Computational Fluid Mechanics and Heat Transfer. CRC Press.

S. Pope (2000). Turbulent flows. Cambridge Univ Pr.

6