Minor bug in cellQualityC

 Register Blogs Members List Search Today's Posts Mark Forums Read

 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: 10 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: 14 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: 10 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 Super Moderator   Mattijs Janssens Join Date: Mar 2009 Posts: 1,416 Rep Power: 17 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: 3,972 Rep Power: 41 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: 10 Thanks Mattijs, this solved the problem. Frank __________________ Frank Bos

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post patti Phoenics 3 December 1, 2007 19:43 henry OpenFOAM Bugs 5 May 22, 2007 11:52 schmidt_d OpenFOAM Bugs 1 May 9, 2007 13:11 Nick Main CFD Forum 3 October 7, 2004 11:28 clifford bradford Main CFD Forum 1 August 2, 2000 16:58

All times are GMT -4. The time now is 07:12.