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

Negative temperature T0 in sonicFoam OF 5.x

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By deepbandivadekar

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 25, 2018, 14:49
Default Negative temperature T0 in sonicFoam OF 5.x
  #1
Senior Member
 
Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 9
deepbandivadekar is on a distinguished road
I am trying to understand why this error exists in the first place. I am running sonicFoam in parallel. To initialise the case, for an inlet, knowing only pressure is practical so am trying to implement boundary conditions like pressureInletVelocity, pressureDirectedInletVelocity etc. however with no luck.

I am getting errors on account of negative temperature T0. I'm trying to find the source of this error but am stuck. I as hoping someone could help?

I looked at some of the relevant threads (Negative temperature and pressure in sonicFoam :O , sonicFoam forwardstep negative temperature problem.) but changing pressure tolerance in fvSolution or changing the fvSchemes to cellLimited Gauss linear 1 and some variations of these do not seem to affect the outcome. According to one more thread, the temperature limits through fvOptions do not seem to affect sonicFoam (Tmax, Tmin), which anyway is sort of meddling with the energy equation which I don't really want to do.

my inlet and outlet conditions are as below:

U:
Code:
inlet1
    {
        type            supersonicFreestream;
        pInf            $pressure;
        TInf            $temperature;
        UInf            $speed;
        gamma           1.4; // Specific heat ratio
        value           $internalField;
    }
    inlet2    //check this again, try variations
    {
        type            pressureDirectedInletVelocity;    //Trial:24 Feb 2018
        phi             phi;
        rho             rho;
        inletDirection  uniform (-1 0 0);
        value           uniform (0 0 0);
    }
corresponding p:
Code:
inlet1
    {
        type            zeroGradient;
    }
    inlet2
    {
//        type            zeroGradient;  //Original condition. fixedValue trial: 20Feb2018
      type        fixedValue;
      value        uniform $pressurePorous;
    }
Error:
Code:
[3] --> FOAM FATAL ERROR: 
[3] Negative initial temperature T0: -31.0648
[3] 
[3]     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::sensibleInternalEnergy; Foam::scalar = double; Foam::species::thermo<Thermo, Type> = Foam::species::thermo<Foam::hConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy>]
[3]     in file /home/ubuntu/OpenFOAM/OpenFOAM-5.x/src/thermophysicalModels/specie/lnInclude/thermoI.H at line 54.
[3] 
FOAM parallel run aborting
[3] 
[3] #0  Foam::error::printStack(Foam::Ostream&) at ??:?
[3] #1  Foam::error::abort() at ??:?
[3] #2  Foam::species::thermo<Foam::hConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy>::TEs(double, double, double) const at ??:?
[3] #3  Foam::hePsiThermo<Foam::psiThermo, Foam::pureMixture<Foam::constTransport<Foam::species::thermo<Foam::hConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy> > > >::calculate() at ??:?
[3] #4  Foam::hePsiThermo<Foam::psiThermo, Foam::pureMixture<Foam::constTransport<Foam::species::thermo<Foam::hConstThermo<Foam::perfectGas<Foam::specie> >, Foam::sensibleInternalEnergy> > > >::correct() at ??:?
[3] #5  ? at ??:?
[3] #6  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
[3] #7  ? at ??:?
What are the reasons temperature could fall below 0? Where should I look?
deepbandivadekar is offline   Reply With Quote

Old   February 26, 2018, 03:52
Default
  #2
Senior Member
 
piu58's Avatar
 
Uwe Pilz
Join Date: Feb 2017
Location: Leipzig, Germany
Posts: 744
Rep Power: 15
piu58 is on a distinguished road
I don't know your boundary and initial conditions of the temperature. But if you work close to 0 K, values below that may be calculated due to numerical effects. If that is the case you may considering to rise the problem to higher temperatures bu correcting the temperature dependant functions.
__________________
Uwe Pilz
--
Die der Hauptbewegung überlagerte Schwankungsbewegung ist in ihren Einzelheiten so hoffnungslos kompliziert, daß ihre theoretische Berechnung aussichtslos erscheint. (Hermann Schlichting, 1950)
piu58 is offline   Reply With Quote

Old   February 26, 2018, 07:32
Default
  #3
Senior Member
 
Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 9
deepbandivadekar is on a distinguished road
Quote:
Originally Posted by piu58 View Post
I don't know your boundary and initial conditions of the temperature. But if you work close to 0 K, values below that may be calculated due to numerical effects. If that is the case you may considering to rise the problem to higher temperatures bu correcting the temperature dependant functions.
Thanks Uwe Pilz for your quick reply. OK, it makes sense that if the lower bound is close to zero the numerical method might be causing it to fall below zero. Although, I'm not sure 180K is closer to zero or not. I'm thinking perhaps it isn't that close, so the issue might be with choosing right schemes?

The temperature difference within the initialised domain is rather low: 180 - 300K. The difference is expected to grow high over the next time steps up to 1000K.
deepbandivadekar is offline   Reply With Quote

Old   February 26, 2018, 09:31
Default
  #4
Senior Member
 
piu58's Avatar
 
Uwe Pilz
Join Date: Feb 2017
Location: Leipzig, Germany
Posts: 744
Rep Power: 15
piu58 is on a distinguished road
180 K is not such close to 0 K and you should not have the effect.

I recommend starting first with a very simple geometry, but all of the physics. I have seen strange effects with temperature when more complicated geometries are used.

Of course, I don't know your case en détail. If you need more help it would be useful to describe what do you try to calculate. Mey be there exists a slighly or even total different way.
__________________
Uwe Pilz
--
Die der Hauptbewegung überlagerte Schwankungsbewegung ist in ihren Einzelheiten so hoffnungslos kompliziert, daß ihre theoretische Berechnung aussichtslos erscheint. (Hermann Schlichting, 1950)
piu58 is offline   Reply With Quote

Old   February 27, 2018, 07:05
Default
  #5
Senior Member
 
Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 9
deepbandivadekar is on a distinguished road
Quote:
Originally Posted by piu58 View Post
180 K is not such close to 0 K and you should not have the effect.
Yes, that's what I felt too. The geometry is simple enough but I have a feeling it has something to do with meshing.

By the way, when it comes to those BCs at inlet (pressureInletVelocity, pressureDirectedInletVelocity,...) what does the value parameter mean? The respective .h definitions clearly indicate a scaler (e.g. uniform 0) and that's logical since we do know pressure at the inlet and that's what we need to supply. But I get error demanding that to be a vector! I figured out after a couple of simulations that it actually is velocity. I'm confused!
deepbandivadekar is offline   Reply With Quote

Old   August 15, 2018, 18:45
Default
  #6
Member
 
Join Date: Oct 2015
Posts: 63
Rep Power: 11
Scram_1 is on a distinguished road
Hi Deep!
I'm facing a similar problem as well where my temperature becomes negative. Have you managed to find a work around for this issue?

Best,
Scram_1
Scram_1 is offline   Reply With Quote

Old   August 17, 2018, 03:22
Default
  #7
New Member
 
Srikar Reddy Palla
Join Date: May 2018
Posts: 19
Rep Power: 8
SRKR is on a distinguished road
Try changing b.conditions as some fixed pressure and zetoGradient for velocity at inlet and please inform back.
SRKR is offline   Reply With Quote

Old   August 18, 2018, 14:57
Default
  #8
Member
 
Join Date: Oct 2015
Posts: 63
Rep Power: 11
Scram_1 is on a distinguished road
Tried changing the BCs but still doesn't work. I also tried a couple of other things. I noticed that the simulation works if the equationOfState in the thermophysical properties is set to perfectGas instead of incompressiblePerfectGas. I want my bulk fluid to behave like an incompressible gas. The negative temperature occurs with incompressiblePerfectGas when delta t is 1e-8. With delta t = 1e-6, the simulation does not crash. However, I need delta t to be 1e-8 to capture the physics involved. I don't know if perfectGas as thermo will give me the right result though. Also, when the size of the particle is reduced to the order of nanometers (1e-9), the particles tend to flash i.e. the mass change equals the mass introduced. This doesn't happen with micron sized particles. Does anyone have any idea about this?

Best,
Scram_1
Scram_1 is offline   Reply With Quote

Old   August 20, 2018, 10:40
Default
  #9
Senior Member
 
Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 9
deepbandivadekar is on a distinguished road
Quote:
Originally Posted by Scram_1 View Post
Hi Deep!
I'm facing a similar problem as well where my temperature becomes negative. Have you managed to find a work around for this issue?

Best,
Scram_1
Hello!

No I did not find a reason for that behaviour. However, I got around it by doing this in fvOptions:

Code:
temperatureLimit
{
    type limitTemperature;
    active true;
    
    limitTemperatureCoeffs
    {
        selectionMode all;
        min 150;
        max 6000;
    }
}
This worked very well. But I'm pretty sure this does not tackle the real cause of the error.
hwangpo likes this.
deepbandivadekar is offline   Reply With Quote

Reply

Tags
negative temperature, pressureinletvelocity, sonicfoam


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
CompressibleInterFoam crashing with negative temperature values rzahoor OpenFOAM Running, Solving & CFD 9 November 4, 2017 15:19
[blockMesh] blockMesh error - Negative Volume Block adoledin OpenFOAM Meshing & Mesh Conversion 2 June 22, 2016 11:44
Ansys CFX problem: unexpected very high temperatures in premix laminar combustion faizan_habib7 CFX 4 February 1, 2016 18:00
Unexpected large decrease in Total temperature across the shock using sonicFoam JLight OpenFOAM 0 December 16, 2010 12:46
Negative temperature Julie Siemens 7 September 13, 2004 09:39


All times are GMT -4. The time now is 09:35.