CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Main CFD Forum (http://www.cfd-online.com/Forums/main/)
-   -   fortran Code for a boundary layer on a plate (http://www.cfd-online.com/Forums/main/115691-fortran-code-boundary-layer-plate.html)

shahrbanoo April 4, 2013 16:16

fortran Code for a boundary layer on a plate
 
Hi...
I'm trying to undersatnd this code that our teacher gave us... he said to change one of the boundary conditions and then see how the result changes. This code's title is "LAMINAR BOUNDARY LAYER FLOW OVER AN ISOTHERMAL FLAT PLATE" . I don't understand what H, G, FPIN,... and other parameters, are. cause It's the first time I'm using a fortran code. I would really appreciate it if someone help me... .
I put the Code in the next post...

shahrbanoo April 4, 2013 16:20

because it is too long,I have to split it into two parts:
!************************************************* ***********************
!***** *****
!***** SIMPLATE *****
!***** ________ *****
!***** *****
!************************************************* ***********************
!***** *****
!***** THIS PROGRAM GIVES SIMILARITY SOLUTION RESULTS FOR *****
!***** *****
!***** LAMINAR BOUNDARY LAYER FLOW OVER AN ISOTHERMAL FLAT PLATE *****
!***** *****
!************************************************* ***********************
!*
DIMENSION T(1500),F(1500),G(1500),H(1500),HGUESS(1500),FPIN(1500),P(1500)
!*
!************************************************* **********************
!*
OPEN(UNIT=1,FILE='SIMPLAPR.DAT',status='new')
OPEN(UNIT=2,FILE='SIMPLAPL.DAT',status='new')
!************************************************* **********************
WRITE(6,4250)
WRITE(6,4290)
WRITE(6,4260)
READ(5,*) PR
WRITE(6,4250)
DETA=0.01
N=1500
WRITE(1,4290)
WRITE(1,4270) PR
!************************************************* **********************
! N=NUMBER OF GRID POINTS
! PR=PRANDTL NUMBER
! DETA=ETA STEP SIZE
END

shahrbanoo April 4, 2013 16:21

!************************************************* **********************
INTR=1
HGUESS(INTR)=1.0
100 F(1)=0.0
G(1)=0.0
H(1)=HGUESS(INTR)
DO 1000 I=2,N
F(I)=F(I-1)+G(I-1)*DETA
G(I)=G(I-1)+H(I-1)*DETA
H(I)=H(I-1)-F(I-1)*H(I-1)*DETA/2.0
1000CONTINUE
FPIN(INTR)=G(N)
IF(INTR.EQ.1)THEN
INTR=2
HGUESS(INTR)=HGUESS(1)-0.000001
GO TO 100
ELSE
IF(INTR.GT.200)GO TO 200
IF(ABS(1.0-FPIN(INTR)).LT.0.0000005)GO TO 300
INTR=INTR+1
DGUESS=+(FPIN(INTR-1)-1.0)*(HGUESS(INTR-1)-HGUESS(INTR-2))/(FPIN(INTR-2)-FPIN(INTR-1))
HGUESS(INTR)=HGUESS(INTR-1)+DGUESS
GO TO 100
ENDIF
200WRITE(6,2000)
GO TO 7777
300WRITE(6,3000) INTR
7777CONTINUE
DO 5000 I=1,N
P(I)=H(I)**PR
5000CONTINUE
T(1)=0.0
DO 6000 I=2,N
T(I)=T(I-1)+DETA*(P(I)+P(I-1))/2.0
6000CONTINUE
WRITE(1,4500)
DO 7000 I=1,N
T(I)=T(I)/T(N)
ETA=(I-1)*DETA
WRITE(1,4000) ETA,F(I),G(I),H(I),T(I)
WRITE(2,5500) ETA,G(I),T(I)
7000CONTINUE
TGRAD=(T(2)-T(1))/DETA
WRITE(1,4280) TGRAD
STOP
CLOSE(1)
CLOSE(2)
2000FORMAT(' FAILURE TO CONVERGE')
3000FORMAT(' CONVERGENCE IN ',I5,' ITERATIONS')
4000FORMAT(5F10.6)
4250FORMAT(////)
4260FORMAT(' INPUT THE VALUE OF THE PRANDTL NUMBER THEN ')
4270FORMAT(//,' PRANDTL NUMBER = ',F12.3,//)
4280FORMAT(//,' THETA GRADIENT AT WALL = ',F12.5)
4290FORMAT(/,' SIMILARITY SOLUTION FOR FLOW OVER ISOTHERMAL PLATE',//,'Output written to files SIMPLAPR.DAT and SIMPLAPL.DAT',//)
4500FORMAT(' ETA F dF/DETA D2F/DETA2 THETA')
5500FORMAT(F10.6,',',F10.6,',',F10.6)


All times are GMT -4. The time now is 18:46.