Flow in porous media 187
% Definition of the well location and head;
% n at the well site indicates flow in m^3/hr;
n(nxm,nym)=-400;
for i=1:nx
for j=1:ny
hn(i,j)=h(i,j);
end
end
chk=0;
% Main program;
for k=1:nt
for j=1:ny
for i=1:nx
if n(i,j)>0
% chk is a number used for computational
% purposes;
chk=1000;
end
if chk ~=1000
fo=h(i,j+1);
fu=h(i,j-1);
fr=h(i+1,j);
fl=h(i-1,j);
% Impervious boundary conditions;
if n(i,j+1)==1
fo=h(i,j);
end
if n(i,j-1)==1
fu=h(i,j);
end
if n(i+1,j)==1
fr=h(i,j);
end
if n(i-1,j)==1
fl=h(i,j);
end
% Constant head boundary conditions;
if n(i,j+1)>1
fo=n(i,j+1);
end
if n(i,j-1)>1
fu=n(i,j-1);
end
if n(i+1,j)>1
fr=n(i+1,j);
end
if n(i-1,j)>1
fl=n(i-1,j);
end
dr=fr-zb(i+1,j);
% Definition of the well location and head;
% n at the well site indicates flow in m^3/hr;
n(nxm,nym)=-400;
for i=1:nx
for j=1:ny
hn(i,j)=h(i,j);
end
end
chk=0;
% Main program;
for k=1:nt
for j=1:ny
for i=1:nx
if n(i,j)>0
% chk is a number used for computational
% purposes;
chk=1000;
end
if chk ~=1000
fo=h(i,j+1);
fu=h(i,j-1);
fr=h(i+1,j);
fl=h(i-1,j);
% Impervious boundary conditions;
if n(i,j+1)==1
fo=h(i,j);
end
if n(i,j-1)==1
fu=h(i,j);
end
if n(i+1,j)==1
fr=h(i,j);
end
if n(i-1,j)==1
fl=h(i,j);
end
% Constant head boundary conditions;
if n(i,j+1)>1
fo=n(i,j+1);
end
if n(i,j-1)>1
fu=n(i,j-1);
end
if n(i+1,j)>1
fr=n(i+1,j);
end
if n(i-1,j)>1
fl=n(i-1,j);
end
dr=fr-zb(i+1,j);
