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

variable CMU for kEpsilon model

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Sugajen

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 1, 2017, 11:54
Default variable CMU for kEpsilon model
  #1
Member
 
Vedamt Chittlangia
Join Date: Feb 2016
Posts: 64
Rep Power: 9
vcvedant is an unknown quantity at this point
Hello,

I want to change change C_\mu for kEpsilon model and define it as a local variable for the whole domain.
So, \nu_t = C_\mu \frac{k^2}{\varepsilon} would remain same but
C_\mu = f(x,y)

Currently it is defined as dimensionedScalar. I am thinking that first I should define it as volScalarField and then do the changes.
I would appreciate any help and guidance.

Thanks
vcvedant is offline   Reply With Quote

Old   August 1, 2017, 21:03
Default
  #2
Member
 
Sugajen
Join Date: Jan 2012
Location: Tempe, USA
Posts: 52
Rep Power: 14
Sugajen is on a distinguished road
Hi Vedamt,

I have not worked with Turbulence models but I can suggest a general way to proceed.

As you said couple of things need to be done.
1. Remove the cMu variable as a diemnsionedScalar from createFields.H and instead create a scalarField similar to P. And initialize to say zero.
Code:
Info<< "Creating field cMu\n" << endl;
volScalarField cMu
(
    IOobject
    (
        "cMu",
        runTime.timeName(),
        mesh,
        IOobject::NO_READ,   
        IOobject::NO_WRITE
    ),
    mesh,
    dimensionedScalar("cMu", dimensionSet(0,0,0,0,0,0,0), scalar(0.0))   // give proper dimensions
);
2. Now write code to give values to the cMu field both internal field and boundary.
Code:
forAll ( mesh.C(), cellI) 
{
cMu[cellI] = // your code here
}

forAll (mesh.boundaryMesh(), patchI)
{
    forAll(mesh.boundaryMesh()[patchI], faceI)
    {
         cMu.boundaryField()[patchI][faceI] = //your code here
    }
}
3. Then use it for anywhere else
4. Also do remove the value from transportProperties of case/constant/ if it is being read from that file.

best,
Sugajen
vcvedant likes this.
Sugajen is offline   Reply With Quote

Reply

Tags
kepsilon, turbulent viscosity, volscalarfield


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
CFX - Bingham Model with yield stess variable with temperature annagoco ANSYS 1 July 16, 2019 17:26
NEW turbulence TRANSITIONAL model giammy92 OpenFOAM 3 June 30, 2016 10:47
coalChemistryFoam: "Foam::error::printStack(Foam::Ostream&) at ??:?" musabai OpenFOAM Running, Solving & CFD 2 February 20, 2015 15:07
Error finding variable "THERMX" sunilpatil CFX 8 April 26, 2013 08:00
K - epsilon VS SST turbulence model Maicol Main CFD Forum 0 November 30, 2012 17:25


All times are GMT -4. The time now is 06:08.