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).
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
4955p = inputParser();
5056p.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
5160p .addOptional(' cohModel' ,' Davenport' );
5261p .addOptional(' Suw' ,zeros(size(Su )));
5362p .addOptional(' Svw' ,zeros(size(Su )));
5665Suw = p .Results .Suw ;
5766Svw = p .Results .Svw ;
5867cohModel = 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"
6172Nm = numel(Y(: )); % number of nodes in the grid, equal to Nyy*Nzz
6273M = 3 * Nm ; % u,v and w are generated together, requiring 3 times more points than Nm (u,v and w are not necessarily independant)
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 ;
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
130162end
0 commit comments