CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   xifoam..floating point error..any interpretations? (http://www.cfd-online.com/Forums/openfoam/104516-xifoam-floating-point-error-any-interpretations.html)

achinta July 11, 2012 11:01

xifoam..floating point error..any interpretations?
 
Hello,
I am using a version of XiFoam and i get the following error:
-----------------------------
[2] #0 Foam::error::printStack(Foam::Ostream&) in "/gt/home/h250241/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[2] #1 Foam::sigFpe::sigHandler(int) in "/gt/home/h250241/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[2] #2 __restore_rt at sigaction.c:0
[2] #3 Foam::sqrt(Foam::Field<double>&, Foam::UList<double> const&) in "/gt/home/h250241/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[2] #4 Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::sqrt<Foam::fvPatchField, Foam::volMesh>(Foam::tmp<Foam::GeometricField<doub le, Foam::fvPatchField, Foam::volMesh> > const&) in "/gt/home/h250241/OpenFOAM/h250241-2.1.1/platforms/linux64GccDPOpt/bin/myXiFoam1"
[2] #5 main in "/gt/home/h250241/OpenFOAM/h250241-2.1.1/platforms/linux64GccDPOpt/bin/myXiFoam1"
[2] #6 __libc_start_main in "/lib64/tls/libc.so.6"
[2] #7 _start in "/gt/home/h250241/OpenFOAM/h250241-2.1.1/platforms/linux64GccDPOpt/bin/myXiFoam1"
[cubad10290:01470] *** Process received signal ***
[cubad10290:01470] Signal: Floating point exception (8)
[cubad10290:01470] Signal code: (-6)
--------------------------------------------
Any idea what it means? Could anybody tell where the error is originating. The solver runs fine for 2500 time steps and then diverges showing this error!!!

Kind regards,
A V

wyldckat July 11, 2012 15:40

Greetings Achinta,

See the line in bold below?
Quote:

Originally Posted by achinta (Post 370857)
Code:

[2] #0  Foam::error::printStack(Foam::Ostream&) in "/gt/home/h250241/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[2] #1  Foam::sigFpe::sigHandler(int) in "/gt/home/h250241/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[2] #2  __restore_rt at sigaction.c:0
[2] #3  Foam::sqrt(Foam::Field<double>&, Foam::UList<double> const&) in "/gt/home/h250241/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[2] #4  Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::sqrt<Foam::fvPatchField, Foam::volMesh>(Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > const&) in "/gt/home/h250241/OpenFOAM/h250241-2.1.1/platforms/linux64GccDPOpt/bin/myXiFoam1"
[2] #5  main in "/gt/home/h250241/OpenFOAM/h250241-2.1.1/platforms/linux64GccDPOpt/bin/myXiFoam1"
[2] #6  __libc_start_main in "/lib64/tls/libc.so.6"
[2] #7  _start in "/gt/home/h250241/OpenFOAM/h250241-2.1.1/platforms/linux64GccDPOpt/bin/myXiFoam1"
[cubad10290:01470] *** Process received signal ***
[cubad10290:01470] Signal: Floating point exception (8)
[cubad10290:01470] Signal code:  (-6)


It indicates that a square root operation tried to do something it shouldn't, such as the square root of a negative number or something like that.

If you want to isolate better the problem, you'll need to do a debug build. Here's an old thread on this subject: Debug version of OpenFOAM-1.6

Best regards,
Bruno

achinta July 16, 2012 10:52

Thanks for the reply Bruno. Some some equations are giving wrong results i guess. I will check. Btw, when i use 'foamToVTK' command to covert OpenFoam files to VTK format, i get the following error
-----
Internal : "/gt/home/h250241/OpenFOAM/h250241-2.1.1/run/tub_sst_piso1/VTK/t ub_sst_piso1_500.vtk"
#0 Foam::error::printStack(Foam::Ostream&) in "/gt/home/h250241/OpenFOAM/OpenFO AM-2.1.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1 Foam::sigFpe::sigHandler(int) in "/gt/home/h250241/OpenFOAM/OpenFOAM-2.1.1/p latforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2 __restore_rt at sigaction.c:0
#3 Foam::writeFuns::insert(double, Foam::DynamicList<float, 0u, 2u, 1u>&) in "/ gt/home/h250241/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/bin/foamToVTK"
#4 void Foam::writeFuns::insert<double>(Foam::List<double> const&, Foam::Dynami cList<float, 0u, 2u, 1u>&) in "/gt/home/h250241/OpenFOAM/OpenFOAM-2.1.1/platform s/linux64GccDPOpt/bin/foamToVTK"
#5 void Foam::writeFuns::write<double>(std::ostream&, bool, Foam::GeometricFiel d<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::vtkMesh const&) in "/ gt/home/h250241/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/bin/foamToVTK"
#6 void Foam::internalWriter::write<double, Foam::fvPatchField, Foam::volMesh>( Foam::PtrList<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > const&) in "/gt/home/h250241/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/b in/foamToVTK"
#7 main in "/gt/home/h250241/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/ bin/foamToVTK"
#8 __libc_start_main in "/lib64/tls/libc.so.6"
#9 _start in "/gt/home/h250241/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOp t/bin/foamToVTK"
Floating point exception
-------------------
Well, it seems some operations are bad. But, i am just converting files. I am not doing any calculations. Do you know why this error is happening?

Kind regards,
Achinta

wyldckat July 16, 2012 18:42

Hi Achinta,

I think that error implies that the saved fields are already contaminated with either NaN or inf values.
If the option in "controlDict" is to use "ascii", you can open the field files for the "500" folder and check if there are values that are not numbers. If you find those values, then it's only natural that you can't export them to VTK.

Best regards,
Bruno

achinta July 17, 2012 04:41

Hi Bruno,
I checked all the files of that folder and i didn't find any NaN or inf. I have paraFoam installed on my laptop and i can open those files using paraFoam.

But, i couldn't install paraFoam on my Desktop but I have paraview. So, to view the results on my desktop i have to use foamToVTK command. But it gives this error when i try to convert. In fact, foamToVTK converted the files of other cases, but it's causing problem with this specific case only. Do i have to change any setting in system folder or something?

Thanks again,

Kind regards,
Achinta

wyldckat July 17, 2012 05:39

Hi Achinta,

OK, I would suggest the following ideas:
  • Try foamToVTK on the "400" time folder, instead of the "500". If it works, then you've got noise in the "500" folder.
  • Try running this before foamToVTK:
    Code:

    unset FOAM_SIGFPE
    unset FOAM_SETNAN

  • Or create a dummy file named "case.foam":
    Code:

    touch case.foam
    And use ParaView to open that file (ParaView 3.8.0 or above). It will use the internal reader for opening the OpenFOAM case.
  • Are you using a virtual machine by any chance? If so, are you running the case inside a shared folder?
    If you are, then don't. Copy/move the VTK folder to a shared folder instead of running directly in it.
Let us know which one of these solved your issue.

Good luck!
Bruno

achinta July 31, 2012 05:05

Hi Bruno,
Sorry for the late reply. Other issues with OpenFoam had kept me busy :(

btw, i tried your suggestions and here are the results:
Method 1) It was giving same error with other folders too!!
Method 2) It works!! when i post-process results, all the parameters were within reasonable limits. No idea why it was giving sigFpe error

i have a question related to:
unset FOAM_SIGFPE
unset FOAM_SETNAN

Does it allow OpenFoam to run even if there are NaNs or Infs? The solver gives similar sigFpe error related to mutWallFunction with XiFoam and i would like the solver to run even if such error happens ( i guess few bad cells in my 'industrial' mesh are causing such errors and may not effect the overall solution. So i want to ignore such errors)

Thank you very much
Kind regards,
Achinta

wyldckat July 31, 2012 06:22

Hi Achinta,

When FOAM_SIGFPE is turned on, it will not allow erroneous values to go around. But there are some situations where you can turn this off, at least until you can figure out the source of the problem.
It could even be an initialization that later on is dumped because new proper values are calculated.
This can be a fallacy, because you might be allowing crazy values to go into your simulation domain and wreck havoc sooner or later.
The right way to do this would be to diagnose where exactly the problem is and fix it properly.

As for FOAM_SETNAN, when turned on (not the default), I think it has to do with a method for initializing all fields with NAN, to help diagnose situations where non-initialized fields are being used and which can lead to crazy or unreproducible results.

Best regards,
Bruno


All times are GMT -4. The time now is 13:54.