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

What's the meaning of "prime2Mean" in fieldAverage function of OpenFOAM

Register Blogs Community New Posts Updated Threads Search

Like Tree12Likes
  • 7 Post By agustinvo
  • 2 Post By Santiago
  • 1 Post By agustinvo
  • 1 Post By Santiago
  • 1 Post By makaveli_lcf

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 23, 2017, 04:42
Default What's the meaning of "prime2Mean" in fieldAverage function of OpenFOAM
  #1
New Member
 
Abiy Melaku
Join Date: Jul 2016
Location: Western University
Posts: 5
Rep Power: 10
abiy is on a distinguished road
Hello Guys,

Does anybody know the meaning of "prime2Mean" option that's specified when we want to calculate average of the a field. Please look the following code. Thank you very much!


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

        fields
        (
            U
            {
                mean        on;
                prime2Mean  on;
                base        time;
            }
        );
    }
}
abiy is offline   Reply With Quote

Old   August 23, 2017, 12:23
Default
  #2
Senior Member
 
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 314
Rep Power: 15
agustinvo is on a distinguished road
Hello

it means that you get the average of the product of the fluctuations of the variable. For instances, in your case you have U. It means that you get UPrime2Mean, it is
\overline{u'u'}, so you get the symmTensor where you have the Reynolds stresses.

For a scalar T, you get \overline{T'T'}, the time average of the squared fluctuations.
kiski, tariq, sxpsxp007 and 4 others like this.
agustinvo is offline   Reply With Quote

Old   September 1, 2017, 18:27
Default
  #3
Member
 
Atul Kumar
Join Date: Dec 2015
Location: National Centre for Combustion Research and Development
Posts: 48
Rep Power: 11
atulkjoy is on a distinguished road
Hi ,
If I use Umean = U - squrt(Uprime2mean) will it be the right thing to find mean value. As mean is instantaneous - fluctuating field.
atulkjoy is offline   Reply With Quote

Old   March 18, 2018, 10:18
Default
  #4
New Member
 
Qi Xueyu
Join Date: Mar 2018
Posts: 7
Rep Power: 8
winsway is on a distinguished road
I don't think so. I have caculated it. the equation is not correct. you can see the case /tutorials/incompressible/pimpleFoam/LES/channel395; And you remove the functions{...} ,then get the result to compare with the result without remove the functions. you can find the U and U_0 are same. but you cann't connect the relationship between U and UMeasure and UPrime2Mean. I'm confused with it too!
winsway is offline   Reply With Quote

Old   March 18, 2018, 10:24
Default
  #5
Senior Member
 
Santiago Lopez Castano
Join Date: Nov 2012
Posts: 354
Rep Power: 16
Santiago is on a distinguished road
Quote:
Originally Posted by abiy View Post
Hello Guys,

Does anybody know the meaning of "prime2Mean" option that's specified when we want to calculate average of the a field. Please look the following code. Thank you very much!


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

        fields
        (
            U
            {
                mean        on;
                prime2Mean  on;
                base        time;
            }
        );
    }
}
Is the second order moment, or square root of the variance, of the quantity of interest. In the case of the velocity, is equivalent to the square root of the trace elements of the R. Stress tensor.
ms.hashempour and Tj_m3 like this.
Santiago is offline   Reply With Quote

Old   March 18, 2018, 10:36
Default
  #6
New Member
 
Qi Xueyu
Join Date: Mar 2018
Posts: 7
Rep Power: 8
winsway is on a distinguished road
Quote:
Originally Posted by Santiago View Post
Is the second order moment, or square root of the variance, of the quantity of interest. In the case of the velocity, is equivalent to the square root of the trace elements of the R. Stress tensor.
thank you for you reply.
I'am caculating the result.the case 40s, first point.
U_0=(0.00631659 -9.16861e-07 -0.0020712);//i don't understand the varible's mean...
U=(0.00625804 4.31012e-06 -0.00207582);
UMean=(0.00956163 5.37524e-05 -0.00152819);
UX=0.00625804;UMeanx=0.00956163;
Uprime2Mean=(6.34187e-06 2.28789e-08 -1.65954e-07 1.92607e-08 1.25591e-07 1.12799e-05);
U'=UX-UMean;
but the equation Uprime2Mean !=sqrt(U'*U');
this is my confused!
winsway is offline   Reply With Quote

Old   March 18, 2018, 10:43
Default
  #7
Senior Member
 
Santiago Lopez Castano
Join Date: Nov 2012
Posts: 354
Rep Power: 16
Santiago is on a distinguished road
Because thats not how you calculate the standard deviation!
You calculate it like follows:

// variance
S = mean(U U) - mean(U)mean(U)
// std. Dev
S = sqrt(S)
Santiago is offline   Reply With Quote

Old   March 18, 2018, 11:40
Default
  #8
New Member
 
Qi Xueyu
Join Date: Mar 2018
Posts: 7
Rep Power: 8
winsway is on a distinguished road
Quote:
Originally Posted by Santiago View Post
Because thats not how you calculate the standard deviation!
You calculate it like follows:

// variance
S = mean(U U) - mean(U)mean(U)
// std. Dev
S = sqrt(S)
I understand your means.
mean(UxUx)=UMeanx*UMeanx+Uprime2Mean(1,1);
mean(UyUy)=UMeany*UMeany+Uprime2Mean(2,2);
mean(UzUz)=UMeanz*UMeanz+Uprime2Mean(3,3);
For instance :
mean(uxux)=
0.00956163^2+6.34187e-06=0.0000977666382569;
mean(uyuy)=5.37524e-05^2+1.92607e-08=2.215002050576E-08
mean(uzuz)=-0.00152819^2+1.12799e-05=0.0000136152646761
mean(uxux)=1/t*
integral(uxux)dt;y and z are same.
but how to calculate the ux , uy , uz ?
winsway is offline   Reply With Quote

Old   March 21, 2019, 06:08
Default
  #9
Senior Member
 
Dr. Alexander Vakhrushev
Join Date: Mar 2009
Posts: 256
Blog Entries: 1
Rep Power: 19
makaveli_lcf is on a distinguished road
Send a message via ICQ to makaveli_lcf
hi!
which mean do you mean? you are mixing Ux and ux so it is hard to understand what are you looking for. Time averaged mean velocity one already have in UMean array.
__________________
Best regards,

Dr. Alexander VAKHRUSHEV

Christian Doppler Laboratory for "Metallurgical Applications of Magnetohydrodynamics"

Simulation and Modelling of Metallurgical Processes
Department of Metallurgy
University of Leoben

http://smmp.unileoben.ac.at
makaveli_lcf is offline   Reply With Quote

Old   March 21, 2019, 06:36
Default
  #10
Senior Member
 
Dr. Alexander Vakhrushev
Join Date: Mar 2009
Posts: 256
Blog Entries: 1
Rep Power: 19
makaveli_lcf is on a distinguished road
Send a message via ICQ to makaveli_lcf
the only official description I found is here:
https://cpp.openfoam.org/v3/a00751.html#details


But I found it is confusing as most of OpenFOAM documentations.
Instead of

\bar{x'}^2=\frac{1}{N}\sum(x-\bar{x})^2


I would raver write


\overline{{x_i}'{x_j}'}=\frac{1}{N}\sum(x_i-\bar{x_i})(x_j-\bar{x_j})



Otherwise you cannot get a tensor for a vector field for example. Or at least some special multiplication operator should be used instead of power 2.
__________________
Best regards,

Dr. Alexander VAKHRUSHEV

Christian Doppler Laboratory for "Metallurgical Applications of Magnetohydrodynamics"

Simulation and Modelling of Metallurgical Processes
Department of Metallurgy
University of Leoben

http://smmp.unileoben.ac.at
makaveli_lcf is offline   Reply With Quote

Old   March 21, 2019, 06:50
Default
  #11
Senior Member
 
Santiago Lopez Castano
Join Date: Nov 2012
Posts: 354
Rep Power: 16
Santiago is on a distinguished road
Quote:
Originally Posted by makaveli_lcf View Post
the only official description I found is here:
https://cpp.openfoam.org/v3/a00751.html#details


But I found it is confusing as most of OpenFOAM documentations.
Instead of

\bar{x'}^2=\frac{1}{N}\sum(x-\bar{x})^2


I would raver write


\overline{{x_i}'{x_j}'}=\frac{1}{N}\sum(x_i-\bar{x_i})(x_j-\bar{x_j})



Otherwise you cannot get a tensor for a vector field for example. Or at least some special multiplication operator should be used instead of power 2.

Both forms are correct, it's just a matter of taste! The first form (vector notation) assumes x to be a vector, and as such, the outer product can be perfectly written as

\mathbf{x\,x} = (\mathbf{x})^2
Santiago is offline   Reply With Quote

Old   March 21, 2019, 06:53
Default
  #12
Senior Member
 
Dr. Alexander Vakhrushev
Join Date: Mar 2009
Posts: 256
Blog Entries: 1
Rep Power: 19
makaveli_lcf is on a distinguished road
Send a message via ICQ to makaveli_lcf
wouldn't it give a scalar for the vector? outer product is actually (a*a^T) to give a tensor, for example in N-S the convective term is not U^2 but U U^T







Quote:
Originally Posted by Santiago View Post
Both forms are correct, it's just a matter of taste! The first form (vector notation) assumes x to be a vector, and as such, the outer product can be perfectly written as

\mathbf{x\,x} = (\mathbf{x})^2
__________________
Best regards,

Dr. Alexander VAKHRUSHEV

Christian Doppler Laboratory for "Metallurgical Applications of Magnetohydrodynamics"

Simulation and Modelling of Metallurgical Processes
Department of Metallurgy
University of Leoben

http://smmp.unileoben.ac.at
makaveli_lcf is offline   Reply With Quote

Old   March 21, 2019, 07:16
Default
  #13
Senior Member
 
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 314
Rep Power: 15
agustinvo is on a distinguished road
Hi,


if you look into the programmers' guide (link), there you can see in Section 1.3.4 how OpenFOAM deals with the outer product.


Then, in Section 1.3.6:
Quote:
Square of a tensor is defined as the outer product of the tensor with itself,e.g.for a vectora, the square a^2=aa

I hope it helps to answer your question.
makaveli_lcf likes this.
agustinvo is offline   Reply With Quote

Old   March 21, 2019, 07:18
Default
  #14
Senior Member
 
Santiago Lopez Castano
Join Date: Nov 2012
Posts: 354
Rep Power: 16
Santiago is on a distinguished road
Quote:
Originally Posted by makaveli_lcf View Post
wouldn't it give a scalar for the vector? outer product is actually (a*a^T) to give a tensor, for example in N-S the convective term is not U^2 but U U^T
an outer product is an outer product, irrespective of notation! Meaning that an outer product between two euclidean vectors return a tensor. The definition given by you is more natural in Linear Algebra, and real analysis, whereas the tensor algebra intended in OF follows more the notation common in some books of functional analysis
sphani4391 likes this.
Santiago is offline   Reply With Quote

Old   March 21, 2019, 07:19
Default
  #15
Senior Member
 
Dr. Alexander Vakhrushev
Join Date: Mar 2009
Posts: 256
Blog Entries: 1
Rep Power: 19
makaveli_lcf is on a distinguished road
Send a message via ICQ to makaveli_lcf
Thank you Agustin! if that means the outer product, it is fine)))


Cheers!





Quote:
Originally Posted by agustinvo View Post
Hi,


if you look into the programmers' guide (link), there you can see in Section 1.3.4 how OpenFOAM deals with the outer product.


Then, in Section 1.3.6:



I hope it helps to answer your question.
__________________
Best regards,

Dr. Alexander VAKHRUSHEV

Christian Doppler Laboratory for "Metallurgical Applications of Magnetohydrodynamics"

Simulation and Modelling of Metallurgical Processes
Department of Metallurgy
University of Leoben

http://smmp.unileoben.ac.at
makaveli_lcf is offline   Reply With Quote

Old   March 21, 2019, 07:20
Default
  #16
Senior Member
 
Dr. Alexander Vakhrushev
Join Date: Mar 2009
Posts: 256
Blog Entries: 1
Rep Power: 19
makaveli_lcf is on a distinguished road
Send a message via ICQ to makaveli_lcf
Dear Santiago, for me aa or a^2 is a dot product, that is why I find it confusing. But if they accept it as an outer product I agree




Quote:
Originally Posted by Santiago View Post
an outer product is an outer product, irrespective of notation! Meaning that an outer product between two euclidean vectors return a tensor. The definition given by you is more natural in Linear Algebra, and real analysis, whereas the tensor algebra intended in OF follows more the notation common in some books of functional analysis
__________________
Best regards,

Dr. Alexander VAKHRUSHEV

Christian Doppler Laboratory for "Metallurgical Applications of Magnetohydrodynamics"

Simulation and Modelling of Metallurgical Processes
Department of Metallurgy
University of Leoben

http://smmp.unileoben.ac.at
makaveli_lcf is offline   Reply With Quote

Old   March 21, 2019, 07:42
Default
  #17
Senior Member
 
Dr. Alexander Vakhrushev
Join Date: Mar 2009
Posts: 256
Blog Entries: 1
Rep Power: 19
makaveli_lcf is on a distinguished road
Send a message via ICQ to makaveli_lcf
the last thing I dont like at


https://cpp.openfoam.org/v3/a00751.html#details


is that the ^2 operator is out of the averaging since to find Reynolds-like stress we average the product of the fluctuating part, but not multiply the the average of the fluctuations, which are actually zero in the ideal case. So it should be:


\overline{{x'}^2}=\frac{1}{N}\sum(x-\overline{x})^2
alainislas likes this.
__________________
Best regards,

Dr. Alexander VAKHRUSHEV

Christian Doppler Laboratory for "Metallurgical Applications of Magnetohydrodynamics"

Simulation and Modelling of Metallurgical Processes
Department of Metallurgy
University of Leoben

http://smmp.unileoben.ac.at
makaveli_lcf 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
Frequently Asked Questions about Installing OpenFOAM wyldckat OpenFOAM Installation 3 November 14, 2023 12:58
[swak4Foam] installation problem with version 0.2.3 Claudio87 OpenFOAM Community Contributions 9 May 8, 2013 11:20
New OpenFOAM Forum Structure jola OpenFOAM 2 October 19, 2011 07:55
ParaView for OF-1.6-ext Chrisi1984 OpenFOAM Installation 0 December 31, 2010 07:42
Droplet Evaporation Christian Main CFD Forum 2 February 27, 2007 07:27


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