CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   2-point spatial velocity correlation (https://www.cfd-online.com/Forums/main/120468-2-point-spatial-velocity-correlation.html)

alexbn024 July 8, 2013 04:07

2-point spatial velocity correlation
 
Hello all,

I was trying to implement 2-pt spatial velocity correlation to my data (ensembled averaged pulsatile flow through the pipe) but it seems like I am getting lost in the process.

Here is what I understand, normalized autocorrelation function is defined as R(x,r)=<Vi'(x)Vi'(x+r)>/sqrt(<Vi'(x)^2>, <>-ensemble average. The velocity I am interested in is in streamwise direction and is represented by an NxM matrix, where V(1:N)-velocity change in radial direction, V(1:M) velocity change in a streamwise direction ("pipe flow"). Here ' -s a fluctuation component of the velocity.

If fix my origin for 2-point spatial velocity correlation at x=x0, along the centerline of the pipe, in order for me to get Rii, do I sweep from x0 to xM by incrementing r between successive velocity values along the centerline of the pipe, i.e. R(1) = <Vi'(x)Vi'(x+r)>/sqrt(<Vi'(x)^2>, R(2) = <Vi'(x)Vi'(x+2r)>/sqrt(<Vi'(x)^2>, ..., R(M) = <Vi'(x)Vi'(x+Mr)>/sqrt(<Vi'(x)^2>?

With this approach, the graph of R vs r does not look right, it cascades down from 1 to 0, oscillates a bit near 0 on the negative side of 0, and then shoots back to 1.6 and oscillates there.

I guess I am missing something here. If somebody has experience with this type of calculations and can point out where I am off in my assumptions, I would greatly appreciate it.

Thanks!

FMDenaro July 8, 2013 06:16

Quote:

Originally Posted by alexbn024 (Post 438386)
Hello all,

I was trying to implement 2-pt spatial velocity correlation to my data (ensembled averaged pulsatile flow through the pipe) but it seems like I am getting lost in the process.

Here is what I understand, normalized autocorrelation function is defined as R(x,r)=<Vi'(x)Vi'(x+r)>/sqrt(<Vi'(x)^2>, <>-ensemble average. The velocity I am interested in is in streamwise direction and is represented by an NxM matrix, where V(1:N)-velocity change in radial direction, V(1:M) velocity change in a streamwise direction ("pipe flow"). Here ' -s a fluctuation component of the velocity.

If fix my origin for 2-point spatial velocity correlation at x=x0, along the centerline of the pipe, in order for me to get Rii, do I sweep from x0 to xM by incrementing r between successive velocity values along the centerline of the pipe, i.e. R(1) = <Vi'(x)Vi'(x+r)>/sqrt(<Vi'(x)^2>, R(2) = <Vi'(x)Vi'(x+2r)>/sqrt(<Vi'(x)^2>, ..., R(M) = <Vi'(x)Vi'(x+Mr)>/sqrt(<Vi'(x)^2>?

With this approach, the graph of R vs r does not look right, it cascades down from 1 to 0, oscillates a bit near 0 on the negative side of 0, and then shoots back to 1.6 and oscillates there.

I guess I am missing something here. If somebody has experience with this type of calculations and can point out where I am off in my assumptions, I would greatly appreciate it.

Thanks!

Hi,
I am not sure to get exactly your question, however when you fix x=x0 then:

R(x0,r)=<Vi'(x0)Vi'(x0+r)>/sqrt(<Vi'(x0)^2> = F(r)

is a function only of the separation lenght r. Therefore you have to compute the function for each r. Why are you computing terms like R(M) = <Vi'(x)Vi'(x+Mr)>/sqrt(<Vi'(x)^2 ?

alexbn024 July 8, 2013 13:04

Hi Filippo,

Thank you for the reply! What you wrote are exactly two steps that I understand and confused about. Let me try to explain.

at x=x0, I do calculate R(x0,r), the way you mentioned, only for V(x0,y0), where y0 is in the centerline of the pipe.

I think my problem is with r. I treated r as a distance x0 and x0+dx, where dx is a distance between grid points. In order to get plot R(x0,r) vs. r I calculated:

[<Vi'(x0)Vi'(x0+r)>/sqrt(<Vi'(x0)^2>, <Vi'(x0)Vi'(x0+2r)>/sqrt(<Vi'(x0)^2>, ..., <Vi'(x0)Vi'(x0+Mr)>/sqrt(<Vi'(x0)^2>]

for [r, 2r, ..., Mr]

I guess this is where I am getting it all wrong?

I attached a sample image of what I am doing, maybe that would help to identify where I am wrong in my calculations? Basically, I only use yellow points for my calculation and vary r from r=r to r=mr to get a dependence of R(r) vs r. Would that be a correct approach?

http://img692.imageshack.us/img692/981/twa7.png

Thank you in advance!

FMDenaro July 8, 2013 13:18

ok, I see... therefore:

1) you have the separation variable r sampled on the x-direction grid, r(i)=i*dx, i=1,...,M-1, note that r(M-1)=(M-1)dx;
2) what about the third dimension?
3) are you interested in the correlation or in the coefficient of correlation? you are actually computing the last one
4) is your case homogeneous? it would be independent from the choice of x0

alexbn024 July 8, 2013 13:55

I would say I am interested in both. Let me explain why:

I wanted to calculate coefficient of correlation so I can see how it declines
over streamwise direction, which, if I understand correctly, can be translated to the correlation of the eddies in the turbulent flow. I think by comparing few phases of the flow, the eddies formed in various phases will change in size and structure, which should be reflected by the different correlation coefficient. I hope I understand that correctly.

Regarding 2pt correlation, I wanted to use it to calculate a 1D wavenumber spectra, as FFT for 2pt correlation. I assume that I can transfer the Taylor's "frozen field" hypothesis to a fixed phase of the flow and consider that phase a quasi-steady. I am not sure if the distribution of the turbulent scales is homogeneous though.

Regarding the third dimension, right now I have only 2D data experimental (U,V) in two perpendicular planes. I wanted to obtain turbulent characteristic of that data before attempting to replicate it with 3D CFD.

Do you think my approach is correct for those goals?

Thanks!

FMDenaro July 8, 2013 14:08

Quote:

Originally Posted by alexbn024 (Post 438516)
I would say I am interested in both. Let me explain why:

I wanted to calculate coefficient of correlation so I can see how it declines
over streamwise direction, which, if I understand correctly, can be translated to the correlation of the eddies in the turbulent flow. I think by comparing few phases of the flow, the eddies formed in various phases will change in size and structure, which should be reflected by the different correlation coefficient. I hope I understand that correctly.

Regarding 2pt correlation, I wanted to use it to calculate a 1D wavenumber spectra, as FFT for 2pt correlation. I assume that I can transfer the Taylor's "frozen field" hypothesis to a fixed phase of the flow and consider that phase a quasi-steady. I am not sure if the distribution of the turbulent scales is homogeneous though.

Regarding the third dimension, right now I have only 2D data experimental (U,V) in two perpendicular planes. I wanted to obtain turbulent characteristic of that data before attempting to replicate it with 3D CFD.

Do you think my approach is correct for those goals?

Thanks!

you have 2d data from experiment or simulation? Correltations in 3d are quite different...
However, if you have a periodic condition along x you can simply compute the spectrum at y=y0, that is E11(Kx, y0). The peaks you see in the spectrum indicate energetic eddies at the corresponding wavenumbers (and therefore to some lenght extent).
Furthermore, the inverse Fourier transform of the spectra drives you to the correlation.

alexbn024 July 8, 2013 14:19

Hi Filippo,

The data that I currently have is 2D from experiments with a grid resolution of ~0.7mm along streamwise direction. If I understand you correctly, I can calculate R(x0,r) at y0, with the separation variable r sampled on the x-direction grid and then use it to compute the spectrum at y=y0?

I wander if the spatial resolution of the data is enough, I can refine it if needed though.

Thank you!

FMDenaro July 8, 2013 14:28

Quote:

Originally Posted by alexbn024 (Post 438519)
Hi Filippo,

The data that I currently have is 2D from experiments with a grid resolution of ~0.7mm along streamwise direction. If I understand you correctly, I can calculate R(x0,r) at y0, with the separation variable r sampled on the x-direction grid and then use it to compute the spectrum at y=y0?

I wander if the spatial resolution of the data is enough, I can refine it if needed though.

Thank you!

well, you can also compute directly the energy spectrum and then compute the correlation by means of the inverse transform...however, even the spectrum alone is sufficient to check for energy-containing eddies.

However 0.7mm says almost nothing, it can be sufficient or not depending on the energy production. What about the Re number? Fluid is air?
How you can refine the space interval? You can repeat the experiment and reduced the probe measurement?

alexbn024 July 8, 2013 17:49

Thanks Filippo!

I can potentially refine the the spatial interval by reprocessing the data with a smaller interrogation window (data is from PIV). I guess realistically, the refinement will not be significant. The fluids is liquid and Re is not fixed since the flow is pulsatile.

I would like to try your suggestion and compute energy spectrum of V(x, y0), the only method I knew was to take FFT of 2pt velocity correlation. Is there an alternative way of doing this?

FMDenaro July 8, 2013 18:14

it is simple using the FFT, take your velocity vector v(1:M,y0) and compute the Fourier coefficients C(Kx,y0), then compute the modulus of the coefficients and plot along Kx. Use a logarithmic scale for clarity ;)

Just as example, here are few lines I use in Matlab for the streamwise spectrum at some fixed Yj value

% 1) ____________ Calcolo di E_uu (stream-wise)______________
% ff è un vettore di appoggio su cui fare la FFT
for i = 1:np+1, ff(i) = u(i,j,k); end
% Trasformata discreta calcolo dei coefficienti di Fourier
c=fft(ff,np); for q = 1:np, c(q)=c(q)/np; end
% Calcolo modulo quadro. Ciclo su ogni armonica k
for q=1:np, cu(q,k)=c(q)*conj(c(q)); end

alexbn024 July 8, 2013 18:32

Thank you very much Filippo! I'll give it a try.

FMDenaro July 9, 2013 06:01

good, let me see some plots
;)

alexbn024 July 9, 2013 19:34

Here is what I got

http://img23.imageshack.us/img23/566/nnvx.png

I am not quite sure I believe it though :( I expected the energy to start a bit higher. That is something for me to think about :D

Thanks for all your help Filippo!

FMDenaro July 10, 2013 03:41

well, consider that this is the only snapshot (I think related to some time measurement), in general the spectrum is statistically averaged. As you are studyng a pulsatile flow this average should be performed over several samples.

What is somehow strange is that the energy cascade seems to not finish... I supposed to see the dissipative part of spectrum. It seems that your resolution is poor to capture the whole spectrum....

alexbn024 July 10, 2013 12:24

Yeah, the spatial resolution of the data was something I was worried about at the first place. While I can improve on the resolution to some extend, I don't think the improvement will be that significant.

Regarding the proper averaging you are right, the plot here was made just for one realization of the set that represent this particular time.

On a related note, when starting from streamwise velocity instead of the correlation of the fluctuation part of the velocity, what normalization is applied to properly scale E and R? Can you still say that for r->0, R->1 after scaling with Urms for instance?

FMDenaro July 10, 2013 12:38

Quote:

Originally Posted by alexbn024 (Post 439006)
Yeah, the spatial resolution of the data was something I was worried about at the first place. While I can improve on the resolution to some extend, I don't think the improvement will be that significant.

Regarding the proper averaging you are right, the plot here was made just for one realization of the set that represent this particular time.

On a related note, when starting from streamwise velocity instead of the correlation of the fluctuation part of the velocity, what normalization is applied to properly scale E and R? Can you still say that for r->0, R->1 after scaling with Urms for instance?

The better the resolution, the wider will be the spectrum, hopefully you will see the dissipative decayding part that here is not shown. It seems that you have until a maximum frequency of about 40 m^-1.
Have you fixed y0 at the center of the pipe?

Concerning the scaling, the coefficient of correlation will be 1 for r=0.
How do you compute the velocity fluctuation?

alexbn024 July 10, 2013 13:01

\bar{u}^{\varphi}=\sum_{k=1}^Nu_k^{\varphi} is my mean, here \varphi is the phase of the flow, I typically use about N=250 realizations of each phase.
I calculate fluctuation component by subtracting mean from the instantaneous velocity. So, in this case, u^{'\varphi}=u^{\varphi}-\bar{u}^{\varphi}. Yes, y = y0 - middle of the pipe, was fixed.

I took ifft of E, which plot is here, and while the obtained shape seems to be OK, at r=0 R is around 0.02 so I started to wander if it needs to be scaled. I'll try to refine the data and see if that will bring any improvement in the E distribution.

FMDenaro July 10, 2013 13:28

Quote:

Originally Posted by alexbn024 (Post 439014)
\bar{u}^{\varphi}=\sum_{k=1}^Nu_k^{\varphi} is my mean, here \varphi is the phase of the flow, I typically use about N=250 realizations of each phase.
I calculate fluctuation component by subtracting mean from the instantaneous velocity. So, in this case, u^{'\varphi}=u^{\varphi}-\bar{u}^{\varphi}. Yes, y = y0 - middle of the pipe, was fixed.

I took ifft of E, which plot is here, and while the obtained shape seems to be OK, at r=0 R is around 0.02 so I started to wander if it needs to be scaled. I'll try to refine the data and see if that will bring any improvement in the E distribution.


of course you have (1/N) in the mean...

the ifft of E produce the correlation, hence you have to scale if you want the coefficients. But I don't think that scaling is something that can add more indication...
It appears from your spectrum that you have an energy cascade without noticeable peaks...

huangxianbei May 15, 2014 09:39

Quote:

Originally Posted by FMDenaro (Post 438510)
ok, I see... therefore:

1) you have the separation variable r sampled on the x-direction grid, r(i)=i*dx, i=1,...,M-1, note that r(M-1)=(M-1)dx;
2) what about the third dimension?
3) are you interested in the correlation or in the coefficient of correlation? you are actually computing the last one
4) is your case homogeneous? it would be independent from the choice of x0

Hi,Filippo:
I got stuck in the post-process again and need your help. I'm calculating the two-point correlation in the channel flow DNS. As you say, if the direction is homogenous, any choice of the x will get the same result, so I only need to calculate it with a chosen x, right?
I calculate it by choosing x=0 and average with 300 samples, but the curve is not smooth at all! The deltaT=0.0065h/ut, everything is in good agreement with Moin's data but this one.

huangxianbei May 15, 2014 09:44

Quote:

Originally Posted by FMDenaro (Post 439017)
of course you have (1/N) in the mean...

the ifft of E produce the correlation, hence you have to scale if you want the coefficients. But I don't think that scaling is something that can add more indication...
It appears from your spectrum that you have an energy cascade without noticeable peaks...

Here is my steps(take x(steamwise,homogenous) for example):
1.range the data to make it looks: x value in one column is the same;
2.chose x=0, so Ruu(r)=u*u(r);
3.average Ruu in z direction(spanwise,homogenous),that is, do average in each column
4.repeat with all samples
5.average


All times are GMT -4. The time now is 22:52.