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: Code:
[2] #0 Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" Many thanks in advance, Dan 
I'd consider rhoCentralFoam.
Best, 
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. Regards, Dan 
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?
Thanks, Dan 
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 secondorder 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, Dan 
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?
Best, 
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. Thanks, Dan 
I am looking into it. At what time do you start seeing the problem? Also, what version of OF are you using?

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? 
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 nonsmooth pressure on airfoil 
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 timevarying flow speed. Thank you Mahdi, Alberto for your assistance  I will try the zeroGradient condition and another interpolation method and write back.
Regards, Dan 
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 
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? Thanks, Dan 
All times are GMT 4. The time now is 20:56. 