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

Running hotRoom tutorial at low pressure causes fatal error "Negative initial temp?"

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 4, 2019, 15:56
Default Running hotRoom tutorial at low pressure causes fatal error "Negative initial temp?"
  #1
Senior Member
 
Andrew Somorjai
Join Date: May 2013
Posts: 175
Rep Power: 13
massive_turbulence is on a distinguished road
Hello all,

I would love an explanation as to why this isn't functioning. I've looked over the theory of why this solver runs and I still cannot imagine why I'd get a negative temperature for the initial case.

Here's the output of the error running the hotRoom tutorial with buoyantPimpleFoam

Code:
Courant Number mean: -6.65662e-05 max: 4.57604e-07
Time = 3e-07

diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
PIMPLE: iteration 1
DILUPBiCGStab:  Solving for Ux, Initial residual = 0.00268968, Final residual = 4.59223e-15, No Iterations 1
DILUPBiCGStab:  Solving for Uy, Initial residual = 0.00269014, Final residual = 4.60139e-15, No Iterations 1
DILUPBiCGStab:  Solving for Uz, Initial residual = 0.00268968, Final residual = 4.59223e-15, No Iterations 1

DILUPBiCGStab:  Solving for h, Initial residual = 0.19232, Final residual = 1.63083e-12, No Iterations 1

--> FOAM FATAL ERROR: 
Negative initial temperature T0: -91630.1

    From function Foam::scalar Foam::species::thermo<Thermo, Type>::T(Foam::scalar, Foam::scalar, Foam::scalar, Foam::scalar (Foam::species::thermo<Thermo, Type>::*)(Foam::scalar, Foam::scalar) const, Foam::scalar (Foam::species::thermo<Thermo, Type>::*)(Foam::scalar, Foam::scalar) const, Foam::scalar (Foam::species::thermo<Thermo, Type>::*)(Foam::scalar) const) const [with Thermo = Foam::hConstThermo<Foam::perfectGas<Foam::specie> >; Type = Foam::sensibleEnthalpy; Foam::scalar = double; Foam::species::thermo<Thermo, Type> = Foam::species::thermo<Foam::hConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleEnthalpy>]
    in file /mnt/external/OpenFOAM/OpenFOAM-v1806/src/thermophysicalModels/specie/lnInclude/thermoI.H at line 54.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::error::abort() at ??:?
#2  Foam::heRhoThermo<Foam::rhoThermo, Foam::pureMixture<Foam::constTransport<Foam::species::thermo<Foam::hConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleEnthalpy> > > >::calculate(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, bool) at ??:?
#3  Foam::heRhoThermo<Foam::rhoThermo, Foam::pureMixture<Foam::constTransport<Foam::species::thermo<Foam::hConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleEnthalpy> > > >::correct() at ??:?
#4  ? in /mnt/external/OpenFOAM/OpenFOAM-v1806/platforms/linux64GccDPInt32Opt/bin/buoyantPimpleFoam
#5  __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6
#6  ? in /mnt/external/OpenFOAM/OpenFOAM-v1806/platforms/linux64GccDPInt32Opt/bin/buoyantPimpleFoam
Basically I setup the case with
blockMesh
setFields
foamJob -s buoyantPimpleFoam

The machines file is obviously my machine so you may need to change that to run it. I attached the entire case as a zip hotRoom.zip


I only made changes to the pressure files, here's p

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1806                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [1 -1 -2 0 0 0 0];

internalField   uniform 1e2;

boundaryField
{
    floor
    {
        type            calculated;
        value           $internalField;
    }

    ceiling
    {
        type            calculated;
        value           $internalField;
    }

    fixedWalls
    {
        type            calculated;
        value           $internalField;
    }
}

// ************************************************************************* //
p_rgh file

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1806                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [1 -1 -2 0 0 0 0];

internalField   uniform 1e2;

boundaryField
{
    floor
    {
        type            fixedFluxPressure;
        value           $internalField;
    }

    ceiling
    {
        type            fixedFluxPressure;
        value           $internalField;
    }

    fixedWalls
    {
        type            fixedFluxPressure;
        value           $internalField;
    }
}

// ************************************************************************* //
I tried using smaller time steps as well from .01 to .0000001; to no luck?

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1806                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application     buoyantPimpleFoam;

startFrom       startTime;

startTime       0;

stopAt          endTime;

endTime         2000;

deltaT          .0000001;

writeControl    timeStep;

writeInterval   100;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;

adjustTimeStep  no;

maxCo           0.5;

// ************************************************************************* //
massive_turbulence is offline   Reply With Quote

Old   January 5, 2019, 03:32
Default
  #2
Senior Member
 
Peter Baskovich
Join Date: Jul 2014
Posts: 127
Rep Power: 12
pete20r2 is on a distinguished road
Do you want to know why this is happening or just how to fix it? I can suggest utilising the limitTemperature function in fvOptions with some reasonable limits. Your issue is likely that the initial conditions are either bad or non-physical, although I have heard of parallel sometimes affecting convergence, although I think that was a bug and not normal behaviour.
https://www.openfoam.com/documentati...mperature.html

Or try initialising with a steady-state solver.

(Sorry for the long link, I'm on my phone)
pete20r2 is offline   Reply With Quote

Old   January 5, 2019, 14:09
Default
  #3
Senior Member
 
Andrew Somorjai
Join Date: May 2013
Posts: 175
Rep Power: 13
massive_turbulence is on a distinguished road
Quote:
Originally Posted by pete20r2 View Post
Do you want to know why this is happening or just how to fix it? I can suggest utilising the limitTemperature function in fvOptions with some reasonable limits. Your issue is likely that the initial conditions are either bad or non-physical, although I have heard of parallel sometimes affecting convergence, although I think that was a bug and not normal behaviour.
https://www.openfoam.com/documentati...mperature.html

Or try initialising with a steady-state solver.

(Sorry for the long link, I'm on my phone)
It's actually the fvSolution file that needs a minor tweak. In the section for PIMPLE that looks like

Code:
PIMPLE
{
    momentumPredictor yes;
    nOuterCorrectors 1;
    nCorrectors     2;
    nNonOrthogonalCorrectors 0;
    pRefCell        0;
    pRefValue       1e2;
}

I changed the pRefValue from 1e5 to the one shown above and then in object p_rgh I changed to this internalField uniform 1e1; and also in object p to internalField uniform 1e2; and the timestep is deltaT .0000001;. These changes made it work.

Not positive if this is the best fix; ran it for a while but at small timesteps, not sure if running it at 1/1000th would still work but that would be ideal.

If you want to explain the theory why the solver got negative temperature that would be fine. I would like to read your explanation. Thanks!
massive_turbulence is offline   Reply With Quote

Reply

Tags
buoyantpimplefoam, fatal error, low pressure, negative temperature


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
decompose dependent solution arionfard OpenFOAM 3 December 10, 2018 10:36
chtMultiRegionSimpleFoam turbulent case Aditya Patil OpenFOAM Running, Solving & CFD 6 April 24, 2017 23:13
Floating point exception error lpz_michele OpenFOAM Running, Solving & CFD 53 October 19, 2015 03:50
simpleFoam error - "Floating point exception" mbcx4jc2 OpenFOAM Running, Solving & CFD 12 August 4, 2015 03:20
Cannot run the code properly: very large time step continuity error crst15 OpenFOAM Running, Solving & CFD 9 December 14, 2014 19:17


All times are GMT -4. The time now is 10:55.