CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Bugs

SVN 1226 - Possible bug with cell centres and volumes

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 4, 2009, 18:08
Exclamation SVN 1226 - Possible bug with cell centres and volumes
  #1
Senior Member
 
Philippose Rajan
Join Date: Mar 2009
Location: Germany
Posts: 552
Rep Power: 25
philippose will become famous soon enough
Hello,

A Good Evening to everyone :-)! I hope all is well, and things are going good for everyone!

Just wanted to report that the change made to the file "primitiveMeshCellCentresAndVols.C" in SVN Revision 1226 seems to cause an issue when dealing with fine meshes.....

In SVN Rev. 1226 the line: "cellCtrs /= cellVols" was changed to "cellCtrs /= cellVols + SMALL" in order to prevent division by zero errors in the case when cellVols = 0.0.

However, when working with fine meshes (in my case, > 1.2 million cells) whose cells inherently have volumes close to 1e-15 (m^3), the addition of the value "SMALL" (which is 1e-15 for double precision) causes a variety of OpenFOAM systems to fail with unusual errors.

The first sign of this was a sudden flurry of errors in checkMesh on meshes which had run fine on earlier SVN revisions of OpenFOAM-1.5-dev.... I also experienced meshes which caused OpenFOAM to abort with a floating point exception after the first pressure solver iteration (again.... these were cases which had run through fine before), etc...etc...

Removing the addition of "SMALL" rectified all the issues....

Wouldn't "VSMALL" be a better option? Or are there other issues which forced the usage of "SMALL" ??

Have a great evening ahead!

Philippose
philippose is offline   Reply With Quote

Old   June 5, 2009, 06:27
Default
  #2
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
Could you please try it and let me know if it works.

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   June 5, 2009, 13:19
Default
  #3
Senior Member
 
Philippose Rajan
Join Date: Mar 2009
Location: Germany
Posts: 552
Rep Power: 25
philippose will become famous soon enough
Hello Hrv,

A Good Evening to you!

I recompiled OpenFOAM-1.5-dev after changing the line:

"cellCtrs /= cellVols + SMALL" ==> "cellCtrs /= cellVols + VSMALL"

And ran checkMesh on the case with which I discovered the issue, and everything worked out fine.... a simpleFoam simulation of the same case also went through without any further issues.

For reference, I am attaching two checkMesh log files, one with the original code (using SMALL), and one with the modified one (using VSMALL).... I hope it gives you more clarity...

Have a nice evening, and a great weekend :-)!

Philippose
Attached Files
File Type: txt checkMeshLog_SMALL.txt (3.2 KB, 6 views)
File Type: txt checkMeshLog_VSMALL.txt (2.9 KB, 6 views)
philippose is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On



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