CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (https://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   Rather obscure division by zero in triangleFuncsintersectAxesBundle (https://www.cfd-online.com/Forums/openfoam-bugs/62440-rather-obscure-division-zero-trianglefuncsintersectaxesbundle.html)

gschaider August 12, 2008 07:42

Version: OF-1.5 Description
 
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
V0http://www.cfd-online.com/OpenFOAM_D...lipart/sad.gif-31.71428 0 -15.10714) V10http://www.cfd-online.com/OpenFOAM_D...lipart/sad.gif-1.285715 8.99165e-16 -1.142858) V20http://www.cfd-online.com/OpenFOAM_D...lipart/sad.gif0 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):

http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif triangleFuncs.patch

Bernhard

mattijs August 12, 2008 18:01

Thanks - I put it in. Does the
 
Thanks - I put it in. Does the mag(u1)<SMALL need some non-dimensionalisation as well?

gschaider August 13, 2008 07:08

It might be good for consisten
 
It might be good for consistency but is in my experience not necessary.

Bernhard


All times are GMT -4. The time now is 11:30.