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

Vortex shed frequency of an velocity array in MATLAB

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 5, 2019, 04:39
Default Vortex shed frequency of an velocity array in MATLAB
  #1
New Member
 
Join Date: May 2019
Posts: 4
Rep Power: 6
nikla is on a distinguished road
There was conducted ten different experiments, with ten different velocities in an air chamber where air at 25 degrees Celsius was blown at a cylinder of 20mm. The measurements were taken by a hot-wire anemometer a certain distance behind the cylinder. The frequency of measurements were 1000Hz and we were given ten different files with one array in them with velocities.

The end goal is too make two graphs, one showing vortex shed freq vs Velocity, and Strouhal- vs Reynolds number as a function of Re, and finding uncertainties considering dU=0,1. I do know the formulas for the two last variables:

Code:
St = f*D/U
Re = rho*U*D/mu
But I am not sure how to get the shedding frequency. And if you look at the image under, I am also unsure how to deal with the very start of the FFT.


I am not sure if I am supposed to do anything with the start like windowing or what not.


What I have done here is to use FFT and nyquist limits and making PSD out of it. I have the impression that if i take the max value of each of these plots and plot them against the velocity I will have what i requested first. However with the start value being so high for each of them the plot is a straight line.

I am not looking for anyone to do it for me, but rather if anyone could point me to relevant information about my problem. If it was not clear i am doing this in MATLAB.
nikla is offline   Reply With Quote

Old   May 5, 2019, 05:06
Default
  #2
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
First of all, the zero-th wavenumber in the spectra is the average energy content, try to plot the spectra in a log-log scale without the zero.
Then, consider that your time-signal is not exactly periodic, are you performing the FFt over the whole interval or are you using windowing technique?
FMDenaro is offline   Reply With Quote

Old   May 5, 2019, 06:50
Default
  #3
New Member
 
Join Date: May 2019
Posts: 4
Rep Power: 6
nikla is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
First of all, the zero-th wavenumber in the spectra is the average energy content, try to plot the spectra in a log-log scale without the zero.
Then, consider that your time-signal is not exactly periodic, are you performing the FFt over the whole interval or are you using windowing technique?

Thanks for the reply!


I am not currently using a windowing technique, as I am unsure if its appropriate in this case.


When I should remove the zero-th wave number is this before or after the FFT? If it is the later i get this for my plots:





Do these to plots look like something that could be correct?
nikla is offline   Reply With Quote

Old   May 5, 2019, 07:03
Default
  #4
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Remove only from the plot, first of all show the energy spectra resulting from the whole signal in a log-log plot
FMDenaro is offline   Reply With Quote

Old   May 5, 2019, 07:17
Default
  #5
New Member
 
Join Date: May 2019
Posts: 4
Rep Power: 6
nikla is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
Remove only from the plot, first of all show the energy spectra resulting from the whole signal in a log-log plot

Okey so I plotted this:

Code:
loglog(PSDx{i})
From:
Code:
%% Number of points
    N = numel(Ucell{i}); % Lenght of signal
    
    %% FFT
    xdft{i} = real(fft(Ucell{i}));
    xdft{i} = xdft{i}(1:N/2+1); % Nyquist
    
    %% PSD - Power Spectral Density
    PSDx{i} = (1/(fs*N)) * abs(xdft{i}).^2;
     PSDx{i}(2:end-1) = 2*PSDx{i}(2:end-1);
I then get this:

Last edited by nikla; May 5, 2019 at 07:23. Reason: fixed img
nikla is offline   Reply With Quote

Old   May 5, 2019, 07:44
Default
  #6
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
what are you exactly representing in x and y axes? If 10^3 Hz is the Nyquist cut-off how can you plot higher frequencies??? What is exactly the time-step of your measurement device?
FMDenaro is offline   Reply With Quote

Old   May 5, 2019, 08:17
Default
  #7
New Member
 
Join Date: May 2019
Posts: 4
Rep Power: 6
nikla is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
what are you exactly representing in x and y axes? If 10^3 Hz is the Nyquist cut-off how can you plot higher frequencies??? What is exactly the time-step of your measurement device?

Sorry I tought wrong, and plotted wrong.

It now cuts of at the nyquist limit 500hz.



Code:
%% Load test data
Ucell   = {load('3d7.lvm') load('5d5.lvm') load('7d1.lvm')...
    load('8d7.lvm') load('11d9.lvm') load('14d4.lvm') load('16d5.lvm')...
    load('18d9.lvm') load('20d8_1.lvm') load('20d8_2.lvm')};
UL      = numel(Ucell);
U       = [3.7 5.5 7.1 8.7 11.9 14.4 16.5 18.9 20.8 20.8]; % m/s

%% Variables and Conditions
D       = 0.02;                 % [m] Diameter of cylinder
T       = 25;                   % [C] Tempratur
rho     = 1.184;                % [kg/m^3] Air density
mu      = 18.37e-6;             % [N*s/m^2] Dynamic (absolute) viscosity
deltaU  = 0.1;                  % [m/s] speed change
fs      = 1000;                 % [Hz] Sampling frequency
ts      = 1/fs;                 % [s] Sample time
Ns      = fs/2;                 % [Hz] Nyquist sampling frequency

%% Calculating
% Preallocation

for i=1:UL
    %% Number of points
    N = numel(Ucell{i}); % Lenght of signal
%     t{i} = (0:N-1)*ts; % Time vector
    
    %% FFT
    xdft{i} = real(fft(Ucell{i}));
    xdft{i} = xdft{i}(1:N/2+1); % Nyquist
    
    %% PSD - Power Spectral Density
    PSDx{i} = (1/(fs*N)) * abs(xdft{i}).^2;
    PSDx{i}(2:end-1) = 2*PSDx{i}(2:end-1);
    freq{i} = 0:fs/N:Ns;
    
    %% Max value
    [M(i),I(i)] = max((PSDx{i}));
    I(i) = (I(i)*Ns)/N; % Getting the frequency and not indic place

    %% Strouhal number and Reynolds number
    St(i) = (M(i)*D)/U(i); % Strouhal number
    Re(i) = (rho*U(i)*D)/mu; % Reynolds number
end


%% PSD
figure(4)
for i=1:UL
    subplot(numRow,plotsPerRow,i)
    loglog(freq{i},PSDx{i})
    title(sprintf('U=%0.5g [m/s]', U(i)))
     xlabel('Frequency (Hz)')
     ylabel('PSD')
    grid on
end
sgtitle('Loglog')
linkaxes % Same axis range for all
nikla is offline   Reply With Quote

Old   May 5, 2019, 08:37
Default
  #8
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
But you must not cut the plot, your whole signal contains frequencies only up to the Nyquist one and that means you perform the FFT on the whole signal and then plot the squared modulus of all Fourier couefficients along each frequency.

And the Nyquist frequency is pi/dt, what is yout dt?
FMDenaro is offline   Reply With Quote

Reply

Tags
vortex shedding frequency


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
Induced downwash velocity for drag computation in Vortex Lattice Method (VLM) Sehwan Main CFD Forum 3 September 13, 2018 14:33
Vortex shedding frequency from cylinder UOWmecheng CFX 7 July 14, 2016 19:05
time step and vortex shedding frequency kevin Main CFD Forum 16 November 19, 2009 06:00
Terrible Mistake In Fluid Dynamics History Abhi Main CFD Forum 12 July 8, 2002 09:11
Free vortex - forced vortex Armin Hofstädter Main CFD Forum 2 November 17, 1998 18:55


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