View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001680 | OpenFOAM | Bug | public | 2015-04-30 14:20 | 2015-05-01 00:44 |
Reporter | derekm | Assigned To | henry | ||
Priority | immediate | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | GNU/Linux | OS | OpenSuSE | OS Version | 12.3 |
Summary | 0001680: Viewfactors throws floating point error with Baffles | ||||
Description | A working case has baffles added to it then Viewfactorsgen throws floating point error. This was found to be data sensitive as it occured when the baffle was in proximity to a heater region and did not occur when the baffle at some distance. The error occurs in both single and parallel working three cases attached, Two where the crash occurs one where it works. Two types of baffle were tested, 3D thermo and "normal" [code] alculating view factors... [1] #0 Foam::error::printStack(Foam::Ostream&) at ??:? [1] #1 Foam::sigFpe::sigHandler(int) at ??:? [1] #2 in "/lib64/libc.so.6" [1] #3 [1] at ??:? [1] #4 [1] at ??:? [1] #5 __libc_start_main in "/lib64/libc.so.6" [1] #6 [1] at /home/abuild/rpmbuild/BUILD/glibc-2.17/csu/../sysdeps/x86_64/start.S:126 [linux-kzcl:05159] *** Process received signal *** [linux-kzcl:05159] Signal: Floating point exception (8) [linux-kzcl:05159] Signal code: (-6) [linux-kzcl:05159] Failing at address: 0x3e800001427 [linux-kzcl:05159] [ 0] /lib64/libc.so.6(+0x350e0) [0x7ff5999df0e0] [linux-kzcl:05159] [ 1] /lib64/libc.so.6(gsignal+0x35) [0x7ff5999df065] [linux-kzcl:05159] [ 2] /lib64/libc.so.6(+0x350e0) [0x7ff5999df0e0] [linux-kzcl:05159] [ 3] viewFactorsGen() [0x41fa5b] [linux-kzcl:05159] [ 4] viewFactorsGen() [0x41cab6] [linux-kzcl:05159] [ 5] /lib64/libc.so.6(__libc_start_main+0xf5) [0x7ff5999cba15] [linux-kzcl:05159] [ 6] viewFactorsGen() [0x41f34d] [linux-kzcl:05159] *** End of error message *** [/code] | ||||
Steps To Reproduce | Run case as per Allrun script in case viwwfactorsgen crashes | ||||
Additional Information | cases are between 1E6 and 2E6 cells | ||||
Tags | No tags attached. | ||||
|
|
|
The severity is incorrect it is MAJOR / Severe |
|
Cause: Viewfactorsgen does not handle patches which are coincident e.g. baffles the following function in viewfactors.c attempts to divide by the scalar distance between the two patches [code] scalar calculateViewFactorFij ( const vector& i, const vector& j, const vector& dAi, const vector& dAj ) { vector r = i - j; scalar rMag = mag(r); scalar dAiMag = mag(dAi); scalar dAjMag = mag(dAj); vector ni = dAi/dAiMag; vector nj = dAj/dAjMag; scalar cosThetaJ = mag(nj & r)/rMag; scalar cosThetaI = mag(ni & r)/rMag; return ( (cosThetaI*cosThetaJ*dAjMag*dAiMag) /(sqr(rMag)*constant::mathematical::pi) ); } [/code] FIX: This can be fixed by substituting the following [code] scalar calculateViewFactorFij ( const vector& i, const vector& j, const vector& dAi, const vector& dAj ) { vector r = i - j; scalar rMag = mag(r); scalar dAiMag = mag(dAi); scalar dAjMag = mag(dAj); if ( mag(r)==0) { return 0; } else { vector ni = dAi/dAiMag; vector nj = dAj/dAjMag; scalar cosThetaJ = mag(nj & r)/rMag; scalar cosThetaI = mag(ni & r)/rMag; return ( (cosThetaI*cosThetaJ*dAjMag*dAiMag) /(sqr(rMag)*constant::mathematical::pi) ); } } [/code] |
|
Thanks for the report and proposed fix. I have incorporated the equivalent change in OpenFOAM-2.3.x and -dev, please reopen this report if it causes problems. |
Date Modified | Username | Field | Change |
---|---|---|---|
2015-04-30 14:20 | derekm | New Issue | |
2015-04-30 14:20 | derekm | File Added: three_cases.zip | |
2015-04-30 15:57 | derekm | Note Added: 0004704 | |
2015-04-30 19:55 | derekm | Note Added: 0004708 | |
2015-04-30 22:25 | henry | Note Added: 0004709 | |
2015-04-30 22:25 | henry | Status | new => resolved |
2015-04-30 22:25 | henry | Resolution | open => fixed |
2015-04-30 22:25 | henry | Assigned To | => henry |