
[Sponsors] 
Error: Negative initial temperature T0, supersonic flows: sonicFoam, rhoCentralFoam 

LinkBack  Thread Tools  Search this Thread  Display Modes 
May 8, 2019, 11:40 
Error: Negative initial temperature T0, supersonic flows: sonicFoam, rhoCentralFoam

#1 
New Member
Oliver
Join Date: May 2019
Posts: 2
Rep Power: 0 
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 2Dnozzle with Mach 5. But when I try to solve my case with densitybased 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 kepsilon 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. 

May 9, 2019, 04:23 

#2 
New Member
Oliver
Join Date: May 2019
Posts: 2
Rep Power: 0 
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 

July 17, 2019, 15:37 
Similar problem

#3 
New Member
Dumbledore
Join Date: Jun 2019
Posts: 10
Rep Power: 5 
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 

July 18, 2019, 04:22 

#4 
New Member
adrian chelaru
Join Date: Mar 2015
Posts: 4
Rep Power: 9 
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?


July 18, 2019, 12:32 

#5 
New Member
Dumbledore
Join Date: Jun 2019
Posts: 10
Rep Power: 5 

January 1, 2020, 15:14 

#6  
New Member
Rozie
Join Date: May 2019
Posts: 7
Rep Power: 5 
Quote:


July 15, 2020, 17:25 

#7 
New Member
Join Date: Nov 2019
Posts: 13
Rep Power: 5 
I had the same problem. I solved it only decreasing the Courant number to 0.2 and the time step to 1e8.. With this setup it run without fvOptions.


July 15, 2020, 17:39 

#8 
New Member
Rozie
Join Date: May 2019
Posts: 7
Rep Power: 5 

April 2, 2021, 07:26 

#9 
Member
Jnana Bhaskar Rao
Join Date: Mar 2020
Posts: 42
Rep Power: 4 
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. 

Tags 
negative initial temp, rhocentralfoam, sonicfoam 
Thread Tools  Search this Thread 
Display Modes  


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 