CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   How to sample turbulenceProperties:R? (https://www.cfd-online.com/Forums/openfoam-post-processing/188151-how-sample-turbulenceproperties-r.html)

kaaja May 24, 2017 03:07

How to sample turbulenceProperties:R?
 
Running k-epsilon with simpleFoam I am using "sample" to sample values at certain locations. This works fine for values like U and k, that are generated during run time. However, it does not work for values like, turbulenceProperties:R and wallShearStress, which is generated by the postprocessing functionality.

For the turbulent stress tensor I get the error message

Code:

--> FOAM Warning :
    From function Foam::label Foam::sampledSets::classifyFields()
    in file sampledSet/sampledSets/sampledSetsGrouping.C at line 140
    Cannot find registered field matching turbulenceProperties:R
--> FOAM Warning :
    From function Foam::label Foam::sampledSets::classifyFields()
    in file sampledSet/sampledSets/sampledSetsGrouping.C at line 140
    Cannot find registered field matching turbulenceProperties:R

My sample-file looks like this

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  4.0                                  |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    object      sampleDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

type sets;
libs ("libsampling.so");

interpolationScheme cellPointFace;

setFormat raw;

sets
(
    mu_0101
    {
        type            face;
        axis            z;
        start          (-0.075 0.0875 0.0);
        end            (-0.075 0.0875 0.05);
    }
    mu_0201
    {
        type            face;
        axis            z;
        start          (-0.025 0.0875 0.0);
        end            (-0.025 0.0875 0.05);
    }

);

fields
(
    U turbulenceProperties:R
);

// ************************************************************************* //

turbulenceProperties:R is generated by

Code:

  simpleFoam -postProcess -func R -latestTime
The sample file is run by

Code:

simpleFoam -postProcess -func sample -latestTime
"turbulenceProperties:R" exists lik a file just like U and k, so I do not understand why there is a problem sampling it. Does anybody have an idea about how to solve this?

kaaja May 24, 2017 03:55

I think I solved it, with help from this thread.

One additional thing I needed to do was to remove "simpleFoam" also from the command calling on sample.

It works for turbulenceFields:R also, not only for the components as in the mentioned link.

openfoam_aero May 29, 2023 12:18

Quote:

Originally Posted by kaaja (Post 650076)
I think I solved it, with help from this thread.

One additional thing I needed to do was to remove "simpleFoam" also from the command calling on sample.

It works for turbulenceFields:R also, not only for the components as in the mentioned link.

which version of OF? i use 1812 and it does not work for me


All times are GMT -4. The time now is 13:52.