This program implements Chorin's projection method to solve the incompressible Navier-Stokes equations on an unstructured triangular mesh using the finite volume method. The convection flux uses hybrid differencing to switch between centred and upwind, depending on the local Peclet number. The high-order upwind differencing employs a TVD scheme with the Superbee limiter. An inlet-outlet boundary condition is applied at the outlet to reduce numerical instabilities caused by reverse flow.
animation.mp4
root/
│
├── data/ # saved data folder
│ └── speed.mp4 # speed animation
│
├── mesh/ # mesh folder
│ ├── body.txt # body coordinates (user input)
│ ├── body.py # generates body.txt
│ ├── geo.py # generates mesh.geo from body.txt
│ ├── su2.py # generates mesh.su2 from mesh.geo
│ └── mesh.f90 # generates mesh.txt from mesh.su2
│
├── mods/ # modules folder
│ ├── mod_mesh.f90 # mesh type and procedures
│ ├── mod_config.f90 # configuration type and procedures
│ ├── mod_solve.f90 # solver procedures
│ └── mod_utils.f90 # utility procedures
│
├── run.sh # script to run program
├── main.f90 # script to run solver
├── read.py # script to read and plot saved data
├── config.txt # configuration for solver (user input)
└── requirements.txt # dependencies for solver
Clone repository:
git clone https://github.com/obdwinston/Incompressible-Flow.git && cd Incompressible-FlowExecute program (for macOS users):
chmod +x run.sh && ./run.shFor Windows users, you need to modify run.sh accordingly before executing the program.
Additional notes:
- For custom bodies, coordinates in
body.txtshould bex yspace-delimited and in clockwise order, with no repeated points or intersecting lines. Thebody.pyscript will automatically scale the body to unit length. - To visualise the generated mesh, you need to first download Gmsh. After installation, open the
.geofile and selectMesh > 2Dto show the mesh. For subsequent changes to the.geofile, selectGeometry > Reload Scriptbefore visualising the changes withMesh > 2D.
| Re | Diameter | Speed | Viscosity |
|---|---|---|---|
| 100 | 0.2 m | 5.0 m/s | 0.01 m2/s |
verification.mp4
[1] Moukalled et al. (2016). The Finite Volume Method in Computational Fluid Dynamics.
[2] Mazumder (2016). Numerical Methods for Partial Differential Equations.
[3] Versteeg et al. (2015). An Introduction to Computational Fluid Dynamics.
[4] Prof. Saad's Computational Fluid Dynamics Lecture Series.
[5] SimFlow's Documentation on Inlet-Outlet Boundary Condition.

