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

post-processing utility R, calculating Reynolds stress tensor

Register Blogs Community New Posts Updated Threads Search

Like Tree13Likes
  • 1 Post By volker
  • 2 Post By chegdan
  • 1 Post By rajeshkunwar
  • 3 Post By johnkh
  • 2 Post By canopus
  • 3 Post By Jess80
  • 1 Post By Jess80

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 3, 2010, 06:35
Default post-processing utility R, calculating Reynolds stress tensor
  #1
New Member
 
Volker Tritschler
Join Date: Jan 2010
Posts: 20
Rep Power: 16
volker is on a distinguished road
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
maphd likes this.
volker is offline   Reply With Quote

Old   February 28, 2010, 14:02
Default
  #2
Member
 
Stefan
Join Date: Jan 2010
Location: Kiel, Germany
Posts: 81
Rep Power: 16
SD@TUB is on a distinguished road
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
SD@TUB is offline   Reply With Quote

Old   April 13, 2011, 13:46
Default
  #3
Senior Member
 
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 621
Rep Power: 0
chegdan will become famous soon enoughchegdan will become famous soon enough
Quote:
Originally Posted by SD@TUB View Post
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.
chegdan is offline   Reply With Quote

Old   May 2, 2013, 00:39
Default
  #4
New Member
 
Rajesh Kumar
Join Date: Apr 2009
Posts: 25
Rep Power: 17
rajeshkunwar is on a distinguished road
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
rajeshkunwar is offline   Reply With Quote

Old   May 2, 2013, 09:40
Default
  #5
Senior Member
 
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 621
Rep Power: 0
chegdan will become famous soon enoughchegdan will become famous soon enough
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.
mgg and charmc like this.

Last edited by chegdan; May 2, 2013 at 17:25. Reason: more details
chegdan is offline   Reply With Quote

Old   May 2, 2013, 14:09
Default
  #6
New Member
 
Rajesh Kumar
Join Date: Apr 2009
Posts: 25
Rep Power: 17
rajeshkunwar is on a distinguished road
Thanks Mr. Daniel for your help.

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

Regards
Rajesh
charmc likes this.
rajeshkunwar is offline   Reply With Quote

Old   July 20, 2013, 11:14
Default
  #7
New Member
 
Join Date: Jan 2013
Posts: 3
Rep Power: 13
charmc is on a distinguished road
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 !
charmc is offline   Reply With Quote

Old   February 19, 2014, 18:16
Question
  #8
New Member
 
Join Date: Jan 2014
Posts: 16
Rep Power: 12
flames is on a distinguished road
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 View Post
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.
flames is offline   Reply With Quote

Old   March 27, 2014, 00:37
Default
  #9
New Member
 
John Khoo
Join Date: Nov 2012
Location: Malaysia
Posts: 4
Rep Power: 14
johnkh is on a distinguished road
Rxx, Rxy, Rxz, Ryy, Ryz and Rzz correspond to R(0), R(3), R(4), R(1), R(5) and R(2) respectively.
johnkh is offline   Reply With Quote

Old   April 14, 2014, 12:32
Default
  #10
Member
 
Join Date: May 2013
Posts: 32
Rep Power: 13
maphd is on a distinguished road
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,
maphd is offline   Reply With Quote

Old   July 30, 2014, 06:14
Default
  #11
New Member
 
Jens
Join Date: Apr 2014
Posts: 28
Rep Power: 12
jensi_t is on a distinguished road
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();
    }

Last edited by jensi_t; August 4, 2014 at 12:52. Reason: I think i mixed the fields up sorry. Now it should work
jensi_t is offline   Reply With Quote

Old   January 17, 2016, 09:28
Default Listing order of output of R utility
  #12
Member
 
SM
Join Date: Dec 2010
Posts: 97
Rep Power: 15
canopus is on a distinguished road
Thanks to JohnKhoo and to make it clear-

Output files obtained by executing R utility (and those obtained by running sample on it) list Reynolds stresses in order of

Code:
Rxx, Rxy, Rxz, Ryy, Ryz and Rzz
respectively.

and for viewing in paraview the same corresponds to

Code:
 R(0), R(3), R(4), R(1), R(5) and R(2)
respectively.
abas.rahmani86 and Gerhard like this.
canopus is offline   Reply With Quote

Old   July 23, 2017, 06:13
Default
  #13
New Member
 
Ali
Join Date: Dec 2016
Location: Hong Kong
Posts: 12
Rep Power: 9
abas.rahmani86 is on a distinguished road
hi guys
I want to know how i can extraction reynolds stress tensor from k-e model theorically?
tnx
abas.rahmani86 is offline   Reply With Quote

Old   January 19, 2018, 12:16
Default Relation between Reynolds stress tensor and k (turbulent kinetic energy)
  #14
New Member
 
Jessica Guichard
Join Date: Jan 2018
Posts: 3
Rep Power: 8
Jess80 is on a distinguished road
Hi,

know that k, the turbulent kinetic energy par unity of mass, can be calculated with
k=1/2 (U'x^2+U'y^2+U'z^2 ) where U'x, U'y and U'z are the fluctuating components of velocity in the x, y and z directions.
whereas R is a symmetric tensor with the following components:

Rxx Rxy Rxz
Rxy Ryy Ryz
Rxz Ryz Rzz

and with Rxx=U'x^2
Rxy=0 if isotropic turbulence (same in all directions), otherwise Rxy=Temporal Average (U’x*U’y)
Rxz=0 if isotropic turbulence (same in all directions) , otherwise Rxz=Temporal Average (U’x*U’z)
Ryy=U'y^2
Ryz=0 if isotropic turbulence (same in all directions), otherwise Ryz=Temporal Average (U’y*U’z)
Rzz=U'z^2

If Rxy=Rxz=Ryz=0, k=0.5*(Rxx+Ryy+Rzz)

The other way around you have to make the assumption that turbulence is isotropic, that is Rxx=Ryy=Rzz and Rxy=Rxz=Ryz=0 and therefore Rxx=2k/3.

Hope this helps.
aow, abas.rahmani86 and tomjo like this.
Jess80 is offline   Reply With Quote

Old   January 23, 2018, 08:14
Default Corrections to post above
  #15
New Member
 
Jessica Guichard
Join Date: Jan 2018
Posts: 3
Rep Power: 8
Jess80 is on a distinguished road
After searching the OpenFOAM code, I finally found the piece of code that indicates how R is calculated.
It is in the file named eddyViscosity.C and can be consulted at this link: https://www.openfoam.com/documentati...8C_source.html

At line 117: ((2.0/3.0)*I)*tk() - (nut_)*dev(twoSymm(fvc::grad(this->U_)))

When calculating R with the k- ε model, the code for the calculation of the value of nut can be found in kEpsilon.C, line 42 (https://www.openfoam.com/documentati...8C_source.html)

this->nut_ = Cmu_*sqr(k_)/epsilon_;
abas.rahmani86 likes this.
Jess80 is offline   Reply With Quote

Old   June 19, 2019, 07:26
Default Switcheroo in R-Field?
  #16
New Member
 
Join Date: May 2017
Posts: 7
Rep Power: 9
Marcio is on a distinguished road
Hey guys,

after searching for the Order of the Reynolds Stress file R in OF to compare wirh ParaView I found a switcheroo in the last posts. I mean this post explicitly:

Quote:
Output files obtained by executing R utility (and those obtained by running sample on it) list Reynolds stresses in order of

Code:

Rxx, Rxy, Rxz, Ryy, Ryz and Rzz

respectively.

and for viewing in paraview the same corresponds to

Code:

R(0), R(3), R(4), R(1), R(5) and R(2)

respectively.
Can somebody else confirm it? The order I saw comparing OF 5.0 and ParaView 5.6 is following:

Rxx , Rxy , Rxz , Ryy , Ryz and Rzz |OpenFoam
R(0), R(3), R(5), R(1), R(4) and R(2) |ParaView


I used the Calculator to extract the Scalar-values for every R-value and compared it to a corresponding line in the turbulenceProperties_R-file
Marcio is offline   Reply With Quote

Old   November 5, 2019, 04:16
Default
  #17
New Member
 
Join Date: Mar 2019
Posts: 12
Rep Power: 7
FoamingSimon is on a distinguished road
Quote:
Originally Posted by Marcio View Post
Hey guys,

after searching for the Order of the Reynolds Stress file R in OF to compare wirh ParaView I found a switcheroo in the last posts. I mean this post explicitly:

Can somebody else confirm it? The order I saw comparing OF 5.0 and ParaView 5.6 is following:

Rxx , Rxy , Rxz , Ryy , Ryz and Rzz |OpenFoam
R(0), R(3), R(5), R(1), R(4) and R(2) |ParaView


I used the Calculator to extract the Scalar-values for every R-value and compared it to a corresponding line in the turbulenceProperties_R-file
I get the same results, using OF 7 and Paraview 5.6.0, when extracting data and comparing these with Paraview plots.
FoamingSimon is offline   Reply With Quote

Old   May 21, 2020, 18:36
Default
  #18
Senior Member
 
Reviewer #2
Join Date: Jul 2015
Location: Knoxville, TN
Posts: 141
Rep Power: 11
randolph is on a distinguished road
Quote:
Originally Posted by FoamingSimon View Post
I get the same results, using OF 7 and Paraview 5.6.0, when extracting data and comparing these with Paraview plots.
Seems legit with OpenFOAM v1912 and Paraview 5.6.3
randolph is offline   Reply With Quote

Old   July 6, 2024, 13:15
Default
  #19
ARG
New Member
 
Masoud Rvn
Join Date: Sep 2023
Posts: 9
Rep Power: 3
ARG is on a distinguished road
Quote:
Originally Posted by FoamingSimon View Post
I get the same results, using OF 7 and Paraview 5.6.0, when extracting data and comparing these with Paraview plots.
Seems to be true for OpenFOAM2312 and ParaView 5.12.0-RC3
ARG 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
Reynolds Stress Boundary Conditions tstorm FLUENT 0 July 27, 2009 15:44
Post processing - Wall shear stress Carlo Siemens 1 March 4, 2009 08:35
Questions about the Reynolds stress model empirer2002 Main CFD Forum 1 January 5, 2006 08:37
How to update polyPatchbs localPoints liu OpenFOAM Running, Solving & CFD 6 December 30, 2005 18:27
Post Processing in FEM Abhijit Tilak Main CFD Forum 0 April 26, 2004 12:59


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