{"id":13407864,"url":"https://github.com/barbagroup/CFDPython","last_synced_at":"2025-03-14T12:31:46.825Z","repository":{"id":14033659,"uuid":"16735928","full_name":"barbagroup/CFDPython","owner":"barbagroup","description":"A sequence of Jupyter notebooks featuring the \"12 Steps to Navier-Stokes\" http://lorenabarba.com/  ","archived":false,"fork":false,"pushed_at":"2024-03-19T16:46:54.000Z","size":24864,"stargazers_count":3425,"open_issues_count":27,"forks_count":1185,"subscribers_count":267,"default_branch":"master","last_synced_at":"2024-10-29T15:29:30.531Z","etag":null,"topics":["cfd","fluid-dynamics","jupyter-notebook","navier-stokes-equations","python"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/barbagroup.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-02-11T15:52:40.000Z","updated_at":"2024-10-29T10:23:10.000Z","dependencies_parsed_at":"2024-10-26T03:23:12.510Z","dependency_job_id":"52e6ff01-d9a5-4061-9535-9c4f9a407f09","html_url":"https://github.com/barbagroup/CFDPython","commit_stats":{"total_commits":217,"total_committers":13,"mean_commits":"16.692307692307693","dds":0.4838709677419355,"last_synced_commit":"92c8220070824e95402d83f193c4e496f4308dcb"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barbagroup%2FCFDPython","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barbagroup%2FCFDPython/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barbagroup%2FCFDPython/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barbagroup%2FCFDPython/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/barbagroup","download_url":"https://codeload.github.com/barbagroup/CFDPython/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243578194,"owners_count":20313778,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cfd","fluid-dynamics","jupyter-notebook","navier-stokes-equations","python"],"created_at":"2024-07-30T20:00:49.117Z","updated_at":"2025-03-14T12:31:45.963Z","avatar_url":"https://github.com/barbagroup.png","language":"Jupyter Notebook","readme":"\n# CFD Python\n\n\u003e Please cite as: Barba, Lorena A., and Forsyth, Gilbert F. (2018). CFD Python: the 12 steps to Navier-Stokes equations. _Journal of Open Source Education_, **1**(9), 21, https://doi.org/10.21105/jose.00021\n\n[![DOI](https://jose.theoj.org/papers/10.21105/jose.00021/status.svg)](https://doi.org/10.21105/jose.00021)\n\n**CFD Python**, a.k.a. the **12 steps to Navier-Stokes**, is a practical module for learning the foundations of Computational Fluid Dynamics (CFD) by coding solutions to the basic partial differential equations that describe the physics of fluid flow.\nThe module was part of a course taught by [Prof. Lorena Barba](http://lorenabarba.com) between 2009 and 2013 in the Mechanical Engineering department at Boston University (Prof. Barba since moved to the George Washington University).\n\nThe module assumes only basic programming knowledge (in any language) and some background 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 until 2011, and the lessons were refined by Prof. Barba and her students over several semesters teaching the CFD course. \nWe wrote this set of Jupyter notebooks in 2013 to teach an intensive two-day course in Mendoza, Argentina.\n\nGuiding 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. \nIn about four weeks of a regularly scheduled course, they become moderately proficient programmers and are motivated to start discussing more theoretical matters.\n\n## How to use this module\n\nIn a regular-session university course, students can complete the **CFD Python** lessons in 4 to 5 weeks. \nAs an intensive tutorial, the module can be completed in two or three full days, depending on the learner's prior experience. \nThe lessons can also be used for self study. \nIn all cases, learners should follow along the worked examples in each lesson by re-typing the code in a fresh Jupyter notebook, maybe taking original notes as they try things out. \n\nLessons\n-------\n\u003e Launch an interactive session with this module using the Binder service:\n[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/barbagroup/CFDPython/master)\n\nSteps 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 for numerical stability, array operations with NumPy, and defining functions in Python.\n\n* [Quick Python Intro](http://nbviewer.jupyter.org/github/barbagroup/CFDPython/blob/master/lessons/00_Quick_Python_Intro.ipynb)\n—For Python novices, this lesson introduces the numerical libraries (NumPy and Matplotlib), Python variables, use of whitespace, and slicing arrays.\n* [Step 1](http://nbviewer.jupyter.org/github/barbagroup/CFDPython/blob/master/lessons/01_Step_1.ipynb)\n—Linear convection with a step-function initial condition (IC) and appropriate boundary conditions (BCs).\n* [Step 2](http://nbviewer.jupyter.org/github/barbagroup/CFDPython/blob/master/lessons/02_Step_2.ipynb)\n—With the same IC/BCs, _nonlinear_ convection.\n* [CFL Condition](http://nbviewer.jupyter.org/github/barbagroup/CFDPython/blob/master/lessons/03_CFL_Condition.ipynb)\n—Exploring numerical stability and the Courant-Friedrichs-Lewy (CFL) condition.\n* [Step 3](http://nbviewer.jupyter.org/github/barbagroup/CFDPython/blob/master/lessons/04_Step_3.ipynb)\n—With the same IC/BCs, _diffusion_ only.\n* [Step 4](http://nbviewer.jupyter.org/github/barbagroup/CFDPython/blob/master/lessons/05_Step_4.ipynb)\n—Burgers’ equation, with a saw-tooth IC and periodic BCs (with an introduction to Sympy).\n* [Array Operations with NumPy](http://nbviewer.jupyter.org/github/barbagroup/CFDPython/blob/master/lessons/06_Array_Operations_with_NumPy.ipynb)\n* [Step 5](http://nbviewer.jupyter.org/github/barbagroup/CFDPython/blob/master/lessons/07_Step_5.ipynb)\n—Linear convection in 2D with a square-function IC and appropriate BCs.\n* [Step 6](http://nbviewer.jupyter.org/github/barbagroup/CFDPython/blob/master/lessons/08_Step_6.ipynb)\n—With the same IC/BCs, _nonlinear_ convection in 2D.\n* [Step 7](http://nbviewer.jupyter.org/github/barbagroup/CFDPython/blob/master/lessons/09_Step_7.ipynb)\n—With the same IC/BCs, _diffusion_ in 2D.\n* [Step 8](http://nbviewer.jupyter.org/github/barbagroup/CFDPython/blob/master/lessons/10_Step_8.ipynb)\n—Burgers’ equation in 2D\n* [Defining Functions in Python](http://nbviewer.jupyter.org/github/barbagroup/CFDPython/blob/master/lessons/11_Defining_Function_in_Python.ipynb)\n* [Step 9](http://nbviewer.jupyter.org/github/barbagroup/CFDPython/blob/master/lessons/12_Step_9.ipynb)\n—Laplace equation with zero IC and both Neumann and Dirichlet BCs.\n* [Step 10](http://nbviewer.jupyter.org/github/barbagroup/CFDPython/blob/master/lessons/13_Step_10.ipynb)\n—Poisson equation in 2D.\n* [Step 11](http://nbviewer.jupyter.org/github/barbagroup/CFDPython/blob/master/lessons/14_Step_11.ipynb)\n—Solves the Navier-Stokes equation for 2D cavity flow.\n* [Step 12](http://nbviewer.jupyter.org/github/barbagroup/CFDPython/blob/master/lessons/15_Step_12.ipynb)\n—Solves the Navier-Stokes equation for 2D channel flow.\n\n\n\n\n## Dependencies\n\nTo use these lessons, you need Python 3, and the standard stack of scientific Python: NumPy, Matplotlib, SciPy, Sympy. And of course, you need [Jupyter](http://jupyter.org)—an interactive computational environment that runs on a web browser.\n\nThis mini-course is built as a set of [Jupyter notebooks](https://jupyter-notebook.readthedocs.org/en/latest/notebook.html) containing the written materials and worked-out solutions on Python code. To work with the material, we recommend that you start each lesson with a fresh new notebook, and follow along, typing each line of code (don't copy-and-paste!), and exploring by changing parameters and seeing what happens. \n\n\n\u003cdetails\u003e\n  \u003csummary\u003e Installing via Anaconda \u003c/summary\u003e\n  \u003cbr\u003e\nWe *highly* recommend that you install the [Anaconda Python Distribution](http://docs.continuum.io/anaconda/install). It will make your life so much easier. \nYou can download and install Anaconda on Windows, OSX and Linux. \n\nAfter installing, to ensure that your packages are up to date, run the following commands in a terminal:\n\n```Bash\nconda update conda\nconda update jupyter numpy sympy scipy matplotlib\n```\n\nIf you prefer Miniconda (a mini version of Anaconda that saves you disk space), install all the necessary libraries to follow this course by running the following commands in a terminal:\n\n```Bash\nconda update conda\nconda install jupyter\nconda install numpy scipy sympy matplotlib\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e Without Anaconda \u003c/summary\u003e\n  \u003cbr\u003e\nIf you already have Python installed on your machine, you can install Jupyter using pip:\n\n```Bash\npip install jupyter\n```\n\nPlease also make sure that you have the necessary libraries installed by running\n\n```Bash\npip install numpy scipy sympy matplotlib\n```\n\u003c/details\u003e\n\n\n\n## How to contribute to CFD Python\n\nWe accept contributions via pull request—in fact, several users have already submitted pull requests making corrections or small improvements. You can also open an issue if you find a bug, or have a suggestion. \n\n## Copyright and License\n\n(c) 2017 Lorena A. Barba, Gilbert F. Forsyth. All content is under Creative Commons Attribution [CC-BY 4.0](https://creativecommons.org/licenses/by/4.0/legalcode.txt), and all [code is under BSD-3 clause](https://github.com/engineersCode/EngComp/blob/master/LICENSE) (previously under MIT, and changed on March 8, 2018). \n\nWe are happy if you re-use the content in any way!\n\n[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause) [![License: CC BY 4.0](https://img.shields.io/badge/License-CC%20BY%204.0-lightgrey.svg)](https://creativecommons.org/licenses/by/4.0/)\n\n","funding_links":[],"categories":["Computational Fluid Dynamics","Educational","Jupyter Notebook"],"sub_categories":["Learning","Notebooks"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarbagroup%2FCFDPython","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbarbagroup%2FCFDPython","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarbagroup%2FCFDPython/lists"}