CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   Supersonic Wedge Question (

Foamaholic September 2, 2013 16:19

Supersonic Wedge Question
Hello all,

I'm very new to OpenFOAM, so please bear with me and my beginner question:

I have run a few of the tutorial cases that come with the OpenFOAM installation, including the wedge15Ma5 tutorial for compressible flow and the rhoCentralFoam solver. However, I want to do more than just run and modify the tutorials that OpenFOAM comes with, so to practice creating new geometries of my own, I used gmsh to create a 15 degree wedge like the one in the wedge15Ma5 tutorial.

I copied the wedge15Ma5 tutorial so that I would have a correct (or so I hoped) setup, put my gmsh mesh into the copied case structure, and converted the mesh using the gmshToFoam command so that OpenFOAM could read it. Then, since I am running this case as a 3-D simulation instead of a 2-D simulation, I altered the p, T, U, and boundary files so that the front and back faces of my geometry no longer had the "empty" boundary condition, but had the "slip" boundary condition instead.

I applied rhoCentralFoam to my case, and while the solver runs and gives me a result, the result seems wrong to me; after OpenFOAM finishes running the solver, I see no shock wave in paraView, even though the shock wave is clearly visible when I run the wedge15Ma5 tutorial.

Sorry for the long description. Can anyone clue me in to what I'm doing wrong?

Mojtaba.a September 3, 2013 08:46


If you are going to make an axis symmetric mesh try the following procedures step by step:

1) Make a 2D (one cell thick mesh) using your desired mesh program.
2) the axis of symmetry has got to be parallel to the XY-plane
3) the boundary which is going to be the symmetry axis has to be a straight line
4) the "front" and "back" are in one patch, i.e front&Back
5) the domain does not cross y=0
6) change writePresicion value in controlDict to 12
7) use gmshToFoam
8) makeAxialMesh -axis symmetry -wedge front&Back
9) copy polymesh located in folder 1 into constant
10) collapseEdges -overwrite
11) change writePresicion value back to 6
12) change wedge boundary condition names to the desired ones and delete the old empty patch
13) use checkMesh to see if everything is ok.

*** Do not forget that Mesh is not in the middle of the origin. It has been translated with the value of thickness of the extruded cells.

And here is the sample collapseDict file:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: |
| \\/ M anipulation | |
version 2.0;
format ascii;
class dictionary;
object collapseDict;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

// Edges shorter than this absolute value will be merged
minimumEdgeLength 1e-10;

// The maximum angle between two edges that share a point attached to
// no other edges
maximumMergeAngle 180;

// ************************************************** *********************** //

I hope it helps a bit,
Do not hesitate to ask more questions.


Foamaholic September 3, 2013 18:01


Originally Posted by Mojtaba.a (Post 449552)

If you are going to make an axis symmetric mesh try the following procedures step by step:


Thanks for your help Mojtaba, but if I understand you correctly, I'm not trying to make an axis symmetric mesh. I just want to model a half-wedge like the one in the tutorial I mentioned.

But I do have another question: the tutorial in Openfoam, as well as the tutorials I've seen elsewhere on the internet, use a mesh made of many small squares in order to run this simulation. However, gmsh creates a mesh of many small triangles. Would gmsh's different mesh shape affect Openfoam's solution?

Foamaholic September 3, 2013 19:51

Problem Solved! When I originally made my computational domain, its -x and -y dimensions were much greater than its -z dimension. So, I created a new domain with approximately equal -x -y and -z dimensions. Now, I get the results I was expecting. I'm not sure why this happened, but I'm not one to argue with success.

Thanks for you help and support.

All times are GMT -4. The time now is 22:40.