CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Pre-Processing (
-   -   rhoPimpleFoam Boundary Condition Problem (

dancfd May 10, 2012 23:21

rhoPimpleFoam Boundary Condition Problem
4 Attachment(s)
Hello all,

I have run my 2D airfoil case successfully in pimpleFoam, but now that I try to migrate my case to rhoPimpleFoam, the boundary conditions misbehave and the simulation stops with a floating point exception. I am running a NACA 0012 airfoil at M 0.3 with Re 6e6. Using MaxCo of 0.5. I have attached the boundary conditions and thermophysical properties, as well as the checkMesh results. I have also attached three images of pressure distributions across the domain: 1) from pimpleFoam that looks the way it should, 2) from rhoPimpleFoam using the same BCs, and 3) from rhoPimpleFoam defining P at the inlet instead of the outlet. It is clear that wherever I define P leads to anomalous results. Note that in this mesh, the outlet is the rightmost limit of the domain, and the inlet is the top, bottom and curved surfaces, as in the nacaAirfoil tutorial. InletOutlet is used as a BC for U since I will be running the simulation at various angles of attack by changing the BCs, not the mesh. I want to use a compressible solver since I will be going as high as M 0.8, and I expect shocks on the airfoil.

Here is the error:


[2] #0  Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/"
[2] #1  Foam::sigFpe::sigHandler(int) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/"
[2] #2  in "/lib/x86_64-linux-gnu/"
[2] #3  Foam::hPsiThermo<Foam::pureMixture<Foam::sutherlandTransport<Foam::specieThermo<Foam::hConstThermo<Foam::perfectGas> > > > >::calculate() in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/"
[2] #4  Foam::hPsiThermo<Foam::pureMixture<Foam::sutherlandTransport<Foam::specieThermo<Foam::hConstThermo<Foam::perfectGas> > > > >::correct() in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/"

Can someone please suggest what the issue might be, or if the boundary conditions can be improved?

Many thanks in advance,


alberto May 11, 2012 02:27

I'd consider rhoCentralFoam.


dancfd May 11, 2012 06:31

Hello Alberto,

Thanks for your suggestion. I ran a case with P defined at the inlet, and although I did not receive a floating point error in the time that I let the case run, the pressure distribution had the same issue as picture #2 above.

I am currently running a case with P defined at the outlet, and I will post the results when they are ready.



dancfd May 11, 2012 18:20

2 Attachment(s)
It looks like the boundary condition issue has been resolved by defining P at the outlet instead of the inlet and by using rhoCentralFoam. The p distribution is now free of anomalies. However, the Cp plot across the airfoil now has a wavy characteristic and the data points are spread out much more than they should be. Angle of attack is <1 deg for both plots. Any ideas what could cause this disruption to the Cp plot?



dancfd May 14, 2012 21:56

2 Attachment(s)
I gave up on rhoCentralFoam. SonicFoam looks promising, however when I change from Euler to backward differencing for the temporal terms, I get strange results (see pics). I think it is necessary to use a second-order scheme such as backward if I want to publish, therefore this is a concern for me. Has anyone else encountered this problem?

Note that CrankNicholson 1 does not converge (floating point error) and CrankNicholson 0.5 produced a similar effect to that shown below.

Thank you,


alberto May 15, 2012 00:24

How do you set your case up in rhoCentralFoam? Take a look at the tutorials. Also, do you have a small case (it should run on 1 CPU in a short time) that reproduces your problem?


dancfd May 16, 2012 23:09

1 Attachment(s)
Hello Alberto,

I have tried to apply the case setups from the tutorial on my case, which is how I got as far as I did. I have attached my case, though I had to make a couple of changes for it to be within the size limits of this board. I am afraid it takes quite some time to run, unfortunately - blame the low courant number limit for that one!

I also tried changing the discretization of the time terms from backward to Euler, since that worked for sonicFoam. Unfortunately, it made no visible difference to the results with rhoCentralFoam - they still are not representative of experimental data.

I would appreciate any assistance you could offer.


alberto May 16, 2012 23:32

I am looking into it. At what time do you start seeing the problem? Also, what version of OF are you using?

alberto May 17, 2012 12:47

Sorry, in my previous post I think I mixed the issues you have in rhoCentralFoam and those in sonicFoam.
I confirm the scatter in values using rhoCentralFoam. Have you checked that the solution stops changing?

anishtain4 May 17, 2012 17:13

I tried to reproduce the case but it takes too much time, however there are two points that came to my mind:
1. change the velocity outlet from inletoutlet to zerogradient, after all your grid is far enough to be free of any recirculation, isn't it?
2. change the interpolation method, that maybe is the case for a non-smooth pressure on airfoil

dancfd May 17, 2012 20:18

I am not sure if it appears any sooner that the time in the file. I had set the transient sim to output data at that interval. I agree that it takes a long time - is there any way to accelerate this sim? The Co must stay low or it will diverge. I am using OF 2.0.1. The solution should stop, since the convergence criteria are very demanding and I normally run the simulation with a time-varying flow speed. Thank you Mahdi, Alberto for your assistance - I will try the zeroGradient condition and another interpolation method and write back.


anishtain4 May 18, 2012 04:45

Well you have a too dense grid, I'm not sure if it is necessary or not? This confines your Co to very low values, and you are solving a viscose flow with turbulence model.

Maybe it is better to first run this case as inviscid to come along with a good farfield boundary condition, and then take care of wall anomalities

dancfd May 18, 2012 21:47

The zeroGradient condition did not have a noticeable effect on the results - the Cp plot is still oscillatory. I changed all of the interpolation schemes to linear and the simulation did not converge. Regarding the mesh, I believe the y+ is reasonable for the SST (~15) and the aspect ratios are acceptable to checkMesh. In which direction do you think I could coarsen the mesh?

The mesh notwithstanding (since that would allow me to run a faster sim, but I do not believe it would remove the oscillations), any other ideas on how to make rhoCentralFoam work with this case?


JonathanG July 14, 2017 12:41

Hi Dan,

I am running the same case with rhoPimpleFoam, and have the same issue as you did. Were you ever able to figure out the problem with rhoPimpleFoam?


dancfd July 15, 2017 14:59

Hi Jonathan,

I ended up using rhoCentralFoam; I never fixed the problem with rhoPimpleFoam.

Good luck,


JonathanG July 19, 2017 11:13

Hi Dan,

I may have ended up getting rhoPimpleFoam to work, everything seems to be converging nicely, though it's still running, I need to validate the results. If you're interested, I could send you the files.


All times are GMT -4. The time now is 10:08.