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

Error: Negative initial temperature T0, supersonic flows: sonicFoam, rhoCentralFoam

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By mm_FOAM

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 8, 2019, 10:40
Default Error: Negative initial temperature T0, supersonic flows: sonicFoam, rhoCentralFoam
  #1
New Member
 
Oliver
Join Date: May 2019
Posts: 2
Rep Power: 0
OlliCFD is on a distinguished road
Hi,

I'm new to CFD simulation, especially to OpenFOAM and I'm working on oblique shocks in supersonic / transonic flows. I tried to simulate an oblique shock of a perfect gas in a simple 2D-nozzle with Mach 5. But when I try to solve my case with density-based rhoCentralFoam, there always comes the error: Negative initial temperature T0. So I changed the discretization schemes to limited ones, I refined my mesh further times, I changed the absolute and relative tolerances, but nothing worked. I also used mapFields with a laminar solution, that I got after working on the laminar case for hours. With RAS model k-epsilon activated, I have no chance to get that error under control. Of course, I also varied the BC, but it does't help. I tried to use limitTemperature in fvOptions, but it had no influence at all. I guess because the temperature gets calculated by the energy equation?

So I took a step backwards and tried to manipulate the tutorial 'forwardStep' (sonicFoam, laminar). In this tutorial, an 'normalized' gas is used, i.e. cp, R, T are set to values, that the velocity of 1 m/s is equal to Mach 1. In the standard case, the inlet velocity is set to 3 m/s (Mach 3). When I only increase the velocity to 5 m/s, the simulation crashes and the same negative temperature error is displayed.

Well, I don't know what to do now. Can anyone give me a hint how to get the temperature issue under control?

Thanks in advice for Your help!

Last edited by OlliCFD; May 8, 2019 at 14:22.
OlliCFD is offline   Reply With Quote

Old   May 9, 2019, 03:23
Default
  #2
New Member
 
Oliver
Join Date: May 2019
Posts: 2
Rep Power: 0
OlliCFD is on a distinguished road
I managed to get the sonicFoam tutorial with Mach 5 under control by reducing the CFL number further below 1. I don't know why this made the solution converge because my issue was the negative temperature. So far, so good.

So here is my own case: Mach 5 oblique shock with rhoCentralFoam. Maybe anyone can find any mistakes that I have made while setting up the case?
Btw: turbulence model is set to laminar
Attached Files
File Type: gz case.tar.gz (2.6 KB, 33 views)
OlliCFD is offline   Reply With Quote

Old   July 17, 2019, 14:37
Arrow Similar problem
  #3
New Member
 
Dumbledore
Join Date: Jun 2019
Posts: 10
Rep Power: 6
hemanthgrylls is on a distinguished road
sonicFoam "prism" tutorial not working when inlet velocity is increased

hello Oliver ,

I have also stuck with similar kind of problem. please help me out!

I have tried to run the case you have uploaded in the above comment box. I downloaded as it is and ran it(blockMesh, rhoCentralFoam). It diverged with the negative temperature error.(boom!). if it has ran successfully in your PC there might be some glitch with the source code in my rhoCentralFoam.C solver. My solver i think was not able to process the adjustable timestep part and ignoring the CFL condition as a result. did you face the same problem initially? please kindlyhelp me out!

-Hcv
hemanthgrylls is offline   Reply With Quote

Old   July 18, 2019, 03:22
Default
  #4
New Member
 
adrian chelaru
Join Date: Mar 2015
Posts: 4
Rep Power: 11
chelucupar is on a distinguished road
I tried running the case. It crashes at the start. Any idea why? I just ran blockMesh then run the solver. Should I do anything else?
chelucupar is offline   Reply With Quote

Old   July 18, 2019, 11:32
Default
  #5
New Member
 
Dumbledore
Join Date: Jun 2019
Posts: 10
Rep Power: 6
hemanthgrylls is on a distinguished road
Quote:
Originally Posted by chelucupar View Post
I tried running the case. It crashes at the start. Any idea why? I just ran blockMesh then run the solver. Should I do anything else?
yah exactly, same thing happened when i have tried!
hemanthgrylls is offline   Reply With Quote

Old   January 1, 2020, 14:14
Default
  #6
New Member
 
Rozie
Join Date: May 2019
Posts: 7
Rep Power: 6
Rozie123 is on a distinguished road
Quote:
Originally Posted by OlliCFD View Post
Hi,

I'm new to CFD simulation, especially to OpenFOAM and I'm working on oblique shocks in supersonic / transonic flows. I tried to simulate an oblique shock of a perfect gas in a simple 2D-nozzle with Mach 5. But when I try to solve my case with density-based rhoCentralFoam, there always comes the error: Negative initial temperature T0. So I changed the discretization schemes to limited ones, I refined my mesh further times, I changed the absolute and relative tolerances, but nothing worked. I also used mapFields with a laminar solution, that I got after working on the laminar case for hours. With RAS model k-epsilon activated, I have no chance to get that error under control. Of course, I also varied the BC, but it does't help. I tried to use limitTemperature in fvOptions, but it had no influence at all. I guess because the temperature gets calculated by the energy equation?

So I took a step backwards and tried to manipulate the tutorial 'forwardStep' (sonicFoam, laminar). In this tutorial, an 'normalized' gas is used, i.e. cp, R, T are set to values, that the velocity of 1 m/s is equal to Mach 1. In the standard case, the inlet velocity is set to 3 m/s (Mach 3). When I only increase the velocity to 5 m/s, the simulation crashes and the same negative temperature error is displayed.

Well, I don't know what to do now. Can anyone give me a hint how to get the temperature issue under control?

Thanks in advice for Your help!
Have you found a solution to it? I am running to the same issue.
Rozie123 is offline   Reply With Quote

Old   July 15, 2020, 16:25
Default
  #7
New Member
 
Join Date: Nov 2019
Posts: 13
Rep Power: 6
EleGiova is on a distinguished road
I had the same problem. I solved it only decreasing the Courant number to 0.2 and the time step to 1e-8.. With this setup it run without fvOptions.
EleGiova is offline   Reply With Quote

Old   July 15, 2020, 16:39
Default
  #8
New Member
 
Rozie
Join Date: May 2019
Posts: 7
Rep Power: 6
Rozie123 is on a distinguished road
Quote:
Originally Posted by EleGiova View Post
I had the same problem. I solved it only decreasing the Courant number to 0.2 and the time step to 1e-8.. With this setup it run without fvOptions.
Yes, although the issue may arise for various reasons, it mainly happens when the courant No. exceeds 1.
Rozie123 is offline   Reply With Quote

Old   April 2, 2021, 06:26
Default
  #9
Member
 
Jnana Bhaskar Rao
Join Date: Mar 2020
Posts: 46
Rep Power: 6
jnanabrao is on a distinguished road
I believe this error occurs because the energy equation is solved using corrected u and p values after solving the momentum and pressure equations for the current time step. Sometimes it also shows up if you use the waveTransmissive boundary condition where the temperature is used to calculate the sonic velocity using square root function and the error message is different but the cause is the same.


I have seen earlier posts where it was suggested to set a limit on temperature using fvOptions. However, it didn't help in my particular case of simulating a Mach 2 jet. I managed to avoid the error sometimes by modifying the grid spacing and sometimes with smaller Courant number/ time step. But I have also had instances with sonicFoam where I don't face the error with large time steps, nonetheless, the error shows up for smaller time steps. I'm yet to find a comprehensive way to deal with this error.
jnanabrao is offline   Reply With Quote

Old   April 17, 2023, 18:03
Default
  #10
New Member
 
Morgan
Join Date: Jun 2020
Posts: 2
Rep Power: 0
mm_FOAM is on a distinguished road
I was having a similar issue running compressibleInterFoam with dynamic mesh refinement at the interface, simulating droplets jetting from ~50 micron orifices. The crash "negative initial temperature T0" could be delayed to some extent by forcing Co but it would still crash.

The mesh was updated to smooth some strangely skew corners (thanks, snappyHexMesh) and that did nothing.

Boundary conditions were revised countless times, and that did not help.

What finally seems to have fixed it was changing the thermoType for my air component from hConst to janaf and transport from const to sutherland. The solver now happily trudges past the point where it used to inevitably crash.


Quote:
thermoType
{
type heRhoThermo;
mixture pureMixture;
transport sutherland;
thermo janaf;
equationOfState perfectGas;
specie specie;
energy sensibleEnthalpy;
}

thermodynamics
{
Tlow 200;
Thigh 6000;
Tcommon 1000;
highCpCoeffs (3.129672277499967 1.211766752750042e-3 -4.04761109000018e-7 6.409571300000324e-11 -3.780447620000211e-15 -.996955811e3 5.257756413);
lowCpCoeffs (3.593868050000014 -8.419292810001117e-4 2.08457592775033e-6 -5.938441825004294e-10 -2.456771699998039e-13 -1.0512181e3 3.140021718);

}
transport
{
As 1.4584E-6;
Ts 110.33;

mu 1.84e-05;
Pr 0.7;
}
hogsonik likes this.

Last edited by mm_FOAM; April 18, 2023 at 09:15.
mm_FOAM is offline   Reply With Quote

Reply

Tags
negative initial temp, rhocentralfoam, sonicfoam

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
pressure in incompressible solvers e.g. simpleFoam chrizzl OpenFOAM Running, Solving & CFD 13 March 28, 2017 05:49
settlingFoam unstable? bendel_boy OpenFOAM Running, Solving & CFD 38 July 8, 2016 05:07
Extrusion with OpenFoam problem No. Iterations 0 Lord Kelvin OpenFOAM Running, Solving & CFD 8 March 28, 2016 11:08
simpleFoam error - "Floating point exception" mbcx4jc2 OpenFOAM Running, Solving & CFD 12 August 4, 2015 02:20
calculation stops after few time steps sivakumar OpenFOAM Running, Solving & CFD 7 March 17, 2013 06:37


All times are GMT -4. The time now is 20:16.