Skip to content

obdwinston/Incompressible-Flow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Program Overview

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

Program Files

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-Flow

Execute program (for macOS users):

chmod +x run.sh && ./run.sh

For Windows users, you need to modify run.sh accordingly before executing the program.

Additional notes:

  1. For custom bodies, coordinates in body.txt should be x y space-delimited and in clockwise order, with no repeated points or intersecting lines. The body.py script will automatically scale the body to unit length.
  2. To visualise the generated mesh, you need to first download Gmsh. After installation, open the .geo file and select Mesh > 2D to show the mesh. For subsequent changes to the .geo file, select Geometry > Reload Script before visualising the changes with Mesh > 2D.

Solver Verification

Circular Cylinder

Re Diameter Speed Viscosity
100 0.2 m 5.0 m/s 0.01 m2/s
verification.mp4

Solver Theory

References

[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.

About

Projection method for incompressible flows.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published