Skip to content

obdwinston/Compressible-Flow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Program Overview

This program implements a Riemann solver for the Euler equations on an unstructured triangular mesh using the finite volume method. The HLLC fluxes are computed by solving the x-split Riemann problem at each face, taking advantage of the rotational invariance of the flux vectors. The solver employs an explicit multi-stage Runge-Kutta temporal discretisation, along with a multi-slope MUSCL gradient reconstruction and van Albada limiter to ensure stability and accuracy, especially near discontinuities.

Program Files

root/
│
├── data/                   # saved data folder
│   ├── cp.png              # pressure coefficient plot
│   └── mach.mp4            # mach number 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_flux.f90        # HLLC flux 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/Compressible-Flow.git && cd Compressible-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

Diamond Airfoil

Half-Angle Mach Number Angle of Attack
15° 2

mach.mp4

NACA Airfoil

NACA Designation Mach Number Angle of Attack
0012 0.8 1.25°
mach.mp4

Solver Theory

References

[1] Toro (2009). Riemann Solvers and Numerical Methods for Fluid Dynamics: A Practical Introduction.
[2] Blazek (2015). Computational Fluid Dynamics: Principles and Applications.
[3] Hou et al. (2015). An Efficient Unstructured MUSCL Scheme for Solving the 2D Shallow Water Equations.
[4] Curcic (2021). Modern Fortran: Building Efficient Parallel Applications.
[5] Anderson (2020). Modern Compressible Flow with Historical Perspective.
[6] Pulliam (1986). Artificial Dissipation Models for the Euler Equations.

About

Riemann solver for compressible flows.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published