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

The infamous floating point exception

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By thekay

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 1, 2010, 12:26
Default The infamous floating point exception
  #1
Member
 
Costas K
Join Date: Nov 2009
Location: UK
Posts: 51
Rep Power: 17
thekay is on a distinguished road
Send a message via ICQ to thekay Send a message via MSN to thekay
I tried to modify the sonicFoam solver and it went through wmake with no errors. When I run it, I get:

Code:
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  1.6                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : 1.6-f802ff2d6c5a
Exec   : mhdSonicFoam
Date   : Feb 01 2010
Time   : 16:22:49
Host   : stokes
PID    : 22919
Case   : /home/kay/OpenFOAM/OpenFOAM-1.6/my-projects/new-nozzle
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Reading thermophysical properties

Selecting thermodynamics package ePsiThermo<pureMixture<constTransport<specieThermo<eConstThermo<perfectGas>>>>>
Reading field T

Reading field U

Reading/calculating face flux field phi

Creating turbulence model

Selecting turbulence model type laminar

Starting time loop

Time = 1e-05

#0  Foam::error::printStack(Foam::Ostream&) in "/home/kay/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libOpenFOAM.so"
#1  Foam::sigFpe::sigFpeHandler(int) in "/home/kay/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libOpenFOAM.so"
#2  ?? in "/lib/libc.so.6"
#3  Foam::divide(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) in "/home/kay/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libOpenFOAM.so"
#4  void Foam::divide<Foam::fvsPatchField, Foam::surfaceMesh>(Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&) in "/home/kay/OpenFOAM/OpenFOAM-1.6/applications/bin/linux64GccDPOpt/mhdSonicFoam"
#5  Foam::tmp<Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> > Foam::operator/<Foam::fvsPatchField, Foam::surfaceMesh>(Foam::tmp<Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> > const&, Foam::tmp<Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> > const&) in "/home/kay/OpenFOAM/OpenFOAM-1.6/applications/bin/linux64GccDPOpt/mhdSonicFoam"
#6  main in "/home/kay/OpenFOAM/OpenFOAM-1.6/applications/bin/linux64GccDPOpt/mhdSonicFoam"
#7  __libc_start_main in "/lib/libc.so.6"
#8  _start at /build/buildd/glibc-2.9/csu/../sysdeps/x86_64/elf/start.S:116
Floating point exception
Is this a problem of the solver itself, or BC or whatever?

Any help will be greatly appreciated.
seuchsy likes this.
thekay is offline   Reply With Quote

Old   February 4, 2010, 05:49
Default
  #2
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Hi Costas

It is very hard to say, as it is a custom solver, however look at error #4, and your are explicitly told that it has something to do with the division operator. You are probably dividing by zero somewhere in the source.

Bests,

Niels
ngj is offline   Reply With Quote

Old   June 4, 2012, 04:48
Default
  #3
New Member
 
Learner
Join Date: Nov 2011
Location: Ingolstadt
Posts: 27
Rep Power: 15
raghu.tejaswi is on a distinguished road
Hi every1,

any concrete solution to the above problem? I have almost a similar problem but a little different. I am posting the failure below..

Create time

Create fluid mesh for region fluid for time = 0

Create solid mesh for region aluminium for time = 0

*** Reading fluid mesh thermophysical properties for region fluid

Adding to thermoFluid

Selecting thermodynamics package hsRhoThermo<pureMixture<constTransport<specieTherm o<hConstThermo<perfectGas>>>>>
#0 Foam::error:rintStack(Foam::Ostream&) in "/opt/openfoam/OpenFOAM-2.0.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1 Foam::sigFpe::sigHandler(int) in "/opt/openfoam/OpenFOAM-2.0.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2 __restore_rt at sigaction.c:0
#3 Foam::hsRhoThermo<Foam:ureMixture<Foam::constTra nsport<Foam::specieThermo<Foam::hConstThermo<Foam: erfectGas> > > > >::calculate() in "/opt/openfoam/OpenFOAM-2.0.1/platforms/linux64GccDPOpt/lib/libbasicThermophysicalModels.so"
#4 Foam::hsRhoThermo<Foam:ureMixture<Foam::constTra nsport<Foam::specieThermo<Foam::hConstThermo<Foam: erfectGas> > > > >::hsRhoThermo(Foam::fvMesh const&) in "/opt/openfoam/OpenFOAM-2.0.1/platforms/linux64GccDPOpt/lib/libbasicThermophysicalModels.so"
#5 Foam::basicRhoThermo::addfvMeshConstructorToTable< Foam::hsRhoThermo<Foam:ureMixture<Foam::constTra nsport<Foam::specieThermo<Foam::hConstThermo<Foam: erfectGas> > > > > >::New(Foam::fvMesh const&) in "/opt/openfoam/OpenFOAM-2.0.1/platforms/linux64GccDPOpt/lib/libbasicThermophysicalModels.so"
#6 Foam::basicRhoThermo::New(Foam::fvMesh const&) in "/opt/openfoam/OpenFOAM-2.0.1/platforms/linux64GccDPOpt/lib/libbasicThermophysicalModels.so"
#7 main in "/opt/openfoam/OpenFOAM-2.0.1/platforms/linux64GccDPOpt/bin/chtMultiRegionSimpleFoam"
#8 __libc_start_main in "/lib64/libc.so.6"
#9 Foam::regIOobject::writeObject(Foam::IOstream::str eamFormat, Foam::IOstream::versionNumber, Foam::IOstream::compressionType) const in "/opt/openfoam/OpenFOAM-2.0.1/platforms/linux64GccDPOpt/bin/chtMultiRegionSimpleFoam"
Fließkommafehler

I tried the 'unset' fro $FOAM_SIGFPE but doesnt seem to work at all.
Any ideas? IS there a problem with the libraries or the installation?
raghu.tejaswi is offline   Reply With Quote

Old   June 4, 2012, 05:58
Default
  #4
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
Quote:
Originally Posted by raghu.tejaswi View Post
Hi every1,

any concrete solution to the above problem? I have almost a similar problem but a little different. I am posting the failure below..

Create time

Create fluid mesh for region fluid for time = 0

Create solid mesh for region aluminium for time = 0

*** Reading fluid mesh thermophysical properties for region fluid

Adding to thermoFluid

Selecting thermodynamics package hsRhoThermo<pureMixture<constTransport<specieTherm o<hConstThermo<perfectGas>>>>>
#0 Foam::error:rintStack(Foam::Ostream&) in "/opt/openfoam/OpenFOAM-2.0.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1 Foam::sigFpe::sigHandler(int) in "/opt/openfoam/OpenFOAM-2.0.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2 __restore_rt at sigaction.c:0
#3 Foam::hsRhoThermo<Foam:ureMixture<Foam::constTra nsport<Foam::specieThermo<Foam::hConstThermo<Foam: erfectGas> > > > >::calculate() in "/opt/openfoam/OpenFOAM-2.0.1/platforms/linux64GccDPOpt/lib/libbasicThermophysicalModels.so"
#4 Foam::hsRhoThermo<Foam:ureMixture<Foam::constTra nsport<Foam::specieThermo<Foam::hConstThermo<Foam: erfectGas> > > > >::hsRhoThermo(Foam::fvMesh const&) in "/opt/openfoam/OpenFOAM-2.0.1/platforms/linux64GccDPOpt/lib/libbasicThermophysicalModels.so"
#5 Foam::basicRhoThermo::addfvMeshConstructorToTable< Foam::hsRhoThermo<Foam:ureMixture<Foam::constTra nsport<Foam::specieThermo<Foam::hConstThermo<Foam: erfectGas> > > > > >::New(Foam::fvMesh const&) in "/opt/openfoam/OpenFOAM-2.0.1/platforms/linux64GccDPOpt/lib/libbasicThermophysicalModels.so"
#6 Foam::basicRhoThermo::New(Foam::fvMesh const&) in "/opt/openfoam/OpenFOAM-2.0.1/platforms/linux64GccDPOpt/lib/libbasicThermophysicalModels.so"
#7 main in "/opt/openfoam/OpenFOAM-2.0.1/platforms/linux64GccDPOpt/bin/chtMultiRegionSimpleFoam"
#8 __libc_start_main in "/lib64/libc.so.6"
#9 Foam::regIOobject::writeObject(Foam::IOstream::str eamFormat, Foam::IOstream::versionNumber, Foam::IOstream::compressionType) const in "/opt/openfoam/OpenFOAM-2.0.1/platforms/linux64GccDPOpt/bin/chtMultiRegionSimpleFoam"
Fließkommafehler

I tried the 'unset' fro $FOAM_SIGFPE but doesnt seem to work at all.
Any ideas? IS there a problem with the libraries or the installation?
If you're developing a new solver you should have a debug-version as well. Because there the stack-trace will give you the actual line numbers in the source where the problem occurred and then it is almost trivial to spot the problem. See for instance http://openfoamwiki.net/index.php/Ho...on_of_OpenFOAM and http://openfoamwiki.net/index.php/Ma...roubleshooting

Nevertheless when I look at the stacktrace my guess is that we're looking at the "YouCan'tHavePressureZeroInACompressibleCase"-problem (so it is a setup problem)

So: start the compilation of a Debug-version. While that is compiling you'll have time to look at your initial conditions ...

Last edited by gschaider; June 4, 2012 at 06:11. Reason: One paste too many
gschaider is offline   Reply With Quote

Old   June 4, 2012, 06:28
Default
  #5
New Member
 
Learner
Join Date: Nov 2011
Location: Ingolstadt
Posts: 27
Rep Power: 15
raghu.tejaswi is on a distinguished road
Thank you for your response Mr.gschaider .... I am not trying to write a sovler myself, nut unfortunately I am receivng the same error as the one stated above, one of the reasons why I posted my situation here.

I use chtMultiRegionSimpleFoam as the std solver without modifications and also I use an incompressible case. I will definitely try with the debug version
raghu.tejaswi is offline   Reply With Quote

Old   June 4, 2012, 19:24
Default
  #6
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
Quote:
Originally Posted by raghu.tejaswi View Post
Thank you for your response Mr.gschaider .... I am not trying to write a sovler myself, nut unfortunately I am receivng the same error as the one stated above, one of the reasons why I posted my situation here.

I use chtMultiRegionSimpleFoam as the std solver without modifications and also I use an incompressible case. I will definitely try with the debug version
Didn't read the poster name so I thought you were the guy who was starting the thread. Things like that are the reason why hijacking threads ("Ah. That looks vaguely like my problem. I'll post here") is not very popular: it breaks the "flow" of the conversation.

Your problem may look similar but is not the same as the other: the stack trace is not the problem but a tool to help find the location of the actual problem and your stack trace and the one of the original poster show totally different locations in the important frames #3 and #4
gschaider is offline   Reply With Quote

Old   August 13, 2012, 17:08
Default
  #7
Member
 
ak
Join Date: May 2011
Posts: 64
Rep Power: 15
newOFuser is on a distinguished road
Hi raghu

were you able to get rid of the floating point exception? what was the problem?

Thanks
ak
newOFuser is offline   Reply With Quote

Old   August 14, 2012, 03:01
Default
  #8
New Member
 
Learner
Join Date: Nov 2011
Location: Ingolstadt
Posts: 27
Rep Power: 15
raghu.tejaswi is on a distinguished road
Quote:
Originally Posted by newOFuser View Post
Hi raghu

were you able to get rid of the floating point exception? what was the problem?

Thanks
ak
Hi newOFUser

if you are refering to the problem I stated (please have a look at the stack trace once again as suggested by gschaider), then the solution to that is to input the perfect boundary conditions for temperature (if constant wall heat flux doesnt work, try constant wall temperature) in 0 folder. And please make doubly sure how the thermophysical properties have to be used (the syntax too).

And yes, my problem is solved by doing the above. If all the above does not work, try to reduce the under-relaxation factor for temp.
raghu.tejaswi is offline   Reply With Quote

Reply


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
Floating point exception error Alan OpenFOAM Running, Solving & CFD 11 July 1, 2021 22:51
Floating point exception error with small DeltaT rassilon OpenFOAM Running, Solving & CFD 19 September 2, 2009 08:39
turbFoam floating point exception and k-epsilon Hectux OpenFOAM Running, Solving & CFD 4 April 28, 2009 08:10
movingConeTopo tutorial from 1.5-dev crashes with Floating Point Exception jaswi OpenFOAM Running, Solving & CFD 2 April 26, 2009 11:21
[Gmsh] Gmsh and samplesurface touf OpenFOAM Meshing & Mesh Conversion 2 December 10, 2007 03:27


All times are GMT -4. The time now is 16:02.