Surface gravity water waves 157
% Initialization of variable;
for i=1:nx
for j=1:ny
h(i,j)=0;
z(i,j)=0;
zo(i,j)=0;
u(i,j)=0;
v(i,j)=0;
sxx(i,j)=0;
syy(i,j)=0;
sxy(i,j)=0;
hrms(i,j)=0;
end
end
ar=0;
al=0;
ao=0;
au=0;
chk=0;
% Water depth data;
for j=1:ny
for i=2:nx-1
h(i,j)=ho-j/ny*8;
end
end
% Definition of the breakwater location and geometry;
for i=nx/4:3*nx/4
h(i,ny/2.5)=0;
end
c1=sqrt(g*h(2,1));
b=theta*pi/180;
elo=c1*T/sin(b);
phi=2*pi*Dd/elo;
% Estimation of eddy coefficient in wave breaking zone;
for j=1:ny
for i=1:nx
if h(i,j)> 2.5*a
ed(i,j)=0;
else
ed(i,j)=ec*h(i,j)*sqrt(g*h(i,j));
end
end
end
% Main program;
for k=1:nt
% Open sea boundary condition: Incident and radiating
waves;
for i=1:nx
zr1=z(i,1)-a*sin(2*pi*((k-1)*Dt/T)+(i-1)*phi);
zr2=z(i,2)-a*sin(2*pi*((k-1)*Dt-Dd/c1)/T+(i-1)*phi);
Précédent

- 170/302

Suivant