GitHub - sahil-9915/CFDPython-fork: Fork of the CFDPython repo: https://github.com/barbagroup/CFDPython.

CFDPython Rewritten

This repository is a rewritten version of the original CFD Python by Barba & Forsyth. The version keeps most of the original code intact but has been rewritten with the most recent syntax and higher spatial discretization for the simulations. The original work is an educational resource for computational fluid dynamics and can be accessed at https://github.com/barbagroup/CFDPython. The practical module is aimed 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. The module was part of a course taught by Prof. Lorena Barba between 2009 and 2013 in the Mechanical Engineering department at Boston University (Prof. Barba since moved to the George Washington University).

Note: I will rewrite some of the lessons with JAX for High-Performance Computing.

Lessons

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.

  • Step 1 —Linear convection with a step-function initial condition (IC) and appropriate boundary conditions (BCs).
  • Step 2 —With the same IC/BCs, nonlinear convection.
  • CFL Condition —Exploring numerical stability and the Courant-Friedrichs-Lewy (CFL) condition.
  • Step 3 —With the same IC/BCs, diffusion only.
  • Step 4 —Burgers’ equation, with a saw-tooth IC and periodic BCs (with an introduction to Sympy).
  • Array Operations with NumPy
  • Step 5 —Linear convection in 2D with a square-function IC and appropriate BCs.
  • Step 6 —With the same IC/BCs, nonlinear convection in 2D.
  • Step 7 —With the same IC/BCs, diffusion in 2D.
  • Step 8 —Burgers’ equation in 2D
  • Step 9 —Laplace equation with zero IC and both Neumann and Dirichlet BCs.
  • Step 10 —Poisson equation in 2D.
  • Step 11 —Solves the Navier-Stokes equation for 2D cavity flow.
  • Step 12 —Solves the Navier-Stokes equation for 2D channel flow.

Dependencies

To use these lessons, you need Python 3, and the standard stack of scientific Python: NumPy, Matplotlib, SciPy, Sympy and Jupyter.

Attribution and Licensing

This project is based on the original CFDPython by Barba & Forsyth:

  • Content: (c) 2017 Lorena A. Barba, Gilbert F. Forsyth. Licensed under Creative Commons Attribution CC-BY 4.0
  • Code: Originally MIT, changed to BSD-3 clause on March 8, 2018
  • Citation: Barba, L.A., & Forsyth, G.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

License License: CC BY 4.0