CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM

Nut generating a floating point exception

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Search this Thread Display Modes
Old   May 17, 2018, 22:11
Post Nut generating a floating point exception
New Member
Roberto Vázquez
Join Date: May 2018
Location: Mérida, Yucatán, México
Posts: 1
Rep Power: 0
robvazdom is on a distinguished road
Good evening,
I'm pretty new to OpenFOAM and CFD in general, so this may be a dumb question. I'm trying to simulate flow in a pipe with chtMultiRegionSimpleFoam, but when I run my case, I get the following message:
#0 Foam::error:: printStack(Foam::Ostream&) at ??:?
#1 Foam::sigFpe::sigHandler(int) at ??:?
#2 ? in "/lib/x86_64-linux-gnu/"
#3 Foam::divide(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) at ??:?
#4 Foam:: operator/(Foam::tmp<Foam::Field<double> > const&, Foam::UList<double> const&) at ??:?
#5 Foam::CompressibleTurbulenceModel<Foam::fluidTherm o>::nu(int) const at ??:?
#6 Foam::nutkWallFunctionFvPatchScalarField::calcNut( ) const at ??:?
#7 Foam::nutWallFunctionFvPatchScalarField::updateCoe ffs() at ??:?
#8 Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::Boundary::evaluate() at ??:?
#9 Foam::RASModels::kEpsilon<Foam::EddyDiffusivity<Fo am::ThermalDiffusivity<Foam::CompressibleTurbulenc eModel<Foam::fluidThermo> > > >::correctNut() at ??:?
#10 ? at ??:?
#11 __libc_start_main in "/lib/x86_64-linux-gnu/"
#12 ? at ??:?Floating point exception (core dumped)

I've read other posts with similar errors, with replies saying that most likely k and epsilon have initial values of zero. Mine are very small, around 3e-6, but definitely not zero. I don't really know what to do when I don't get a FOAM fatal error, so any help would be appreciated .

Thank you all in advance!

Last edited by robvazdom; May 17, 2018 at 22:13. Reason: smileys in my text
robvazdom is offline   Reply With Quote

Old   June 19, 2018, 17:24
Raunak Bardia
Join Date: Jan 2015
Posts: 32
Rep Power: 11
raunakbardia is on a distinguished road
I am facing the same issue while trying to run "reactingFoam". I understand that the error is being generated from the calcNut() function called from the boundary condition "nutkwallfunction".

Here is that function:
tmp<scalarField> nutkWallFunctionFvPatchScalarField::calcNut() const
    const label patchi = patch().index();

    const turbulenceModel& turbModel = db().lookupObject<turbulenceModel>

    const scalarField& y = turbModel.y()[patchi];
    const tmp<volScalarField> tk = turbModel.k();
    const volScalarField& k = tk();
    const tmp<scalarField> tnuw =;
    const scalarField& nuw = tnuw();

    const scalar Cmu25 = pow025(Cmu_);

    tmp<scalarField> tnutw(new scalarField(patch().size(), 0.0));
    scalarField& nutw = tnutw.ref();

    forAll(nutw, facei)
        label celli = patch().faceCells()[facei];

         scalar yPlus = Cmu25*y[facei]*sqrt(k[celli])/nuw[facei]; 

        if (yPlus > yPlusLam_)
           nutw[facei] = nuw[facei]*(yPlus*kappa_/log(E_*yPlus) - 1.0);

    return tnutw;
The issue seems to generate from the highlighted line as the line#5 in the error mentioned by Roberto refers to nu(int). On tracking line#5, I ended up in the file: OpenFOAM-5.0/src/TurbulenceModels/compressible/CompressibleTurbulenceModel. The reference to the nu(int) function is on line #125. The function is:

//- Return the laminar viscosity on patchi
        virtual tmp<scalarField> nu(const label patchi) const
The error is with division, and this implies that my rhoField has a value of zero at the boundaryField. I have defined the density using icoPolynomial<8> format. Is the error related to this or am I missing something else? How can we resolve this error? I have attached my 0 directory files.

Help from the more experienced FOAMers will be really useful.
Attached Files
File Type: zip (7.8 KB, 11 views)

Last edited by raunakbardia; June 19, 2018 at 17:52. Reason: Identifying the Code component separately.
raunakbardia is offline   Reply With Quote

Old   July 25, 2020, 07:34
New Member
Join Date: Aug 2019
Posts: 4
Rep Power: 6
yppoonia is on a distinguished road
Did you find a solution to this? I have run into a similar problem.
yppoonia is offline   Reply With Quote


chtmultiregionsimplefoam, floating point error, nut, openfoam

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
A floating point exception has occurred: floating point exception [Overflow]. starlight STAR-CCM+ 4 May 4, 2016 09:08
A floating point exception - SEM Model yansheng STAR-CCM+ 1 April 4, 2016 04:57
Floating point exception from twoPhaseEulerFoam openfoammaofnepo OpenFOAM Running, Solving & CFD 1 March 19, 2016 13:56
Floating point exception (core dumped) for GAMG solver yuhou1989 OpenFOAM Running, Solving & CFD 2 March 24, 2015 19:28

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