CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

Modifying Turbulence Model Coefficients

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 3 Post By akidess
  • 1 Post By dsh5400

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 7, 2016, 16:42
Default Modifying Turbulence Model Coefficients
  #1
New Member
 
Join Date: Apr 2012
Posts: 9
Rep Power: 14
dsh5400 is on a distinguished road
I'm working with the v2f RAS model. Ultimately, I'd like to be able to modify the model's coefficients without having to recompile.

The two files, v2f.C and v2f.H, found in the directory, /src/turbulenceModels/incompressible/RAS/v2f/, seem to contain everything I need to make the changes.

v2f.C contains a section called "Constructors" and looks like this
Code:
// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //

v2f::v2f
(
    const volVectorField& U,
    const surfaceScalarField& phi,
    transportModel& transport,
    const word& turbulenceModelName,
    const word& modelName
)
:
    RASModel(modelName, U, phi, transport, turbulenceModelName),

    Cmu_
    (
        dimensioned<scalar>::lookupOrAddToDict
        (
            "Cmu",
            coeffDict_,
            0.22
        )
    ),
    CmuKEps_
    (
        dimensioned<scalar>::lookupOrAddToDict
        (
            "CmuKEps",
            coeffDict_,
            0.09
        )
    ),
...
Which leads me to believe I should just modify these values as needed. However, the OpenFOAM User Guide states:

7.2.1 Model coefficients
The coefficients for the RAS turbulence models are given default values in their respective source code. If the user wishes to override these default values, then they can do so by adding a sub-dictionary entry to the RAS sub-dictionary file, whose keyword name is that of the model with Coeffs appended, e.g. kEpsilonCoeffs for the kEpsilon model. If the printCoeffs switch is on in the RAS sub-dictionary, an example of the relevant …Coeffs dictionary is printed to standard output when the model is created at the beginning of a run. The user can simply copy this into the RAS sub-dictionary file and edit the entries as required.


And the v2f.H file contains the following in the header:
Code:
    \verbatim
        v2fCoeffs
        {
            Cmu         0.22;
            CmuKEps     0.09;
            C1          1.4;
            C2          0.3;
            CL          0.23;
            Ceta        70;
            Ceps2       1.9;
            sigmaEps    1.3;
            sigmaK      1;
        }
    \endverbatim
Which has me wondering if this is the "sub-directory entry" mentioned by the User Guide. Is something that I should move into the body of the code, and modify the values?

So, I guess my real question is: what is the easiest way to modify these coefficients? And, does this require that I compile the RAS directory (using the Allwmake found in the /src/turbulenceModels/incompressible/ directory, parallel to the /RAS/ directory)?

Thanks!
dsh5400 is offline   Reply With Quote

Old   April 8, 2016, 03:21
Default
  #2
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
You don't need to change the code at all to modify these values. Just add the v2fCoeffs into the file where you select the turbulence model. Note that a dictionary never refers to a code file, but a configuration file.
calf.Z, purnp2 and labyrinth01 like this.
__________________
*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   April 8, 2016, 11:53
Default
  #3
New Member
 
Join Date: Apr 2012
Posts: 9
Rep Power: 14
dsh5400 is on a distinguished road
Quote:
Originally Posted by akidess View Post
You don't need to change the code at all to modify these values. Just add the v2fCoeffs into the file where you select the turbulence model. Note that a dictionary never refers to a code file, but a configuration file.
Thank you! I added the code to the RASProperties file found in the /constant/ directory as follows:

Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "constant";
    object      RASProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

RASModel        v2f;

v2fCoeffs
{
    Cmu         0.221;
    CmuKEps     0.091;
    C1          1.41;
    C2          0.31;
    CL          0.231;
    Ceta        701;
    Ceps2       1.91;
    sigmaEps    1.31;
    sigmaK      1.1;
}

turbulence      on;

printCoeffs     on;


// ************************************************************************* //
labyrinth01 likes this.
dsh5400 is offline   Reply With Quote

Old   August 31, 2016, 07:06
Default
  #4
New Member
 
larmes
Join Date: Aug 2016
Posts: 26
Rep Power: 10
yeya is on a distinguished road
Just wondering but in which cases would you need to modify them?
yeya is offline   Reply With Quote

Old   August 31, 2016, 12:10
Default
  #5
New Member
 
Join Date: Apr 2012
Posts: 9
Rep Power: 14
dsh5400 is on a distinguished road
Quote:
Originally Posted by yeya View Post
Just wondering but in which cases would you need to modify them?
Just looking to see if there is some room to improve the values of the constants in various RANS models. Working with flows that are transitioning in/out of turbulent states, where RANS models can have some trouble predicting the physics of the flow.
dsh5400 is offline   Reply With Quote

Old   September 1, 2016, 04:44
Default
  #6
New Member
 
larmes
Join Date: Aug 2016
Posts: 26
Rep Power: 10
yeya is on a distinguished road
sounds good thanks!
yeya 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
Fluent :- turbulence Model prince_pahariaa FLUENT 9 May 20, 2016 04:41
Overflow Error in Multiphase Modelling with Two Continuous Fluids ashtonJ CFX 6 August 11, 2014 15:32
Spalarat - Allmaras turbulence model saisanthoshm88 Main CFD Forum 1 June 16, 2014 17:33
question about turbulence model selection and sensitivity karananand Main CFD Forum 1 February 26, 2010 05:41
Discussion: Reason of Turbulence!! Wen Long Main CFD Forum 3 May 15, 2009 10:52


All times are GMT -4. The time now is 07:01.