CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

Negative initial temperature error (chtMultiRegionFoam)

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 14, 2018, 10:06
Exclamation Negative initial temperature error (chtMultiRegionFoam)
  #1
New Member
 
jebin george
Join Date: Sep 2018
Posts: 17
Rep Power: 7
jebin is on a distinguished road
Hi,


I am fairly new to OpenFoam using version 6. I am trying to solve the heat transfer between a heatsink with heat source at the bottom and air traveling through the pipe in which only the heat sink is exposed.


I am using chtMultiRegionFoam solver. Split the mesh into two regions and created cellzones.
I gave the thermophysical properties to both heatsink and air and also defined the boundary conditions and the contact boundary as compressible::turbulentTemperatureCoupledBaffleMix ed.


Using RAS model for turbulence properties of air.
Initial temperature of air is 300k and that of heat sink is 273K but I am getting very low values of about -206k




I used fvschemes and fvsoultion from tutorial/heatTransfer/chtMultiRegionFoam/multiregionheater for both separately.


When I try to solve it, its showing "Negative initial temperature T0: -206.172"
and is exiting at 2.5 s while solving the solid


The error message is:


Code:
Solving for fluid region waterCellSet
DILUPBiCGStab:  Solving for Ux, Initial residual = 0.0201238, Final residual = 0.000422419, No Iterations 1
DILUPBiCGStab:  Solving for Uy, Initial residual = 0.0189649, Final residual = 0.000425249, No Iterations 1
DILUPBiCGStab:  Solving for Uz, Initial residual = 0.00718987, Final residual = 0.000186804, No Iterations 1
DILUPBiCGStab:  Solving for h, Initial residual = 0.00431549, Final residual = 0.000122464, No Iterations 1
Min/max T:-206.151 339.013
GAMG:  Solving for p_rgh, Initial residual = 0.0455872, Final residual = 0.000385342, No Iterations 2
time step continuity errors : sum local = 0.000534267, global = 8.44534e-05, cumulative = 8.44534e-05
Min/max rho:1.25 1.25
DILUPBiCGStab:  Solving for epsilon, Initial residual = 0.00599105, Final residual = 8.33063e-05, No Iterations 1
DILUPBiCGStab:  Solving for k, Initial residual = 0.0191864, Final residual = 0.000366755, No Iterations 1

Solving for solid region heaterCellSet
DICPCG:  Solving for h, Initial residual = 0.738924, Final residual = 7.06039e-07, No Iterations 32


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

    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::rhoConst<Foam::specie> >, Foam::sensibleEnthalpy>]
    in file /home/ubuntu/OpenFOAM/OpenFOAM-6/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::heSolidThermo<Foam::solidThermo, Foam::pureMixture<Foam::constIsoSolidTransport<Foam::species::thermo<Foam::hConstThermo<Foam::rhoConst<Foam::specie> >, Foam::sensibleEnthalpy> > > >::calculate() at ??:?
#3  Foam::heSolidThermo<Foam::solidThermo, Foam::pureMixture<Foam::constIsoSolidTransport<Foam::species::thermo<Foam::hConstThermo<Foam::rhoConst<Foam::specie> >, Foam::sensibleEnthalpy> > > >::correct() at ??:?
#4  ? in "/opt/openfoam6/platforms/linux64GccDPInt32Opt/bin/chtMultiRegionFoam"
#5  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#6  ? in "/opt/openfoam6/platforms/linux64GccDPInt32Opt/bin/chtMultiRegionFoam"
Aborted (core dumped)
I suspect it might be some error with defining air as I am getting negative values in the result.
The Temp conditions I gave for air is given:
Code:
dimensions      [ 0 0 0 1 0 0 0 ];

internalField   uniform 300;

boundaryField
{
    inlet
    {
        type            fixedValue;
        value           uniform 300;
    }
    outlet
    {
        type            inletOutlet;
        value           uniform 300;
        inletValue      uniform 300;
    }
    wall-domain
    {
        type            zeroGradient;
    }
    default_wall
    {
        type            compressible::turbulentTemperatureCoupledBaffleMixed;
        value           $internalField;
        Tnbr            T;
        kappaMethod     fluidThermo;
    }
}
and that for solid is :

Code:
dimensions      [ 0 0 0 1 0 0 0 ];

internalField   uniform 273;

boundaryField
{
    base
    {
        type            fixedValue;
        value           uniform 273;
        inletValue      uniform 273;
    }
    sinkbody
    {
        type            zeroGradient;
    }
    wall-domain
    {
        type            zeroGradient;
    }
    default_wall
    {
        type            compressible::turbulentTemperatureCoupledBaffleMixed;
        value           uniform 273;
        Tnbr            T;
        kappaMethod     solidThermo ;
    }
}
the fvScheme for air is:
Code:
ddtSchemes
{
    default        steadyState;
}

gradSchemes
{
    default         Gauss linear;
    grad(U)         cellLimited Gauss linear 1;
}

divSchemes
{
    default         none;
    div(phi,U)      bounded Gauss upwind;
    div(phi,h)      bounded Gauss upwind;
    div(phi,e)      bounded Gauss upwind;
    div(phi,K)      bounded Gauss upwind;
    div(phi,k)      bounded Gauss upwind;
    div(phi,epsilon) bounded Gauss upwind;
    div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}

laplacianSchemes
{
    default         Gauss linear limited corrected 0.33;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         limited corrected 0.33;
}
The fvScheme for solid is:
Code:
ddtSchemes
{
    default Euler;
}

gradSchemes
{
    default         Gauss linear;
}

divSchemes
{
    default         none;
}

laplacianSchemes
{
    default             none;
    laplacian(alpha,h)  Gauss linear corrected;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         corrected;
}
Can somebody please explain to me what I have done wrong
Attached Images
File Type: jpg case_setup_with_heatsink_domainwall.jpg (19.2 KB, 141 views)
jebin is offline   Reply With Quote

Old   September 14, 2018, 15:49
Default
  #2
Senior Member
 
Peter Hess
Join Date: Apr 2011
Location: Austria
Posts: 250
Rep Power: 17
peterhess is on a distinguished road
Your ddt shemes for fluid and solid are different...

For fluid you have steady state and for solid you have euler!

I am not sure if this is relevant or could cause such a problem. Test this and see what happens.

Post the case please.

Last edited by peterhess; September 15, 2018 at 01:02.
peterhess is offline   Reply With Quote

Old   September 15, 2018, 01:33
Default case setup without polymesh directory
  #3
New Member
 
jebin george
Join Date: Sep 2018
Posts: 17
Rep Power: 7
jebin is on a distinguished road
Here is the case setup. I could not include the polymesh directory because the case exceeded the upload limit. Do not mind that air casesetup is called watercellset
Attached Files
File Type: zip case setup.zip (20.9 KB, 71 views)
jebin is offline   Reply With Quote

Old   September 15, 2018, 01:40
Default
  #4
New Member
 
jebin george
Join Date: Sep 2018
Posts: 17
Rep Power: 7
jebin is on a distinguished road
Thank You for replying.
I changed ddt schemes for solid and air to steady state and the temperature drop in error reduced to -7k. SO its probably the error of choosing the wrong schemes. I have uploaded the case setup. I do not have much knowledge in choosing the appropriate schemes. Please look into it and suggest the appropriate schemes for each part.
jebin is offline   Reply With Quote

Old   September 15, 2018, 02:02
Default
  #5
Senior Member
 
Peter Hess
Join Date: Apr 2011
Location: Austria
Posts: 250
Rep Power: 17
peterhess is on a distinguished road
Hi!

Well, by problems with the setups it is always a good idea to use the default setup.

Simply copy the setup (i.e. fvSchemes and fvSolution) from the working tutorial and use them in your case.

If it works, then compare the difference to find the cause.

There is no mesh in the case you uploaded.

The mesh is needed to run the case and test the progress.

Upload a case with mesh setup please.

Regards

Peter
peterhess is offline   Reply With Quote

Old   September 15, 2018, 02:38
Default
  #6
Senior Member
 
Peter Hess
Join Date: Apr 2011
Location: Austria
Posts: 250
Rep Power: 17
peterhess is on a distinguished road
I used the fvSchemes and fvSolution from your case for both solid and fluid regions in an example case that I have...

I replaced my fvSchemes and fvSolution with those from your case.

The case (my case) works with your fvSchemes and fvSolution fine.

The problem you are facing is somewhere else!


What about the pressure?

Change p_rgh from 0 to 1e5!

p_rgh should look like this:

/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 6
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0/waterCellSet";
object p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField uniform 1e5;

boundaryField
{
inlet
{
type zeroGradient;
}
outlet
{
type fixedValue;
value uniform 1e5;
}
wall-domain
{
type zeroGradient;
}
default_wall
{
type fixedFluxPressure;
value uniform 1e5;
}
wall_domain
{
type fixedFluxPressure;
value uniform 1e5;
}
}


// ************************************************** *********************** //


Regards

Peter

Last edited by peterhess; September 15, 2018 at 03:39.
peterhess is offline   Reply With Quote

Old   September 15, 2018, 05:43
Default
  #7
New Member
 
jebin george
Join Date: Sep 2018
Posts: 17
Rep Power: 7
jebin is on a distinguished road
Thank you for taking your time to help me.
I have included the case with the mesh file in the link. https://drive.google.com/open?id=1jf...nOUshYzvDdiK8J


Can you please run it to see the problem, If I defined the boundaries wrong. Also what does ".*" mean. Am i supposed to solve using chtMultiRegionSimpleFoam.


Regards
Jebin
jebin is offline   Reply With Quote

Old   September 15, 2018, 06:23
Default
  #8
Senior Member
 
Peter Hess
Join Date: Apr 2011
Location: Austria
Posts: 250
Rep Power: 17
peterhess is on a distinguished road
".*" means apply for all bouandries independent of the name...

In OF6.0 there is no chtMultiRegionSimpleFoam anymore. It has been merged with chtMultiRegionFoam.

By the way, the mesh quality in the case you uploaded is very poor. You need to fix this!


----------------------------------------


And now to the divergence problem...

Add the folllowing lines to the bottom of controlDict:


maxCo 1; //This limits courant number going higher than 1

maxDi 100; //This limits the diffusity going higher than 100

adjustTimeStep yes; //This let the time steps (deltaT) you defined as 0.1 to be modified to hold maxCo and maxDi


The default deltaT = 0.1 is very high and the courant number becomes very high, since your simulation defined to be transient. You need to reduce it or make it automatic controlled applying the changes I added here.

At least the simulation runs now without any problems...

The file should looks like this:

/*--------------------------------*- 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 chtMultiRegionFoam;

startFrom latestTime;

startTime 0;

stopAt endTime;

endTime 100;

deltaT 0.1;

writeControl adjustableRunTime;

writeInterval 5;

purgeWrite 0;

writeFormat ascii;

writePrecision 6;

writeCompression off;

timeFormat general;

timePrecision 6;

runTimeModifiable true;

maxCo 1;

maxDi 100;

adjustTimeStep yes;



----------------------------------


To make the simulation steady state you need to do the following:

- For all solid regions in your simulation use fvSchemes and fvSolution from here:

/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeaterRadiation/system/heater/

- For all fluid regions in your simulation use fvSchemes and fvSolution from here:

/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeaterRadiation/system/bottomAir/

Those shemes and solver setups are made for steady state!

Regards

Peter

Last edited by peterhess; September 15, 2018 at 09:27.
peterhess is offline   Reply With Quote

Old   September 15, 2018, 13:45
Default
  #9
New Member
 
jebin george
Join Date: Sep 2018
Posts: 17
Rep Power: 7
jebin is on a distinguished road
Thank you sir for giving me the directions.
Right now, I am not facing the initial temperature error and am running the simulation.
jebin is offline   Reply With Quote

Old   September 16, 2018, 02:18
Default
  #10
New Member
 
jebin george
Join Date: Sep 2018
Posts: 17
Rep Power: 7
jebin is on a distinguished road
Quote:
To make the simulation steady state you need to do the following:

- For all solid regions in your simulation use fvSchemes and fvSolution from here:

/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeaterRadiation/system/heater/

- For all fluid regions in your simulation use fvSchemes and fvSolution from here:

/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeaterRadiation/system/bottomAir/
This is showing the initial temperature as before


I wanted to obtain a temperature profile on the heat sink walls which is at 273k by the flow of air over it whose inlet temperature is 300k. Right now, I am only getting the air to cool to a lower temperature from 300k because of the heatsink .

The temperature profile is formed by conduction of heat from air into the heat sink. This was validated from an ansys fluent simulation. Do you know of any way I can include this by changing the boundary conditions.
jebin is offline   Reply With Quote

Old   September 16, 2018, 03:26
Default
  #11
Senior Member
 
Peter Hess
Join Date: Apr 2011
Location: Austria
Posts: 250
Rep Power: 17
peterhess is on a distinguished road
The pressure p defined in the internalField in:

/0/waterCellSet/p

need to be changed from 0 to 1e5!

This will solve the divergence problem in steady state case you are facing.

This change is a good idea for both situations transient and steady state...

Last edited by peterhess; September 16, 2018 at 15:10.
peterhess is offline   Reply With Quote

Old   September 17, 2018, 06:31
Default
  #12
New Member
 
jebin george
Join Date: Sep 2018
Posts: 17
Rep Power: 7
jebin is on a distinguished road
The case setup is working in steady state now.

During solving, the temperature on the surface of the heatsink fin surface is only rising to 275K (from being at 273k initially) when exposed to air of 300k in a time span of 45 seconds.
I increased the air temperature to 500k but still the heatsink fins are at 275k. In a ansys simulation recreating the conditions, the temperature of the heatsink after post-processing was more than 280k.

Is there a reason as to the temperature of heatsink stopping at 275k or if i simulate for a longer time will it rise to higher temperature ?
jebin is offline   Reply With Quote

Old   September 17, 2018, 06:58
Default
  #13
Senior Member
 
Peter Hess
Join Date: Apr 2011
Location: Austria
Posts: 250
Rep Power: 17
peterhess is on a distinguished road
To compare the results of openFoam and Fluent, you need to be sure that all parameters are identical. Especially the boundaries conditions.

There are many reasons to get different results using openFoam and Fluent.


In my opinion, I would say that having 275 K on the surface is possible, cause you have very high thermal conductivity in the solid and constant temperatur at the base 273 K! 2 K difference between the base and the fins are in my opinion right!


Are Fluent results right and plausible?

Quote:
Originally Posted by jebin View Post

I increased the air temperature to 500k but still the heatsink fins are at 275k. In a ansys simulation recreating the conditions, the temperature of the heatsink after post-processing was more than 280k.
I do not confirm that. The steady state case with 500 K at the inlet results about 285 K at the fins!



See attached file!
Attached Images
File Type: jpg Heatsink_500K_Inlet.jpg (33.7 KB, 138 views)

Last edited by peterhess; September 17, 2018 at 15:01.
peterhess is offline   Reply With Quote

Old   September 19, 2018, 02:06
Default
  #14
New Member
 
jebin george
Join Date: Sep 2018
Posts: 17
Rep Power: 7
jebin is on a distinguished road
Thank you for doing the simulation. Was it the same case setup I uploaded? How long was the simulation for?
jebin is offline   Reply With Quote

Old   September 19, 2018, 03:10
Default
  #15
Senior Member
 
Peter Hess
Join Date: Apr 2011
Location: Austria
Posts: 250
Rep Power: 17
peterhess is on a distinguished road
Yes, your case.

I just changed the following:

- making the case steady state (as described above)

- changing internalField p = 1e5 (fluid!)

- changing internalField p_rgh = 1e5

- changing the temperature at the inlet to 500 K

- adding the 3 lines for controlling the time steps, as described above (the simulation works as steady state without this step!)

Those actualy the necessery steps I made, as I remember...

I run the simulation in parallel.

I cant say how much time I needed. I already deleted the simulation. Anyway, about 4 or 5 minutes, then the mesh size is very small.

In about 600 iterations I reached convergence. The simulation run 1000 iterations then I stopped manually!

By the way, I still dont like the mesh. 2 or 3 cells between the fins is unacceptable for me...

Regards

Peter
Attached Images
File Type: png Residuals.png (82.2 KB, 152 views)

Last edited by peterhess; September 19, 2018 at 05:09.
peterhess is offline   Reply With Quote

Old   September 19, 2018, 09:12
Default
  #16
New Member
 
jebin george
Join Date: Sep 2018
Posts: 17
Rep Power: 7
jebin is on a distinguished road
I am not using a good mesh now because I am running the simulation on my laptop in a virtual box with only two processors.
So its took about 2hrs for me to simulate 10 seconds because of very small time steps.

When i tried using good mesh, the system froze which is why i am sticking to poor mesh.
Right now, I am learning openFoam as part of a internship I am doing.

Once I am capable to do the simulation on my own, I will be using a server to do the simulation

Also how can I see the graph? Which commands should i use?

I also wanted to know if Salome software can create named section and can be exported as .msh file?
jebin is offline   Reply With Quote

Old   September 19, 2018, 10:05
Default
  #17
Senior Member
 
Peter Hess
Join Date: Apr 2011
Location: Austria
Posts: 250
Rep Power: 17
peterhess is on a distinguished road
Quote:
Originally Posted by jebin View Post

Also how can I see the graph? Which commands should i use?

I also wanted to know if Salome software can create named section and can be exported as .msh file?
To plot the residuals you need to do the following:

- install gnuplot (if not already installed)

- copy the file attached to the simulation folder

- start the simulation by typing:

chtMultiRegionsFoam > log

This will write the simulation iterations progress to a log file called log instead of the terminal!

- in a new terminal type:

gnuplot Plot.txt


I cant talk about Salome, cause I dont use it!

Regards

Peter
Attached Files
File Type: txt Plot.txt (952 Bytes, 53 views)

Last edited by peterhess; September 19, 2018 at 15:55.
peterhess is offline   Reply With Quote

Old   September 24, 2018, 07:35
Default
  #18
New Member
 
jebin george
Join Date: Sep 2018
Posts: 17
Rep Power: 7
jebin is on a distinguished road
Hi Peter,


I created a new case with four heat sinks arranged in serial in air domain with same conditions as the previous case. I solved it using one core processor.
- Then, I tried decomposing it using the decomposeParDict but its showing an error--


Quote:
fileName::stripInvalid() called for invalid fileName /home/jebin-helyx/Desktop/test2/airdomainwith4heatsinks--steady
For debug level (= 2) > 1 this is considered fatal
Aborted (core dumped)

-I am using the steady state solver and the same values as before.
-The case setup is

https://drive.google.com/file/d/16Vk...ew?usp=sharing


-Can you please check the case file and tell me what I have done wrong? Also do I have to setup any file after it is decomposed, to run the 'mpirun -np ....' command and get the result.



Disclaimer- The mesh is extremely poor. I created this only to learn the decomposition and reconstruction.


Regards

Jebin
jebin is offline   Reply With Quote

Old   September 24, 2018, 09:03
Default
  #19
Senior Member
 
Peter Hess
Join Date: Apr 2011
Location: Austria
Posts: 250
Rep Power: 17
peterhess is on a distinguished road
Hello,

Changing the name of the Folder from:

airdomain with 4heatsinks--steady

To

airdomain_with_4heatsinks--steady

Solves the problem!

Spaced in the name are not allowed

Regards

Peter

Last edited by peterhess; September 24, 2018 at 11:11.
peterhess is offline   Reply With Quote

Old   September 24, 2018, 11:55
Default
  #20
New Member
 
jebin george
Join Date: Sep 2018
Posts: 17
Rep Power: 7
jebin is on a distinguished road
Wow! That was simple!
Thank you for clearing that out. I couldn't have reached here without your help, sir.

I divided the case between two processors by running the command decomposePar

-The 0 folder in each processors only have cellToRegion file.
-Do I need to add any files or can I directly run the command " mpirun -np 2 chtMultiRegionFoam" ?

-Will the time required for processing decrease if I increase the number of cores ?

Regards

Jebin
jebin is offline   Reply With Quote

Reply

Tags
chtmultiregionfoam, error, negative initial temp


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


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