# Confusion in calculation of u', the velocity flucation

 Register Blogs Members List Search Today's Posts Mark Forums Read

 March 16, 2022, 12:12 Confusion in calculation of u', the velocity flucation #1 New Member   CPark Join Date: Apr 2021 Location: Germany Posts: 11 Rep Power: 5 Dear all, I have a simple dataset with just the 3 components of velocity, , and , and I am trying to compute the turbulence kinetic energy, , in which the velocity fluctuations need to be computed. The velocity fluctuation is simply, , where is the time average of . The confusion is, say the dataset exists from time to with a finite number time steps and i would like to compute for each timestep. So for example for where , I need to compute the at this specific time. Then, is the time average between and or is it between and ? It is a simple base theory for CFD but I just ran into this confusion while trying to calculate by myself instead of relying on programs.

 March 16, 2022, 14:15 #2 Senior Member   Lucky Join Date: Apr 2011 Location: Orlando, FL USA Posts: 5,673 Rep Power: 65 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. ckpark likes this.

March 16, 2022, 14:15
#3
Senior Member

Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
Quote:
 Originally Posted by ckpark Dear all, I have a simple dataset with just the 3 components of velocity, , and , and I am trying to compute the turbulence kinetic energy, , in which the velocity fluctuations need to be computed. The velocity fluctuation is simply, , where is the time average of . The confusion is, say the dataset exists from time to with a finite number time steps and i would like to compute for each timestep. So for example for where , I need to compute the at this specific time. Then, is the time average between and or is it between and ? It is a simple base theory for CFD but I just ran into this confusion while trying to calculate 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.

March 17, 2022, 06:50
#4
New Member

CPark
Join Date: Apr 2021
Location: Germany
Posts: 11
Rep Power: 5
Quote:
 Originally Posted by LuckyTran 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.

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?

March 17, 2022, 07:16
#5
Senior Member

Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
Quote:
 Originally Posted by ckpark 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

March 17, 2022, 07:23
#6
New Member

CPark
Join Date: Apr 2021
Location: Germany
Posts: 11
Rep Power: 5
Quote:
 Originally Posted by FMDenaro 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?

March 17, 2022, 08:04
#7
Senior Member

Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
Quote:
 Originally Posted by ckpark 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)

 March 17, 2022, 08:28 #8 Senior Member   Lucky Join Date: Apr 2011 Location: Orlando, FL USA Posts: 5,673 Rep Power: 65 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.

March 17, 2022, 09:08
#9
New Member

CPark
Join Date: Apr 2021
Location: Germany
Posts: 11
Rep Power: 5
Quote:
 Originally Posted by LuckyTran 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?

March 17, 2022, 09:20
#10
Senior Member

Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
Quote:
 Originally Posted by ckpark 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 ??

March 17, 2022, 09:33
#11
New Member

CPark
Join Date: Apr 2021
Location: Germany
Posts: 11
Rep Power: 5
Quote:
 Originally Posted by FMDenaro 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?

March 17, 2022, 10:31
#12
Senior Member

Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
Quote:
 Originally Posted by ckpark 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.

 March 17, 2022, 12:28 #13 Senior Member   Lucky Join Date: Apr 2011 Location: Orlando, FL USA Posts: 5,673 Rep Power: 65 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. And UPrime2Mean is ,,, etc.

March 21, 2022, 07:40
#14
New Member

CPark
Join Date: Apr 2021
Location: Germany
Posts: 11
Rep Power: 5
Quote:
 Originally Posted by LuckyTran 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. And UPrime2Mean is ,,, etc.
Quote:
 Originally Posted by FMDenaro 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.