CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (http://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   post-processing utility R, calculating Reynolds stress tensor (http://www.cfd-online.com/Forums/openfoam-post-processing/72357-post-processing-utility-r-calculating-reynolds-stress-tensor.html)

volker February 3, 2010 06:35

post-processing utility R, calculating Reynolds stress tensor
 
Hi,

I experienced a problem when using the post-processing utility R to evaluate the Reynolds stress tensor based on a compressible simulation using a kEpsilon turbulence model. The Reynolds stress tensor is needed as initialization for a RSM simulation.
The problem I experienced is basically related to the compressible nature of my simulation and it seems that the R-utility is written exclusively for incompressible flows (makes use of transportProperties file).
I searched already the forum without success.
Does anybody have a suggestion how to resolve that issue?


I'm happy about any idea.


Greets, Volker

SD@TUB February 28, 2010 14:02

Hello Volker,

reading in Doxygen --> base class for incompressible turbulence models, i guess that R just work for incompressible turbulent calcualtions so far.

I tried some sampling with your mentioned tool and i'm a little confused, 'cause i get six columns for the reynolds stress tensor in my output file!
Could you/someone explain me the columns? In Doxygen i can't find the source of the utility R!
For future development of post-processing tools it would be useful to include an obvious header to the produced output files.


Regards,
/Stefan

chegdan April 13, 2011 12:46

Quote:

Originally Posted by SD@TUB (Post 247799)
Hello Volker,

reading in Doxygen --> base class for incompressible turbulence models, i guess that R just work for incompressible turbulent calcualtions so far.

I tried some sampling with your mentioned tool and i'm a little confused, 'cause i get six columns for the reynolds stress tensor in my output file!
Could you/someone explain me the columns? In Doxygen i can't find the source of the utility R!
For future development of post-processing tools it would be useful to include an obvious header to the produced output files.


Regards,
/Stefan

I know this is old, but I thought I would answer anyway.

You only have 6 components because you have a symmetric tensor Rxx, Ryy, Rzz, Rxy, Rxz, Ryz. that means that Rxy=Ryx, Rxz=Rzx, and Ryz=Rzy.

rajeshkunwar May 1, 2013 23:39

Hi Volker,

I am also facing the same problem while getting Reynolds stress. Did u solve this issue? If yes, please post the solution so that others can also get benefited.

Regards
Rajesh

chegdan May 2, 2013 08:40

You can make a custom tool to calculate R for compressible cases. To create a compressible turbulence model you will need to read in:

Code:

    Info<< "Creating turbulence model\n" << endl;
    autoPtr<compressible::turbulenceModel> turbulence
    (
        compressible::turbulenceModel::New
        (
            rho,
            U,
            phi,
            thermo
        )
    );

So you will need a thermo object to pass to the constructor. Basically, you will have to look at a compressible solver (e.g. rhoPimpleFoam) and add things like a compressible phi, thermo from basiPsiThermo, etc. Most of these changes are in the createFields.H file in the R utility....but I suggest you make your own utility separately called something like "Rcompressible". Additioanlly, you will have to change some entries in the Make/Options file to let the compiler know where to search for these new "compressible" classes. Hope this helps.

rajeshkunwar May 2, 2013 13:09

Thanks Mr. Daniel for your help.

I have created the utility for computing Reynolds stresses for compressible solver.

Regards
Rajesh

charmc July 20, 2013 10:14

Dear Rajesh:
As a newer to openfoam ! Can you write more detail about how to
creat the utility for computing Reynolds stresses for compressible solver ?
Thank you !

flames February 19, 2014 18:16

Hello there,

In openfoam, what is the order of the components in Reynolds stress tensor? For example, the Reynolds stress is (1,2, 3, 4, 5, 6), how these 6 components corresponds to the Rxx, Ryy ......? Thank you in advance!

flames

Quote:

Originally Posted by chegdan (Post 303475)
I know this is old, but I thought I would answer anyway.

You only have 6 components because you have a symmetric tensor Rxx, Ryy, Rzz, Rxy, Rxz, Ryz. that means that Rxy=Ryx, Rxz=Rzx, and Ryz=Rzy.


johnkh March 27, 2014 00:37

Rxx, Rxy, Rxz, Ryy, Ryz and Rzz correspond to R(0), R(3), R(4), R(1), R(5) and R(2) respectively.

maphd April 14, 2014 11:32

Hi,

I have a question: is there a way to read Reynolds stresses directly from Fluent? If you could help me on this, I really appreciate it.

Thanks,

jensi_t July 30, 2014 05:14

Hey maphd,

you can use the fluentDataToFoam utility, but you have to adapt it bacause Reynolds Stresses are missing:

Code:


    //Reynolds stresses
   
    if (fields.found(128) || fields.found(129) || fields.found(130) || fields.found(131) || fields.found(132) || fields.found(133))
    {
        Info << "Converting reynolds-stresses field" << endl;
        volSymmTensorField R
        (
            IOobject
            (
                "R",
                mesh.time().timeName(),
                mesh,
                IOobject::NO_READ,
                IOobject::NO_WRITE
            ),
            mesh,
            dimensionedSymmTensor("zero", dimensionSet(0, 2, -2, 0, 0, 0, 0), symmTensor::zero)
        );

        if (fields.found(128))
        {
            R.replace
            (
                symmTensor::XX,
                fdc.convertField
                (
                    "UU",  // field name
                    128,          // fluent Unit number
                    dimensionedScalar("zero", dimensionSet(0, 2, -2, 0, 0, 0, 0), 0)
                )
            );
        }

        if (fields.found(129))
        {
            R.replace
            (
                symmTensor::YY,
                fdc.convertField
                (
                    "VV",  // field name
                    129,          // fluent Unit number
                    dimensionedScalar("zero", dimensionSet(0, 2, -2, 0, 0, 0, 0), 0)
                )
            );
        }
       
        if (fields.found(130))
        {
            R.replace
            (
                symmTensor::ZZ,
                fdc.convertField
                (
                    "WW",  // field name
                    130,          // fluent Unit number
                    dimensionedScalar("zero", dimensionSet(0, 2, -2, 0, 0, 0, 0), 0)
                )
            );
        }
       
        if (fields.found(131))
        {
            R.replace
            (
                symmTensor::XY,
                fdc.convertField
                (
                    "UV",  // field name
                    131,          // fluent Unit number
                    dimensionedScalar("zero", dimensionSet(0, 2, -2, 0, 0, 0, 0), 0)
                )
            );
        }
       
        if (fields.found(132))
        {
            R.replace
            (
                symmTensor::YZ,
                fdc.convertField
                (
                    "VW",  // field name
                    132,          // fluent Unit number
                    dimensionedScalar("zero", dimensionSet(0, 2, -2, 0, 0, 0, 0), 0)
                )
            );
        }
       
        if (fields.found(133))
        {
            R.replace
            (
                symmTensor::XZ,
                fdc.convertField
                (
                    "UW",  // field name
                    133,          // fluent Unit number
                    dimensionedScalar("zero", dimensionSet(0, 2, -2, 0, 0, 0, 0), 0)
                )
            );
        }
        R.write();
    }

epsilon as well as i remember

Code:

        if (fields.found(6))
    {
        Info << "Converting dissipation rate field" << endl;
        fdc.convertField
        (
            "epsilon",  // field name
            6,    // fluent Unit number
            dimensionedScalar("zero", dimensionSet(0, 2, -3, 0, 0, 0, 0), 0)
        )().write();
    }



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