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

How to estimate the scales in your flow - 3d Data

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 7, 2015, 15:02
Default How to estimate the scales in your flow - 3d Data
  #1
New Member
 
Erik Thyil
Join Date: Sep 2015
Posts: 8
Rep Power: 10
Excalibur is on a distinguished road
The classical approach for 1d hot wire anemometer experiments is simply doing an fft analysis for a time resolved data taking sampling frequency into account.

However, i couldnt find much info for calculating spatial spectrum where the largest and the smallest scales in the flow would be calculated.

Additionally, do you have any idea how to filter a turbulence box. i have some signal filtering knowledge but i am not sure if it is directly applicable to a flow field data.
Excalibur is offline   Reply With Quote

Old   September 7, 2015, 15:42
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
Quote:
Originally Posted by Excalibur View Post
The classical approach for 1d hot wire anemometer experiments is simply doing an fft analysis for a time resolved data taking sampling frequency into account.

However, i couldnt find much info for calculating spatial spectrum where the largest and the smallest scales in the flow would be calculated.

Additionally, do you have any idea how to filter a turbulence box. i have some signal filtering knowledge but i am not sure if it is directly applicable to a flow field data.

Are you considering a numerical or experimental measurement?
Numerically the largest scale is the computational domain lenght and the smallest scale is dictated by the computational step size (2*h is the smallest wavelength)
FMDenaro is offline   Reply With Quote

Old   September 7, 2015, 16:04
Default
  #3
New Member
 
Erik Thyil
Join Date: Sep 2015
Posts: 8
Rep Power: 10
Excalibur is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
Are you considering a numerical or experimental measurement?
Numerically the largest scale is the computational domain lenght and the smallest scale is dictated by the computational step size (2*h is the smallest wavelength)
I am considering numerically. So I should be able to see this either from autocorrelation or fft. For example if one looks at the autocorrelation of a 1D vector taken from a 3D flow field data, in the streamwise it is correlated up to 800 meter even though my domain size is 6km
so isnt that supposed to be the largest size then?

Second method is the spatial fft. So a routine like this below indeed gives the smallest wavelength to be 2*h. however the largest scale is weird numbers in the log log plot.

v=U(:,100,100);
fs=1./(6000/32768)
npt=length(v);v=v-mean(v);
ff=fft(v); pff=ff.*conj(ff)/npt;
f=fs*(0:npt/2-1)/npt;
loglog(f,pff(1:npt/2),'b')



And if the largest and the smallest sizes are those, one should still be able to filter with a cutoff or bandpass to have the same turbulence box with various scales. This I can do while generating my turbulence box since i tell the pseudo random numbers correlation to fit a spectrum, however if i get a readily generated box then how to filter it i am not sure...
Excalibur is offline   Reply With Quote

Old   September 7, 2015, 16:21
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
Quote:
Originally Posted by Excalibur View Post
I am considering numerically. So I should be able to see this either from autocorrelation or fft. For example if one looks at the autocorrelation of a 1D vector taken from a 3D flow field data, in the streamwise it is correlated up to 800 meter even though my domain size is 6km
so isnt that supposed to be the largest size then?

Second method is the spatial fft. So a routine like this below indeed gives the smallest wavelength to be 2*h. however the largest scale is weird numbers in the log log plot.

v=U(:,100,100);
fs=1./(6000/32768)
npt=length(v);v=v-mean(v);
ff=fft(v); pff=ff.*conj(ff)/npt;
f=fs*(0:npt/2-1)/npt;
loglog(f,pff(1:npt/2),'b')



And if the largest and the smallest sizes are those, one should still be able to filter with a cutoff or bandpass to have the same turbulence box with various scales. This I can do while generating my turbulence box since i tell the pseudo random numbers correlation to fit a spectrum, however if i get a readily generated box then how to filter it i am not sure...
The separation value for which the correlation goes to zero should provide the assessment that the largest structure is well described by the lenght of the computational domain.

What kind of signal you have?
FMDenaro is offline   Reply With Quote

Old   September 7, 2015, 16:29
Default
  #5
New Member
 
Erik Thyil
Join Date: Sep 2015
Posts: 8
Rep Power: 10
Excalibur is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
The separation value for which the correlation goes to zero should provide the assessment that the largest structure is well described by the lenght of the computational domain.

What kind of signal you have?
The correlation value that goes to zero in the streamwise is around 4000 and the dx=0.18 so the signal does not continue corrrelated until the end.

The signal i have is a 3d turbulence box. for streamwise component
Excalibur is offline   Reply With Quote

Old   September 7, 2015, 16:39
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
3D periodical box? Why do you want to filter ?
FMDenaro is offline   Reply With Quote

Old   September 7, 2015, 16:45
Default
  #7
New Member
 
Erik Thyil
Join Date: Sep 2015
Posts: 8
Rep Power: 10
Excalibur is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
3D periodical box? Why do you want to filter ?
not necessarily periodic, but i can choose to have it like that too...

i want to filter it because i want to run different simulations with the same turbulence box that has different scale content. this flow field is embedded to another acoustic simulation
Excalibur is offline   Reply With Quote

Old   September 8, 2015, 03:00
Default
  #8
New Member
 
Erik Thyil
Join Date: Sep 2015
Posts: 8
Rep Power: 10
Excalibur is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
3D periodical box? Why do you want to filter ?
i found sth relevant in the pivmat toolbox
for instance

% U is a 2D slice of turbulence box
filtsize = 8; % must be adjusted
order = 8; % must be adjusted
nx=size(U,2);ny=size(U,1);
n=min(nx,ny);
kx0=nx/2+1;
ky0=ny/2+1;
[ky,kx] = meshgrid(1:ny,1:nx);
k = sqrt((kx-kx0).^2+(ky-ky0).^2);
T = 1./(1+(k/(n/filtsize)).^(order/2));
sp=fftshift(fft2(U));
filtU = real(ifft2(ifftshift(sp.*T)));
Excalibur is offline   Reply With Quote

Old   September 8, 2015, 04:22
Default
  #9
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
I am not sure of what you want to do ...
you have a turbulent field in a 3D box of lenght L and you want to extract a field over a 2D box of lenght < L ??
FMDenaro is offline   Reply With Quote

Old   September 8, 2015, 04:37
Default
  #10
New Member
 
Erik Thyil
Join Date: Sep 2015
Posts: 8
Rep Power: 10
Excalibur is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
I am not sure of what you want to do ...
you have a turbulent field in a 3D box of lenght L and you want to extract a field over a 2D box of lenght < L ??
This is what I wanted to do, and it seems to be working, this can be done in 3D or 2D in this image it is a 2D case.
http://imgur.com/ecgEKuJ,fhOaXmn#0
if you click the link there are two images second one is the specta of thsoe two
Excalibur is offline   Reply With Quote

Old   September 8, 2015, 04:44
Default
  #11
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
Quote:
Originally Posted by Excalibur View Post
This is what I wanted to do, and it seems to be working, this can be done in 3D or 2D in this image it is a 2D case.
http://imgur.com/ecgEKuJ,fhOaXmn#0
if you click the link there are two images second one is the specta of thsoe two

Ok, so you filtered with a cut-off at a wavenumber kc = pi/hc < pi/h (h original computational size) over the same domain.
But, as a consequence, the two spectra in the second figure should be exactly the same up to kc, then the filtered spectra should vanish for wavenumbers > kc. I suspect something is not clear to me...
FMDenaro is offline   Reply With Quote

Old   September 8, 2015, 04:52
Default
  #12
New Member
 
Erik Thyil
Join Date: Sep 2015
Posts: 8
Rep Power: 10
Excalibur is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
Ok, so you filtered with a cut-off at a wavenumber kc = pi/hc < pi/h (h original computational size) over the same domain.
But, as a consequence, the two spectra in the second figure should be exactly the same up to kc, then the filtered spectra should vanish for wavenumbers > kc. I suspect something is not clear to me...
http://imgur.com/8oFpT7f,51YybE4#1

I tuned the order and the filtersize, the second image in this link is as good as it gets so to say, on the other hand i believe if you look at an average spectrum (the images are only for a stremwise vector of a 2d data) they should be identical.

additionally this is a badly generated turbulence box in the sense that the largest and there are not enough modes while generation 1024 for 500 meter so i believe a better resolved turb. box would me more accurate to comment on.
Excalibur is offline   Reply With Quote

Old   September 8, 2015, 04:58
Default
  #13
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
Quote:
Originally Posted by Excalibur View Post
http://imgur.com/8oFpT7f,51YybE4#1

I tuned the order and the filtersize, the second image in this link is as good as it gets so to say, on the other hand i believe if you look at an average spectrum (the images are only for a stremwise vector of a 2d data) they should be identical.

additionally this is a badly generated turbulence box in the sense that the largest and there are not enough modes while generation 1024 for 500 meter so i believe a better resolved turb. box would me more accurate to comment on.

I suppose the problem could be in the way you are doing FFT....
if the unfiltered field is sampled over a step size h = L/N the FFT is done considering the N/2 nodes.

but the filtered field is equivalent to have a sampling over hf=L/Nf, therefore the FFT should be over Nf/2, can not be extended up to N/2. This way you are causing a sort of aliasing effect.
The key is to work on a coars grid for the filtered field, not on the original fine.
FMDenaro is offline   Reply With Quote

Old   September 8, 2015, 05:14
Default
  #14
New Member
 
Erik Thyil
Join Date: Sep 2015
Posts: 8
Rep Power: 10
Excalibur is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
I suppose the problem could be in the way you are doing FFT....
if the unfiltered field is sampled over a step size h = L/N the FFT is done considering the N/2 nodes.

but the filtered field is equivalent to have a sampling over hf=L/Nf, therefore the FFT should be over Nf/2, can not be extended up to N/2. This way you are causing a sort of aliasing effect.
The key is to work on a coars grid for the filtered field, not on the original fine.
here in this link 2 images for the averaged spectrum for two cases and the generated box is much better resolved
the lines are on top of each other.
http://imgur.com/Bovhh5N,HxLgnbz
see 2 images
Excalibur 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
Compressible flow, no data at the outlet mireis FLUENT 6 September 3, 2015 02:10
Possible Bug in pimpleFoam (or createPatch) (or fluent3DMeshToFoam) cfdonline2mohsen OpenFOAM 3 October 21, 2013 09:28
information from saved data files:Unsteady flow Atul FLUENT 5 July 27, 2008 20:05
Inviscid Drag at subsonic, subcritical Mach # Axel Rohde Main CFD Forum 1 November 19, 2001 12:19
PhD in turbulence Hans Main CFD Forum 14 October 8, 2001 03:03


All times are GMT -4. The time now is 06:21.