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

How to solve Floating point exception error

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By erichu

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 10, 2013, 08:17
Default How to solve Floating point exception error
  #1
Member
 
M Mallikarjuna Reddy
Join Date: Jul 2012
Posts: 91
Rep Power: 13
mmkr825 is on a distinguished road
Hi Foamers,
I am doing simulations on 2D rectangular channel by using steady state solver. I prepared my solver by modifying "simpleFoam" solver. The dimensions (length*breadth) of the channel are 0.143*0.0017 (m). My geometry has 500*10 grids in x- and y- directions respectively. When i run my solver with 500*10 grids, it is giving good results. But when I refine grids or increase the dimensions of the channel, It is giving the following error.

Error:
Code:
#0  Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#1  Foam::sigFpe::sigHandler(int) in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#2  Uninterpreted: 
#3   in "/lib/i386-linux-gnu/libm.so.6"
#4  pow in "/lib/i386-linux-gnu/libm.so.6"
#5   Foam::pow(Foam::Field<double>&, Foam::UList<double>  const&, double const&) in  "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#6   Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField,  Foam::volMesh> > Foam::pow<Foam::fvPatchField,  Foam::volMesh>(Foam::tmp<Foam::GeometricField<double,  Foam::fvPatchField, Foam::volMesh> > const&,  Foam::dimensioned<double> const&) at  /opt/openfoam211/src/OpenFOAM/lnInclude/GeometricScalarField.C:273
#7  
 at /opt/openfoam211/src/OpenFOAM/lnInclude/GeometricScalarField.C:349
#8  __libc_start_main in "/lib/i386-linux-gnu/libc.so.6"
#9  
 in "/home/malli_reddy/OpenFOAM/malli_reddy-2.1.1/platforms/linuxGccDPOpt/bin/SBM25Foam"
Floating point exception
Even the geometry pass the checkMesh test. Could someone please help me to understand though my solver is steady state why it is grid dependent. Thanks in advance.

Regards
Reddy
mmkr825 is offline   Reply With Quote

Old   April 10, 2013, 08:47
Default
  #2
New Member
 
Eric
Join Date: Mar 2013
Posts: 22
Rep Power: 13
erichu is on a distinguished road
I had a similar problem just a couple of days ago. I found that if I refine the mesh I get problems with vortices that causes the sovler to abort.

Are you running with turbulence models? In that case, try lowering relaxation factors, i.e. for k and epsilon.

You can also save every iteration and later on analyse flow vectors (U) the last steps before the crash using Paraview and a glyph filter.
HappyS5 likes this.
erichu is offline   Reply With Quote

Old   April 11, 2013, 04:28
Default
  #3
Member
 
M Mallikarjuna Reddy
Join Date: Jul 2012
Posts: 91
Rep Power: 13
mmkr825 is on a distinguished road
Dear Erichu,
Thanks for your quick reply. I am running with laminar flow only. As you noticed, i saved each iteration data and found the values are tending to infinite. I also tried by lowering relaxation factors but the same result. Could you please suggest me is anything should i change?

Thanks
M Reddy
mmkr825 is offline   Reply With Quote

Old   April 12, 2013, 22:10
Default
  #4
Senior Member
 
atmcfd's Avatar
 
ATM
Join Date: May 2009
Location: United States
Posts: 104
Rep Power: 16
atmcfd is on a distinguished road
Hey mmkr,

though I am not able to exactly point out the root cause, one thing I can suggest is "bounding" the solution values in your fvSchemes file. Usually this works for RANS turbulence models when the k and epsilon values overshoot often to cause sigFpe. You may try something like that.

And if you are not sure which parameter to bound, you have to compile the code in debug mode. Here your error appears in a pow() operation....Compiling in the debug mode will actually give you the exact line number in your solver and associated header files, which will make it easier for you to trace the parameter causing the issue.

If I remember right, to compile in debug mode you need to add

Code:
   
 -DFULLDEBUG -g -O0
to the end of the EXE_INC = \ in your options file.

Let me know if this works.

good luck,
Atm
atmcfd is offline   Reply With Quote

Old   April 13, 2013, 03:16
Default
  #5
Member
 
M Mallikarjuna Reddy
Join Date: Jul 2012
Posts: 91
Rep Power: 13
mmkr825 is on a distinguished road
Dear Atm,
Thanks for your response. I compiled my code in debug mode and found the exact line number which causing the errors. In my solver after few iterations the values for the field T (let say) tends to very high value (O(10^39)). Moreover i have one more parameter "f" which is pow(T) and this operation causing the error. Could you please tell me how to bound this in "fvSchemes" file.

Thanks
M Reddy
mmkr825 is offline   Reply With Quote

Old   April 13, 2013, 17:25
Default
  #6
Senior Member
 
atmcfd's Avatar
 
ATM
Join Date: May 2009
Location: United States
Posts: 104
Rep Power: 16
atmcfd is on a distinguished road
Hi M. Reddy,

The 10^39 squared will give you a number very high which causes the sigFpe. I guess bounding should work here, but I am not sure of the parameters since you are running a steady state case. You may actually try using flux limiters to bound the values, and this feature is there in OpenFOAM. In case you are running turbulence, I would suggest bounding scalar k and epsilon values as

Code:
div(phi,k) Gauss limitedVanLeer <lower limit> <Upper limit>;

The choice of schemes here can be changed. However, to get a complete idea of how bounding can be done, refer to this thread

http://www.cfd-online.com/Forums/ope...g-epsilon.html

Also, bounding scalars which are part of the modeling scheme is more advisable than bounding state variables like velocity etc, since that might lead to huge errors due to continuity equation.
atmcfd is offline   Reply With Quote

Old   April 16, 2013, 05:28
Default
  #7
Member
 
M Mallikarjuna Reddy
Join Date: Jul 2012
Posts: 91
Rep Power: 13
mmkr825 is on a distinguished road
Dear Atm,
Thank you very much for your valuable information. I would like to explain in more detail about my solver. In my solver i have three field variables (p, U & T) and it is steady and the flow is laminar. I modified "simpleFoam" to fit my needs (I commented the lines where turbulent related terms are present). Since in my solver i am using shear rate term good initial guess for the velocity is necessary.
I plotted the residuals plots. For the field variable "T", the residual plot has oscillations and the residuals are increasing gradually. At present i am using "Gauss linear" for the div operations. As you suggested i tried to change the div schemes to "Gauss upwind" but the following error is coming.

Error:
Code:
--> FOAM FATAL IO ERROR: 
attempt to read beyond EOF

file: /home/malli_reddy/OpenFOAM/malli_reddy-2.1.1/run/caseFile4/system/fvSchemes::divSchemes::div(Epnn1) at line 32.

    From function ITstream::read(token&)
    in file db/IOstreams/Tstreams/ITstream.C at line 83.

FOAM exiting
Could you please explain me why it is giving the above error. Thanks in advance.

Regards
M Reddy
mmkr825 is offline   Reply With Quote

Old   April 16, 2013, 14:39
Default
  #8
Senior Member
 
atmcfd's Avatar
 
ATM
Join Date: May 2009
Location: United States
Posts: 104
Rep Power: 16
atmcfd is on a distinguished road
Dear M Reddy,

the EOF refers to the code trying to read beyond the "end of file" looking for an identifier, or an OpenFOAM option, which you might have missed.

most of the time this happens due to incorrect declaration of numerical schemes - Did you miss including a "Gauss" or a "phi" somewhere? Please check the OF website for the settings and makes sure this is consistent.

If thats fine, check if you have not missed a ";" at the end of the statement. These are the most common causes in my experience.


Atm
atmcfd is offline   Reply With Quote

Old   April 18, 2013, 09:22
Default
  #9
Member
 
M Mallikarjuna Reddy
Join Date: Jul 2012
Posts: 91
Rep Power: 13
mmkr825 is on a distinguished road
Dear Atm,
I corrected the error but still after few iterations the solution is diverging. For the first few iterations the solution seems qualitatively OK but as the iterations increases the values for the field "T" going beyond bounds. Physically the solution for T should be in between (0, 0.68). When T value exceeds 0.68 it is diverging. I didn't encounter this problem for coarser mesh. Could you please tell me how to bound T in between (0, 0.68).

Thanks
M Reddy
mmkr825 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
[swak4Foam] GroovyBC the dynamic cousin of funkySetFields that lives on the suburb of the mesh gschaider OpenFOAM Community Contributions 300 October 29, 2014 18:00
c++ libraries and solver compiling vaina74 OpenFOAM Installation 13 February 3, 2012 17:43
[OpenFOAM] Saving ParaFoam views and case sail ParaView 9 November 25, 2011 15:46
ParaView for OF-1.6-ext Chrisi1984 OpenFOAM Installation 0 December 31, 2010 06:42
POSDAT problem piotka STAR-CD 4 June 12, 2009 08:43


All times are GMT -4. The time now is 18:39.