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

OpenFOAM zero Equation Turbulence Model

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 13, 2016, 05:57
Question OpenFOAM zero Equation Turbulence Model
  #1
Senior Member
 
shereez234's Avatar
 
M Sereez
Join Date: Jan 2014
Location: England
Posts: 353
Blog Entries: 1
Rep Power: 13
shereez234 is on a distinguished road
Hello Every one;

I have been trying to code the zero equation turbulence model Baldwin - Lomax inorder to replicate some results from a published journal paper. I have been able to remove the k and omega PDE's from a 2 equation turbulence model in order to begin this with.

It works on a principle of calculating two different turbulent viscosity. One for Outer region (Hence nut_Outer) and one for Inner region ( nut_Inner). The two viscosity regions are separated at a wall distance value where the nut_Inner and nut_Outer are equal. nut_Inner is calculated using prandit's van driest formulation and nut_Outer is calculated using a function for wake region and Intermittency factor (Fwake and Fkleb).

The whole model in theory can be found on CFD online wiki:
http://www.cfd-online.com/Wiki/Baldwin-Lomax_model

All the coding went well until I had to define yCrossOver:

Code:
    Foam::dimensioned<double> BL::yCrossOver(const volScalarField& NDiff, const volScalarField& nut_Inner) const
    {
        Foam::dimensioned<double> arg = min(y_);
        if (NDiff < ((nut_Inner/nut_Inner)*1e-7))
        {
            return arg;
        }
        else
        {
            return false;
        }

   }
where NDiff is something I have introduced and is the Difference of Nut_Inner and Nut_Outer. I did this just so the division by zero error can be avoided and if not then this becomes a boolean operation which is much harder to code.

Now the question is how I do get the minimum value of y ( walldistance) when nut_Inner is equal to nut_Outer? How do I code this bit?

Sorry about the lengthy post and have a good day!

Thank you.
Shereez
shereez234 is offline   Reply With Quote

Old   October 13, 2016, 11:07
Default
  #2
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22
jherb is on a distinguished road
Quote:
Originally Posted by shereez234 View Post
Code:
    Foam::dimensioned<double> BL::yCrossOver(const volScalarField& NDiff, const volScalarField& nut_Inner) const
    {
        Foam::dimensioned<double> arg = min(y_);
        if (NDiff < ((nut_Inner/nut_Inner)*1e-7))
        {
            return arg;
        }
        else
        {
            return false;
        }

   }
This looks like you return either a dimensioned double or a boolean, depending on the result of your if statement. This should not work.


Quote:
Originally Posted by shereez234 View Post
Now the question is how I do get the minimum value of y ( walldistance) when nut_Inner is equal to nut_Outer? How do I code this bit?
See https://github.com/OpenFOAM/OpenFOAM...kLOmega.C#L535
and
https://github.com/OpenFOAM/OpenFOAM...kLOmega.H#L203

Here the wall distance is calculated using the OpenFOAM class wallDist.
jherb is offline   Reply With Quote

Old   November 6, 2016, 20:49
Default
  #3
Senior Member
 
shereez234's Avatar
 
M Sereez
Join Date: Jan 2014
Location: England
Posts: 353
Blog Entries: 1
Rep Power: 13
shereez234 is on a distinguished road
How can I code to get the wall distance y_ of a specific cell ( for example maximum vorticity or minimum viscocity) ?
shereez234 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
Use of k-epsilon and k-omega Models Jade M Main CFD Forum 40 January 27, 2023 08:18
Setting the height of the stream in the free channel kevinmccartin CFX 12 October 13, 2022 22:43
Turbulent frequency equation for compressible kOmegaSST turbulence model Bojan OpenFOAM Programming & Development 1 September 6, 2013 07:45
OpenFOAM: LES turbulence model names Ollie OpenFOAM 5 January 7, 2013 11:24
k-e turbulence model and energy equation Blob Main CFD Forum 0 May 29, 2009 09:35


All times are GMT -4. The time now is 19:03.