mirror of
https://github.com/ParticulateFlow/CFDEMcoupling-PFM.git
synced 2025-12-08 06:37:44 +00:00
This 2D case of vortex shedding in laminar cross-flow demonstrates the concept of recurrence. This is a bit work-in-progress: please check whether this tutorial runs with the recurrence model and tools of CFDEMcoupling, namely rStatAnalysis. The simulation roughly goes through three stages: * The initial solution computed by potentialFoam * A period of symmetric, steady-state flow * Finally, periodic vortex shedding These three stages are clearly visible in the recurrence plot. * We see how not one of the later velocity fields is similar to the initial one * We see the intermediate stage with a symmetric flow field * We see the periodic vortex shedding
76 lines
954 B
Matlab
76 lines
954 B
Matlab
% open files
|
|
fid1 = fopen('../recurrenceMatrix');
|
|
|
|
% read dimensions
|
|
A1 = fscanf(fid1, '%g %g');
|
|
|
|
% skip the first two lines
|
|
tline = fgetl(fid1);
|
|
tline = fgetl(fid1);
|
|
|
|
% get dimensions
|
|
N1 = A1(1)
|
|
M1 = A1(2)
|
|
|
|
% allocate space
|
|
B0 = zeros(M1,N1);
|
|
|
|
% read data
|
|
for i=1:N1
|
|
B0(:,i) = fscanf(fid1, '%g', inf);
|
|
tline = fgetl(fid1);
|
|
tline = fgetl(fid1);
|
|
end
|
|
|
|
% close files
|
|
fclose(fid1);
|
|
|
|
|
|
% skip this many leading entries
|
|
sle = 0;
|
|
|
|
B1 = zeros(M1-sle,N1-sle);
|
|
|
|
B1 = B0(1+sle:M1,1+sle:N1);
|
|
|
|
maxval=0.0;
|
|
%for i=1:M1
|
|
% for j=1:N1
|
|
% if(B1(i,j)>maxval)
|
|
% maxval=B1(i,j);
|
|
% endif
|
|
% end
|
|
%end
|
|
|
|
maxval = 1.0;
|
|
for i=1:M1-sle
|
|
for j=1:N1-sle
|
|
B1(i,j)=1-B1(i,j)/maxval;
|
|
% B1(i,j)=B1(i,j)/maxval;
|
|
end
|
|
end
|
|
|
|
|
|
|
|
% write full matrix to simple text file
|
|
dlmwrite('myMatrix.txt',B1,'delimiter','\t','precision',3)
|
|
|
|
|
|
|
|
%plot(C1)
|
|
%saveas(gcf,'Plot','png')
|
|
|
|
%B1=B1*1;
|
|
|
|
|
|
%hold on
|
|
|
|
|
|
%colormap(jet(50))
|
|
%imagesc(B1)
|
|
%colorbar
|
|
|
|
%saveas(gcf,'Figure','png')
|
|
|
|
|