مهندسی آلودگی هوا

کانوکشن دو بعدی.

MODULE C
IMPLICIT NONE
DOUBLE PRECISION, ALLOCATABLE::X(:),Y(:),CONVECT(:,:,:)
DOUBLE PRECISION::L,H,TOTAL,DX,DY,DT,U,V
CHARACTER(4)::KK
INTEGER::I,J,K,M,N,NSTEP
END MODULE
PROGRAM CONVECTER
USE C
IMPLICIT NONE
WRITE(*,*) 'PLESE ENTER L,N,H,M,TOTAL,NSTEP,U,V'
READ(*,*) L,N,H,M,TOTAL,NSTEP,U,V
ALLOCATE(X(N),Y(M),CONVECT(N,M,NSTEP))
CALL MESH
CALL INI
CALL BOUND
CALL TEM
CALL PLOT
END PROGRAM


SUBROUTINE MESH ()
USE C
IMPLICIT NONE
DX=L/(N-1)
DY=H/(M-1)
DT=TOTAL/NSTEP
DO I=1,N
X(I)=(I-1)*DX
END DO
DO J=1,M
Y(J)=(J-1)*DY
END DO
END SUBROUTINE

 

SUBROUTINE INI()
USE C
IMPLICIT NONE
DO J=2,M
DO I=2,N
CONVECT(I,J,1)=0
END DO
END DO
END SUBROUTINE

SUBROUTINE BOUND()
USE C
IMPLICIT NONE
DO K=1,NSTEP
DO J=2,M
CONVECT(1,J,K)=0.4
CONVECT(N,J,K)=0.4
END DO
END DO
DO K=1,NSTEP
DO I=1,N
CONVECT(I,1,K)=0.4
CONVECT(I,M,K)=0.4
END DO
END DO
END SUBROUTINE


SUBROUTINE TEM()
USE C
IMPLICIT NONE
DO K=1,NSTEP-1
DO J=2,M-1
DO I=2,N-1
CONVECT(I,J,K+1)=-(U/(DX*2))*(CONVECT(I,J,K)-CONVECT(I-1,J,K))-(V/(DY*2))*(CONVECT(I,J,K)-CONVECT(I,J-1,K))+CONVECT(I,J,K)
END DO
END DO
END DO
END SUBROUTINE


SUBROUTINE PLOT()
USE C
IMPLICIT NONE
DO K=1,NSTEP-1
WRITE(KK,1) 1000+K
1 FORMAT (I4)
OPEN(1,FILE="CONVECT" //TRIM(KK)//".PLT")
WRITE(1,*) "VARIABLE X,Y,CONVECT ZONE I=" , N ,"J=" , M
DO J=1,M
DO I=1,N
WRITE(1,*) X(I),Y(J),CONVECT(I,J,K)
END DO
END DO
END DO
END SUBROUTINE

   + مصطفی کلهر ; ۱٠:٢۳ ‎ب.ظ ; دوشنبه ٢۱ اسفند ۱۳٩۱
comment نظرات ()