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

Minor bug in cellQualityC

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 13, 2009, 06:15
Default Dear all, I observed for 2
  #1
Senior Member
 
Frank Bos
Join Date: Mar 2009
Location: The Netherlands
Posts: 340
Rep Power: 18
lr103476 is on a distinguished road
Dear all,

I observed for 2D cases that the nonOrthogonality() and faceNonOrthogonality() functions in cellQuality can cause a 'floating points exceptions'. This occurs in the calculation of cosDDotS = Foam::acos((d & s)/(mag(d)*magS + VSMALL)), apparently VSMALL is too small and indeed, when I change this in SMALL, everything works fine again.

Regards, Frank
__________________
Frank Bos
lr103476 is offline   Reply With Quote

Old   February 13, 2009, 06:45
Default The problem is that for very s
  #2
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 22
henry is on a distinguished road
The problem is that for very small geometries you will find that SMALL is too big. I guess we will need to make VSMALL a bit bigger, could you find out how much bigger VSMALL has to be for your case?

Thanks

H
henry is offline   Reply With Quote

Old   February 13, 2009, 07:12
Default I already did that. in my case
  #3
Senior Member
 
Frank Bos
Join Date: Mar 2009
Location: The Netherlands
Posts: 340
Rep Power: 18
lr103476 is on a distinguished road
I already did that. in my case VSMALL need to be 1e-16, so almost SMALL.

The case is not very small, just a moving 2D block on a 2D domain which is 25 squared. Overall domain bounding box (-12.5 -12.5 -0.1) (12.5 12.5 0.1).

Frank
__________________
Frank Bos
lr103476 is offline   Reply With Quote

Old   February 13, 2009, 07:24
Default Is the problem in acos getting
  #4
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
Is the problem in acos getting a number >1 or in the division?

Could you try something like

Foam::acos(min(1.0, (d & s)/(mag(d)*magS + VSMALL)))
mattijs is offline   Reply With Quote

Old   February 13, 2009, 07:28
Default Just my two cents: the point i
  #5
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Just my two cents: the point in that VSMALL constant is to avoid division by zero, and get zero if (d&s) is zero, is it? How about replacing it with max(VSMALL,SMALL*max(mag(d),mag(s))) or something similar that would correlate it to the local sizes. But I havn't looked at the full source so I may be talking nonsense

Bernhard
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   February 13, 2009, 07:28
Default Thanks Mattijs, this solved th
  #6
Senior Member
 
Frank Bos
Join Date: Mar 2009
Location: The Netherlands
Posts: 340
Rep Power: 18
lr103476 is on a distinguished road
Thanks Mattijs, this solved the problem.

Frank
__________________
Frank Bos
lr103476 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Minor buoyancy problem in Phoen2007 patti Phoenics 3 December 1, 2007 18:43
Minor bug in CrankNicholsonDdtScheme henry OpenFOAM Bugs 5 May 22, 2007 11:52
Minor compilation problem with Gcc42 schmidt_d OpenFOAM Bugs 1 May 9, 2007 13:11
Minor loss coefficients Nick Main CFD Forum 3 October 7, 2004 11:28
minor loss k values clifford bradford Main CFD Forum 1 August 2, 2000 16:58


All times are GMT -4. The time now is 21:19.