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

Spectrum by using correlation function

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 20, 2014, 13:26
Thumbs up Spectrum by using correlation function
  #1
New Member
 
Victor Cunha
Join Date: Jun 2014
Posts: 1
Rep Power: 0
VictorCunha is on a distinguished road
Hi,

That`s the first time I'm calculating energy spectrum and I have seen many examples of calculating the spectrum by using the FFT of the velocity components and then scaling it accordingly. However, I am trying to plot the spectrum using the spatial correlation function and FFT of that. I am not sure about scaling in the frequency. My plot does not show the decaying region.

I am using E11(k) = FFT(R11(x)/2) relation.


Code:
Lz=16;%length in the x direction
R11 = autocorr(u_prime, length(u_prime)-1);
NFFT = 2^nextpow2(length(R11)); % Next power of 2 from length of L
Y = fft(R11/2,NFFT);
E = Y.*conj(Y);

f = 2*pi*[0:1:NFFT/2]/Lz;
loglog(f,E),':bs', 'MarkerSize',2);
hold on
loglog(f,10*f.^(-5/3),'r');
hold off
If someone could try this code in a known data set or if there are some huge mistakes, please let me know.
VictorCunha 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
[blockMesh] Errors during blockMesh meshing Madeleine P. Vincent OpenFOAM Meshing & Mesh Conversion 51 May 30, 2016 10:51
[blockMesh] non-orthogonal faces and incorrect orientation? nennbs OpenFOAM Meshing & Mesh Conversion 7 April 17, 2013 05:42
Version 15 on Mac OS X gschaider OpenFOAM Installation 113 December 2, 2009 10:23
Problem with compile the setParabolicInlet ivanyao OpenFOAM Running, Solving & CFD 6 September 5, 2008 20:50
Please help about the VTKFoam liugx212 OpenFOAM Running, Solving & CFD 0 November 18, 2005 18:27


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