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

kEpsilon: correctNut() and eddyViscosity::correct()

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By simrego

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 22, 2018, 11:04
Default kEpsilon: correctNut() and eddyViscosity::correct()
  #1
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 245
Rep Power: 10
gu1 is on a distinguished road
Hi,

Could someone tell me what these featured lines do?

Quote:
template<class BasicTurbulenceModel>
void kEpsilon<BasicTurbulenceModel>::correctNut()
{
this->nut_ = Cmu_*sqr(k_)/epsilon_;
this->nut_.correctBoundaryConditions();
fv:: options::New(this->mesh_).correct(this->nut_);

BasicTurbulenceModel::correctNut(); // If I call only correctNut() it gives error while executing the solverFoam.
}
and

Quote:
void kEpsilon<BasicTurbulenceModel>::correct()
{
if (!this->turbulence_) //Is it necessary?
{
return;
}

fv:: options& fvOptions(fv:: options::New(this->mesh_));

eddyViscosity<RASModel<BasicTurbulenceModel>>::cor rect(); // If I call only correct() it gives error while executing the solverFoam.
I was testing a version I compiled from the kEpsilon model (OF5.0) and both I did not insert (because when I did, it gave error in executing the solver - to my understanding, I was closing the loop) in my code ... I noticed a difference in results, but very small. Unfortunately '' I could not understand '' what they do ... if anyone can teach me.
gu1 is offline   Reply With Quote

Old   November 22, 2018, 20:58
Default
  #2
Senior Member
 
Join Date: Mar 2018
Posts: 115
Rep Power: 8
anon_q is on a distinguished road
I think you can find the answer in this link:
https://pingpong.chalmers.se/public/...o?item=3855255
anon_q is offline   Reply With Quote

Old   November 23, 2018, 06:56
Default
  #3
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 245
Rep Power: 10
gu1 is on a distinguished road
Hi Linda,

I got to read this file, but he did not answer my questions.

It says that part of the code: eddyViscosity<RASModel<BasicTurbulenceModel>>::cor rect();, "...that it first calls the correct() function of the base class, in case there are some general things to be done.", what general things?

...and about: BasicTurbulenceModel::correctNut();, ...he does not say anything.
gu1 is offline   Reply With Quote

Old   November 25, 2018, 06:20
Default
  #4
Senior Member
 
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14
simrego is on a distinguished road
Hi!


For the second question: if (!this->turbulence_) //Is it necessary?
Yes, it is. turbulence_ is a switch from the RASModel<BasicTurbulenceModel>. This is the switch in the RASDict. This is usually on. But if you turn it off, you just skip this part of the code (return from the function), since you turned the turbulence off.


eddyViscosity<RASModel<BasicTurbulenceModel>>::cor rect();
Honestly I have no idea what basic things he talking about.
If you check the code:
Code:
template<class BasicTurbulenceModel>
 void Foam::eddyViscosity<BasicTurbulenceModel>::correct()
 {
     BasicTurbulenceModel::correct();
 }
This function just calls the correct() function from the turbulence model.
Maybe this is for further developments. So if you have to add something to all turbulence models when you call the correct() function, you can add it in the base class.


I hope i understood the code correctly and I'm right.
gu1 likes this.
simrego is offline   Reply With Quote

Reply

Tags
kepsilon, openfoam 5.0, program development


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



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