CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   Steady State solver for High Mach No flows (

mecbe2002 April 20, 2010 10:23

Steady State solver for High Mach No flows
Hi all,

I want to solve supersonic(M=2.5) & transonic(M=0.9) flow over Body-Tail missile configuration.

Only one steady state compressible flow solver is available in OpenFOAM which is "rhoSimpleFoam", but when i used this for supersonic case, the solution starts diverging after few iterations.
I searched in the forum, but not able to get any answer for this problem.

sonicFoam is good for transonic and supersonic case but this is a transient solver, so using it to solve a steady flow problem takes a lot of time. So is there a way to convert the "sonicFoam" to steady flow solver.

Answer for this question will help many people, because i searched in the forum and saw no solid answer.


mecbe2002 April 21, 2010 01:19

Hi all,

Any answers...


olesen April 21, 2010 03:34


Originally Posted by mecbe2002 (Post 255545)
Hi all,

Any answers...


Did you try heavily under-relaxing the density (eg, with 0.05) to prevent the pressure corrector from wracking havoc? Adding min/max bounds for rho might help too.

mecbe2002 April 21, 2010 03:39

Hi Olesen,

Thank you very much for the reply. The under relaxation i used for rho is 0.01. But i didn't bound rho. Can you tell the syntax for that.

olesen April 21, 2010 05:50


Originally Posted by mecbe2002 (Post 255555)
Hi Olesen,

Thank you very much for the reply. The under relaxation i used for rho is 0.01. But i didn't bound rho. Can you tell the syntax for that.

Somewhere near the beginning (eg, in createFields.H)


    dimensionedScalar rhoMax

    dimensionedScalar rhoMin

Elsewhere (eg, near the bottom of pEqn.H)


rho = thermo.rho();
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);

AFAIK the normal 'bound()' function can only be used to enforce a lower bound.

cboss April 21, 2010 06:03

I am also very interested in solving transonic and supersonic problems in OF. I have also never got the rhoSimpleFoam solver working on these problems, but also did not spend much time on it.

Just a remark:
Genrally I also use sonicFoam for these problems. Perhaps it is obvious for most users, but if the simulation is started with upwind discretization of the convection terms, the timestep can be increased to speed it up a little. Mainly up to Courant-Number = 10 is stable in my calculations.


mecbe2002 April 21, 2010 07:04


I made the changes to the code and compiled it. But still the solution diverges after few iterations. Is there any solutions?

Is there a way to convert "sonicFoam" as steady state solver.


truong_nm April 24, 2010 12:07

Hi Foamers,

I experienced sonicFoam for subsonic/transonic cases. I regret that there is no adaptating timestep :mad: I ran with very low timestep 1e-08 and experienced very very long computations for a really simple 2D airfoil. If you can share you experience, that would be nice :D
Concerning rhoSimpleFoam, there is a boolean 'transonic' that you can put in your fvSolution file with SIMPLE settings. That will change the way it solves the equations (because transonic equations are strongly non-linear). But I am not sure rhoSimpleFoam will solve your supersonic flows :rolleyes:
Hope it'll help, don't forget to update your results :)

mecbe2002 April 26, 2010 15:33


I used sonicFoam to solve the problem, its working for comparatively large time step i.e. Courant No < 10. Using upwind scheme for divergence operator.

But i compared the results with the fluent, the velocity is matching but the pressure is under predicted by OpenFoam (50% less).

Wat may be the problem.

swahono February 23, 2012 19:51

I experienced the same problem with getting a converged solution with OpenFOAM when simulating a supersonic fully expanded jet on a turbojet engine nozzle (Mach 1 at Nozzle exit plane). I used a 2D axisymmetric model.

However, I managed to get it to converged lately using rhoSimpleFoam using the following strategies:

1. Ramp up the inlet mass flow rate very slowly (in my case I ramp up the mDot at inlet from 1 per cent of intended flow rate to 100 per cent over 6000 iterations).


type timeVaryingFlowRateInletVelocity;
flowRate 0.00625;
fileName "turbxitflowrate.dat";
outOfBounds clamp;
value (0 0 0);

2. Use Gauss Upwind for all convective schemes over the ramp period - more numerical diffusion is good to damp out any initial oscillation in the pressure field and localised strong gradients in the flowfield.

3. Use very low Under-Relaxation Factors (URF) over the ramp period. Just try to get the initial starting flow to develop all the way to the outlet boundary.

p 0.01;
rho 0.005;
U 0.7;
k 0.3;
epsilon 0.3;
h 0.7;

When your flow is not transonic, you can put URF for rho to 1.

4. When I switched to 2nd order gauss linearUpwind scheme later in the run (about 10,000 iterations), I used face limiter on all gradient and flux reconstruction schemes.

default cellLimited Gauss pointLinear 1;
limitedGrad(U) cellMDLimited Gauss pointLinear 1;
limitedGrad(h) cellLimited Gauss linear 1;
limitedGrad(k) cellLimited Gauss pointLinear 1;
limitedGrad(epsilon) cellLimited Gauss pointLinear 1;

div(phi,U) Gauss linearUpwindV limitedGrad(U);
div(phi,h) Gauss linearUpwind limitedGrad(h);
div(phi,epsilon) Gauss linearUpwind limitedGrad(epsilon);
div(phi,k) Gauss linearUpwind limitedGrad(k);

div((muEff*dev2(grad(U).T()))) Gauss linear;
div((muEff*dev2(T(grad(U))))) Gauss linear;
div(U,p) Gauss linear;

5. Do not use standard KE for high transonic flow - never worked for me.

6. If possible use low-RE mesh - avoid wall function for mut.

BC at wall:
mut: type calculated
alphat: type calculated
epsilon: type compressible::epsilonWallFunction
k: type fixedValue; value uniform 1e-12;

7. If you expect strong shocks in the flowfield, rhoSimpleFoam will never ever work. Need density based solver. Unfortunately to my understanding, no density-based solver for steady state currently exists in OpenFOAM. Anyone wants to contribute?

Thank you.


All times are GMT -4. The time now is 05:58.