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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 8, 2019, 11: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 15:22.
OlliCFD is offline   Reply With Quote

Old   May 9, 2019, 04: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, 18 views)
OlliCFD is offline   Reply With Quote

Old   July 17, 2019, 15:37
Arrow Similar problem
  #3
New Member
 
Dumbledore
Join Date: Jun 2019
Posts: 10
Rep Power: 4
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, 04:22
Default
  #4
New Member
 
adrian chelaru
Join Date: Mar 2015
Posts: 4
Rep Power: 8
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, 12:32
Default
  #5
New Member
 
Dumbledore
Join Date: Jun 2019
Posts: 10
Rep Power: 4
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, 15:14
Default
  #6
New Member
 
Rozie
Join Date: May 2019
Posts: 7
Rep Power: 4
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, 17:25
Default
  #7
New Member
 
Join Date: Nov 2019
Posts: 13
Rep Power: 4
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, 17:39
Default
  #8
New Member
 
Rozie
Join Date: May 2019
Posts: 7
Rep Power: 4
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, 07:26
Default
  #9
Member
 
Jnana Bhaskar Rao
Join Date: Mar 2020
Posts: 39
Rep Power: 3
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

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


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