CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Average of Uprime2Mean(Reynolds stresses) in time and Uprime3mean definition (https://www.cfd-online.com/Forums/openfoam-programming-development/244344-average-uprime2mean-reynolds-stresses-time-uprime3mean-definition.html)

farzadmech August 3, 2022 10:19

Average of Uprime2Mean(Reynolds stresses) in time and Uprime3mean definition
 
Hello all
I want to average prime2Mean in time. There must be two options;
1- Adding new volScalarfield named RXX,RYY,RZZ,.... an then average in time(This should work fine)
2- Since we have generated Uprime2Mean already in U section, we may average it as a new parameter again without adding RXX,RYY,RZZ,.... .

Also I want to define Uprime3mean which is the third moment of velocity. I believe it must be defined in "libfieldFunctionObjects.so", but I can find the file to define this new parameter.

Do you have any suggestion for my questions?


Code:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                |
  \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox
  \\    /  O peration    | Website:  https://openfoam.org
    \\  /    A nd          | Version:  6
    \\/    M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "system";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application    pimpleFoam;

startFrom      latestTime;

startTime      0;

stopAt          endTime;

endTime        20;

deltaT          0.2;

writeControl    timeStep;

writeInterval  10;

purgeWrite      0;

writeFormat    ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision  6;

runTimeModifiable true;

functions
{
    fieldAverage1
    {
        type            fieldAverage;
        libs            ("libfieldFunctionObjects.so");
        writeControl    writeTime;

        fields
        (
            U
            {
                mean        on;
                prime2Mean  on;
                base        time;
            }


        );
    }

}

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


aghsin August 3, 2022 10:30

hi
 
Hi,
uprime2Mean is already averaged in time. why do you want to average again?

farzadmech August 3, 2022 13:05

You are right, it is already averaged. What about Uprime3mean? Where is the function object file so I can modify it?


Thanks,
Farzad

Quote:

Originally Posted by aghsin (Post 833035)
Hi,
uprime2Mean is already averaged in time. why do you want to average again?


agustinvo August 3, 2022 18:40

Quote:

Originally Posted by farzadmech (Post 833050)
You are right, it is already averaged. What about Uprime3mean? Where is the function object file so I can modify it?


Thanks,
Farzad

Do you mean a rank 3 tensor? I saw something about that a long time ago (at least in the programming guide they are mentioned) in the code, but it was not implemented or I never knew how to use it.

farzadmech August 3, 2022 22:19

I want R111,R222,R333 and etc.


Farzad

Quote:

Originally Posted by agustinvo (Post 833064)
Do you mean a rank 3 tensor? I saw something about that a long time ago (at least in the programming guide they are mentioned) in the code, but it was not implemented or I never knew how to use it.


farzadmech August 3, 2022 23:10

My main question is that where is Reynolds stresses defined? I found libfieldFunctionObjects but I did not see where Reynolds stresses has been defined. I want to add my definition there.

Thanks,
Farzad

Quote:

Originally Posted by farzadmech (Post 833071)
I want R111,R222,R333 and etc.


Farzad


agustinvo August 5, 2022 13:53

The Reynolds stress tendor is defined in the turbulence model library. If you are using a eddy viscosity model R is not callable unless you use the turbulenceFields functioObject. If you are using a Reynolds stress model you would have no problems.

The problem you might have when computing the UPrime3Mean is that there are no rank three volFields. You should somehow load U and UMean and define your third momentum tensor instantaneously, but you should create three tensor fields and average them in time. Check the fieldAverage function to help you with that.


All times are GMT -4. The time now is 04:27.