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

Negative initial temperature

Register Blogs Community New Posts Updated Threads Search

Like Tree45Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 30, 2018, 08:18
Default Negative initial temperature
  #1
New Member
 
Join Date: Apr 2018
Posts: 9
Rep Power: 8
Lexe is on a distinguished road
Hello,

i'm trying to simulate the heating of a cube with a channel full of hot oil through it with the chtMultiRegionSimpleFoam-solver. But whenever the initialfield temperature of the oil differs from the temperature of my inlet, openfoam aborts after a few time steps with the explanation, that the inital temperature is negative. The error message says something about an error in thermophysicalProperties.H line 54. Does anybody know a solution, please?

I attach the T, fvSolution and fvsheme files of the fluid.
Attached Files
File Type: zip fluid lexe.zip (1.9 KB, 119 views)
Lexe is offline   Reply With Quote

Old   April 30, 2018, 10:36
Default
  #2
Member
 
ff
Join Date: Feb 2010
Posts: 81
Rep Power: 16
fxzf is on a distinguished road
Do you have radiation in your case?

Quote:
Originally Posted by Lexe View Post
Hello,

i'm trying to simulate the heating of a cube with a channel full of hot oil through it with the chtMultiRegionSimpleFoam-solver. But whenever the initialfield temperature of the oil differs from the temperature of my inlet, openfoam aborts after a few time steps with the explanation, that the inital temperature is negative. The error message says something about an error in thermophysicalProperties.H line 54. Does anybody know a solution, please?

I attach the T, fvSolution and fvsheme files of the fluid.
fxzf is offline   Reply With Quote

Old   April 30, 2018, 11:02
Default
  #3
New Member
 
Join Date: Apr 2018
Posts: 9
Rep Power: 8
Lexe is on a distinguished road
I have the file, but the radiation is turned off.
Lexe is offline   Reply With Quote

Old   April 30, 2018, 12:01
Default
  #4
Member
 
ff
Join Date: Feb 2010
Posts: 81
Rep Power: 16
fxzf is on a distinguished road
Quote:
Originally Posted by Lexe View Post
I have the file, but the radiation is turned off.
I see. What is your geometry look like? Where is solid part?
fxzf is offline   Reply With Quote

Old   April 30, 2018, 13:13
Default
  #5
New Member
 
Join Date: Apr 2018
Posts: 9
Rep Power: 8
Lexe is on a distinguished road
The geometry is quite simple. A cube with a hole and a cylinder inside the hole. The cube is declared as solid and the cylinder as fluid.
Attached Images
File Type: jpg geometry.JPG (23.3 KB, 256 views)
Lexe is offline   Reply With Quote

Old   May 1, 2018, 12:58
Default
  #6
New Member
 
Join Date: Apr 2018
Posts: 9
Rep Power: 8
Lexe is on a distinguished road
Maybe it is helpful, if i post the complete error message:

Time = 417


Solving for fluid region FLUIDROHR
DILUPBiCG: Solving for h, Initial residual = 0.0006912361, Final residual = 2.371398e-11, No Iterations 1
Min/max T:-0.6823983 433
GAMG: Solving for p_rgh, Initial residual = 0.7395947, Final residual = 0.3443955, No Iterations 10
time step continuity errors : sum local = 1.071075e-13, global = 4.308673e-16, cumulative = -1.476626e-14
Min/max rho:2 2

Solving for solid region SOLIDWURFEL
DICPCG: Solving for h, Initial residual = 0.009793508, Final residual = 0.0001714627, No Iterations 3
DICPCG: Solving for h, Initial residual = 0.01000549, Final residual = 0.000171063, No Iterations 3
DICPCG: Solving for h, Initial residual = 0.009274253, Final residual = 0.0001471489, No Iterations 3
DICPCG: Solving for h, Initial residual = 0.009199457, Final residual = 0.0001446249, No Iterations 3
Min/max T:316.1508 318.3617
ExecutionTime = 88.38 s ClockTime = 92 s

Time = 418


Solving for fluid region FLUIDROHR
DILUPBiCG: Solving for h, Initial residual = 0.0006895797, Final residual = 2.367034e-11, No Iterations 1


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

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::rhoConst<Foam::specie> >; Type = Foam::sensibleEnthalpy; Foam::scalar = double; Foam::species::thermo<Thermo, Type> = Foam::species::thermo<Foam::hConstThermo<Foam::rho Const<Foam::specie> >, Foam::sensibleEnthalpy>]
in file /home/pawan/OpenFOAM/OpenFOAM-v1712/src/thermophysicalModels/specie/lnInclude/thermoI.H at line 54.

FOAM aborting

#0 Foam::error:rintStack(Foam::Ostream&) at ??:?
#1 Foam::error::abort() at ??:?
#2 Foam::heRhoThermo<Foam::rhoThermo, Foam:ureMixture<Foam::constTransport<Foam::speci es::thermo<Foam::hConstThermo<Foam::rhoConst<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:ureMixture<Foam::constTransport<Foam::speci es::thermo<Foam::hConstThermo<Foam::rhoConst<Foam: :specie> >, Foam::sensibleEnthalpy> > > >::correct() at ??:?
#4 ? at ??:?
#5 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#6 ? at ??:?
Abgebrochen (Speicherabzug geschrieben)



FLUIDROHR is the oil-cylinder and SOLIDWURFEL is the cube. The respective line says this: scalar Ttol = T0*tol_;
Lexe is offline   Reply With Quote

Old   May 2, 2018, 13:27
Default
  #7
Member
 
ff
Join Date: Feb 2010
Posts: 81
Rep Power: 16
fxzf is on a distinguished road
can you use min/Max functionobject to identify where is the negative temperature?
fxzf is offline   Reply With Quote

Old   May 2, 2018, 14:13
Default
  #8
New Member
 
Join Date: Apr 2018
Posts: 9
Rep Power: 8
Lexe is on a distinguished road
Sorry, i am not very experienced, how do i do that?

Via trial and error, I also found out, that i can postpone the error by decreasing the relaxationFactors for h. But then i don't have any heat transfer between inlet and oil(not sure if that is always the case, or only with the small relaxation factor)

Last edited by Lexe; May 2, 2018 at 17:48.
Lexe is offline   Reply With Quote

Old   May 7, 2018, 09:00
Default
  #9
New Member
 
Join Date: Apr 2018
Posts: 9
Rep Power: 8
Lexe is on a distinguished road
Anybody? Please, i need this for my thesis and i'm running out of time.
Tobi, parthigcar, Hughtong and 1 others like this.
Lexe is offline   Reply With Quote

Old   May 7, 2018, 18:40
Default
  #10
New Member
 
Osman Mirza Demircan
Join Date: May 2017
Location: Ankara, Türkiye
Posts: 29
Rep Power: 9
omdemircan is on a distinguished road
I'm not familiar with that solver but maybe you could make use of a fvOptions file with the limitTemperature function in it? Here's an example,

limitTemperature
{
type limitTemperature;
active true;
limitTemperatureCoeffs
{
selectionMode all;
Tmin 200;
Tmax 400;
}
}
static, hogsonik and tmik like this.
__________________
Osman Mirza Demircan
omdemircan is offline   Reply With Quote

Old   September 20, 2018, 07:46
Default
  #11
vs1
New Member
 
vaibhav
Join Date: Sep 2016
Posts: 15
Rep Power: 10
vs1 is on a distinguished road
I get the same error when i set turbulence to laminar but with other turbulence models the error is gone.
vs1 is offline   Reply With Quote

Old   September 23, 2018, 18:25
Default
  #12
New Member
 
Join Date: Aug 2017
Posts: 18
Rep Power: 9
Calmly is on a distinguished road
I am not familiar with that solver but I think that you should check how it calculates the temperature. Then you will better understand who's the culprit.

Have you tried to reduce the time step or the cell size?
Calmly is offline   Reply With Quote

Old   September 24, 2018, 05:22
Default
  #13
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi all,

just a few comments on your situations

Quote:
Originally Posted by vs1 View Post
I get the same error when i set turbulence to laminar but with other turbulence models the error is gone.
This is basically related to the higher diffusion while using a turbulence model. E.g. the gradients are smoothed out and this will lead to a better convergence of the solver.


Quote:
]
I'm not familiar with that solver but maybe you could make use of a fvOptions file with the limitTemperature function in it? Here's an example,

Code:
limitTemperature
{
    type	limitTemperature;
    active	true;
    limitTemperatureCoeffs
    {
        selectionMode all;
        Tmin	200;
        Tmax	400;
    }
}
This is a nice hack to avoid these problems.

Quote:
Hello,

i'm trying to simulate the heating of a cube with a channel full of hot oil through it with the chtMultiRegionSimpleFoam-solver.
The temperature (negative one) is probably related to the usage of the SIMPLE algorithm. Especially for free convection this is a wrong starting point; e.g. the initial guess is probably in each case a uniform field. Estimating the direction of the solution should be done by using a transient solver. After the flow is established, one can change to steady-state solvers. In addition, wrong boundary conditions can be a part of the problem. Many people set-up wrong BC especially for p_rgh - Me too
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   July 6, 2019, 13:52
Default The Same Problem
  #14
New Member
 
Jalil
Join Date: Nov 2018
Posts: 8
Rep Power: 7
Jalil786 is on a distinguished road
Dear Tobias and everyone else!



Thank you for your nice comments. I have the same problem. I am trying to simulate an air pocket traveling upstream in a pipe and eventually escaping from a ventilation hole at the top of the the tower (image attached). I use compressibleInterFoam solver, but the temperature drops below zero and the simulation stops.

As you mentioned, I am not sure about the boundary conditions, but I am sure BCs are set wrong. The "limitTemperature" function does not work. I have attached an image of the apparatus and a file that contains all BCs from 0 folder.


Can you please have a look and let me know what is wrong with them.



Thank you all in advance!


Jalil
Attached Images
File Type: jpg Capture.JPG (25.7 KB, 250 views)
Attached Files
File Type: docx BCs.docx (14.1 KB, 141 views)
Jalil786 is offline   Reply With Quote

Old   October 23, 2019, 11:29
Default
  #15
New Member
 
Robson Leo Pachaly
Join Date: Oct 2019
Posts: 3
Rep Power: 7
rpachaly is on a distinguished road
Hello everyone,

I'm trying to simulate something very similar to Jalil and having the same problem. The limitTemperature function approach also did not work for me.

Does anybody have any other solution?

Thanks!
rpachaly is offline   Reply With Quote

Old   October 23, 2019, 11:49
Default
  #16
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi,

For me, the limit Temperature function is working fine always. Is it initialized at the start of the application?
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   January 10, 2020, 05:12
Default
  #17
New Member
 
Arne
Join Date: Dec 2018
Posts: 19
Rep Power: 7
arsimons is on a distinguished road
Quote:
Originally Posted by Tobi View Post
Hi,

For me, the limit Temperature function is working fine always. Is it initialized at the start of the application?


Hello everyone


I also have a problem with 'limitTemperature', but it is only when I try to run this in parallel. In that case, it seems to ignore the fvOptions (it errors at the same time with the same negative value for the temperature as when fvOptions was not present) even though it is certainly read.


Does anyone have experience with limitTemperature in parallel run?


Thanks in advance.



Best regards
Arne
arsimons is offline   Reply With Quote

Old   January 12, 2020, 12:01
Default
  #18
New Member
 
Jalil
Join Date: Nov 2018
Posts: 8
Rep Power: 7
Jalil786 is on a distinguished road
Based on my experience, the problem "Negative Initial Temperature" usually existed with the mesh. If there are some bad cells in the mesh or the cells are too different from each other in a region i.e the cells are refined in some regions and are very course in some other regions, then the model crashes.



I tried changing the mesh multiple times and it finally worked.
Jalil786 is offline   Reply With Quote

Old   April 9, 2020, 22:16
Default
  #19
Member
 
Sai Guruprasad Jakkala
Join Date: Jan 2017
Posts: 34
Rep Power: 9
saiguruprasad is on a distinguished road
I was having the same problem and changing the mesh got rid of the problem.

Make sure that there is no sudden change in mesh spacings.
saiguruprasad is offline   Reply With Quote

Old   May 22, 2020, 04:01
Default
  #20
New Member
 
Jad
Join Date: Jun 2013
Posts: 15
Rep Power: 13
JTDN is on a distinguished road
Quote:
Originally Posted by saiguruprasad View Post
I was having the same problem and changing the mesh got rid of the problem.

Make sure that there is no sudden change in mesh spacings.



Same here. Running a mesh convergence study on a buoyantSimpleFoam case and it ran just fine (ie boundary conditions are OK) until a bad quality iteration of the mesh made it crash with negative temperature.


In many cases just running checkMesh will give you a good idea of how your simulation is likely to behave.
hogsonik and Makkus like this.
JTDN is offline   Reply With Quote

Reply

Tags
chtmultiregionsimpefoam, temperature calculation


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
Free surface issues with interDyMFoam for hydroturbine oumnion OpenFOAM Running, Solving & CFD 0 October 6, 2017 15:05
Extrusion with OpenFoam problem No. Iterations 0 Lord Kelvin OpenFOAM Running, Solving & CFD 8 March 28, 2016 12:08
Cannot run the code properly: very large time step continuity error crst15 OpenFOAM Running, Solving & CFD 9 December 14, 2014 19:17
pimpleFoam: turbulence->correct(); is not executed when using residualControl hfs OpenFOAM Running, Solving & CFD 3 October 29, 2013 09:35
SLTS+rhoPisoFoam: what is rDeltaT??? nileshjrane OpenFOAM Running, Solving & CFD 4 February 25, 2013 05:13


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