|
[Sponsors] |
February 13, 2009, 07:15 |
Dear all,
I observed for 2
|
#1 |
Senior Member
Frank Bos
Join Date: Mar 2009
Location: The Netherlands
Posts: 340
Rep Power: 18 |
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 |
|
February 13, 2009, 07:45 |
The problem is that for very s
|
#2 |
Senior Member
Join Date: Mar 2009
Posts: 854
Rep Power: 22 |
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 |
|
February 13, 2009, 08:12 |
I already did that. in my case
|
#3 |
Senior Member
Frank Bos
Join Date: Mar 2009
Location: The Netherlands
Posts: 340
Rep Power: 18 |
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 |
|
February 13, 2009, 08:24 |
Is the problem in acos getting
|
#4 |
Senior Member
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26 |
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))) |
|
February 13, 2009, 08:28 |
Just my two cents: the point i
|
#5 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
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 |
|
February 13, 2009, 08:28 |
Thanks Mattijs, this solved th
|
#6 |
Senior Member
Frank Bos
Join Date: Mar 2009
Location: The Netherlands
Posts: 340
Rep Power: 18 |
Thanks Mattijs, this solved the problem.
Frank
__________________
Frank Bos |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Minor buoyancy problem in Phoen2007 | patti | Phoenics | 3 | December 1, 2007 19:43 |
Minor bug in CrankNicholsonDdtScheme | henry | OpenFOAM Bugs | 5 | May 22, 2007 12:52 |
Minor compilation problem with Gcc42 | schmidt_d | OpenFOAM Bugs | 1 | May 9, 2007 14:11 |
Minor loss coefficients | Nick | Main CFD Forum | 3 | October 7, 2004 12:28 |
minor loss k values | clifford bradford | Main CFD Forum | 1 | August 2, 2000 17:58 |