Computational Fluid Dynamics
IIT Ghandhinagar: Rachit, Himanshu, Vinay, Yogesh, Neelesh
TIFR-CAM: Anant Diwakar, Deep Ray
- Linear hyperbolic conservation laws
- Non-linear conservation laws
- High order methods
- Linear hyperbolic systems
- Euler equations in 1-D
- Flux vector splitting schemes
- Flux difference splitting schemes (Approximate Riemann solver)
- JST, SLIP and CUSP schemes
- Low mach number schemes
- Compressible flow equations
- Finite volume method on unstuctured grids
- Convergence acceleration techniques
Exact solution for shock tube problem
Here are the steps to run the exact solution code from book of Toro. This requires fortran compiler and gnuplot. The five test cases have been setup in different files
test1.ini etc. The output solution is written into the file
e1rpex.out which contains x coordinate, density, velocity, pressure and internal energy (basically temperature).
gfortran E1RPEX.F -o E1RPEX
./E1RPEX < test1.ini
This creates postscript file
allplot.ps which can be opened to see the solution.
1-D finite volume code for shock tube problem
Download the three files given above. This code solves Euler equations in 1-D for given initial condition. It has kinetic split fluxes and reconstruction using minmod limiter. You can run it in first order or second order mode. The initial condition is based on test1.ini conditions so we can compare with exact solution.
The postscript file contains numerical and exact solution. Run it for
first order and then for
second order and see the solution in each case. You have to set the variable
order in function
FVProblem::FVProblem () which is the constructor of the
Here are the steps to compile serial version. I am going to install it into /Users/praveen/Applications; modify it according to your actual installation location. In the following
$ denotes the shell prompt in the terminal where you type in your commands.
$ cd /Users/praveen/Applications
$ tar zxvf SU2v2.0.tgz
$ cd SU2v2.0
$ ./configure --prefix=`pwd`
$ make install
Add following lines to your
The part in red may be different in your case; modify above lines according to your installation path. Then open new terminal and check the following variables have been defined.
$ echo $SU2_RUN
$ echo $SU2_HOME
If you now type
SU2_CFD you should get following result
There is no configuration file!!
Press any key to exit...
If you get different result then you made a mistake in the above steps.
Meshing using Gmsh
Gmsh is an excellent open source meshing tool for unstructured grids. You can get binaries for most common platforms from their website.
To try the diamond airfoil case, download the Gmsh script from here. You can open it in Gmsh and use the gui to do mesh generation.
Or you can do it from the command line
gmsh -2 diamond.geo
which creates the mesh file called
diamond.msh. You can open this in Gmsh to see the mesh.
We now need to convert the msh file to su2 format. I borrowed a code I found online and Anant Diwakar made some small modifications. You can get the converter here. Compile the converter and run it as shown below. You have to input the filename of msh file without the msh extension as shown in red below.
$ gfortran gmsh2su2d.f90 -o gmsh2su2d
Gmsh2SU2: Converts a Gmsh mesh file to SU2 format.
(Input must be in Gmsh version 2.0 ascii format.
Output is in SU2 format.)
Input Gmsh filename, excluding the .msh suffix
Opening the Gmsh file
MeshFormat: 2.2 0 8
Name 2 -> airfoil
Name 3 -> farfield
Name 1 -> domain
Nodes written 5306
Total Gmsh elements to be read in: 10612
Creating the .su2 files
Triangle boundaries: 10352
Done su2 file.
This creates the file
diamond.su2 which can be used in SU2.