38 Computational Modelling in Hydraulic and Coastal Engineering
f(k1,k2)=(f(k1+1,k2)+f(k1-1,k2)+f(k1,k21)+f(k1,k2+1)+S(k1,k2))/4;
end
end
% Von Neumann boundary conditions at the upper and
lower conduit walls;
for j1=1:jm
f(1,j1)=f(2,j1);
f(im,j1)=f(im-1,j1);
end
% Von Neumann boundary conditions at the end wall of
the conduit;
for j2=1:(is-3)
f(j2,jm)=f(j2,jm-1);
end
for j2=is+3 : im
f(j2,jm)=f(j2,jm-1);
end
% Estimation of the error between two consecutive
iterations;
fnew=f;
fer=fnew-fold;
end
i=1:k1+1;
j=1:k2+1;
fpp=fnew(i,j);
error=fer(i,j);
% Plot of the potential distribution;
surf(j,i,fpp);
figure
% Plot of the computational error distribution;
surf(j,i,error);
PROBLEM 3.1
Solve the same problem by making the following suggested changes while
keeping the rest of the data constant:
1. Change the downstream boundary so that the potential is zero in sections EC and DF, while there is no flux in section CD (Figure 3.6), and
plot the results.
2. Add a negative potential source of SN = –10 at the point with coordinates (15, 45), and plot the results.
3. For the sections EC and DF, define the Von Neumann relation as
∂
∂
=
f
n x
0 5
. and plot the results.
4. Knowing that the velocities are defined as u
f
x
x =
∂
∂
and u
f
y
y =
∂
∂
, calculate the velocity field and plot the results.
Précédent

- 51/302

Suivant