160 Computational Modelling in Hydraulic and Coastal Engineering
sxx(i,j)=sxx(i,j)+h(i,j)*u(i,j)^2+g/2*z
(i,j)^2;
syy(i,j)=syy(i,j)+h(i,j)*v(i,j)^2+g/2*z
(i,j)^2;
sxy(i,j)=sxy(i,j)+h(i,j)*u(i,j)*v(i,j);
end
end
end
% Computation of the rms wave height;
for j=1:ny
for i=1:nx
hrms(i,j)=hrms(i,j)+z(i,j)^2;
end
end
end
index=k
end
for j=1:ny
for i=1:nx
hrms(i,j)=sqrt(hrms(i,j)/nx*2)*2;
if h(i,j)<0.1
hrms(i,j)=4;
end
end
end
plot(1:nt,zmid,'k','Linewidth',1.5)
xlabel('Time x 10^-^1 [s]')
ylabel('Free-surface oscillation : Midpoint of solution
domain [m]')
figure
i=1:nx;
j=1:ny;
fplot=z(i,j);
fplot1=hrms(i,j);
surf(j,i,fplot)
figure
surf(j,i,fplot1)
figure
[i,j]=meshgrid(1:1:nx,1:1:ny);
pcolor(i,j,h'); hold on;
%colormap(gray(2))
shading flat
% Plotting at every node;
% quiver(i,j,u',v')
% Plotting at every four points;
quiver(i(1:4:end,1:4:end),j(1:4:end,1:4:end),(u(1:4:end,1:4:
end))',(v(1:4:end,1:4:end))','Color','w'); hold on;
Précédent

- 173/302

Suivant