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

Floating point exception Error from fvSolution

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By wyldckat

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 8, 2015, 09:54
Default Floating point exception Error from fvSolution
  #1
Member
 
Sandra
Join Date: Oct 2014
Posts: 58
Rep Power: 11
sabago is on a distinguished road
Dear OFers,

I have a case that I know is ok in terms of geometry as I have run other solvers on it and checkMesh is OK.

I made a change somewhere (in the charge density equations) in my solver and it compiled fine, however, I get an error after one iteration at a different point from where I made the edit (e.g in the diffusion equations). Below is the error
Code:
#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::sigFpe::sigHandler(int) at ??:?
#2   in "/lib/x86_64-linux-gnu/libc.so.6"
#3  double Foam::sumProd<double>(Foam::UList<double> const&, Foam::UList<double> const&) at ??:?
#4  Foam::PCG::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const at ??:?
#5  Foam::fvMatrix<double>::solveSegregated(Foam::dictionary const&) at ??:?
#6  Foam::fvMatrix<double>::solve(Foam::dictionary const&) at ??:?
#7  
 at ??:?
#8  
 at ??:?
#9  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#10  
 at ??:?
Floating point exception (core dumped)
My fvScheme is as follows
Code:
ddtSchemes
{
    default         Euler;
}

gradSchemes
{
    default         Gauss linear;
    grad(p)         Gauss linear;
}

divSchemes
{
    default         none;
    div(phi,U)      Gauss linear;
}

laplacianSchemes
{
    default         none;
    laplacian(DH2,H2) Gauss linear corrected;
    laplacian(DT,H2O) Gauss linear corrected;
    laplacian(DH2Oeff,H2O) Gauss linear corrected;

    laplacian(Tussle,phi) Gauss linear corrected;
    
}

interpolationSchemes
{
    default         linear;
    interpolate(HbyA) linear;
}

snGradSchemes
{
    default         corrected;
}

fluxRequired
{
    default         no;
    p               ;
}
and my fvSolution
Code:
solvers
{H2O
    {
        solver          PCG;
        preconditioner  DIC;
        tolerance       1e-06;
        relTol          0;
    }
    
    H2
    {
        solver          PCG;
        preconditioner  DIC;
        tolerance       1e-06;
        relTol          0;
    }
    phi

    {
        solver          smoothSolver;
	smoother	GaussSeidel;
	//smoother	DICGaussSeidel;
        tolerance       1e-06;
	nSweeps 	1;
        relTol          .99999999999999;//.999969;//.99995;//.99999;
    }

}
SIMPLE
{
    nNonOrthogonalCorrectors 0;
}
I changed the fvSolution to this (below) for the calculation of H2O diffusion where I was getting the error but I still get the DICPCG error! even when I change the fvSolution!
Code:
H2O
    {
         solver           GAMG;
        tolerance        1e-12;
        relTol           0.1;

        maxIter         20;    

        smoother         DIC;
    
        nPreSweeps       1;
        nPostSweeps      1;
        nFinestSweeps    2;

        cacheAgglomeration true;

        nCellsInCoarsestLevel 1000;
        agglomerator     faceAreaPair;
        mergeLevels      1;
    }
I have spent days trying the suggestions elsewhere on the forum like checking mesh, reducing timeStep to reduce Courant number and BC (case works fine with one line of code changed in the solver) and tried playing with the fvSchemes and fvSolution; what I'm I doing wrong/missing?

Best,
Sandra
sabago is offline   Reply With Quote

Old   December 11, 2015, 15:58
Default
  #2
Member
 
Sandra
Join Date: Oct 2014
Posts: 58
Rep Power: 11
sabago is on a distinguished road
Hi again OFers,

At this point I just want the changes that I make in fvSolution to take!

I changed from PCG to GAMG solver but I'm still getting a "Foam::PCG::solve" error.

Any ideas will be much appreciated.

Best,
Sandra
sabago is offline   Reply With Quote

Old   December 12, 2015, 15:45
Default
  #3
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Sandra,

Quote:
Originally Posted by sabago View Post
I made a change somewhere (in the charge density equations) in my solver and it compiled fine, however, I get an error after one iteration at a different point from where I made the edit (e.g in the diffusion equations). Below is the error
Code:
#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::sigFpe::sigHandler(int) at ??:?
#2   in "/lib/x86_64-linux-gnu/libc.so.6"
#3  double Foam::sumProd<double>(Foam::UList<double> const&, Foam::UList<double> const&) at ??:?
#4  Foam::PCG::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const at ??:?
The problem likely has nothing to do with the parameters you defined in "fvSolution". The major problem is that "sigFpe" refers to this: https://en.wikipedia.org/wiki/Unix_signal#SIGFPE - the usual reason is a division by zero, but given that it occurred in the operation "sumProd", my guess is that there is one value that is either NaN (not-a-number) or INF (infinite).

You need to retrace your steps back to the change you made in the source code. Whatever you did, no matter how innocent it might have seemed, it's likely the origin of this problem.

When in doubt, old-school-debugging is one way to isolate the breaking point. Quoting myself from another post:
Quote:
Originally Posted by wyldckat View Post
First thing you should do: isolate and conquer. There is a wiki page on the topic of debugging: http://openfoamwiki.net/index.php/HowTo_debugging
And recently I wrote a post with an example on how to do old-school debugging, namely to output as much information as possible, to see what's truly happening: http://www.cfd-online.com/Forums/ope...tml#post512967 post #9

I don't have much time to ask for more details, so the best i can do is to tell you for you to look for the details yourself
More specifically, try to see what exact values do the more relevant fields have before the crash. For example:
Code:
Info << "flu_: " << flu_ << endl;
Best regards,
Bruno
calf.Z likes this.
__________________
wyldckat is offline   Reply With Quote

Old   December 14, 2015, 02:16
Default Coukd be the boundary conditions
  #4
Senior Member
 
Fabian Roesler
Join Date: Mar 2009
Location: Germany
Posts: 213
Rep Power: 18
fabian_roesler is on a distinguished road
From your log I can see that your simulation is running serial an not parallel. However, I sometimes have this kind of error when some boundaries or processor patches have no value defined. Since this happened a couple of times I always set the boundary values as initial condition.

Code:
myPatch
{
   type    someType;
   value   $internalField;
}
Cheers

Fabian
fabian_roesler is offline   Reply With Quote

Old   December 14, 2015, 09:36
Default
  #5
Member
 
Sandra
Join Date: Oct 2014
Posts: 58
Rep Power: 11
sabago is on a distinguished road
Thanks for your input, Bruno and Fabian,

I'll try your suggestions.

Best,
Sandra
sabago is offline   Reply With Quote

Old   March 22, 2016, 00:59
Default
  #6
New Member
 
Alpha Beta
Join Date: Mar 2016
Posts: 28
Rep Power: 10
xoitx is on a distinguished road
Hello Sandra
Did you find out the cause?
I have the exact same error message.. I guess it's a division by 0 somewhere can't figure out where.
Thanks

[ Moderator note: This forum member later started a new thread on this topic here: http://www.cfd-online.com/Forums/ope...erdymfoam.html ]

Last edited by wyldckat; March 26, 2016 at 05:52. Reason: see "Moderator note:"
xoitx 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
icoFoam floating point exception (8) leizhao512 OpenFOAM Running, Solving & CFD 7 November 1, 2018 11:43
Floating point exception (core dumped) for GAMG solver yuhou1989 OpenFOAM Running, Solving & CFD 2 March 24, 2015 19:28
Inlet Velocity Profile BC - Floating Point exception during solution initialization Janshi STAR-CCM+ 4 March 14, 2012 10:21
Pipe flow in settlingFoam floating point exception jochemvandenbosch OpenFOAM Running, Solving & CFD 4 February 16, 2012 03:24
block-structured mesh for t-junction Robert@cfd ANSYS Meshing & Geometry 20 November 11, 2011 04:59


All times are GMT -4. The time now is 06:29.