if G1=1 then i1:=1 else i1:=0;
for j:=1 to Ny do begin // По всем строкам
// Вычисляем прогоночные коэффициенты
{if kind=kOmModel then with OmPsiModel do
G^[0,j] := -(Psi[0,j]-2*Psi[1,j]+Psi[2,j])/h/h;}
case G1 of
1: begin L[1]:=0; M[1]:=G^[0,j]; end;
2: begin L[1]:=1; M[1]:=0; end;
end;
for i:=1 to Nx do if Cells[i,j]=kAir then begin
if Cells[i-1,j]=kBuildings then begin
L[i]:=0;
if kind=kOmModel then
with OmPsiModel do M[i]:=(Psi[i,j]-Psi[i+1,j])/h/h
else M[i]:=0;
end;
if Ux[i,j]>0 then aij := -taumk_2h*Ux[i,j]-taualfamk_2hh
else aij := -taualfamk_2hh;
bij := 1 + taumk_2h*Abs(Ux[i,j]) + 2*taualfamk_2hh;
if Ux[i,j]>0 then cij := -taualfamk_2hh
else cij := taumk_2h*Ux[i,j]-taualfamk_2hh;
fij := G^[i,j];
if meth = kVarDirectsMeth then begin // Метод перем.напр.
if Uy[i,j]>0 then
fij := fij - tau/2 * Uy[i,j] * (G^[i,j]-G^[i,j-1])/h
+ taualfamk_2hh/mk * (G^[i,j+1]+G^[i,j-1]-2*G^[i,j])
else fij := fij - tau/2 * Uy[i,j]*(G^[i,j+1]-G^[i,j])/h
+ taualfamk_2hh/mk * (G^[i,j+1]+G^[i,j-1]-2*G^[i,j]);
if kind = kUModel then with PModel do
if res = 0 then
fij := fij -tau/2 * (P[i+1,j+1]+P[i+1,j-1]
-P[i-1,j+1]-P[i-1,j-1]) /4/h/kRo
else fij := fij -tau/2 * (P[i+1,j+1]+P[i-1,j+1]
-P[i+1,j-1]-P[i-1,j-1]) /4/h/kRo;
end;
L[i+1] := -cij/(bij+aij*L[i]);
M[i+1] := (fij-aij*M[i])/(bij+aij*L[i]);
end;
// Вычисляем новое значение G
{if kind=kOmModel then with OmPsiModel do
G^[Nx+1,j] := G^[Nx,j];//-(Psi[Nx+1,j]-2*Psi[Nx,j]+Psi[Nx-
1,j])/h/h;}
case G3 of
1: NewG[Nx+1,j]:=G^[Nx+1,j];
2: NewG[Nx+1,j]:=-M[Nx+1]/(L[Nx+1]-1);
3: NewG[Nx+1,j] := -((L[Nx]-2)*M[Nx+1]+M[Nx]) / ((L[Nx]-
2)*L[Nx+1]+1);
end;
i:=Nx;
while i>=i1 do begin
if (Cells[i,j]=kBuildings) and (Cells[i-1,j]=kAir) then
if kind<>kOmModel then NewG[i,j]:=0
else with OmPsiModel do
NewG[i,j] := (Psi[i-1,j]-Psi[i-2,j])/h/h;
if Cells[i,j]=kAir then