CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   Floating point exception with simpleFoam (

sbusmayer October 28, 2013 20:55

Floating point exception with simpleFoam
5 Attachment(s)
Hi all,
I'm having trouble to run simulations with turbulence (k-epsilon model) and my desired case settings.
To give an idea, the simulation consists of:
* A rectangular tank (2x2x2) generated using SALOME-MECA
* Mesh -> NETGEN Max size 0.10
* There are 3 groups: inlet, outlet, walls
* Diameter of pipes = 0.075m
* U (inlet) = (0.5 0 0)
* nu = 1e-06 (water)
* Initial k-epsilon values are k=0.00094 and epsilon=0.00031 (these values were calculated using openfoam suggested formula)
* timeSteps used for now => 1, 0.1, 0.01, 0.001, 0.0001

The thing is, I ran the simulation with icoFoam and got no problems.
But now using simpleFoam I got this error:


sbusmayer@SBusmayer-CAE:~/OpenFOAM/sbusmayer-2.0.1/CFD-OpenFOAM/simpleFoam$  #0  Foam::error::printStack(Foam::Ostream&) in  "/home/sbusmayer/OpenFOAM/sbusmayer-2.0.1/platforms/linux64GccDPOpt/lib/"
#1  Foam::sigFpe::sigHandler(int) in "/home/sbusmayer/OpenFOAM/sbusmayer-2.0.1/platforms/linux64GccDPOpt/lib/"
#2  in "/lib/"
#3    Foam::DICPreconditioner::calcReciprocalD(Foam::Field<double>&,  Foam::lduMatrix const&) in  "/home/sbusmayer/OpenFOAM/sbusmayer-2.0.1/platforms/linux64GccDPOpt/lib/"
#4  Foam::DICPreconditioner::DICPreconditioner(Foam::lduMatrix::solver  const&, Foam::dictionary const&) in  "/home/sbusmayer/OpenFOAM/sbusmayer-2.0.1/platforms/linux64GccDPOpt/lib/"
#5    Foam::lduMatrix::preconditioner::addsymMatrixConstructorToTable<Foam::DICPreconditioner>::New(Foam::lduMatrix::solver  const&, Foam::dictionary const&) in  "/home/sbusmayer/OpenFOAM/sbusmayer-2.0.1/platforms/linux64GccDPOpt/lib/"
#6  Foam::lduMatrix::preconditioner::New(Foam::lduMatrix::solver  const&, Foam::dictionary const&) in  "/home/sbusmayer/OpenFOAM/sbusmayer-2.0.1/platforms/linux64GccDPOpt/lib/"
#7  Foam::PCG::solve(Foam::Field<double>&,  Foam::Field<double> const&, unsigned char) const in  "/home/sbusmayer/OpenFOAM/sbusmayer-2.0.1/platforms/linux64GccDPOpt/lib/"
#8  Foam::fvMatrix<double>::solve(Foam::dictionary const&) in  "/home/sbusmayer/OpenFOAM/sbusmayer-2.0.1/platforms/linux64GccDPOpt/lib/"
#9  Foam::fvMatrix<double>::solve() in "/home/sbusmayer/OpenFOAM/sbusmayer-2.0.1/platforms/linux64GccDPOpt/bin/simpleFoam"
 in "/home/sbusmayer/OpenFOAM/sbusmayer-2.0.1/platforms/linux64GccDPOpt/bin/simpleFoam"
#11  __libc_start_main in "/lib/"
 in "/home/sbusmayer/OpenFOAM/sbusmayer-2.0.1/platforms/linux64GccDPOpt/bin/simpleFoam"
sbusmayer@SBusmayer-CAE:~/OpenFOAM/sbusmayer-2.0.1/CFD-OpenFOAM/simpleFoam$ ^C
[1]+  Floating point exceptionsimpleFoam > log

On this last sim, I used timeStep = 0.0001, and it goes fine up to 10s, but it soon increases the Courant number and I got floating points exception. It also happened with timeStep = 0.1/0.01/0.001.

I've attached my system files, and am hoping that someone could help me with this as I need the simulation to complete my final thesis :eek:

Attachment 26437

Attachment 26438

Attachment 26439

Attachment 26440

Attachment 26441

sbusmayer October 28, 2013 20:58

The other files
3 Attachment(s)
The rest of "system" files:

Please I really need someone's help because here where I study no one uses OpenFOAM, so there is no one to assist me.

Attachment 26442

Attachment 26443

Attachment 26444

tomf October 29, 2013 08:44

Hi Samanta,

First of all, I was wondering why you are checking the Courant number in simpleFoam? It is a steady state solver, so it does not need to check for the Courant number, which is only relevant in time dependent problems. Out of the box this check is not available, so the source code must have been changed.

So, you should be able to run the case also with a "time step" (better would be iteration counter) of 1.

The only thing that it does point out in this case is that you get very high velocities, which is probably due to some issues with the turbulence variables, maybe the initial conditions are not correct for your simulation? I think you set-up a case with 5 % Turbulence intensity, which seems appropriate, but I think your epsilon value is a bit low. If I use a length scale of 0.07 times the pipe diameter I come to a value of 0.35, instead of the value of 0.00031.

Good luck.

sbusmayer October 29, 2013 19:46

Dear tomf,

Thank you for your reply!
You're totally right.. Thanks for pointing it out! I think I messed up with my source code when trying to find what was going wrong, and now that I put the original simpleFoam it worked without problems!
I also used delta_t = 1s as you said.

I just have one question, why do you use the "length scale of 0.07 times the pipe diameter"?
OpenFOAM suggests to use:
epsilon = (C_mu^0.75 x k^1.5) / L
where L was set as 20% of pipe diameter, so:
epsilon = (0.09^0.75 x 0.00094^1.5) / (0.20 x 0.075) = 0.00031

Just to complement, k was calculated as follow:
k = 1/2 (Ux' + Uy' + Uz'), I considered that Ux'=Uy'=Uz' so:
k = 3/2 (U'), the I said that U'=5% of U
k = 3/2 (0.05 x 0.5) = 0.00094

I would much appreciate a bit more of your attention!! =)

TReviol October 30, 2013 04:37


have a look at this link.


tomf October 30, 2013 05:57

Hi Samanta,

Well it looks like we have used a different formula to estimate epsilon. I think I made a mistake to get to 0.35, however the 0.07 factor is what we use instead of 20% and the 0.07 seems to work for most of our internal flow cases. For external flow I would rather get the estimate from the viscosity ratio. Anyway it seems like if you pipe length is large enough, the exact value at the inlet is not influencing the final result, except for stability issues. As always best would be to compare with experimental data.

Good to hear that the simulation is running.


sbusmayer October 30, 2013 16:47


Originally Posted by TReviol (Post 459796)

have a look at this link.


That's awesome! Thanks mate! =)

sbusmayer October 30, 2013 17:34


Originally Posted by tomf (Post 459818)
Hi Samanta,

Anyway it seems like if you pipe length is large enough, the exact value at the inlet is not influencing the final result, except for stability issues. As always best would be to compare with experimental data.

Good to hear that the simulation is running.


Thank you for your attention Tom!
Your help was really valuable! =D

All times are GMT -4. The time now is 11:36.