MATLAB Examples

Example

The uniform-shear model is computed with the parameters used in Mann (1998) [1] and compared to the spectra from the Great belt experiment, which are displayed in Mann (1994). The three parameters of the uniform-shear model are:

  1. $\alpha \epsilon^{2/3}$, referred to as "alphaEps "
  1. $\Gamma$, referred to as "GAMMA"
  1. $L$, referred to as "L"

References: [1] Mann, J. (1994). The spatial structure of neutral atmospheric surface-layer turbulence. Journal of fluid mechanics, 273, 141-168.

Contents

Initialisation

Basic parameter definitions

clearvars;close all;clc;
U = 22.3; % Mean wind speed (m/s)
z = 70; % altitude (m)
GAMMA = 3.2;
L = 61; % m
alphaEps =0.11; % m^(4/3)/s^2

% frequency steps
N1=100;
k2max = log10(100);
k3max = log10(100);
k2min = -6;
k3min = -6;
% frequency vector
f = logspace(log10(1/3600),log10(10),N1);
%wavenumber
k1 = 2*pi.*f./U;

Computation of the uniform shar model

% Compute Mann spectral tensor
tic
[PHI,k2,k3,k11,k2_log,k3_log] = MannTurb(alphaEps,GAMMA,L,'N1',N1,'N2',100,'N3',100,'k2max',k2max,'k3max',k3max,'k2min',k2min ,'k3min',k3min);
toc
Elapsed time is 10.096575 seconds.

Computation the corresponding single point spectra

FM= squeeze(trapz(k3_log,trapz(k2_log,PHI,2),3));
% Single point spectra is chosen
FM = FM(end-N1+1:end,:,:);
% set Suv = 0 and Svw = 0
FM(:,1,2)=0; FM(:,2,1)=0; FM(:,2,3)=0; FM(:,3,2)=0;

Comparison with the wind spectra from the great belt bridge experiment

% Load the spectral data estimated with a digitalization software from Mann (1994), so the resolution is not perfect
load('GreatBeltSpectra.mat')

clf;close all;
figure
hold on;box on;
plot(k11,k11'.*FM(:,1,1),'k',k11,k11'.*FM(:,2,2),'r',k11,k11'.*FM(:,3,3),'b',k11,k11'.*FM(:,1,3),'g');
plot(fu1,Su1,'k.--',fv1,Sv1,'r.--',fw1,Sw1,'b.--',fuw1,Suw1,'g.--')
legend('Computed (u)','Computed (v)','Computed (w)','Computed (uw)','full-scale (u)','full-scale (v)','full-scale (w)','full-scale (uw)','location','northeast')
set(gca,'Xscale','log')
ylim([-0.2,0.5])
xlim([0.0005,0.5])
xlabel('k_{1} (m^{-1}) ')
ylabel('k_{1} Fij, (i,j) = (u,v,w)');
grid on
grid minor
set(gcf,'color','w')

Computation of the wind co-coherence

Warning: Due to the particular numerical implementation, there exist
potentialy large numerical errors at high frequency, which have been put as "nan" in the
present code.
% lateral separation
dy = 15; % lateral separation (m)
dz = 0; % vertical separation (m)

tic
[newK1,coh] = MannCoherence(PHI,k11,k2,k3,dy,dz,k2_log,k3_log);
toc

figure
hold on;box on;
plot(newK1.*dy,squeeze(coh(1,1,:)),'k',newK1.*dy,squeeze(coh(2,2,:)),'r',newK1.*dy,squeeze(coh(3,3,:)),'b')
xlabel('k_{1} dy ')
ylabel('co-coherence');
legend('u','v','w')
grid on
grid minor
set(gcf,'color','w')
xlim([0,2])

% vertical separation
dy = 0; % lateral separation (m)
dz = 20; % vertical separation (m)

tic
[newK1,coh] = MannCoherence(PHI,k11,k2,k3,dy,dz,k2_log,k3_log);
toc

figure
hold on;box on;
plot(newK1.*dz,squeeze(coh(1,1,:)),'k',newK1.*dz,squeeze(coh(2,2,:)),'r',newK1.*dz,squeeze(coh(3,3,:)),'b')
xlabel('k_{1} dz ')
ylabel('co-coherence');
legend('u','v','w')
grid on
grid minor
set(gcf,'color','w')
xlim([0,2])
Elapsed time is 11.211229 seconds.
Elapsed time is 11.464289 seconds.