floating point exception
-
如题,出错情况如下,但是和通常情况下的浮点数例外又不太一样,有人知道这个错误是什么原因引起的吗?上一个时间步的库朗数0.87,字典中设置的最大库朗数为0.9,和这个有关系吗?
[2] #0 Foam::error::printStack(Foam::Ostream&) at ??:? [2] #1 Foam::sigFpe::sigHandler(int) at ??:? [2] #2 ? in /lib/x86_64-linux-gnu/libc.so.6 [2] #3 Foam::DILUPreconditioner::calcReciprocalD(Foam::Field<double>&, Foam::lduMatrix const&) at ??:? [2] #4 Foam::DILUPreconditioner::DILUPreconditioner(Foam::lduMatrix::solver const&, Foam::dictionary const&) at ??:? [2] #5 Foam::lduMatrix::preconditioner::addasymMatrixConstructorToTable<Foam::DILUPreconditioner>::New(Foam::lduMatrix::solver const&, Foam::dictionary const&) at ??:? [2] #6 Foam::lduMatrix::preconditioner::New(Foam::lduMatrix::solver const&, Foam::dictionary const&) at ??:? [2] #7 Foam::PBiCGStab::scalarSolve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const at ??:? [2] #8 Foam::PBiCGStab::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const at ??:? [2] #9 Foam::fvMatrix<double>::solveSegregated(Foam::dictionary const&) at ??:? [2] #10 Foam::fvMatrix<double>::solveSegregatedOrCoupled(Foam::dictionary const&) at ??:? [2] #11 Foam::fvMesh::solve(Foam::fvMatrix<double>&, Foam::dictionary const&) const at ??:? [2] #12 Foam::SolverPerformance<double> Foam::dynamicOversetFvMesh::solve<double>(Foam::fvMatrix<double>&, Foam::dictionary const&) const at ??:? [2] #13 Foam::dynamicOversetFvMesh::solve(Foam::fvMatrix<double>&, Foam::dictionary const&) const at ??:? [2] #14 ? in ~/OpenFOAM/user-v1906/platforms/linux64GccDPInt32Opt/bin/overOlaDyMFlow [2] #15 __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6 [2] #16 ? in ~/OpenFOAM/user-v1906/platforms/linux64GccDPInt32Opt/bin/overOlaDyMFlow [zc:02256] *** Process received signal *** [zc:02256] Signal: Floating point exception (8) [zc:02256] Signal code: (-6) [zc:02256] Failing at address: 0x3e8000008d0 [zc:02256] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x3ef20)[0x7fdf3dd29f20] [zc:02256] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0xc7)[0x7fdf3dd29e97] [zc:02256] [ 2] /lib/x86_64-linux-gnu/libc.so.6(+0x3ef20)[0x7fdf3dd29f20] [zc:02256] [ 3] /home/user/OpenFOAM/OpenFOAM-v1906/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so(_ZN4Foam18DILUPreconditioner15calcReciprocalDERNS_5FieldIdEERKNS_9lduMatrixE+0xa5)[0x7fdf3f197095] [zc:02256] [ 4] /home/user/OpenFOAM/OpenFOAM-v1906/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so(_ZN4Foam18DILUPreconditionerC1ERKNS_9lduMatrix6solverERKNS_10dictionaryE+0xa4)[0x7fdf3f197224] [zc:02256] [ 5] /home/user/OpenFOAM/OpenFOAM-v1906/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so(_ZN4Foam9lduMatrix14preconditioner31addasymMatrixConstructorToTableINS_18DILUPreconditionerEE3NewERKNS0_6solverERKNS_10dictionaryE+0x2e)[0x7fdf3f1973ae] [zc:02256] [ 6] /home/user/OpenFOAM/OpenFOAM-v1906/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so(_ZN4Foam9lduMatrix14preconditioner3NewERKNS0_6solverERKNS_10dictionaryE+0x917)[0x7fdf3f17e637] [zc:02256] [ 7] /home/user/OpenFOAM/OpenFOAM-v1906/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so(_ZNK4Foam9PBiCGStab11scalarSolveERNS_5FieldIdEERKS2_h+0x8df)[0x7fdf3f18a53f] [zc:02256] [ 8] /home/user/OpenFOAM/OpenFOAM-v1906/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so(_ZNK4Foam9PBiCGStab5solveERNS_5FieldIdEERKS2_h+0x53)[0x7fdf3f18cc53] [zc:02256] [ 9] /home/user/OpenFOAM/OpenFOAM-v1906/platforms/linux64GccDPInt32Opt/lib/libfiniteVolume.so(_ZN4Foam8fvMatrixIdE15solveSegregatedERKNS_10dictionaryE+0x187)[0x7fdf43a49c47] [zc:02256] [10] /home/user/OpenFOAM/OpenFOAM-v1906/platforms/linux64GccDPInt32Opt/lib/libfiniteVolume.so(_ZN4Foam8fvMatrixIdE24solveSegregatedOrCoupledERKNS_10dictionaryE+0x3a5)[0x7fdf4357d895] [zc:02256] [11] /home/user/OpenFOAM/OpenFOAM-v1906/platforms/linux64GccDPInt32Opt/lib/libfiniteVolume.so(_ZNK4Foam6fvMesh5solveERNS_8fvMatrixIdEERKNS_10dictionaryE+0x23)[0x7fdf43521553] [zc:02256] [12] /home/user/OpenFOAM/OpenFOAM-v1906/platforms/linux64GccDPInt32Opt/lib/liboverset.so(_ZNK4Foam20dynamicOversetFvMesh5solveIdEENS_17SolverPerformanceIT_EERNS_8fvMatrixIS3_EERKNS_10dictionaryE+0x2d2)[0x7fdf3ff4fee2] [zc:02256] [13] /home/user/OpenFOAM/OpenFOAM-v1906/platforms/linux64GccDPInt32Opt/lib/liboverset.so(_ZNK4Foam20dynamicOversetFvMesh5solveERNS_8fvMatrixIdEERKNS_10dictionaryE+0x1d)[0x7fdf3ff5076d] [zc:02256] [14] overOlaDyMFlow(+0x57c8c)[0x55bfc0ab9c8c] [zc:02256] [15] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x7fdf3dd0cb97] [zc:02256] [16] overOlaDyMFlow(+0x6b36a)[0x55bfc0acd36a] [zc:02256] *** End of error message *** -------------------------------------------------------------------------- mpirun noticed that process rank 2 with PID 0 on node zc exited on signal 8 (Floating point exception). user@zc:~/OpenFOAM/OpenFOAM-v1906/run/various/floatingObject_refined/background$ ^C user@zc:~/OpenFOAM/OpenFOAM-v1906/run/various/floatingObject_refined/background$
-
DILU 预条件器出错 对应代码在
DILUPreconditioner.C 90行
for (label cell=0; cell<nCells; cell++) { 90 rDPtr[cell] = 1.0/rDPtr[cell]; }
更换预条件器 换成diagonal或者none一般就可以,或者换光顺求解器也可以。
一般不完全ILU分解做预条件器,是不能够完全分解成一个L和U矩阵的,还会剩下一个对角阵D,如果某行完全分解了,那么对角阵会有元素为0,由于这第90行代码会将D中的元素做除数,OpenFoam刚好又会捕捉浮点数异常,程序就退出了。