CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   defining constant transport property inside a turbulence model (http://www.cfd-online.com/Forums/openfoam-programming-development/117101-defining-constant-transport-property-inside-turbulence-model.html)

PonchO May 2, 2013 04:59

defining constant transport property inside a turbulence model
 
Hello Foamers,

i want to implement a turbulence model based on a k-epsilon-model for turbulent magnetohydrodynamics-flow.
Therfore i have to add additional dissipation terms in the epsilon-equation and in the k-equation.
These terms containing the density "rho" and the electrical conductivity "sigma".

Because that properties are constants in my incompressible case, i can't introduce them like it's done in the compressible turbulence-model.

So how can i introduce or address them inside my turbulence-model-files?

Best Regards,

Christoph

abe June 19, 2013 04:33

Hi Christoph,

Have you find a way to call rho inside turbulence model for incompressible case? if yes, please share.

ABE

PonchO June 21, 2013 06:48

Quote:

Originally Posted by abe (Post 434783)
Hi Christoph,

Have you find a way to call rho inside turbulence model for incompressible case? if yes, please share.

ABE

Hi abe,

after some trial and error i've found a solution.

In my .C-File i read the properties as follows:

Code:

//that part you should find in your turbulence-model-code
void kEpsilonZeta::correct()
{
    RASModel::correct();

    if (!turbulence_)
    {
        return;
    }

//Here the reading of the properties starts
    Info<< "\nReading transportProperties\n" << endl;
    IOdictionary transportProperties
    (
        IOobject
        (
            "transportProperties",
            runTime_.constant(),
            mesh_,
            IOobject::MUST_READ,
            IOobject::NO_WRITE,
            false
        )
    );


    dimensionedScalar nu
    (
        transportProperties.lookup("nu")
    );

   
    dimensionedScalar rho
    (
        transportProperties.lookup("rho")
    );

    // electromagnetic properties
    dimensionedScalar mu
    (
        transportProperties.lookup("mu")
    );

    dimensionedScalar sigma
    (
        transportProperties.lookup("sigma")
    );

    dimensionedScalar Cm
    (
        transportProperties.lookup("Cm")
    );

//Now the Solution of the turbulence transport equations follows

Hope that helps you too. :)

Best regards,

Christoph

abe June 21, 2013 09:00

Hi Christoph,

Thank you for sharing.

ABE


All times are GMT -4. The time now is 16:41.