-
Notifications
You must be signed in to change notification settings - Fork 0
/
A4_1_View_FF.m
153 lines (113 loc) · 2.97 KB
/
A4_1_View_FF.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
%% A4_1_View_FF
% view a movie of the full-field turbulent wind file & plots
ADFileName = fullfile(save_dir,[save_name,'.',outputExtension]);
[velocity, twrVelocity, y, z, zTwr, nz, ny, dz, dy, dt, zHub, z1,mffws]...
= readTSgrid(ADFileName);
%% Movie
sampleRate = 1; %sec
sampleInt = round(sampleRate/dt);
if 0
figure(11);
for i = 1:sampleInt:size(velocity(:,1,1,1),1)
subplot(131);
u_ = velocity(i,1,:,:);
u = reshape(u_,[length(y),length(z)]);
imagesc(y,z,u');
set(gca,'YDir','normal')
colorbar;
title('u [m/s]')
subplot(132);
v_ = velocity(i,2,:,:);
v = reshape(v_,[length(y),length(z)]);
imagesc(y,z,v');
set(gca,'YDir','normal')
colorbar;
title(['v [m/s], t = ',num2str((i-1)*dt),'s']);
subplot(133);
w_ = velocity(i,3,:,:);
w = reshape(w_,[length(y),length(z)]);
imagesc(y,z,w');
set(gca,'YDir','normal')
colorbar;
title('w [m/s]');
pause(sampleRate);
end
end
%% Averages
figure(12);
%Streamwise
u_ = velocity(:,1,:,:);
u_bar = reshape(mean(u_,1),[length(y),length(z)]);
subplot(131);
imagesc(y,z,u_bar');
set(gca,'YDir','normal')
colorbar;
title('mean u [m/s]');
%Horizontal
v_ = velocity(:,2,:,:);
v_bar = reshape(mean(v_,1),[length(y),length(z)]);
subplot(132);
imagesc(y,z,v_bar');
set(gca,'YDir','normal')
colorbar;
title('mean v [m/s]');
%Vertical
w_ = velocity(:,3,:,:);
w_bar = reshape(mean(w_,1),[length(y),length(z)]);
subplot(133);
imagesc(y,z,w_bar');
set(gca,'YDir','normal')
colorbar;
title('mean w [m/s]');
%% T.I. & Std
figure(13);
%Streamwise
u_hat = reshape(std(u_,1),[length(y),length(z)]);
subplot(131);
imagesc(y,z,u_hat');
set(gca,'YDir','normal')
colorbar;
title('std u [m/s]');
%Horizontal
v_hat = reshape(std(v_,1),[length(y),length(z)]);
subplot(132);
imagesc(y,z,v_hat');
set(gca,'YDir','normal')
colorbar;
title('std v [m/s]');
%Vertical
w_hat = reshape(std(w_,1),[length(y),length(z)]);
subplot(133);
imagesc(y,z,w_hat');
set(gca,'YDir','normal')
colorbar;
title('std w [m/s]');
%% Hub Height
time = 0:dt:size(u_,1)*dt-dt;
u_h = squeeze(u_(:,:,:,floor(size(u_,4)/2)));
v_h = squeeze(v_(:,:,:,floor(size(u_,4)/2)));
w_h = squeeze(w_(:,:,:,floor(size(u_,4)/2)));
figure(14)
subplot(131)
imagesc(y,time,u_h);
set(gca,'YDir','normal');
title('u (m/s)');
ylabel('time (s)');
colorbar;
subplot(132)
imagesc(y,time,v_h);
set(gca,'YDir','normal');
xlabel('lateral distance (m)');
title('v (m/s)');
colorbar;
subplot(133)
imagesc(y,time,w_h);
set(gca,'YDir','normal');
title('w (m/s)')
colorbar;
%% Print?
printDir = 'C:\Users\danza\OneDrive\Documents\CU Energy\Energy Talks';
if 0
Af_SaveFigure(12,'means',printDir);
Af_SaveFigure(14,'hubheigh',printDir);
end