CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (https://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   Possible bug in icoFoam (https://www.cfd-online.com/Forums/openfoam-bugs/62529-possible-bug-icofoam.html)

msrinath80 November 18, 2007 13:05

Description: The case in ques
 
Description:
The case in question is isothermal transient laminar flow of an incompressible newtonian fluid in a 2D channel which features a square obstacle somewhere inside it. While the velocity fields from both the coarse and fine grids make sense, the pressure field from both is unphysical (i.e. low pressure extending from the channel inlet up to a significant entry length and high pressure near the outlet). The contour plots for both velocity and pressure obtained for the fine mesh are shown below:


Solver/Application:
icoFoam


Source file:
icoFoam.C ?


Testcase:
Coarse mesh (11846 cells) http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif coarse.tar.gz
Fine mesh (47384 cells) http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif fine.tar.gz


Platform:
Linux64 (RHEL 5.0, Ubuntu 7.10)


Version:
OpenFOAM 1.4.1 patched with:
[1] Cumulative patch (http://www.cfd-online.com/OpenFOAM_D...tml?1193779783)
[2] Cyclic patch bug fix (http://www.cfd-online.com/OpenFOAM_D...tml?1194078051)


Notes:

[1] Switching solvers seems to have no effect on the results (i.e. same results on AMG or PCG).
[2] Same results whether you run the case in parallel or serial.
[3] Whether the fine mesh is created using blockMesh directly or using refineMesh once on the coarse mesh, the result is the same.
[4] checkMesh reports no errors on either mesh. There is no non-orthogonality or skewness.
[5] Although I cannot confirm this totally, I am yet to observe any discrepencies when running either case on a 3D mesh. So I suspect this is some problem only in 2D?

Images:

Pressure field from the fine mesh:

http://www.cfd-online.com/OpenFOAM_D...s/126/5927.jpg



Pressure field from the fine mesh (zoom near cylinder):

http://www.cfd-online.com/OpenFOAM_D...s/126/5928.jpg



Velocity field from the fine mesh (zoom near cylinder):

http://www.cfd-online.com/OpenFOAM_D...s/126/5929.jpg

philippose November 19, 2007 14:56

Hello Srinath, A Good day t
 
Hello Srinath,

A Good day to you!

I must say... this possible bug you have spoken about seems to be uncannily close to the problem I was talking about a week ago, with the pressure field being unacceptably different when running the same simulation on two computers with slightly different versions of OpenFOAM-1.4.1.

In my case, I had used the stock simpleFoam in both cases, and I too had a perfectly fine looking velocity field, but a different pressure field.

I shall see if I can post a couple of pictures here. I hope I still have those simulations.

I solved it by compiling the latest version of OpenFOAM-1.4.1 from SVN. It really may be some bug that crept into the system because of some change made between the different versions.

Have a nice day!

Philippose

henry November 19, 2007 16:14

I tested your coarse mesh case
 
I tested your coarse mesh case with 1.4.1 (with the bug fixes posted on this list) and also our development version 1.4.2 and it runs fine in both and the pressure field is fine. One thing I did notice is that the pressure residual oscillates due to the pure Crank-Nicholson scheme being a little unstable; if you use a small amount of "off-centering" by setting the coefficient to 0.9 or 0.95 it is MUCH better behaved. Alternatively you can use the "backward" scheme which is also second-order but more stable than Crank-Nicholson.

msrinath80 November 19, 2007 17:19

Hi Henry, Thanks for your m
 
Hi Henry,

Thanks for your message. I assume that you checked the pressure solution at Endtime (i.e. 10 seconds). I will look into this once again more carefully. Perhaps as Philippose suggests, I need to recompile OpenFOAM just to be sure.

henry November 19, 2007 17:41

I hadn't but I have now. It a
 
I hadn't but I have now. It appears that the Crank-Nicholson scheme induces increasingly large pressure oscillations as the run progresses and by 10s is looks very odd and changes greatly between consecutive time-steps. Using a coefficient of 0.9 or 0.95 solved the problem completely.

msrinath80 November 19, 2007 17:56

I'm trying it with 0.9 now. Wi
 
I'm trying it with 0.9 now. Will keep you updated. Thanks!

msrinath80 November 19, 2007 18:35

You're absolutely right. This
 
You're absolutely right. This was no bug. My sincere apologies to anyone who got scared after reading the title of this thread. Thanks for your help Henry.


All times are GMT -4. The time now is 20:24.