CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

autocorrelation in Matlab

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 11, 2016, 02:53
Default autocorrelation in Matlab
  #1
New Member
 
Alessandro
Join Date: Jul 2016
Posts: 10
Rep Power: 5
pappo1890 is on a distinguished road
Dear all,

I am trying to plot the energy spectrum from the autocorrelation function. For this aim I am using the velocity fluctuation of a point of the domain varying through the time.
the expression of the autocorrelation from Pope is:
<u'(t)u'(t+s)>/<u'>^2, so in case s=0 the autocorrelation is 1.

The code that I have written in Matlab is:

u_primequad=zeros(n,1);
%autocorr=0;
for i=1:n-1
u_primequad(i,1)=((u_prime(i)*u_prime(i)));
end
u_primequad=mean(u_primequad);


f=zeros(n,1);
autocorr=zeros(n,1);
for j=0:n-1

for i=1:n-j
autocorr(i,1)=(u_prime(i)*u_prime(i+j));
end
autocorr1=mean(autocorr);
f(j+1,1)=autocorr1/u_primequad;
end


Someone can say me if are there some errors?

Thank you in advance
pappo1890 is offline   Reply With Quote

Old   August 12, 2016, 10:12
Default
  #2
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Augsburg
Posts: 2,243
Blog Entries: 6
Rep Power: 38
Tobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi,

I think you missed the correct forum. This forum is about OpenFOAM and not Matlab (:
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   July 13, 2019, 03:06
Default
  #3
Senior Member
 
Jianrui Zeng
Join Date: May 2018
Location: China
Posts: 135
Rep Power: 3
calf.Z is on a distinguished road
I am doing DNS of pipe flow, and I am wondering how to do autocorrelation using Matlab? Thank you.
calf.Z is offline   Reply With Quote

Old   August 20, 2019, 07:03
Default
  #4
New Member
 
Arijit Saha
Join Date: Feb 2019
Location: Singapore
Posts: 12
Rep Power: 2
ari003 is on a distinguished road
Quote:
Originally Posted by calf.Z View Post
I am doing DNS of pipe flow, and I am wondering how to do autocorrelation using Matlab? Thank you.
Did you get how to do it?
I m in a great need.
Will be very helpful if you share.
ari003 is offline   Reply With Quote

Old   September 4, 2019, 03:47
Default
  #5
Senior Member
 
Jianrui Zeng
Join Date: May 2018
Location: China
Posts: 135
Rep Power: 3
calf.Z is on a distinguished road
Quote:
Originally Posted by ari003 View Post
Did you get how to do it?
I m in a great need.
Will be very helpful if you share.
I am still researching it, we can keep contact if we make any progress.
calf.Z is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to start Fluent with Matlab?? Jay Hu FLUENT 6 November 10, 2018 03:20
Export/Import data contour plots with Matlab meangreen FLUENT 5 September 6, 2017 07:46
Very small Matlab job: post-processing OpenFOAM (.CSV) results RbBb CFD Freelancers 1 July 11, 2016 09:00
Linking with Matlab?? LostinSpace Phoenics 0 March 25, 2013 05:39
Live connection Matlab VS OF levka OpenFOAM Running, Solving & CFD 0 July 10, 2012 04:15


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