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

Energy spectrum calculation

Register Blogs Community New Posts Updated Threads Search

Like Tree6Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 27, 2001, 04:46
Default Energy spectrum calculation
  #1
Robert
Guest
 
Posts: n/a
Hi,

My simple question is: wath is the best way (and fast) to calculate the energy spectrum of a 2D turbulent velocity field?

Thanks in advance for your help
  Reply With Quote

Old   March 27, 2001, 07:34
Default Re: Energy spectrum calculation
  #2
andy
Guest
 
Posts: n/a
Are you using a spectral code?

What are your boundary conditions?

Are you expecting the spectrum to look like "normal" 3D turbulence? (just checking)
  Reply With Quote

Old   March 27, 2001, 08:25
Default Re: Energy spectrum calculation
  #3
Robert
Guest
 
Posts: n/a
Thanks for your answer, Andy,

I have two codes: a DNS and a Kinematical Simulation. The boundary conditions are periodical in a (2pi x 2pi) box. The flow is (theoretically) homogeneous and isotropic.

What do you mean with "normal" 3D tuebulence? "-5/3" law? No, I don't expect that.
  Reply With Quote

Old   March 27, 2001, 11:32
Default Re: Energy spectrum calculation
  #4
Patrick Godon
Guest
 
Posts: n/a
The usual way that to obtain an energy spectrum of a turbulent flow, is first to calculate the kinetic energy (and you can chose each dimension separately E=u**2, E=v**2, or together E=u**2+v**2), then you decompose E as a function of the wave number k (E(k)) by carrying a Fourier Transform, a FFT.

For the FFT to work:

E has to be given on discrete points (the grid points) equally spaced (delta-x, delta-y or whatever). Then E(x,y) is entered in the FFT and E(k) is the output. Here also, you can decide on 1D or 2D FFT. One of the important things, here, is that the output E(k) of the FFT comes in a given order (which is different, depending on which software is used). So the output array for example could be: E(0), E(1), E(2), ... E(M), E(-1), E(-2), .. E(-M+1), where N=2M is the total number of grid points (Fastest when N is a power of 2).

The energy spectrum is then the amplitude for each k:

0 sqrt(E(0)**2)

1 sqrt(E(1)**2+E(-1)**2)

etc..

I hope this helps,

Patrick Godon
  Reply With Quote

Old   March 27, 2001, 12:06
Default Re: Energy spectrum calculation
  #5
andy
Guest
 
Posts: n/a
To add to Patrick's response. I have checked with the people here and they tend to use an assembly language routine for the FFT developed a while a go. If that seems like too much hassle try following a few links from:

http://www.fftw.org/benchfft/

  Reply With Quote

Old   March 27, 2001, 13:37
Default Re: Energy spectrum calculation
  #6
kalyan
Guest
 
Posts: n/a
Energy spectrum is not the Fourier transform of the kinetic energy in physical space. If you want to use physical space quantities to computed the energy spectrum, you need to compute 2-point velocity correlation and take FFT with respect to the separation distance. This is quite cumbersome. It is much easier to compute FFTs of u, v and then compute E(k).
Sparsh and kooki_13 like this.
  Reply With Quote

Old   March 27, 2001, 15:05
Default Correction
  #7
Patrick Godon
Guest
 
Posts: n/a
Sorry, my mistake, Kalyan is right, the energy spectrum is given by:

(1/2)*4*pi*k**2*|v(k)|**2,

where v(k) is the FFT of v(x). Thus the square is taken after the FFT is performed. I often decompose 'entities' in 'modes' using FFT, that's how I got mixed up.

Thanks Kalyan for correcting me.
  Reply With Quote

Old   March 29, 2001, 09:40
Default Re: Correction
  #8
Robert
Guest
 
Posts: n/a
Thank, Patrick,

I've applied your suggestion and it seems to work better, but I found some "anomalous" behavior at small scales (high k). I think that it can be due to the integration methode. In your last message, you write

E(k) = (1/2)*4*pi*k**2*|v(k)|**2,

That true for an isotropic 1D signal, and integrated in 3D. But my signal is 2D, and I have to integrate u(kx,ky)˛ + v(kx,ky)˛ over a 2D shell of radius k, and it is not easy to do. I am thinking in interpolate to a grid (k, phi) and then integrate over phi, but I would need a gridding algorithm, and I have no idea about hoe expensive is it, and where to find this code (ideally, I need just the algorithm in order to implementate a SciLab function).
Mohmd and Saeef like this.
  Reply With Quote

Old   March 29, 2001, 10:15
Default Re: Correction
  #9
Patrick Godon
Guest
 
Posts: n/a
I am not quite sure about grids for interpolation between (I guess probably what you have is a) cartezian and polar grid, since as you interpolate you might introduce error on the small scales.

At the smallest wavelenght (higher k) you should have something (like a viscosity of 'high order' - hyper viscosity) that takes care of dissipation (I am not sure whether you do DNS). There, at the large k, you want to have a steep slope in the spectrum.

And you want to have enough resolution (grid points) to resolve the rest of the spectrum (low and intermediate k). Since you have a 2D problem, the energy is going to accumulate in the largest scales (low k - the inverse cascade of energy).

Numerical instability and low resolution can introduce two-point oscillations, therefore large k growth. Whether the resolution is enough or not depends on the scale you want to resolve (and the problem of interest) and the (hyper)viscosity.

If the viscosity is too small for a given resolution, then you will not have a steep slope at high k in the spectrum and can have instabilities. You can either increase the viscosity or the resolution. You need for a given resolution to have the high k affected (cut off) by the viscosity.

If the viscosity is too large, then you damp too much of your signal at lower k and you cannot resolve the fine structure of the flow.

If originally your problem is 'polar', then the best is to use polar coordinate from the start.

I have no idea about commercial software for that, since I never use any commercial software.
  Reply With Quote

Old   March 29, 2001, 13:20
Default Re: Correction
  #10
kalyan
Guest
 
Posts: n/a
The high wavenumber spectrum has little to do with the time-integration method unless you are using really high time-steps (see the paper by Choi and Moin in Phys. of Fluids about the effect of time step in DNS and LES). You might get a better idea about what is going on from the suggestion made by Patrick.
  Reply With Quote

Old   April 9, 2010, 12:40
Default
  #11
New Member
 
Germán González Silva
Join Date: Mar 2010
Location: Campinas-SP
Posts: 20
Rep Power: 16
germangsilva is on a distinguished road
Send a message via MSN to germangsilva
I have a question about turbulent energy spectrum !
Now I have the data of position and velocity at grid.

the data is like this:
t (time) ,X ,Y, Z , Vx ,Vy ,Vz

I have already used FFT to transform Vx ,Vy, Vz to V_kx ,V_ky. V_kz RESPECTLY


Now the data is like this:
Vx ,Vy, Vz V_kx ,V_ky. V_kz

How can I calculate the energy spectrum?

1. How can I calculate the k?

2. V(k) = sqrt(V_kx^2 + V_ky^2), is right??

3. plot(k,V(K),k^(-5/3)) ????

please tell me the detail of the calculation procedure!!!


Thanks in advance,
germangsilva is offline   Reply With Quote

Old   April 9, 2010, 13:03
Default
  #12
Senior Member
 
cfdnewbie
Join Date: Mar 2010
Posts: 557
Rep Power: 20
cfdnewbie is on a distinguished road
Regarding 1:
k is computed from sqrt(kx^2+ky^2+kz^2)

greetings
cfdnewbie
cfdnewbie is offline   Reply With Quote

Old   April 9, 2010, 13:13
Default
  #13
New Member
 
Germán González Silva
Join Date: Mar 2010
Location: Campinas-SP
Posts: 20
Rep Power: 16
germangsilva is on a distinguished road
Send a message via MSN to germangsilva
dear cfdnewbie
How can I calculate the kx, ky,kz??
Thanks in advance for your help
germangsilva is offline   Reply With Quote

Old   April 12, 2010, 11:59
Default
  #14
New Member
 
Patrick Godon
Join Date: Apr 2010
Posts: 19
Rep Power: 17
PGodon is on a distinguished road
the k's are just the indices of the discrete Fourier transform in each dimension, you don't compute them, you have them as the indices of your array.
PGodon is offline   Reply With Quote

Old   April 12, 2010, 12:53
Default
  #15
New Member
 
Germán González Silva
Join Date: Mar 2010
Location: Campinas-SP
Posts: 20
Rep Power: 16
germangsilva is on a distinguished road
Send a message via MSN to germangsilva
Dear Godon
is possible that you send me your email please?
germangsilva@gmail.com
germangsilva is offline   Reply With Quote

Old   April 12, 2010, 13:33
Default
  #16
New Member
 
Patrick Godon
Join Date: Apr 2010
Posts: 19
Rep Power: 17
PGodon is on a distinguished road
Niet, ya nie Xochu
PGodon is offline   Reply With Quote

Old   April 29, 2014, 15:13
Default
  #17
New Member
 
Amjad
Join Date: May 2012
Posts: 21
Rep Power: 13
Amjad Asad is on a distinguished road
Quote:
Originally Posted by PGodon View Post
the k's are just the indices of the discrete Fourier transform in each dimension, you don't compute them, you have them as the indices of your array.

Hallo,
could i get the code too pls thanks
Amjad Asad is offline   Reply With Quote

Old   September 24, 2015, 18:09
Red face Energy Spectrum for a 3D turbulent Flow
  #18
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
Dear Community;
I have read many post about the topics but I still have a question. I am working with LES and I want to verify my LES code. Basically I am doing validation using the channel flow data base from JHUTB. So, I have a 3D flow field: u(x,y,z,t),v(x,y,z,t),w(x,y,z,t). I am interesting in compute the power spectrum at each plane. I have read about defining a point a collect the temporal velocity at a single point; which make sense, but I am more interested over the space rather than time..!!!
I have read about compute the FFT from the velocity, but from Wilcox book, I read that the Spectrum Energy is the FFT of the velocity correlation tensor.
I was planning to use FORTRAN to write the script, but I have read that the majority is using Matlab, so it seems that I will lean towards Matlab. However, I want to have the picture clear before starting!!!

Thanks community!
juliom is offline   Reply With Quote

Old   September 24, 2015, 18:45
Default
  #19
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
Dear Mr. kalyan.
Could you please explain in more details your reply. So far I have read that the Energy Spectrum is the FFT of the Velocity Correlation tensor which is cumbersome, I agree. But you claimed that is also possible to obtain the PSD from the FFT of each velocity component How?? I was planning to make my own script in FORTRAN but I does not make sense to re-invent the wheel!. I just want to keep going but I would like to understand the physics.
I want to compute the PSD at a fixed height (y + 11.0) along the plane x-z
juliom is offline   Reply With Quote

Old   September 29, 2015, 08:35
Default
  #20
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
Quote:
Originally Posted by Patrick Godon
;13740
Sorry, my mistake, Kalyan is right, the energy spectrum is given by:

(1/2)*4*pi*k**2*|v(k)|**2,

where v(k) is the FFT of v(x). Thus the square is taken after the FFT is performed. I often decompose 'entities' in 'modes' using FFT, that's how I got mixed up.

Thanks Kalyan for correcting me.
DEar Mr. Godon,
Where does this equation come from. The only equation I have read so far, is the eergy computation from the two point correlation. According to chapter 6 from Pope's book. I do not know where is that equation coming from that allows to circumvent the problem from the two point correlation and the spatial correlations.

Thanks
juliom 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
ATTENTION! Reliability problems in CFX 5.7 Joseph CFX 14 April 20, 2010 15:45
turbulent energy spectrum cfd.newbie FLUENT 0 June 18, 2008 18:34
LES correlation and turbulent energy spectrum Fabian Main CFD Forum 4 October 18, 2005 02:04
Warning 097- AB Siemens 6 November 15, 2004 04:41
Energy Spectrum Emad Khalifa Main CFD Forum 3 June 30, 2003 16:03


All times are GMT -4. The time now is 09:02.