README.md

November 6, 2024 · View on GitHub

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-AngleMach NumberAngle of Attack
15°2

https://github.com/user-attachments/assets/08b6ac5a-815d-43f4-acbe-edc91b71cd5b

NACA Airfoil

NACA DesignationMach NumberAngle of Attack
00120.81.25°

https://github.com/user-attachments/assets/07ff9b2c-39f8-4928-aa63-1daaa86eb329

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.