234 Computational Modelling in Hydraulic and Coastal Engineering
kk=1.0;
mm=1.0;
Dx=20;
Dt=360;
nx=50;
nt=7200;
% Wave height data file;
load a.mat
% Angle of incident wave data file;
load fo.mat
% Location of the groin;
load N.mat
% Configuration of original coastline;
load yo.mat
for i=1:nx
y(i)=yo(i);
end
% Main program;
for k=1:nt
% Computation of the wave breaking angle;
for i=2:nx-1
f(i)=mm*fo(i)-atan((y(i)-y(i-1))/Dx);
end
% Computation of the longshore transport;
for i=2:nx-1
if N(i) ~=1
q(i)=at*(kk*a(i))^m*sin(2*f(i));
end
end
q(1)=2*q(2)-q(3);
q(nx)=2*q(nx-1)-q(nx-2);
% Estimation of the new coastline;
for i=1:nx-1
y(i)=y(i)-Dt/Dx*(q(i+1)-q(i))/(2*H);
% Consideration of the coast (Groin; Breakwater;
Coastline)
if N(i)== 2 && y(i)
y(i)=yo(i);
elseif N(i)== 3 && y(i)>yf
y(i)=yf;
end
end
end
par=find(N== 1);
x_groin=par-0.4;
i=1:nx;
yplot=y(i);
plot(i,yplot,'b','Linewidth',1.5)
text(35,-30,'downstream')
text(10,50,'upstream')
kk=1.0;
mm=1.0;
Dx=20;
Dt=360;
nx=50;
nt=7200;
% Wave height data file;
load a.mat
% Angle of incident wave data file;
load fo.mat
% Location of the groin;
load N.mat
% Configuration of original coastline;
load yo.mat
for i=1:nx
y(i)=yo(i);
end
% Main program;
for k=1:nt
% Computation of the wave breaking angle;
for i=2:nx-1
f(i)=mm*fo(i)-atan((y(i)-y(i-1))/Dx);
end
% Computation of the longshore transport;
for i=2:nx-1
if N(i) ~=1
q(i)=at*(kk*a(i))^m*sin(2*f(i));
end
end
q(1)=2*q(2)-q(3);
q(nx)=2*q(nx-1)-q(nx-2);
% Estimation of the new coastline;
for i=1:nx-1
y(i)=y(i)-Dt/Dx*(q(i+1)-q(i))/(2*H);
% Consideration of the coast (Groin; Breakwater;
Coastline)
if N(i)== 2 && y(i)
elseif N(i)== 3 && y(i)>yf
y(i)=yf;
end
end
end
par=find(N== 1);
x_groin=par-0.4;
i=1:nx;
yplot=y(i);
plot(i,yplot,'b','Linewidth',1.5)
text(35,-30,'downstream')
text(10,50,'upstream')
