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

comfortHotRoom laminar carshes with negative temperature

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By Tobi
  • 1 Post By Tobi

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 7, 2021, 07:19
Default comfortHotRoom laminar carshes with negative temperature
  #1
New Member
 
Kai Salscheider
Join Date: Aug 2018
Posts: 13
Rep Power: 8
Skaiwalker is on a distinguished road
Hello forum!

I want to simulate a gas atmosphere with laminar inlets, comparable to the comfortHotRoom tutorial in OF8. Upon changing the momentumTransport/simulationType from RAS to laminar in the tutorial case (and disabling the functionObjects, see attached case), the simulation crashes in time step 4 when solving for p_rgh with the error message "Negative initial temperature T0: -1046.27".

The attached pictures show the comparison between the fields p, p_rgh, U and T of the standard tutorial case and the laminar one. As one can see, p is fairly similar, but p_rgh, T and U show no similarities with U being the big outlier with a velocity of over 200 m/s. T and p_rgh are at least in the same order of magnitude compared to the turbulent case.

Question: Why is the case not running with laminar settings and what can I do make it run?

Thanks in advance!

p.png
p_rgh.png
T.png
U.png

comfortHotRoom_laminar.tar.gz
Skaiwalker is offline   Reply With Quote

Old   June 7, 2021, 09:11
Default
  #2
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Okay ... thanks for reporting. I will check it out as the development of the comfort library as well as the tutorial comes from my side. I will need a few days as I don´t have access to my laptop right now. For the velocity field something seems to be wired as you do have almost 200 m/s which is the source of the crash.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   June 8, 2021, 18:59
Default
  #3
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
I checked the case and for any reason, we get some numerical problems during the first time-steps which let the case diverge. The turbulence model smooths the errors and hence, it is in a limit in which everything works fine. A possible solution for stabilization is to add a fvOptions file in the system folder and limit the velocity:


Code:
foamAnalyzerLimitU                                                              
{                                                                               
    type            limitVelocity;                                              
    active          true;                                                       
    max             5;                                                          
    selectionMode   all;                                                        
}
Doing so will limit the velocity to max 5 m/s and hence the analysis will work stable. Another way that works is to initialize the internal velocity field as follows:
Code:
/*--------------------------------*- C++ -*----------------------------------*\ 
  =========                 |                                                   
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox             
   \\    /   O peration     | Website:  https://openfoam.org                    
    \\  /    A nd           | Version:  8                                       
     \\/     M anipulation  |                                                   
\*---------------------------------------------------------------------------*/ 
FoamFile                                                                        
{                                                                               
    version     2.0;                                                            
    format      ascii;                                                          
    class       volVectorField;                                                 
    object      U;                                                              
}                                                                               
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 
                                                                                
dimensions      [0 1 -1 0 0 0 0];                                               
                                                                                
internalField   uniform (0.01 0 0);
Here we start with a value of 0.01 m/s in x-direction which will also solve the problem. The main problem for steady-state analysis is mostly the first few iterations which might go into a wrong direction. Possible options:


  • Limit the solution (using fvOptions)
  • Better initialization (as given in the U field above)
  • Trying to introduce diffusion such as turbulence models and first order schemes
Skaiwalker likes this.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   June 9, 2021, 04:44
Lightbulb
  #4
New Member
 
Kai Salscheider
Join Date: Aug 2018
Posts: 13
Rep Power: 8
Skaiwalker is on a distinguished road
Thank you Tobi for your enlightening answer!

Just a few thoughts: So the best way to solve this problem would be the calculation of the initial field with a transient simulation run for a few time steps? On the other hand, this should just help with convergence speed, as the steady state solution should be independent from the initial conditions, correct?

Greetings
Kai

Last edited by Skaiwalker; June 10, 2021 at 03:37. Reason: Wording...
Skaiwalker is offline   Reply With Quote

Old   June 9, 2021, 16:12
Default
  #5
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Correct. You also can try to initialize the solution using the potentialFoam. However, in that case it is sufficient to initialize the velocity field (internal field) with a value different compared to (0 0 0).
Skaiwalker likes this.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   June 10, 2021, 03:45
Default
  #6
New Member
 
Kai Salscheider
Join Date: Aug 2018
Posts: 13
Rep Power: 8
Skaiwalker is on a distinguished road
Thanks again Tobi!

I'll try out potentialFoam. Kudos to you for your friendly and precise answers!
Skaiwalker is offline   Reply With Quote

Old   June 28, 2021, 13:49
Lightbulb initialization of p
  #7
New Member
 
Kai Salscheider
Join Date: Aug 2018
Posts: 13
Rep Power: 8
Skaiwalker is on a distinguished road
Hello Tobi and others interested in this topic!

A thread of your's popped up on the thread list which suggests that, in standard OF createFields, the pressure field initialization is not optimal for buoyancy driven flows. The different initialization method is described in this post by Hannes. I've changed the solver accordingly and now the laminar problem doesn't explode anymore, albeit not converging either, as can be seen in the residuals graph. Smaller underrelaxation for p_rgh doesn't help either. Up until now I didn't have time for more testing and just wanted to let you know.

residuals_comfortHotRoomLaminar.png

Greetings
Kai
Skaiwalker is offline   Reply With Quote

Reply

Tags
laminar flow, negative temperature


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
Error: Negative initial temperature T0, supersonic flows: sonicFoam, rhoCentralFoam OlliCFD OpenFOAM Running, Solving & CFD 10 November 21, 2024 01:33
rhoCentralFoam Negative initial temperature in simulation of gas jet into vacuum c_underwood OpenFOAM Running, Solving & CFD 1 November 19, 2020 15:45
Laminar Non-premixed CH4-air combustion Temperature problem SinNi FLUENT 7 April 9, 2020 07:25
Negative temperature T0 in sonicFoam OF 5.x deepbandivadekar OpenFOAM Running, Solving & CFD 8 August 20, 2018 10:40
Boundary Layer of Laminar Flow over a Flat Plate Blasius_Pohlhausen_Crocco Main CFD Forum 12 September 30, 2013 18:35


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