CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Offset when calculating TKE using autocorrelation (https://www.cfd-online.com/Forums/main/234067-offset-when-calculating-tke-using-autocorrelation.html)

Falu February 22, 2021 06:32

Offset when calculating TKE using autocorrelation
 
2 Attachment(s)
Hey CFD Community,

I simulated a free jet stream in Ansys CFX and want to plot the Turbulence Kinetic Energy of my Simulation. In my Simulation I computed a variable which tracks the unresolved Turbulent Kinetic Energy. Now Im using Matlab to calculate the TKE with the components of the velocity vector. The two graphs have a similar trend, but you can see an offset in the y-values. I attached the two graphs below.

I guess there is something wrong with my calculation, am I missing something? The relevant part is the following:

for Wort=1:words
Bereich=Liste(Wort);
for d=1:1:datapoints
spalte=d+(Wort-1)*datapoints;
dstring=int2str(d);

energy_vel(:,spalte)=(P2Y_fluc_win_han(:,spalte).* conj(P2Y_fluc_win_han(:,spalte)))/(N^2);

end
end

for d=1:1:datapoints
energy_tot(:,d)=energy_vel(:,d)+energy_vel(:,d+dat apoints)+energy_vel(:,d+datapoints*2);
end


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