# Energy Spectrum !!!

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 LinkBack Thread Tools Search this Thread Display Modes
 June 20, 2012, 09:34 code request #21 New Member   Join Date: Jun 2012 Posts: 7 Rep Power: 13 Hi everyone, Can someone please send me the matlab code as well? - sjd1e11@soton.ac.uk. Many Thanks, Steven

 August 21, 2012, 06:45 #22 New Member   Martin Söder Join Date: Jun 2011 Posts: 8 Rep Power: 14 Hi, I would also be interested in the code, and would be very thankful if I could get it martins@mech.kth.se /Martin

 November 1, 2012, 00:15 turbulence spectrum #23 New Member   Join Date: Nov 2012 Posts: 1 Rep Power: 0 hi, i'm doing my undergrad final year prjct on simulation of atmospheric boundary layer in wind tunnel.....have to measure wind profile, turbulence intensities and turbulence spectrum.... can anybody help with the turbulence spectrum....what i need to measure...how to get the plot? thank you in advance

 November 2, 2012, 08:53 #24 New Member   Kevii Join Date: Nov 2012 Posts: 1 Rep Power: 0 wow aye doing spectum always does my head in everytime :\ i suck at this T__T

 February 8, 2013, 16:20 Autocorrelation Function help #25 New Member   Kealie Goodwin Join Date: Feb 2013 Posts: 2 Rep Power: 0 I am also trying to compute the turbulence energy spectrum for some velocity data I have. My data are taken with a profiling ADV so I have u, v, w velocities for 12 points along a depth profile. These data are collected over time, which is used for a x-space proxy. In short, I have u, v, w velocity data spatially distributed across x and z dimensions (only one point in y-direction). So, 3 matrices that are 1501 (x) by 12 (z), one each for u, v, w. I understand all the steps of calculating the energy spectrum. My only problem is that I'm not sure I completely understand the autocorrelation step in Pope, especially with respect to my data. R_ij(r, x) = The <> notation is an average, correct? What does this mean for a scalar? Or is this the dot product notation? Again what does this mean for a scalar? If anyone has any matlab code for this portion that they are willing to share, it would be helpful. Thanks!

 February 9, 2013, 04:01 #26 Senior Member   Filippo Maria Denaro Join Date: Jul 2010 Posts: 6,765 Rep Power: 71 just consider a 3d Cartesian mesh and (j,k) some fixed positions. This is some lines of my Matlab code for the energy spectrum % ____________ E_uu (stream-wise)______________ % ff is a dump array for using the FFT of the field u(i,j,k) for i = 1:np+1, ff(i) = u(i,j,k); end % Discrete transform: computation of the Fourier coefficient c=fft(ff,np); for q = 1:np, c(q)=c(q)/np; end % Computation of the modulus squared. Cycle for all the wavenumbers for q=1:np, cu(q,k)=c(q)*conj(c(q)); end Then, you must simply plot your power spectrum. Generally, the computed spectrum are also computed along the whole homogeneous directions (e.g. for all the k) and then averaged to have a statistically meaning. juliom, mm.abdollahzadeh, arunsmec and 4 others like this.

 February 12, 2013, 12:30 #27 New Member   Kealie Goodwin Join Date: Feb 2013 Posts: 2 Rep Power: 0 Thank you for your code, FMDenaro. However, it's difficult for me to understand your process without your data. Does anyone have the math formulas they used for the autocorrelation? Again, the steps I'm using are: 1. Calculate autocorrelation to get signal into wave number space 2. Take fft 3. Calculate energy E(k) = E(k) + abs(V(i,j,m))^2 + abs(U(i,j,m))^2 + abs(W(i,j,m))^2; 4. plot energy vs wave number

 March 23, 2013, 21:54 #28 Member   ehk Join Date: Sep 2012 Posts: 30 Rep Power: 13 modes should change from -N/2:N/2.

 May 4, 2013, 12:30 #29 Senior Member   Bobby Join Date: Oct 2012 Location: Michigan Posts: 454 Rep Power: 15 Dear FMDenaro Thanks for sharing ur code. Last edited by babakflame; May 4, 2013 at 12:50.

 May 28, 2013, 09:55 The code #30 New Member   martin lindström Join Date: Apr 2013 Posts: 1 Rep Power: 0 Can you please send me the code as well? martinrjl@gmail.com Thank you in advance!

 June 20, 2013, 16:07 #31 New Member   Join Date: Jun 2013 Posts: 10 Rep Power: 12 If somebody can share the code for energy spectrum calculation I would greatly appreciate that. My email is: alexbn024@gmail.com

 July 10, 2013, 16:07 #32 New Member   Nik Join Date: Jun 2013 Posts: 1 Rep Power: 0 Can you send me the matlab code as well please? Thank you very much. My email is nikthomar@gmail.com.

 September 6, 2013, 04:56 #33 New Member   Terrence Nguyen Join Date: Jan 2012 Posts: 13 Rep Power: 14 Can anyone also send me the matlab code for the energy spectrum calculation, please?? My email is: sonnyvo018@yahoo.de

 September 6, 2013, 06:37 #34 Senior Member   Filippo Maria Denaro Join Date: Jul 2010 Posts: 6,765 Rep Power: 71 there is nothing else to do that loading the data in matlab, calling the built-in FFT and plotting the modulus of the Fourier coefficients versus the frequencies

 November 4, 2013, 12:17 #35 New Member   Arne Join Date: Oct 2013 Posts: 16 Rep Power: 12 Hey could someone please send me the code. my email adress : arne-eggers@web.de

 November 6, 2013, 16:32 #36 Senior Member   cfdnewbie Join Date: Mar 2010 Posts: 557 Rep Power: 20 The question has been answered in the posts above by FMDenaro, including the code! It is 3 lines in Matlab, that should be doable...

 December 4, 2013, 03:06 #37 New Member   Christian Join Date: Dec 2013 Posts: 1 Rep Power: 0 Hi Everyone, I am currently trying to perform a problem similar to this one except with a different geometry. Could someone please forward me the matlab code harish sent? My email is combustion.spot@gmail.com Thank you in advance

 January 16, 2014, 07:51 #38 Senior Member   S.Bogoda Join Date: Jul 2012 Posts: 133 Rep Power: 13 Hi, Could somebody pls send me the matlab code? sakurabogoda@gmail.com

 March 24, 2014, 01:38 code for energy spectra #39 Senior Member   chandra shekhar pant Join Date: Oct 2010 Posts: 220 Rep Power: 16 Can anyone send the code for energy spectra to me also. chandukec@gmail.com It will be a great help. Thanks in advance

April 20, 2014, 21:40
#40
Senior Member

Huang Xianbei
Join Date: Sep 2013
Location: Yangzhou,China
Posts: 302
Rep Power: 13
Quote:
 Originally Posted by FMDenaro just consider a 3d Cartesian mesh and (j,k) some fixed positions. This is some lines of my Matlab code for the energy spectrum % ____________ E_uu (stream-wise)______________ % ff is a dump array for using the FFT of the field u(i,j,k) for i = 1:np+1, ff(i) = u(i,j,k); end % Discrete transform: computation of the Fourier coefficient c=fft(ff,np); for q = 1:np, c(q)=c(q)/np; end % Computation of the modulus squared. Cycle for all the wavenumbers for q=1:np, cu(q,k)=c(q)*conj(c(q)); end Then, you must simply plot your power spectrum. Generally, the computed spectrum are also computed along the whole homogeneous directions (e.g. for all the k) and then averaged to have a statistically meaning.
Hi,Filippo
I think the third line should be: cu(q)=c(q)*conj(c(q))
As known, the velocity spectrum tensor is
phi[i,j](k)=cu(k),the energy spectrum is integrated to
E(k)=1/2*cu(k)*dS(k)
where S(k) is the sphere's surface area with radius mag(k)
is this means to calculate E(k)=1/2*cu(k)*4*pi*k^2？

 Tags energy spectrum, fft

 Thread Tools Search this Thread Search this Thread: Advanced Search Display Modes Linear Mode

 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 OffTrackbacks are Off Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post cfd.newbie Main CFD Forum 6 September 24, 2015 16:13 cfd.newbie Siemens 1 June 19, 2008 23:48 cfd.newbie FLUENT 0 June 18, 2008 18:34 Fabian Main CFD Forum 4 October 18, 2005 02:04 Emad Khalifa Main CFD Forum 3 June 30, 2003 16:03

All times are GMT -4. The time now is 04:45.

 Contact Us - CFD Online - Privacy Statement - Top