CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Confusion in calculation of u', the velocity flucation (https://www.cfd-online.com/Forums/main/241728-confusion-calculation-u-velocity-flucation.html)

ckpark March 16, 2022 12:12

Confusion in calculation of u', the velocity flucation
 
Dear all,


I have a simple dataset with just the 3 components of velocity, u, v and w, and I am trying to compute the turbulence kinetic energy, k, in which the velocity fluctuations need to be computed.
The velocity fluctuation u' is simply, u' = u - \overline{u}, where \overline{u} is the time average of u.

The confusion is, say the dataset exists from time t=0 to t=T with a finite number time steps and i would like to compute k for each timestep. So for example for t=t_{1} where 0<t_{1}<T, I need to compute the u' at this specific time. Then, is \overline{u} the time average between 0 and T or is it between 0 and t_{1}?

It is a simple base theory for CFD but I just ran into this confusion while trying to calculate k by myself instead of relying on programs.

LuckyTran March 16, 2022 14:15

You should average all times. There is only one average.

Technically the answer is neither. What you are looking for is the population quantity in statistics. What you can obtain is a sample estimate of the population quantity. The real time average is from time going from negative infinity to positive infinity.

FMDenaro March 16, 2022 14:15

Quote:

Originally Posted by ckpark (Post 824197)
Dear all,


I have a simple dataset with just the 3 components of velocity, u, v and w, and I am trying to compute the turbulence kinetic energy, k, in which the velocity fluctuations need to be computed.
The velocity fluctuation u' is simply, u' = u - \overline{u}, where \overline{u} is the time average of u.

The confusion is, say the dataset exists from time t=0 to t=T with a finite number time steps and i would like to compute k for each timestep. So for example for t=t_{1} where 0<t_{1}<T, I need to compute the u' at this specific time. Then, is \overline{u} the time average between 0 and T or is it between 0 and t_{1}?

It is a simple base theory for CFD but I just ran into this confusion while trying to calculate k by myself instead of relying on programs.






The time averaging must be theoretically extended up to T->Infinite. Therefore, in practice you have to compute from 0 to T, but T must be enough large.

ckpark March 17, 2022 06:50

Quote:

Originally Posted by LuckyTran (Post 824206)
You should average all times. There is only one average.

Technically the answer is neither. What you are looking for is the population quantity in statistics. What you can obtain is a sample estimate of the population quantity. The real time average is from time going from negative infinity to positive infinity.

Thank you Lucky and Filippo for your answers.


This leads me to another question. Since k is a time varying parameter and involves the mean of the squared u' (UPrime2mean as OpenFoam calls it), does it mean that this mean is not computed as poulation average but instead just the average up until the specific time t that I am computing k for?

FMDenaro March 17, 2022 07:16

Quote:

Originally Posted by ckpark (Post 824239)
Thank you Lucky and Filippo for your answers.


This leads me to another question. Since k is a time varying parameter and involves the mean of the squared u' (UPrime2mean as OpenFoam calls it), does it mean that this mean is not computed as poulation average but instead just the average up until the specific time t that I am computing k for?

But in a real RANS computations you have no resolved fluctuations, you never compute the (u’u’)_bar term

ckpark March 17, 2022 07:23

Quote:

Originally Posted by FMDenaro (Post 824241)
But in a real RANS computations you have no resolved fluctuations, you never compute the (u’u’)_bar term

I am currently handling an LES dataset that merely has velocity data so I am trying to compute its turbulence kinetic energy.
So is the (u'u')_bar term a time varying parameter?

FMDenaro March 17, 2022 08:04

Quote:

Originally Posted by ckpark (Post 824243)
I am currently handling an LES dataset that merely has velocity data so I am trying to compute its turbulence kinetic energy.
So is the (u'u')_bar term a time varying parameter?

No, the statistical average is exactly the time averaging that produces a steady mean. Conversely, in LES the overbar is a filtering and all filtered variables are time dependent. Thus

[f_fil(x,t)]_bar = F(x)

LuckyTran March 17, 2022 08:28

UMean and UPrime2Mean are averages from 0 to T and both of these are sample estimates for population statistics. There are infinite number of possible such estimators. You only really care about the best estimator that you get in the very last time dir because it is averaged over the longest time duration. Getting the population value is not possible unless you have the entire population ensemble, which means running your simulation until T=>infinity.

Hence, it's nearly impossible to directly calculate the time-varying u' and time-varying k at runtime because you don't know (and can never know) the population statistics. You must calculate it until T=>infinity, save U at all the times you care about, and then post-process it a posteriori. If you waned to do this manually you would run your simulation with fieldAverage option set. Go to the very last time dir and find UMean. Copy (and overwrite) this latest UMean into all previous time dirs. Then do something like:
Code:

foamCalc addSubtract U subtract -field UMean -resultName UPrime

And then calculate k.

ckpark March 17, 2022 09:08

Quote:

Originally Posted by LuckyTran (Post 824255)
UMean and UPrime2Mean are averages from 0 to T and both of these are sample estimates for population statistics. There are infinite number of possible such estimators. You only really care about the best estimator that you get in the very last time dir because it is averaged over the longest time duration. Getting the population value is not possible unless you have the entire population ensemble, which means running your simulation until T=>infinity.

Hence, it's nearly impossible to directly calculate the time-varying u' and time-varying k at runtime because you don't know (and can never know) the population statistics. You must calculate it until T=>infinity, save U at all the times you care about, and then post-process it a posteriori. If you waned to do this manually you would run your simulation with fieldAverage option set. Go to the very last time dir and find UMean. Copy (and overwrite) this latest UMean into all previous time dirs. Then do something like:
Code:

foamCalc addSubtract U subtract -field UMean -resultName UPrime

And then calculate k.

Yes so I understand that both the UMean and UPrime2Mean are the population statistis that require a large T.
However, I am not sure how k can be time varying when it only depends on the 3 directional components of UPrime2Mean which are not time varying. What am I missing?

FMDenaro March 17, 2022 09:20

Quote:

Originally Posted by ckpark (Post 824264)
Yes so I understand that both the UMean and UPrime2Mean are the population statistis that require a large T.
However, I am not sure how k can be time varying when it only depends on the 3 directional components of UPrime2Mean which are not time varying. What am I missing?

But are you considering RANS, URANS or LES for k ??

ckpark March 17, 2022 09:33

Quote:

Originally Posted by FMDenaro (Post 824266)
But are you considering RANS, URANS or LES for k ??

I am currently considering LES for k, the resolved k to be precise.
Apologies, I did not really get what you meant by "[f_fil(x,t)]_bar = F(x)" but thanks for helping me recall that in LES it is a filtering operation instead of averaging. I completely missed that.



Anyhow, according to Sagaut's book on LES for incompressible flow, the resolved turbulence kinetic energy is simply half of the squared of filtered velocity (page 51). Since the velocity data I have is for the given grid, the filtered velocity in my case is simply this velocity data.
Does this sound like a valid statement?

FMDenaro March 17, 2022 10:31

Quote:

Originally Posted by ckpark (Post 824267)
I am currently considering LES for k, the resolved k to be precise.
Apologies, I did not really get what you meant by "[f_fil(x,t)]_bar = F(x)" but thanks for helping me recall that in LES it is a filtering operation instead of averaging. I completely missed that.



Anyhow, according to Sagaut's book on LES for incompressible flow, the resolved turbulence kinetic energy is simply half of the squared of filtered velocity (page 51). Since the velocity data I have is for the given grid, the filtered velocity in my case is simply this velocity data.
Does this sound like a valid statement?


Your LES database provided for sure the filtered velocity. From that you can deduce the k (unsteady) but also the approximation for the RANS (steady) velocity and the fluctuations.
My previous notation means you can apply the time averaging to the filtered variable and the result is a steady field.

LuckyTran March 17, 2022 12:28

The instantaneous k depends on the three direction components of u', not uPrime2Mean. UPrime2Mean is the root mean square of u', it is a statistic like UMean. k inherits the temporal characteristics of u'.

You can get the time-averaged k from UPrime2Mean, but not the instantaneous k.

\overline{k}=\frac{1}{2}(\overline{u'u'}+\overline{v'v'}+\overline{w'w'})

k(t)=\frac{1}{2}(u'u'+v'v'+w'w')

And
u'=u(t)-\overline{u}

UPrime2Mean is
\overline{u'u'},\overline{u'v'},\overline{u'w'},\overline{v'v'} etc.

ckpark March 21, 2022 07:40

Quote:

Originally Posted by LuckyTran (Post 824283)
The instantaneous k depends on the three direction components of u', not uPrime2Mean. UPrime2Mean is the root mean square of u', it is a statistic like UMean. k inherits the temporal characteristics of u'.

You can get the time-averaged k from UPrime2Mean, but not the instantaneous k.

\overline{k}=\frac{1}{2}(\overline{u'u'}+\overline{v'v'}+\overline{w'w'})

k(t)=\frac{1}{2}(u'u'+v'v'+w'w')

And
u'=u(t)-\overline{u}

UPrime2Mean is
\overline{u'u'},\overline{u'v'},\overline{u'w'},\overline{v'v'} etc.

Quote:

Originally Posted by FMDenaro (Post 824277)
Your LES database provided for sure the filtered velocity. From that you can deduce the k (unsteady) but also the approximation for the RANS (steady) velocity and the fluctuations.
My previous notation means you can apply the time averaging to the filtered variable and the result is a steady field.


Thank you FMDenaro and LuckyTran for your kind replied. I have eventually figured it out with your help and managed to calculate the TKE of my dataset.


All times are GMT -4. The time now is 23:35.