Skip to content

Commit 850f37a

Browse files
authored
Add files via upload
1 parent 816c76b commit 850f37a

4 files changed

Lines changed: 34 additions & 2 deletions

File tree

Example1.mlx

0 Bytes
Binary file not shown.

Example2.mlx

-649 Bytes
Binary file not shown.

Example3.mlx

127 KB
Binary file not shown.

windSimFast.m

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@
2828
% 'Suw': vector [Nm x 1] corresponding to the CPSD the u and w components
2929
% 'Svw': vector [Nm x 1] corresponding to the CPSD the v and w components
3030
% 'cohModel': string: the coherence model (so far, only 'Davenport' exist)
31+
% 'quadCoh_Cu' are decay coeficients for the quad-coherence of the u component.
32+
% Example: quadCoh_Cu = [5 10];
33+
% 'quadCoh_Cv' are decay coeficients for the quad-coherence of the w component.
34+
% Example: quadCoh_Cv = [5 10];
35+
% 'quadCoh_Cw' are decay coeficients for the quad-coherence of the w component.
36+
% Example: quadCoh_Cw = [5 10];
3137
%
3238
% References:
3339
% [1] Shinozuka, M., & Deodatis, G. (1991).
@@ -43,11 +49,14 @@
4349
% the ground in high winds.
4450
% Quarterly Journal of the Royal Meteorological Society, 87(372), 194-211.
4551
%
46-
% Author: E. Cheynet - UiS - last modified : 13-05-2020
52+
% Author: E. Cheynet - UiB - last modified : 12-06-2020
4753

4854
%% Input parser
4955
p = inputParser();
5056
p.CaseSensitive = false;
57+
p.addOptional('quadCoh_Cu',[]); % optional coefficients used for the quad-coherence
58+
p.addOptional('quadCoh_Cv',[]); % optional coefficients used for the quad-coherence
59+
p.addOptional('quadCoh_Cw',[]); % optional coefficients used for the quad-coherence
5160
p.addOptional('cohModel','Davenport');
5261
p.addOptional('Suw',zeros(size(Su)));
5362
p.addOptional('Svw',zeros(size(Su)));
@@ -56,7 +65,9 @@
5665
Suw = p.Results.Suw ;
5766
Svw = p.Results.Svw ;
5867
cohModel = p.Results.cohModel;
59-
68+
quadCoh_Cu = p.Results.quadCoh_Cu;
69+
quadCoh_Cv = p.Results.quadCoh_Cv;
70+
quadCoh_Cw = p.Results.quadCoh_Cw;
6071
%% Create the structure "nodes"
6172
Nm = numel(Y(:)); % number of nodes in the grid, equal to Nyy*Nzz
6273
M = 3*Nm; % u,v and w are generated together, requiring 3 times more points than Nm (u,v and w are not necessarily independant)
@@ -91,6 +102,23 @@
91102
else
92103
error('In the present version, no other coherence model than the Davenport model has been implemented');
93104
end
105+
106+
107+
if ~isempty(quadCoh_Cu)
108+
quadCohU = getQuadCoh(meanU,dz,f(ii),quadCoh_Cu); % compute the quad-coherence
109+
cohU = cohU + 1i.*quadCohU;
110+
end
111+
112+
if ~isempty(quadCoh_Cv)
113+
quadCohV = getQuadCoh(meanU,dz,f(ii),quadCoh_Cv); % compute the quad-coherence
114+
cohU = cohU + 1i.*quadCohV;
115+
end
116+
117+
if ~isempty(quadCoh_Cw)
118+
quadCohW = getQuadCoh(meanU,dz,f(ii),quadCoh_Cw); % compute the quad-coherence
119+
cohU = cohU + 1i.*quadCohW;
120+
end
121+
94122
Suu = sqrt(Su(:,ii)*Su(:,ii)').*cohU;
95123
Svv = sqrt(Sv(:,ii)*Sv(:,ii)').*cohV;
96124
Sww = sqrt(Sw(:,ii)*Sw(:,ii)').*cohW;
@@ -127,4 +155,8 @@
127155
% separations
128156
coh = exp(-sqrt(ay.^2+az.^2).*f./meanU);
129157
end
158+
function [Qu] = getQuadCoh(meanU,dz,f,C)
159+
dummy = -tril(ones(size(dz)),-1) + triu(ones(size(dz)),1);
160+
Qu = dummy.*(C(1).*f./meanU.*dz).*exp(-C(2).*f./meanU.*dz);
161+
end
130162
end

0 commit comments

Comments
 (0)