Escolar Documentos
Profissional Documentos
Cultura Documentos
Sample program for solving Lid-driven cavity flow test using SIMPLE-algorithm
! solution of linear system of equations by Thomas algorithm modul
!Copyright (C) 2010 Michail Kirickov
!This program is
!modify it under
!as published by
!of the License,
Forward Elimination
Do 10 i = 2,NXmaxC-1
temp = Ap(i,j,nf) - Aw(i,j) * P(i-1)
Spp= Sp(i,j,nf) + As(i,j) * F(i,j-1,nf) + &
An(i,j) * F(i,j+1,nf)
P(i) = Ae(i,j) / temp
Q(i) = (Spp + Aw(i,j)*Q(i-1)) / temp
10
continue
Back Substitution
Do 20 i = NXmaxC-1,1,-1
F(i,j,nf) = P(i)*F(i+1,j,nf) + Q(i)
20
101 continue
continue
Forward Elimination
Do 32 i = 2,NXmaxC-1
temp = Ap(i,j,nf) - Aw(i,j) * P(i-1)
Spp= Sp(i,j,nf) + As(i,j) * F(i,j-1,nf) + &
An(i,j) * F(i,j+1,nf)
P(i) = Ae(i,j) / temp
Q(i) = (Spp + Aw(i,j)*Q(i-1)) / temp
32
continue
Back Substitution
Do 30 i = NXmaxC-1,2,-1
F(i,j,nf) = P(i)*F(i+1,j,nf) + Q(i)
30
continue
301 continue
!------------------------------------------------------------------------------------------------------------------------------------------------------Return
End