-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcalcAlpha.m
68 lines (49 loc) · 1.27 KB
/
calcAlpha.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
function [dsint,kint,alpha] = calcAlpha(ke,dltk,keta,nui,u,tol)
%set wavenumber as centre of bin
%for m = 1:nmM
% km(m) = kmi+(kmx-kmi)/nmM*(mn(m)-0.5);
%end
%dltk = (max(km)-min(km))/(nmM-1);
k = dltk/2;
kint = 0;
dsint = 0;
while k<keta
bfk = k/ke;
expc = exp(-2*(k/keta)^2);
Ek = u^2/ke*bfk^4/(1+bfk^2)^(17/6)*expc;
kint = kint+Ek*dltk;
dsint = dsint+Ek*dltk*k^2;
k = k+dltk;
end
%{
while 1
bfk = k/ke;
expc = exp(-2*(k/keta)^2);
Ek = u^2/ke*bfk^4/(1+bfk^2)^(17/6)*expc;
int = int+Ek*dltk;
dissint = dissint+Ek*dltk*k^2;
resE = 2/3*k*Ek;
if resE/int<tol
break
end
k = k+dltk;
end
%}
while 1
bfk = k/ke;
expc = exp(-2*(k/keta)^2);
Ek = 1/ke*bfk^4/(1+bfk^2)^(17/6)*expc;
kint = kint+Ek*dltk;
dsint = dsint+Ek*dltk*k^2;
%resk = keta*ke^(2/3)/4*exp(-2*(k/keta)^2)/k^(8/3);
resk = 2/3*k*Ek;
if resk/kint<tol
break
end
k = k+dltk;
end
tke = 3/2*u^2;
alpha = tke/kint;
dsint = 2*nui*alpha*dsint;
kint = alpha*kint;
end