|
1 | 1 |
|
2 | | -## Welcome to CFD Python |
| 2 | +## CFD Python |
| 3 | + |
| 4 | +**CFD Python**, a.k.a. the **12 steps to Navier-Stokes**, is a practical module for learning the basics of Computational Fluid Dynamics (CFD). |
| 5 | +The module was part of a course taught by [Prof. Lorena Barba](lorenabarba.com) between 2009 and 2013 in the Mechanical Engineering department at Boston University (Prof. Barba since moved to the George Washington University). |
| 6 | + |
| 7 | +The module assumes only basic programming knowledge (in any language) and some foundation in partial differential equations and fluid mechanics. The "steps" were inspired by ideas of Dr. Rio Yokota, who was a post-doc in Prof. Barba's lab, and the lessons were refined by Prof. Barba and her students over several semesters teaching the CFD course. |
| 8 | + |
| 9 | +Guiding students through these steps (without skipping any!), they learn many valuable lessons. The incremental nature of the exercises means they get a sense of achievement at the end of each assignment, and they feel they are learning with low effort. As they progress, they naturally practice code re-use and they incrementally learn programming and plotting techniques. As they analyze their results, they learn about numerical diffusion, accuracy and convergence. In about four weeks, they become moderately proficient programmers and are motivated to start discussing more theoretical matters. |
| 10 | + |
| 11 | +Lessons |
| 12 | +------- |
| 13 | +Steps 1–4 are in one spatial dimension. Steps 5–10 are in two dimensions (2D). Steps 11–12 solve the Navier-Stokes equation in 2D. Three "bonus" notebooks cover the CFL condition, array operations with NumPy, and defining functions in Python. |
| 14 | + |
| 15 | +* [Quick Python Intro](http://nbviewer.ipython.org/urls/github.com/barbagroup/CFDPython/blob/master/lessons/00_Quick_Python_Intro.ipynb) |
| 16 | +—For Python novices, this lesson introduces the numerical libraries (NumPy and Matplotlib), Python variables, use of whitespace, and slicing arrays. |
| 17 | +* [Step 1](http://nbviewer.ipython.org/urls/github.com/barbagroup/CFDPython/blob/master/lessons/01_Step_1.ipynb) |
| 18 | +—Linear convection with a step-function initial condition (IC) and appropriate boundary conditions (BCs). |
| 19 | +* [Step 2](http://nbviewer.ipython.org/urls/github.com/barbagroup/CFDPython/blob/master/lessons/02_Step_2.ipynb) |
| 20 | +—With the same IC/BCs, _nonlinear_ convection. |
| 21 | +* [CFL Condition](http://nbviewer.ipython.org/urls/github.com/barbagroup/CFDPython/blob/master/lessons/03_CFL_Condition.ipynb) |
| 22 | +* [Step 3](http://nbviewer.ipython.org/urls/github.com/barbagroup/CFDPython/blob/master/lessons/04_Step_3.ipynb) |
| 23 | +—With the same IC/BCs, _diffusion_ only. |
| 24 | +* [Step 4](http://nbviewer.ipython.org/urls/github.com/barbagroup/CFDPython/blob/master/lessons/05_Step_4.ipynb) |
| 25 | +—Burgers’ equation, with a saw-tooth IC and periodic BCs (with an introduction to Sympy). |
| 26 | +* [Array Operations with NumPy](http://nbviewer.ipython.org/urls/github.com/barbagroup/CFDPython/blob/master/lessons/06_Array_Operations_with_NumPy.ipynb) |
| 27 | +* [Step 5](http://nbviewer.ipython.org/urls/github.com/barbagroup/CFDPython/blob/master/lessons/07_Step_5.ipynb) |
| 28 | +—Linear convection in 2D with a square-function IC and appropriate BCs. |
| 29 | +* [Step 6](http://nbviewer.ipython.org/urls/github.com/barbagroup/CFDPython/blob/master/lessons/08_Step_6.ipynb) |
| 30 | +——With the same IC/BCs, _nonlinear_ convection in 2D. |
| 31 | +* [Step 7](http://nbviewer.ipython.org/urls/github.com/barbagroup/CFDPython/blob/master/lessons/09_Step_7.ipynb) |
| 32 | +—With the same IC/BCs, _diffusion_ in 2D. |
| 33 | +* [Step 8](http://nbviewer.ipython.org/urls/github.com/barbagroup/CFDPython/blob/master/lessons/10_Step_8.ipynb) |
| 34 | +—Burgers’ equation in 2D |
| 35 | +* [Defining Function in Python](http://nbviewer.ipython.org/urls/github.com/barbagroup/CFDPython/blob/master/lessons/11_Defining_Function_in_Python.ipynb) |
| 36 | +* [Step 9](http://nbviewer.ipython.org/urls/github.com/barbagroup/CFDPython/blob/master/lessons/12_Step_9.ipynb) |
| 37 | +—Laplace equation with zero IC and both Neumann and Dirichlet BCs. |
| 38 | +* [Step 10](http://nbviewer.ipython.org/urls/github.com/barbagroup/CFDPython/blob/master/lessons/13_Step_10.ipynb) |
| 39 | +—Poisson equation in 2D. |
| 40 | +* [Step 11](http://nbviewer.ipython.org/urls/github.com/barbagroup/CFDPython/blob/master/lessons/15_Step_11.ipynb) |
| 41 | +—Solves the Navier-Stokes equation for 2D cavity flow. |
| 42 | +* [Step 12](http://nbviewer.ipython.org/urls/github.com/barbagroup/CFDPython/blob/master/lessons/16_Step_12.ipynb) |
| 43 | +—Solves the Navier-Stokes equation for 2D channel flow. |
3 | 44 |
|
4 | | -Hello! Welcome to the **12 steps to Navier-Stokes**. This is a practical module that is used in the beginning of an interactive Computational Fluid Dynamics (CFD) course taught by [Prof. Lorena Barba](lorenabarba.com) between 2009 and 2013 at Boston University (Prof. Barba since moved to the George Washington University). The course assumes only basic programming knowledge (in any language) and of course some foundation in partial differential equations and fluid mechanics. The practical module was inspired by the ideas of Dr. Rio Yokota, who was a post-doc in Prof. Barba's lab, and has been refined by Prof. Barba and her students over several semesters teaching the course. The course is taught entirely using Python and students who don't know Python just learn as we work through the module. |
5 | 45 |
|
6 | 46 | ### Installing Python |
7 | 47 |
|
@@ -51,22 +91,3 @@ jupyter notebook |
51 | 91 |
|
52 | 92 | to start up a jupyter session in your browser! |
53 | 93 |
|
54 | | -Lessons |
55 | | -------- |
56 | | - |
57 | | -* [Quick Python Intro](http://nbviewer.ipython.org/urls/github.com/barbagroup/CFDPython/blob/master/lessons/00_Quick_Python_Intro.ipynb) |
58 | | -* [Step 1](http://nbviewer.ipython.org/urls/github.com/barbagroup/CFDPython/blob/master/lessons/01_Step_1.ipynb) |
59 | | -* [Step 2](http://nbviewer.ipython.org/urls/github.com/barbagroup/CFDPython/blob/master/lessons/02_Step_2.ipynb) |
60 | | -* [CFL Condition](http://nbviewer.ipython.org/urls/github.com/barbagroup/CFDPython/blob/master/lessons/03_CFL_Condition.ipynb) |
61 | | -* [Step 3](http://nbviewer.ipython.org/urls/github.com/barbagroup/CFDPython/blob/master/lessons/04_Step_3.ipynb) |
62 | | -* [Step 4](http://nbviewer.ipython.org/urls/github.com/barbagroup/CFDPython/blob/master/lessons/05_Step_4.ipynb) |
63 | | -* [Array Operations with NumPy](http://nbviewer.ipython.org/urls/github.com/barbagroup/CFDPython/blob/master/lessons/06_Array_Operations_with_NumPy.ipynb) |
64 | | -* [Step 5](http://nbviewer.ipython.org/urls/github.com/barbagroup/CFDPython/blob/master/lessons/07_Step_5.ipynb) |
65 | | -* [Step 6](http://nbviewer.ipython.org/urls/github.com/barbagroup/CFDPython/blob/master/lessons/08_Step_6.ipynb) |
66 | | -* [Step 7](http://nbviewer.ipython.org/urls/github.com/barbagroup/CFDPython/blob/master/lessons/09_Step_7.ipynb) |
67 | | -* [Step 8](http://nbviewer.ipython.org/urls/github.com/barbagroup/CFDPython/blob/master/lessons/10_Step_8.ipynb) |
68 | | -* [Defining Function in Python](http://nbviewer.ipython.org/urls/github.com/barbagroup/CFDPython/blob/master/lessons/11_Defining_Function_in_Python.ipynb) |
69 | | -* [Step 9](http://nbviewer.ipython.org/urls/github.com/barbagroup/CFDPython/blob/master/lessons/12_Step_9.ipynb) |
70 | | -* [Step 10](http://nbviewer.ipython.org/urls/github.com/barbagroup/CFDPython/blob/master/lessons/13_Step_10.ipynb) |
71 | | -* [Step 11](http://nbviewer.ipython.org/urls/github.com/barbagroup/CFDPython/blob/master/lessons/15_Step_11.ipynb) |
72 | | -* [Step 12](http://nbviewer.ipython.org/urls/github.com/barbagroup/CFDPython/blob/master/lessons/16_Step_12.ipynb) |
|
0 commit comments