CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Main CFD Forum

fortran code - boundary layer - frank white

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   February 9, 2009, 15:16
Default fortran code - boundary layer - frank white
  #1
Ed
Guest
 
Posts: n/a
Hello CFD-programmers

In the appendix of the book "viscous fluid flow" [frank white], there is a fortran code that solves boundary layer problems, such as blasius, using runge-kutta gills method.

I copied the code and tried to compile it, but the fortran language is older than f77 and I really have no idea how to make it run.

Does anybody have a working code or can someone help me to transform the (short) code into fortran 77 ???

Please help!

(I apologize in case I violate any copyright policy by publishing the following lines. Please say if so.)

Notation:

N: NUMBER OF DIFFERENTIAL EQUATIONS TO BE SOLVED

Y: ARRAY OF N DEPENDENT VARIABLES

F: ARRAY OF THE N DERIVATIVES OF THE VARIABLES Y

X: INDEPENDENT VARIABLE

H: STEP SIZE DELTA-X

M: INDEX USED IN THE SUBROUTINE WHICH MUST BE SET TO ZERO BY THE PROGRAMMER BEFORE THE FIRST CALL

K: INTEGER FROM THE SUBROUTINE WHICH IS USED AS THE ARGUMNET OF A COMPUTED GO TO STATEMENT IN THE MAIN PROGRAM

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&

PROGRAM WHITE_SOLVER

DIMENSION Y(10), F(10)

READ X, N, XLIM, H, M, (Y(I), I = 1, N)

8 IF(X - XLIM)6,6,7

6 CALL RUNGE(N, Y, F, X, H, M, K)

GO TO (10,20), K

C BLASIUS: f''' + f*f'' = 0

10 F(1) = -Y(1)*Y(3)

F(2) = Y(1)

F(3) = Y(2)

GO TO 6

c$$$C BLASIUS: f''' + f*f'' = 0

c$$$C POHLHAUSEN: theta'' + Pr*f*theta' = 0

c$$$ 10 F(1) = -Y(1)*Y(3)

c$$$ F(2) = Y(1)

c$$$ F(3) = Y(2)

c$$$ F(4) = Y(3)

c$$$ F(5) = EXP(-PR*Y(4))

c$$$ GO TO 6

20 WRITE X, (Y(I), I = 1, N)

GO TO 8

7 STOP

END

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&

SUBROUTINE RUNGE(N, Y, F, X, H, M, K)

DIMENSION Y(10), F(10), Q(10)

M = M + 1

GO TO (1, 4, 5, 3, 7), M

1 DO 2 I = 1, N

2 Q(I) = 0.

A = 0.5

GO TO 9

3 A = 1. + SQRT(2.)/2.

C A = 1.7071067811865475244

4 X = X + 0.5*H

5 DO 6 I = 1, N

Y(I) = Y(I) + A*(F(I)*H - Q(I))

6 Q(I) = 2.*A*H*F(I) + (1. - 3.*A)*Q(I)

A = 1. - SQRT(2.)/2.

C A = 0.2928932188134524756

GOTO 9

7 DO 8 I = 1, N

8 Y(I) = Y(I) + H*F(I)/6. - Q(I)/3.

M = 0

K = 2

GO TO 10

9 K = 1

10 RETURN

END

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&

  Reply With Quote

Old   February 12, 2009, 18:30
Default Re: fortran code - boundary layer - frank white
  #2
Ananda Himansu
Guest
 
Posts: n/a
Except for the "READ X" needing to be replaced with "READ *, X" or "READ (*,*) X", nothing really springs out at me. I thought things like computed GOTOs and arithmetic IFs were obsolescent in F77 but not obsolete until F90, though I could be wrong. Why don't you tell the readers what the F77 compiler barfs at, rather than asking for the whole code to be modernized? This way, no one will have to admit to being old enough to remember FORTRAN IV. I assume you know how to arrange characters in the first six columns for fixed format, and that the way they appear here is only because of HTML peculiarities.
  Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[GAMBIT] 3D boundary layer and meshing problem in GAMBIT 2.4.6 prashanthreddyh ANSYS Meshing & Geometry 1 December 20, 2011 01:35
Comparison between C/C++ and Fortran? rick Main CFD Forum 45 September 6, 2011 00:52
[GAMBIT] problems in boundary layer yubaibai88 ANSYS Meshing & Geometry 8 April 19, 2010 21:07
2D Boundary Layer Development in CFX11 Chris Basciano CFX 1 August 28, 2008 16:15
free 2D boundary layer code peter schaffarczyk Main CFD Forum 0 March 24, 1999 04:05


All times are GMT -4. The time now is 21:45.