-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWaveSedimentTransport.m
69 lines (40 loc) · 1.73 KB
/
WaveSedimentTransport.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
function [QsWslope,QsWon]=wavetransport(Hs,hwave,kwave,rhos,N,M,Tp,dx,ss,ws,hwavelim,fTide)
%Hs=Hs*sqrt(2);
g=9.81;
K=rhos*3600*24*(16*0.01*0.01/(15*pi*ss*g));
%the rhos*3600*24 is needed to give kg/m/day instead of m3/m/s
QsWslope=zeros(N,M);QsWon=zeros(N,M);
a=find(hwave>hwavelim & kwave>0 & Tp>0);
Wtrans=K/ws*( pi*Hs(a)/sqrt(2)./(Tp(a).*sinh(kwave(a).*hwave(a))) ).^5;%Wtrans=K/ws*Uwave(a).^5 ;
%Wtrans=Wtrans.*fTide(a);
%Downslope transport
QsWslope(a)=Wtrans/ws;
%
redSTRtubr=1;%reduction in streaming velocity in turbulent boundary layer
%Along wave trasnport
QsWon(a)=Wtrans.*3.*( redSTRtubr*5*Tp(a)./(4*(2*pi./kwave(a))) +3*Tp(a)./(4*(2*pi./kwave(a)).*(sinh(kwave(a).*hwave(a))).^2) );
% figure;imagesc(Tp)
% pause
% %shift the inputs: d and kwave
% angledir=sign(angleswell);
% tgangle=tan(abs(angleswell)/180*pi);
% for i=1:N
% s=floor(tgangle*i);
% QsWon(i,:)=circshift(QsWon(i,:),[0 s*angledir]);
% QsWslope(i,:)=circshift(QsWslope(i,:),[0 s*angledir]);
% end
%
% %QsWon=[QsWon(:,2:end) QsWon(:,end)];%leftorright
% %QsWon=[QsWon(:,1) QsWon(:,1:end-1)];leftorright
% %QsWon=(QsWon+[QsWon(1,:); QsWon(1:end-1,:)])/2;%makes it isntabilty
% QsWon=(QsWon+[QsWon(1,:); QsWon(1:end-1,:)])/2;%makes it isntabilty
% %QsWon=([QsWon(1,:); QsWon(1:end-1,:)]+[QsWon(2:end,:); QsWon(end,:)])/2;%makes it flat
%
% QsWslope=([QsWslope(1,:); QsWslope(1:end-1,:)]+[QsWslope(2:end,:); QsWslope(end,:)])/2;%makes it flat
% %QsWslope=([QsWslope(1,:); QsWslope(1:end-1,:)]);%makes it isntabilty
%
% for i=1:N
% s=floor(tgangle*i);
% QsWon(i,:)=circshift(QsWon(i,:),[0 -s*angledir]);
% QsWslope(i,:)=circshift(QsWslope(i,:),[0 -s*angledir]);
% end