CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   sonicFoam - Floating point eception (core dumped) (https://www.cfd-online.com/Forums/openfoam-solving/144599-sonicfoam-floating-point-eception-core-dumped.html)

MSans November 17, 2014 11:04

sonicFoam - Floating point eception (core dumped)
 
Hello everyone!

I am working with a 3D nozzle. First of all I ran simpleFoam with no further issues but after introducing compressibility and turbulence it's when problems appear. The error is ot FOAM FATAL ERROR as usual. The exact script is the following:

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Create time

Create mesh for time = 0

Reading thermophysical properties

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

Reading/calculating face flux field phi

Creating turbulence model

Selecting turbulence model type RASModel
Selecting RAS turbulence model laminar

Starting time loop

Time = 0.05

#0 Foam::error:: PrintStack(Foam::Ostream&) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1 Foam::sigFpe::sigHandler(int) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2 in "/lib/x86_64-linux-gnu/libc.so.6"
#3 Foam::divide(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#4 Foam:: operator/(Foam::UList<double> const&, Foam::UList<double> const&) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#5
in "/opt/openfoam211/platforms/linux64GccDPOpt/bin/sonicFoam"
#6 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#7
in "/opt/openfoam211/platforms/linux64GccDPOpt/bin/sonicFoam"
Floating point exception (core dumped)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

I've seen in other posts that dicreasing the deltaT sometimes works but already tried with no better results.
Does ayone know what's this all about and how could I solve this?

Thank you very much!

Marc

alexeym November 17, 2014 11:31

Hi,

as the error happens during Courant number calculation (according to your output)

Code:

    scalarField sumPhi
    (
        fvc::surfaceSum(mag(phi))().internalField()
      / rho.internalField()
    );

    CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();

    meanCoNum =
        0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue();

and the error is FPE in division, I guess either you've got a problem with density IC (rho is zero somewhere) or your mesh is rather interesting (cell volume is zero somewhere).

MSans November 17, 2014 13:04

Thank you Alexey.

So, assuming (and hoping) it's not a 0-volume-cell problem (simpleFoam ran with no problem and it would have appeared then too, isn't it?) it most probably is a problem with density. Then, how can I fix it? is it just due to a certain value I should increase or decrease or it comes from combining pressure, velocity and temperature to satisfy Bernoulli's equation?

Thank you,

Marc

alexeym November 17, 2014 14:02

Well, if we take a look at createFields.H:

Code:

    Info<< "Reading thermophysical properties\n" << endl;

    autoPtr<psiThermo> pThermo
    (
        psiThermo::New(mesh)
    );
    psiThermo& thermo = pThermo();
    thermo.validate(args.executable(), "e");

    volScalarField& p = thermo.p();
    volScalarField& e = thermo.he();
    const volScalarField& psi = thermo.psi();

    volScalarField rho
    (
        IOobject
        (
            "rho",
            runTime.timeName(),
            mesh
        ),
        thermo.rho()
    );

and then at psiThermo.C:

Code:

Foam::tmp<Foam::volScalarField> Foam::psiThermo::rho() const
{
    return p_*psi_;
}

p_ is inherited form basicThermo and is a pressure, psi_ is calculated by concrete implementation of the thermo class. If any of these is zero, density is also zero, etc.

MSans November 17, 2014 17:45

But, as p is set as fixedValue and psi is the compressibility (psi=(rho*T*R)/W where rho is density, T temperature, R is the constant of gases and W not 100% sure what it exactly is but its units must be 1/mol) and all the variables come from the thermoPhysicalProperties document and those are constants, the only option is that at the very begining of the iterative process (this is why the terminal crashes at the first time loop), rho is set as 0 and it leads to psi=0 so rho* is again =0 and it makes my core dump.

Thank you very much Alexey!

But now (and this is the very last issue I bother you with, I hope) where can I change this initial value of rho?

alexeym November 18, 2014 02:12

Well,

post your 0 folder and thermophysicalProperties, otherwise it'll be just speculations.

chriss85 November 18, 2014 03:42

Without having looked very much into your problem, crashes can occur because of too large time steps or in unconverged solutions. Did you try lowering the time step size?

MSans November 18, 2014 05:28

1 Attachment(s)
Hello Chris, yes, I already tried but that's not the problem. Thank you anyway for taking a look at my post and try to help.

Alexey, here I leave you my 0 folder and the thermophysicalProperties (this is directly copied from the sonicFoam airfiol tutorial, though)

alexeym November 18, 2014 05:52

Hi,

if you take a look at your p file:

Code:

...
dimensions      [0 2 -2 0 0 0 0];

internalField  uniform 0;
...

you'll see, at t=0 pressure overall the calculation domain is 0 (well, inlet and outlet have non-zero value).

MSans November 19, 2014 04:22

3 Attachment(s)
Oh dear... it sounded so stupid and so obvious that seemed it had to work but didn't... It's true that we could go a bit forward. Following the steps sonicFoam follows when solving I've seen it crashes when it tries to calculate density
(or just after it but without having the right value (it leaves rho=0) and has to divide by it. Dividing by 0 -> core dumped).

Now the code is:

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

Create mesh for time = 0

Reading thermophysical properties

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

Reading/calculating face flux field phi

Creating turbulence model

Selecting turbulence model type RASModel
Selecting RAS turbulence model laminar

Starting time loop

Time = 5e-05

Courant Number mean: 0.000373442 max: 0.00330131
#0 Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1 Foam::sigFpe::sigHandler(int) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2 in "/lib/x86_64-linux-gnu/libc.so.6"
#3 Foam::divide(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#4 Foam::operator/(Foam::UList<double> const&, Foam::UList<double> const&) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#5 Foam::diagonalSolver::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#6 Foam::fvMatrix<double>::solve(Foam::dictionary const&) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libfiniteVolume.so"
#7 Foam::fvMatrix<double>::solve() in "/opt/openfoam211/platforms/linux64GccDPOpt/bin/sonicFoam"
#8
in "/opt/openfoam211/platforms/linux64GccDPOpt/bin/sonicFoam"
#9 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#10
in "/opt/openfoam211/platforms/linux64GccDPOpt/bin/sonicFoam"
Floating point exception (core dumped)
//////////////////////////////////////////////////////////////////////////////////////////////////////////////

I've been trying to find where the error is and changed some parameters but ,sadly, it was not effective. I am sure there is another stupid mistake like the one with the pressure but I am not able to find it.

I leave you here the full case so you can take a look at it (if you can).
I removed polyMesh and trisurface from the constant folder just due to a folder-size problem

Thank you!

alexeym November 19, 2014 06:03

Well, sonicFoam is transient solver, not quite sure it likes this

Code:

ddtSchemes
{
    default        steadyState;
}

I'll skip source code walk-through this time.

MSans November 19, 2014 15:54

Awesome!

After changing it to Euler and adjusting FvSchemes and FvSolution to it, finally worked!

I am really really grateful

Thank you very much Alexey!

Marc

Kittipos August 4, 2015 05:10

3 Attachment(s)
Hi

I have a problem with running rhoPorousSimpleFoam.

I used Gambit to generated mesh and export 3D mesh to OpenFoam.

#0 Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam221/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#1 Foam::sigFpe::sigHandler(int) in "/opt/openfoam221/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#2 Uninterpreted:
#3 Foam::heRhoThermo<Foam::rhoThermo, Foam::pureMixture<Foam::sutherlandTransport<Foam:: species::thermo<Foam::hConstThermo<Foam::perfectGa s<Foam::specie> >, Foam::sensibleInternalEnergy> > > >::calculate() in "/opt/openfoam221/platforms/linuxGccDPOpt/lib/libfluidThermophysicalModels.so"
#4 Foam::heRhoThermo<Foam::rhoThermo, Foam::pureMixture<Foam::sutherlandTransport<Foam:: species::thermo<Foam::hConstThermo<Foam::perfectGa s<Foam::specie> >, Foam::sensibleInternalEnergy> > > >::correct() in "/opt/openfoam221/platforms/linuxGccDPOpt/lib/libfluidThermophysicalModels.so"
#5
in "/opt/openfoam221/platforms/linuxGccDPOpt/bin/rhoPorousSimpleFoam"
#6 __libc_start_main in "/lib/i386-linux-gnu/libc.so.6"
#7
in "/opt/openfoam221/platforms/linuxGccDPOpt/bin/rhoPorousSimpleFoam"
Floating point exception (core dumped)


All times are GMT -4. The time now is 03:14.