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

Checking if Turbulence modeling is on/off

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 12, 2016, 20:12
Default Checking if Turbulence modeling is on/off
  #1
Member
 
Jack
Join Date: May 2015
Posts: 98
Rep Power: 10
Jack001 is on a distinguished road
Hi all,

Sometimes seeing is believing. In my constant/turbulenceProperties one can choose to set "turbulence" on or off. I would expect this to have the same effect as if the other keyword in the same file- "simulationType" is set to laminar. But I want to be sure of this. So for example, in simpleFoam, in the UEqn.H, the term turbulence->divDevReff(U) seems to be where the turbulence model comes into play (right!?)

But there is no logic telling the solver whether to use the turbulence model or not, depending on what we specified in constant/turbulenceProperties! How does the solver know if we turned turbulence on or off? I was hoping maybe I could put in some print statements at the very least to see if the turbulence model is on or off! Maybe I am missing something regarding what the (class!?) "turbulence" is. But I could really use someone to point me in the right direction on this.
Jack001 is offline   Reply With Quote

Old   July 13, 2016, 05:40
Default
  #2
Senior Member
 
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 313
Rep Power: 15
agustinvo is on a distinguished road
Hi

As you say, when you turn off the turbulence, it just do not execute correct, so the different variables (k, epsilon, nut ...) remain as they were in the previous iteration.

The solver knows , it seems it looks for it each time step. It makes sense when, for instance, you want first a simulation without resolving turbulence, and then you switch it on to start to solve your turbulence variables.

I hope I was clear!
agustinvo is offline   Reply With Quote

Old   July 13, 2016, 06:32
Default
  #3
Member
 
Jack
Join Date: May 2015
Posts: 98
Rep Power: 10
Jack001 is on a distinguished road
Hi agustinvo,

Thanks for your reply. I believe you but I wanted to understand exactly what happens in the code! So I did the following:

In rhoPimpleFoam.C I edited to include a print statement

Code:
if (pimple.turbCorr())
{
    Info << "Turbulence correction is on!" << endl;
    turbulence->correct();
}
but this print happens even if turbulence is turned off! So there must be somewhere else where the solver is told not to solve the turbulence model! Any ideas? Also in the simpleFoam.C solver there isn't even an if statement so where does the solver take into consideration the on/off?
Jack001 is offline   Reply With Quote

Old   July 13, 2016, 07:10
Default
  #4
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 29
akidess will become famous soon enough
The distinction is not made in the solver but in the turbulence library. If you use a RAS model and set turbulence to off, you in fact use the laminar "turbulence" model.
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
akidess is offline   Reply With Quote

Old   July 13, 2016, 07:25
Default
  #5
Member
 
Jack
Join Date: May 2015
Posts: 98
Rep Power: 10
Jack001 is on a distinguished road
Ok great! Could you point me in the direction to which file I should look at to see where this happens? I am using the LES smagorinsky model, so I am looking in

Code:
$WM_PROJECT_DIR/src/TurbulenceModels/turbulenceModels/LES/Smagorinsky/Smagorinsky.C
but to be honest I am overwhelmed c++ - I find it incredibly hard to follow the flow of information, how data is passed between objects etc. Searching through this code has prompted another question- Where in the code does the solver select the turbulence model? It must happen somewhere inside the class turbulence right? If so where can I find the details on this?
Jack001 is offline   Reply With Quote

Old   July 13, 2016, 07:34
Default
  #6
Senior Member
 
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 313
Rep Power: 15
agustinvo is on a distinguished road
Hi

inside the correct function, you have
Quote:
RASModel::correct();
if (!turbulence_)
{
return;
}
So if you have turbulence off, turbulence_=0, !turbulence_=1, and it goes out of the correct function.
agustinvo is offline   Reply With Quote

Old   July 17, 2016, 15:39
Default
  #7
Member
 
Jack
Join Date: May 2015
Posts: 98
Rep Power: 10
Jack001 is on a distinguished road
OK thanks thats what I was looking for!
Jack001 is offline   Reply With Quote

Reply

Tags
openfoam, turbulence modelling


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
Which Turbulence modeling???? Yapoo FLUENT 2 October 2, 2016 02:29
[GAMBIT] Problem with interior faces miro2000 ANSYS Meshing & Geometry 11 August 24, 2013 14:00
Problems with Turbulence Modeling ezsoal OpenFOAM Running, Solving & CFD 4 November 26, 2009 15:12
Gerris software installation mer Main CFD Forum 2 November 12, 2005 08:50
turbulence modeling questions llowen Main CFD Forum 3 September 11, 1998 04:24


All times are GMT -4. The time now is 18:43.