Spring 2019 (Jan 7 – April 23, 2018)

**Instructor: **Prof. Tony Saad**Email:** tony.saad@chemeng.utah.edu**Phone Number: **801 585 0344**Office Hours: **Thursdays from 1:00 PM to 3:00 PM, by appointment, or if door is open**Office Location: **MEB 2286

## Course Catalog Description

Survey of approaches including time accurate and steady-state methods, explicit and implicit techniques. Eulerian and Lagrangian methods, laminar and turbulent flow, compressible and incompressible approaches, projection methods, stability considerations, etc. Application of CFD to mixing, heat transfer and reaction. Meets with CH EN 5353.

Cross listed with ME EN6720.

## Course Objectives

Computational fluid dynamics has come to mean a variety of things depending on who you ask. At its core, however, CFD deals with calculation of a fluid flow. Whether the flow has chemical reactions, heat transfer, structures, etc… as long as there is fluid flow – you are doing CFD. Therefore it makes sense to focus on calculation of the fluid flow in a basic CFD course. We will cover and review the following concepts:

- Review of transport theory, conservation laws, and the Navier-Stokes equations
- Overview of advection/dispersion and diffusionHyperbolic Equations
- Parabolic Equations
- Elliptic equations
- Putting it all together: the Navier-Stokes equations
- Finite difference/finite volume methods
- Verification and validation

## Lectures

You can find all Jupyter notebooks related to this course @ https://github.com/saadtony/uCFD. You can also view them cleanly at ttps://nbviewer.jupyter.org/github/saadtony/uCFD

Lecture # | Topic | Handouts | Jupyter Notebooks |
Homework |
---|---|---|---|---|

Part I |
||||

1 | Motivationvideo – slides |
Harlow’s scientific memoir NSF Fluid Mechanics films IIHR Fluid Mechanics films Anderson Chapter 1 |
||

2 | The Navier-Stokes Equations – Part 1video – slides (includes all parts) |
Anderson Chapter 2 White Chapter 3 White Chapter 4 |
||

3 | The Navier-Stokes Equations – Part 2video – slides (see previous) |
(see previous) | HW1 | |

4 | Review of Finite Difference Methods (FDM)video – slides |
Pletcher Chapter 3 Anderson Chapter 4 |
1D Advection FDM | |

5 | Continuation of previous lecture video |
|||

6 | FDM for a Model Equation: Linear Advection Diffusion Error analysis, Stability, consistency, and convergence. Two-Dimensional Advection Equationvideo – slides |
2D Advection FDM | HW2 | |

7 | Solving the Navier-Stokes Equations using the Vorticity-Streamfunction Formulationvideo – slides |
|||

8 | Continuation of previous lecture video |
2D Vorticity-Streamfunction Code | ||

9 | Solving the Navier-Stokes using Primitive Variables: The Projection Method (FDM)video – slides |
Project 1 | ||

10 | Continuation of previous lecture video |
2D Navier-Stokes Solver using the Finite Difference Method (lid-driven cavity example) | ||

11 | The Finite Volume Method video – slides |
|||

12 | Finite Volume Navier Stokes on a Staggered Grid video – slides |
|||

13 | Programming the Navier-Stokes FVM – Staggered Formulation video |
2D Navier-Stokes FVM Staggered | ||

14 | Project 1 presentations + intro to iterative solvers (see next lecture) | HW 3 | ||

15 | Iterative Solvers video – no audio 🙁 – slides |
Strang – Ch 7 | Using sparse iterative solvers in Python | Project 2 |

16 | Guest Lecture: Parallel Computing for CFD (by Prof. James C. Sutherland) video – slides |
|||

17 | Numerical Phenomena (advection, diffusion, dispersion) video – slides |
|||

18 | Hyperbolic Equations 1 video – slides |
|||

19 | Hyperbolic Equations 2 video – slides (see previous) |
|||

Part II |
Core Algorithms and Analysis of Numerical Methods |
|||

Linear Solvers 1 | ||||

Linear Solvers 2 | ||||

Hyperbolic Equations 1 | ||||

Hyperbolic Equations 2 | ||||

Hyperbolic Equations 3 | ||||

The Euler Equations 1 | ||||

The Euler Equations 2 | ||||

Revisiting the Advection-Diffusion Equation | ||||

Elliptic Equations 1 | ||||

Elliptic Equations 2 | ||||

Advanced NS Solvers | ||||

Other CFD Methods | ||||

Survey of commercial software | ||||

Part III |
Modeling & Complex Flows |
|||

Turbulent flows 1 | ||||

Turbulent flows 2 | ||||

Multiphase flows 1 | ||||

Multiphase flows 2 | ||||

Reacting flows 1 | ||||

Reacting flows 2 |

## Other Resources

You can find a collection of useful jupyter notebooks on Dr. Saad’s github repository: http://www.github.com/saadtony

## Python

This class will make exclusive use of Python – a modern programming language that is suitable for scientific computing. Python is easy to use and – most importantly – free!

We will also focus on using Python within Jupyter Notebooks: a great way to combine text, math, and programming into one document that is edited and executed in a web browser (See this example). You will learn about that in the class. You will also have access to python through your web browser (after the class starts). If you want to download your own Python + Jupyter Notebook, then download the Anaconda distribution here.

Please go here for an easy tutorial on Python by Prof. Saad. In addition, Prof. Saad will hold a few in-class lectures on learning Python.

### Python programming:

Python is very ubiquitous and a google search can usually turn up answers to many of your questions. But here are a few ideas of places to look if you want to learn python:

- General Python programming resources:
- CodeAcademy Python class and the you-tube version
- Google’s Python class
- Python for data science
- Trinket is an online programming platform that provides some pretty good python documentation/tutorials.
- Professor Tony Saad has prepared a set of introductory material for python available here.

- A brief tutorial on
**arrays in python**that includes discussion of python lists as well as numpy arrays. **Python has a vast number of libraries**to simplify many tasks. Among those that you will probably use regularly:- matplotlib provides very powerful (but sometimes challenging to use) plotting capabilities. A quick way to get started on a plot is to look at the matplotlib gallery to obtain code to generate a plot like the one you want to create. Here is another great resource on matplotlib.
- NumPy provides really powerful array handling capabilities like those in Matlab to allow you to create and manipulate arrays of data. It also has some algorithms that operate on the data. We will use numpy extensively in this class.
- SciPy has a large number of algorithms such as interpolation, quadrature (numerical integration), optimization, ODE solvers, linear algebra tools, etc. There is some duplication between NumPy and SciPy.
- pandas provides a lot of data analysis tools. This includes tools to read/write data, analyze and manipulate data, etc.
- SymPy provides support for symbolic mathematics within Python.

- If you are a
**Matlab user**, here are a few resources:- Numpy for Matlab users (I find this quite useful as a general summary of common Python operations)
- Python primer for Matlab users

### Jupyter Notebooks:

Jupyter notebooks allow you to run Python code fragments interspersed with markup text including equations, plots, etc. This is really useful for communicating results, and will be the format required for homework submission.

You will need to familiarize yourself with Jupyter notebooks since you will be submitting homework as a notebook.

Here is a link to a Jupyter notebook that provides a crash course on some of the key features of a notebook.

#### Web-Based Access for Jupyter Notebooks:

There are two options for web-based access to Jupyter

- You should have access to chen6355.chpc.utah.edu using your University login credentials for the duration of the semester.
- The chemical engineering virtual machine pool. Log in with your ICC credentials and use the UG (not graduate) VM pools. This will open a full windows machine where you can launch jupyter from the start menu.

These are great options if you have consistent web access and don’t want to perform a local python installation on your own laptop.

I will use your utah.edu Email address to communicate with you and send information to class. Please make sure that you have access to your utah email address.

## Homework

- Homework is a fundamental piece of the learning process. It will help you strengthen the concepts you learned in class and apply them to new problems.
- The goal of homework is to get you to familiarize yourself with the nomenclature and the types of problems that can be solved with numerical methods.
- Homework assignments will be posted on the homework page of the course web site. Unless otherwise stated, homework is due by the
*beginning of class*on the date indicated on the schedule. - Solutions will be posted on the class web site shortly after the due date.
- Feel free to “work together” on homework assignments. Discuss the various solutions methods and attempt to learn or fill deficits in your understanding of the subject matter. However, you must submit your own original work. Please do not cross the line of plagiarism and cheating. Such behavior will not be tolerated.
- Homework assignments must be submitted electronically via the course web page. You should write a report describing the problem, your solution, and presenting your results.

## Grading policy (tentative)

- 20% each midterm exam (two midterms)
- 25% Homework
- 10% In-Class comprehension quizzes
- 25% Final exam

Grades will be assigned on the following scale, normalized to the highest student in the class (who, by definition, is 100%)

- 92< A ≤ 100, 89 < A- ≤ 92
- 86 < B+ ≤ 89, 81 < B ≤ 86, 78 < B- ≤ 81
- 75 < C+ ≤ 78, 70 < C ≤ 75, 67 < C- ≤ 70
- 64 < D+ ≤ 67, 59 < D ≤ 64, 56 < D- ≤ 59
- E ≤ 56

I reserve the right to adjust this scale downward if I deem it necessary.

## Addressing Sexual Misconduct

Title IX makes it clear that violence and harassment based on sex and gender (which includes sexual orientation and gender identity/expression) is a Civil Rights offense subject to the same kinds of accountability and the same kinds of support applied to offenses against other protected categories such as race, national origin, color, religion, age, status as a person with a disability, veteran’s status or genetic information. If you or someone you know has been harassed or assaulted, you are encouraged to report it to the Title IX Coordinator in the Office of Equal Opportunity and Affirmative Action, 135 Park Building, 801-581-8365, or the Office of the Dean of Students, 270 Union Building, 801-581-7066. For support and confidential consultation, contact the Center for Student Wellness, 426 SSB, 801-581-7776. To report to the police, contact the Department of Public Safety, 801-585-2677(COPS).

## Academic Misconduct

All instances of academic misconduct will be handled in accordance with the Student Code (http://regulations.utah.edu/academics/6-400.php).

## Students with Disabilities (ADA)

The University of Utah seeks to provide equal access to its programs, services, and activities for people with disabilities. If you will need accommodations in this class, reasonable prior notice needs to be given to the Center for Disability Services, 162 Olpin Union Building, (801) 581-5020. CDS will work with you and the instructor to make arrangements for accommodations. All written information in this course can be made available in an alternative format with prior notification to the Center for Disability Services.