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

Rather obscure division by zero in triangleFuncsintersectAxesBundle

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 12, 2008, 08:42
Default Version: OF-1.5 Description
  #1
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
Version: OF-1.5

Description: While reading in a STL into snappyHex it crashes with a division by zero in line 142 of meshTools/triSurface/triangleFuncs/triangleFuncs.C

The cause seems to be these parameters for intersectAxesBundle
V0-31.71428 0 -15.10714) V10-1.285715 8.99165e-16 -1.142858) V200 0 -1.678573) i0:0

For these parameters the local variable det = 8.9e-16*1.67 > SMALL (not by much ;) ) but u1=8.99e-16<SMALL and the routine then tries to divide by u2=0

I know it is a one in a million chance that this might happen, but it happened. I propose the following patch that tightens the restriction on det (and fixes this):

triangleFuncs.patch

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   August 12, 2008, 19:01
Default Thanks - I put it in. Does the
  #2
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
Thanks - I put it in. Does the mag(u1)<SMALL need some non-dimensionalisation as well?
mattijs is offline   Reply With Quote

Old   August 13, 2008, 08:08
Default It might be good for consisten
  #3
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
It might be good for consistency but is in my experience not necessary.

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

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
About flow division sunnysun OpenFOAM Running, Solving & CFD 5 March 2, 2009 13:34
Division by zero vitke OpenFOAM Running, Solving & CFD 5 September 1, 2008 06:35
Division by zero in Xoodles hannes OpenFOAM Bugs 3 August 4, 2008 12:04
ScalarField division maka OpenFOAM Pre-Processing 2 August 27, 2007 06:10


All times are GMT -4. The time now is 10:52.