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

Baldwin Lomax - Zero Equation Turbulence Model

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 6, 2016, 21:20
Default Baldwin Lomax - Zero Equation Turbulence Model
  #1
Senior Member
 
shereez234's Avatar
 
M Sereez
Join Date: Jan 2014
Location: England
Posts: 352
Blog Entries: 1
Rep Power: 13
shereez234 is on a distinguished road
Hello experts in OpenFoam.

I need some assistance in coding a zero equation turbulence model i.e. Baldwin Lomax.

http://www.cfd-online.com/Wiki/Baldwin-Lomax_model

I have tried to modify the two equation turbulence models and one equation models to remove the PDEs and convert this into a fully algebraic zero equation model without much success.

Another Idea I have is to start from Laminar so that I don't have to remove the PDE's. What is the best way to go about it?

Also if any one else has done some work or know more information please help me out.

With kind regards

Shereez
shereez234 is offline   Reply With Quote

Old   June 7, 2016, 21:54
Default
  #2
Senior Member
 
shereez234's Avatar
 
M Sereez
Join Date: Jan 2014
Location: England
Posts: 352
Blog Entries: 1
Rep Power: 13
shereez234 is on a distinguished road
Hello;

I have made some progress in removing 2 PDE's from a 2-equation model. But Baldwin Lomax uses y+ (yPlus) for it's execution. Wall distance y_ is easily incorporated in to the code but does any one know how I can incorporate yplus in to my source code without having to redefine the whole calculation of yplus again...

Thanks
shereez234 is offline   Reply With Quote

Old   June 9, 2016, 12:58
Default
  #3
Senior Member
 
shereez234's Avatar
 
M Sereez
Join Date: Jan 2014
Location: England
Posts: 352
Blog Entries: 1
Rep Power: 13
shereez234 is on a distinguished road
Going forward;

now I am stuck here:

I have a function

F= a * b * y_ * C

I would like to return the Ymax which is the corresponding y_ while F = Fmax (i,e, maximum of function F)

I tried

while ( F == Fmax)
{

return y_(Fmax);

}


But it doesnt work. Can somebody please help me


Thanks
shereez234 is offline   Reply With Quote

Old   June 10, 2016, 01:31
Default
  #4
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 26
RodriguezFatz will become famous soon enough
Hey shereez,
Your code looks horrible
I can probably help you, but I need more information.
What are a, b, C and y_ ? Functions or constants?
Philipp.
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   June 10, 2016, 14:13
Default
  #5
Senior Member
 
shereez234's Avatar
 
M Sereez
Join Date: Jan 2014
Location: England
Posts: 352
Blog Entries: 1
Rep Power: 13
shereez234 is on a distinguished road
Quote:
Originally Posted by RodriguezFatz View Post
Hey shereez,
Your code looks horrible
I can probably help you, but I need more information.
What are a, b, C and y_ ? Functions or constants?
Philipp.
Code:
tmp<volScalarField> Baldwin_Fake::L() const
 {
     return f_ * y_ *(1 - exp(yPlus/Aplus_));
 }

 tmp<volScalarField> Baldwin_Fake:: Fnum(const volScalarField& G1) const
 {
   return  (y_ * G1 * (1 - exp(yPlus/Aplus_)));
 }



 tmp<volScalarField> Baldwin_Fake::Fmax(const volScalarField &Fnum) const
  {
      tmp<volScalarField> Y1 = max
      (Fnum, 1e-40);
     return Y1;
}

tmp<volScalarField> Baldwin_Fake::Ymax(const volScalarField& Fmax, const volScalarField& G1) const
   {

                 return  (Fmax / (G1 *(1 - exp(yPlus/Aplus_)) ));

    }
//
  tmp<volScalarField> Baldwin_Fake::Fkleb(const volScalarField& Ymax) const
  {
      tmp<volScalarField> H;
       (1 +5.5 * pow(((y_ * Ckleb_)/Ymax),(6)));

       return pow(H,-1);
  }



  tmp<volScalarField> Baldwin_Fake::YmaxFmax
  (
    const volScalarField& Ymax,
      const volScalarField& Fmax
 ) const
  {
      return (Ymax * Fmax);
  }
//
//
 tmp<volScalarField> Baldwin_Fake::Fwake(const volScalarField& YmaxFmax, const volScalarField& Fmax, const volScalarField& Udiff, const volScalarField& Ymax) const
  {

  //   ((YmaxFmax, Cwk_ * Ymax * ((Udiff * Udiff))/Fmax)),1e-40);
        return max ((((sqr(Udiff))/Fmax) * Cwk_ * Ymax), YmaxFmax );

  }

 tmp<volScalarField> Baldwin_Fake::nut_Inner(const volScalarField& L, const volScalarField& G1) const
  {
     return ((sqr(L)) * G1 * scalar(1.2));
  }

 tmp<volScalarField> Baldwin_Fake::nut_Outer(const volScalarField& Fkleb, const volScalarField& Fwake) const
  {
     return (Fwake* Fkleb * Ccp_ * K_ * scalar(1.2));
  }

 tmp<volScalarField> Baldwin_Fake::yCrossOver(const volScalarField& nut_Inner, const volScalarField& nut_Outer) const
  {
    if (nut_Inner = nut_Outer)
    {
        return 0.0;
    }
  }
Yeah that wasnt the real code. Some how I am able to get the Ymax now. At the moment I am stuck in a position with yCrossOver (the last function in the code) nut_Inner = nut_Outer as you can see from above. I need to return thee min(y_) while nut_Inner is equal to nut_Outer. Do you think I need a bool function to do this?

Thanks for the help I am not an expert in C++ coding
shereez234 is offline   Reply With Quote

Old   June 14, 2016, 18:40
Default
  #6
Senior Member
 
shereez234's Avatar
 
M Sereez
Join Date: Jan 2014
Location: England
Posts: 352
Blog Entries: 1
Rep Power: 13
shereez234 is on a distinguished road
Code:
  tmp<volScalarField> Baldwin_Edit2::Ymax(const volScalarField& Fmax) const
   {
        return y_(Fmax);
   }
I have tried several different ways. I would like to know how I can return the value of wall distance y_ when Fmax = maximum.

Is there any one who can help me?
shereez234 is offline   Reply With Quote

Old   June 21, 2016, 02:13
Default
  #7
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 26
RodriguezFatz will become famous soon enough
Hi again,

Sorry I forgot about this thread...
Well, I don't understand your code or I don't understand the model!
Can you post the whole code? It looks like you use y+ as a constant...
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Reply


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
Implement an les turbulence model pante OpenFOAM Programming & Development 19 December 5, 2014 16:16
Zero equation turbulence model gives better result?? Sanyo CFX 10 June 26, 2011 10:58
Baldwin Lomax Turbulence Model kharati Main CFD Forum 0 February 7, 2009 11:30
Baldwin lomax turbulence model masoud Main CFD Forum 1 February 7, 2009 11:29
Reynolds transport, turbulence model, etc Beginner Main CFD Forum 1 January 7, 2009 05:36


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