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

Modifying Turbulence Model Coefficients

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   April 7, 2016, 15:42
Default Modifying Turbulence Model Coefficients
  #1
New Member
 
Join Date: Apr 2012
Posts: 9
Rep Power: 6
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, 02:21
Default
  #2
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,197
Rep Power: 21
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.
__________________
*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, 10:53
Default
  #3
New Member
 
Join Date: Apr 2012
Posts: 9
Rep Power: 6
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;


// ************************************************************************* //
dsh5400 is offline   Reply With Quote

Old   August 31, 2016, 06:06
Default
  #4
New Member
 
larmes
Join Date: Aug 2016
Posts: 26
Rep Power: 2
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, 11:10
Default
  #5
New Member
 
Join Date: Apr 2012
Posts: 9
Rep Power: 6
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, 03:44
Default
  #6
New Member
 
larmes
Join Date: Aug 2016
Posts: 26
Rep Power: 2
yeya is on a distinguished road
sounds good thanks!
yeya is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
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 03:41
Overflow Error in Multiphase Modelling with Two Continuous Fluids ashtonJ CFX 6 August 11, 2014 14:32
Spalarat - Allmaras turbulence model saisanthoshm88 Main CFD Forum 1 June 16, 2014 16: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 09:52


All times are GMT -4. The time now is 15:22.