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/)
-   -   Negative initial temperature (https://www.cfd-online.com/Forums/openfoam-solving/201364-negative-initial-temperature.html)

Lexe April 30, 2018 07:18

Negative initial temperature
 
1 Attachment(s)
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 April 30, 2018 09:36

Do you have radiation in your case?

Quote:

Originally Posted by Lexe (Post 690745)
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.


Lexe April 30, 2018 10:02

I have the file, but the radiation is turned off.

fxzf April 30, 2018 11:01

Quote:

Originally Posted by Lexe (Post 690768)
I have the file, but the radiation is turned off.

I see. What is your geometry look like? Where is solid part?

Lexe April 30, 2018 12:13

1 Attachment(s)
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.

Lexe May 1, 2018 11:58

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::printStack(Foam::Ostream&) at ??:?
#1 Foam::error::abort() at ??:?
#2 Foam::heRhoThermo<Foam::rhoThermo, Foam::pureMixture<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::pureMixture<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_;

fxzf May 2, 2018 12:27

can you use min/Max functionobject to identify where is the negative temperature?

Lexe May 2, 2018 13:13

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)

Lexe May 7, 2018 08:00

Anybody? Please, i need this for my thesis and i'm running out of time.

omdemircan May 7, 2018 17:40

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;
}
}

vs1 September 20, 2018 06:46

I get the same error when i set turbulence to laminar but with other turbulence models the error is gone.

Calmly September 23, 2018 17:25

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?

Tobi September 24, 2018 04:22

Hi all,

just a few comments on your situations

Quote:

Originally Posted by vs1 (Post 706902)
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 :)

Jalil786 July 6, 2019 12:52

The Same Problem
 
2 Attachment(s)
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

rpachaly October 23, 2019 10:29

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!

Tobi October 23, 2019 10:49

Hi,

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

arsimons January 10, 2020 04:12

Quote:

Originally Posted by Tobi (Post 747825)
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

Jalil786 January 12, 2020 11:01

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.

saiguruprasad April 9, 2020 21:16

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.

JTDN May 22, 2020 03:01

Quote:

Originally Posted by saiguruprasad (Post 764987)
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.


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