CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Power spectrum of LES: understanding of the result

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 27, 2017, 10:52
Default Power spectrum of LES: understanding of the result
  #1
Senior Member
 
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 314
Rep Power: 15
agustinvo is on a distinguished road
Good afternoon,

I know that it is a very common doubt, it has been spoken several times... but I couldn't get a good idea about what should I expect from a power spectra density result.

The procedure to obtain my spectrum has been:
- At a given position, I have obtained the velocity value each time step dt, so my sampling frequency is Fs=1/dt
- I have done the same with several points in the spanwise direction, I suppose that the flow is isotropic in that direction
- This information, I give it to a PSD Welch algortihm, who provides me a frequency range, and the PSD for each frequency value.
- I apply an average in the spanwise direction to smooth the PSD

When I plot it, I obtain something like the attached figure.

As far as I know, the PSD it usually used to estimate if the mesh, the numerical setup of the LES... is good enough, but I don't know how to understand this.

If somebody can help me, I would be very gratefull. Many thanks in advance,

Agustin
Attached Images
File Type: jpg figure_5.jpg (28.6 KB, 383 views)
agustinvo is offline   Reply With Quote

Old   January 27, 2017, 12:02
Default
  #2
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
First of all, I suggest to do a check on your spectrum calculation to see if it works correctly. You can build your signal by sampling the sin(kx) function in [0:2pi] so that once you fix a value for k you have only a peack in your spectrum.

Second, the spectrum you plot can not be discussed if you do not give details of your flow problem and mesh resolution. The shape is very strange.
lcarasik likes this.
FMDenaro is offline   Reply With Quote

Old   January 27, 2017, 13:09
Default
  #3
Senior Member
 
Julio Mendez
Join Date: Apr 2009
Location: Fairburn, GA. USA
Posts: 290
Rep Power: 18
juliom is on a distinguished road
Send a message via Skype™ to juliom
I agree with Professor Denaron comment. This spectrum does not look like a turbulent kinetic energy spectrum. I would start with a an isotrooic flow field; for example a channel flow. You can choose the center line (far from the walls). You can use the DNS data set from the jhon Hopkins turbulence data base and test your spectrum (code) with the one they provide.
As far as understanding; profesor Davison has suggested in several papers that the energy spectrum computed from the two point correlation is the right approach to validate your les computation. This is also in line with Pope's textbook.
I am looking forward to more contributions from other members and professor Denaro.
XJ_Wang likes this.
juliom is offline   Reply With Quote

Old   January 27, 2017, 13:23
Default
  #4
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Yes. Correlations and spectra are mutually related by a mathematical transformation. This topic can be read in the book of Pope. A breif summary is here https://www.io-warnemuende.de/tl_fil...Chap4_WS08.pdf

However, understanding if a resulting spectra is mathematically well computed does not imply that it is physically meaningful. For this reason I suggest to split the study first in a numerical assesement of the procedure and then in an application on a well controlled flow problem.
FMDenaro is offline   Reply With Quote

Old   January 30, 2017, 04:46
Default
  #5
Senior Member
 
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 314
Rep Power: 15
agustinvo is on a distinguished road
Hello, sorry for not answering during the weekend.

As Filippo told me, I have tried to use the PSD Welch with different sinusoidal signals, and I have checked that I obtain a peak of frequency in the specified one. I is, the code of the algorithm is ok. Now I have to see if my input is ok or not. The mistake in my spectrum may be here.

I have my velocity signal, that I can decompose in a mean and fluctuating terms. With the fluctuating ones, I can get the turbulent kinetic energy as q=1/2 * (u'^2 + v'^2 + w'^2).

So, I get the Fourier transform's for u'u', v'v' and w'w', and I get the FT of the turbulent kinetic energy with the previous expression. Is is like this? One question that comes to my mind is if we can get the expression of q along the time and get its FFT. Would we obtain the same results?
agustinvo is offline   Reply With Quote

Old   January 30, 2017, 05:05
Default
  #6
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Using the sine function you get exactly 1 peak and the other coefficients are zero at machine accuracy?? How about the value of the peak?

why do you perform the FFT of the kinetic energy?? How do you perform the periodic windowing of the time-signal??

I agree with Julio, I suggest to do a controlled case using the channel flow problem and performing the spectral analysis in streamwise and spanwise direction. Only once you can superimpose the spectra with the existing database you can be sure.
FMDenaro is offline   Reply With Quote

Old   January 30, 2017, 05:20
Default
  #7
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Just a final consideration, if you want to characterize a LES spectrum, you must analyze the spatial energy spectra to see the correspondance with the LES filter. The time step characterizes a different Nyquist cut-off that, usually, lies withint the Kolomogorov time-scale.
juliom likes this.
FMDenaro is offline   Reply With Quote

Old   January 30, 2017, 05:31
Default
  #8
Senior Member
 
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 314
Rep Power: 15
agustinvo is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
Using the sine function you get exactly 1 peak and the other coefficients are zero at machine accuracy?? How about the value of the peak?

why do you perform the FFT of the kinetic energy?? How do you perform the periodic windowing of the time-signal??

I agree with Julio, I suggest to do a controlled case using the channel flow problem and performing the spectral analysis in streamwise and spanwise direction. Only once you can superimpose the spectra with the existing database you can be sure.
Thanks for you answer. I attach my sinusoidal signal (20 Hz), with a sampling frequency of Fs=1000 Hz, and the output of the Welch algorithm. The other frequencies, as you can see, specially the higher ones, are very low, in the order of 10E-11 and lower.

About the FFT on the TKE, I was just asking. I give as input the velocity in this algorithm.

I am totally a newbie in all these things in LES, and I want to understand these concepts properly.
Attached Images
File Type: jpg sinsignal20Hz.jpg (114.3 KB, 114 views)
File Type: jpg welch.jpg (26.2 KB, 148 views)
agustinvo is offline   Reply With Quote

Old   January 30, 2017, 05:52
Default
  #9
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Your spectrum is not correct...to see better do not use the continuous line but only symbols, you will see other contribution out of the peak at 20 Hz.
You must se only one non-zero coefficients, the others being O(10^-13).

So, your first task now is clear, focus on the right FFT procedure.

Second, if you want to get into the LES field you must start learning the basis...for example, read the intro of book of Sagaut. You must be aware of the fact the LES has the aim of reducing the degree of freedom and that is obtained by filtering the spatial small flow scales. As a consequence, you must assess your results by looking at the spatial correlation and spectra.
For this reason you have to start with well controlled flow problem.
juliom likes this.
FMDenaro is offline   Reply With Quote

Old   January 30, 2017, 08:54
Default
  #10
Senior Member
 
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 314
Rep Power: 15
agustinvo is on a distinguished road
Hello again,

for sure, when I apply the FFT to the sinus signal I got what you say, however I have some discrepancies close to the peak of 20 Hz.

If I apply directly the FFT to the fluctuating part of the velocity. I obtain complex results, and in order to obtain the term u'u', I multiply by the conjugate. After that, I get the turbulent kinetic energy in the frequency domain as usual, k=0.5*uu+vv+ww. At the end, what I obtain is something like the image I attach.

I forgot to say that my case is a natural convection boundary layer, so, I don't know if the profile I obtain is due to that fact, or there is something bad in my procedure.

Thanks for your replies!
Attached Images
File Type: png ffttke.png (28.5 KB, 138 views)
File Type: png sinusFFT.png (18.5 KB, 81 views)
agustinvo is offline   Reply With Quote

Old   January 30, 2017, 09:44
Default
  #11
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by agustinvo View Post
Hello again,

for sure, when I apply the FFT to the sinus signal I got what you say, however I have some discrepancies close to the peak of 20 Hz.

If I apply directly the FFT to the fluctuating part of the velocity. I obtain complex results, and in order to obtain the term u'u', I multiply by the conjugate. After that, I get the turbulent kinetic energy in the frequency domain as usual, k=0.5*uu+vv+ww. At the end, what I obtain is something like the image I attach.

I forgot to say that my case is a natural convection boundary layer, so, I don't know if the profile I obtain is due to that fact, or there is something bad in my procedure.

Thanks for your replies!

Until you are not able to reproduce the correct sinus response in the PDS, you cannot apply your analysis to a flow problem...
You must see only one spike at the correct frequency and zero (at machine accuracy) everywhere. So, check if you passed correctly the periodic window to the FFT, it seems you get frequencies aliased.

Has your buoyancy-driven flow problem homogenous directions ?
FMDenaro is offline   Reply With Quote

Old   January 30, 2017, 09:49
Default
  #12
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
This is a plot of the spectrum for the sin kx function at k=1
Attached Images
File Type: jpg spectrum_k1.jpg (77.9 KB, 121 views)
FMDenaro is offline   Reply With Quote

Old   January 30, 2017, 10:24
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
Quote:
Originally Posted by FMDenaro View Post
Until you are not able to reproduce the correct sinus response in the PDS, you cannot apply your analysis to a flow problem...
You must see only one spike at the correct frequency and zero (at machine accuracy) everywhere. So, check if you passed correctly the periodic window to the FFT, it seems you get frequencies aliased.

Has your buoyancy-driven flow problem homogenous directions ?
Yes. the flow ascends in the Y direction (streamwise), the normal direction to the wall is X, and the spanwise is the Z direction. It is a simple boundary layer, so it should be homogeneous in the Z direction, where I impose periodicity.

Quote:
Originally Posted by FMDenaro View Post
This is a plot of the spectrum for the sin kx function at k=1
As you can see, I think that I am in the right way. In the FFT of sin(2*pi*t), I can see clearly the peak. That peak only contains the real part of the solution. If I plot the magnitude of the complex values, I get the other one. There are several orders of magnitude of difference. Could I consider that it is ok?
Attached Images
File Type: png sin2px.png (26.1 KB, 26 views)
File Type: png fftSin2px.png (32.6 KB, 43 views)
File Type: png absfftSin2px.png (34.9 KB, 60 views)
agustinvo is offline   Reply With Quote

Old   January 30, 2017, 10:33
Default
  #14
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
No, when you plot the magnitude, that is the modulus of the Fourier coefficient, you must get 0.25. The other coefficients are less than O(10^-14).
Conversely your second plot has a wrong magnitude and other coefficients are aliased.
FMDenaro is offline   Reply With Quote

Old   January 30, 2017, 11:13
Default
  #15
Senior Member
 
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 314
Rep Power: 15
agustinvo is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
No, when you plot the magnitude, that is the modulus of the Fourier coefficient, you must get 0.25. The other coefficients are less than O(10^-14).
Conversely your second plot has a wrong magnitude and other coefficients are aliased.
Mmm... I am checking the values I get, and it seems that in that modulus, I should divide at a certain point by my number of samples, is it? For the moment, I was not using a window, but using the Hann one, I get really close of what you mean, only the closest points have a non negligible value.
Attached Images
File Type: png hannwindow.png (16.0 KB, 37 views)
agustinvo is offline   Reply With Quote

Old   January 30, 2017, 11:51
Default
  #16
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Check the correct number of nodes you pass to the FFT and the correct value of the period... I think that is your problem
FMDenaro is offline   Reply With Quote

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

I have checked my code, and I obtain a peak of 0.5. I think I am missing something... What I do is

Code:
N=8000
dt=1e_3
Fs=1000
time=linspace(0,8,8000)

signal=sin(2*pi*time)

fftSignal = fft(signal, n=N)/N % N is the number of samples, and I normalize
fftSignal = fftsignal(1:N/2)
freq=Fs/2*linspace(0,1,N/2)

plot(freq,abs(fftSignal))
My max FFT value is 0.5 at 1Hz, as you can see in the figure. I think I am missing a factor of two in the input of my fft.

EDIT: well, the missing factor I think is the power of 2, otherwhise I am plotting a module, not the square of my signal. I should use fftSignal*conj(fftSignal)
Attached Images
File Type: png absfftSignal.png (18.7 KB, 43 views)
agustinvo is offline   Reply With Quote

Old   January 30, 2017, 13:05
Default
  #18
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
yes, you can compare with the portion of my Matlab script I posted here

Energy Spectrum for a 3D turbulent Flow
FMDenaro is offline   Reply With Quote

Old   January 31, 2017, 04:34
Default
  #19
Senior Member
 
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 314
Rep Power: 15
agustinvo is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
yes, you can compare with the portion of my Matlab script I posted here

Energy Spectrum for a 3D turbulent Flow
Buongiorno Filippo, sorry for bothering you again.

I am taking a look into your code, and this part:
Code:
for q = 1:np
  sum_u = 0; 
  for k=1:l-1
      sum_u = sum_u + 0.5*(cu(q,k) + cu(q,k+1))*dz;
  end
  ek1_uu(q) = sum_u/lz; 
end
In my case, I am getting a time-correlation, and in yours is a spatial one, but the theory behind is the same. I don't know what "l" means, but I suppose is an index related with position. Your sum_u, is the turbulent kinetic energy, so "k" and "l" are related with the x,y,z direction, aren't they?

At the end, you get ek1_uu dividing since you are averaging in space with dz.
agustinvo is offline   Reply With Quote

Old   January 31, 2017, 05:04
Default
  #20
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,882
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
The cycle is over "l", an index for the spanwise direction in a channel flow problem. This way I perform a statistical averaging of the one-dimensional spectra along the stream-wise direction at several position.
Supplementary averaging is useful to get statistically meaningful results.
For a time analysis, you should consider the same approach, using several periodical time-windows, performing spectra on each one and then averaging.
FMDenaro 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
LES Filtering: how are the small and large scales equations solved? atmcfd Main CFD Forum 38 March 14, 2016 15:52
Amplitude spectrum of temperature fluctuations selvam2487 CFX 0 March 16, 2014 14:59
Beginning to work in LES - Suggestions needed atmcfd Main CFD Forum 5 July 20, 2012 23:16
Method to determine spectrum of turbulence? Walid Main CFD Forum 2 December 2, 2005 09:29
Power spectrum. Jake. Main CFD Forum 1 October 9, 2004 16:18


All times are GMT -4. The time now is 03:38.