Shooting Method
Shooting Method
Shooting Method
Before we present the computer program, we first describe Keller's shooting method
[1], which replaces the traditional trial-and-error searching technique used in a
conventional shooting method by Newton's method; this generally provides quadratic
convergence of the iterations and decreases the computational time. According to this
method, as in the finite-difference method discussed in Section 4.2, Eq. (4.2.5) is
replaced by a system of three first-order ordinary differential equations. Denoting the
unknowns f ′ and f ′′ by u and v , respectively (as in Section 4.5), we write the
Falkner-Skan equation and its boundary conditions as a first-order system,
f′=u (1.1a)
u′ = v (1.1b)
m +1
v′ = − fv − m(1 − u 2 ) (1.1c)
2
f (0) = 0, u (0) = 0 (1.2a)
u (η e ) = 1 (1.2b)
The numerical integration of the above system of equations requires v(0) , a quantity
which is an unknown at the start of the integration process. Its value, denoted by s ,
v(0) = s (1.3)
must be determined such that the solution of the Falkner-Skan equation satisfies all of its
boundary conditions given by Eq. (1.2a). Thus an iteration procedure is needed. If a
solution of the Falkner-Skan equation is denoted by [ f (η , s ), u (η , s ), v(η , s )] , then a value
of s may be found such that
u (η e , s ) − 1 ≡ φ ( s ) = 0 (1.4)
To solve Eq. (1.4), we employ Newton's method and define the successive values of
ν
s by
ν +1 ν φ ( sν ) ν u (η e , sν ) − 1
s =s − ≡s − ν = 0,1, 2,... (1.5)
[dφ ( sν ) / ds ] [∂u (η e , sν ) / ∂s ]
To determine the derivative of u with respect to s , Eqs. (1.1), (1.2a) and (1.3) are
differentiated to obtain the following linear differential equations, known as the
variational equations, for Eq. (1.1):
F′ = U (1.6a)
′
U =V (1.6b)
6/12/2004 4:34 PM 1
m +1
V′ = − ( fV + vF ) + 2muU (1.6c)
2
and the initial conditions,
F (0) = 0, U (0) = 0, V (0) = 1 (1.7)
Here
∂f ∂u ∂v
F (η , s ) ≡ , U (η , s) ≡ , V (η , s) ≡ (1.8)
∂s ∂s ∂s
Once a solution of the Falkner-Skan equation is obtained subject to Eqs. (1.2a) and
(1.3), and a solution of the variational equations (1.6), subject to Eqs. (1.7), u (η e , sν ) and
U (η e , sν ) is known, then the next approximation to v(0) , namely sν +1 can be computed
from Eq. (1.5). The solution procedure is repeated until convergence when
| sν +1 − sν |< ε (1.9)
where ε is a convergence parameter.
Computer Program
We now describe the computer program for solving the Falkner-Skan equation for a
specified value of m using the shooting method discussed above. While several
integration methods can be used to solve the initial value problem, here, because of its
simplicity, a fourth-order Runge-Kutta method is used.
The computer program consists of a main program containing the logic of the
computations which has three subroutines: STNDRD, VARS and RKM. The following is
a description of the computer program and its subroutines.
MAIN Contains the input data, the boundary-layer grid, the logic of the
numerical scheme, the number of iterations performed, and the output,
which consists of the profiles f , u , v as a function of η and the
dimensionless displacement and momentum thickness parameters δ 1∗
and θ1 , respectively
ηe
δ 1∗ = ∫ (1 − f ′)dη = η e − f e
0
ηe
θ1 = ∫ f ′(1 − f ′)dη
0
The input data are similar to the input data described for the finite-difference
boundary-layer method BLP2 in Program 3, with NXT, ITMAX, ∆ X, S(1), ETAINF,
EPS corresponding to the total number of x -stations, maximum iteration number, ∆η -
increment, v(0) = S (1) , η e and convergence criterion, which is usually taken as 10 −5 or
10 −6 .
6/12/2004 4:34 PM 2
Program Main
C PROGRAM MAIN
COMMON/SHARE/F(101),U(101),V(101),PNX1,NP,DX,NX,ETA(101),P(15),
1 S(15),PHI,ETAINF,DERWRS
C--------------------------------------------------------------------
C INPUT
READ(5,8000) NXT,ITMAX,DX,S(1),ETAINF,EPS
READ(5,8100) (P(I),I=1,NXT)
C TOTAL NUMBER OF GRID POINTS, NP
NP = ETAINF/DX +1.1
NX = 1
C INITIAL VALUE OF INDEPENDENT VARIABLE
60 ETA(1) = 0.0
WRITE(6,9300) NX,P(NX),S(NX)
WRITE(6,9050)
IT = O
PNX1 = -0.5*(P(NX)+1.0)
C
90 IT = IT+1
IF (IT .LE. ITMAX) GO TO 95
WRITE(6,9000)
GO TO 400
C
95 CALL STNDRD
CALL VARS
TERM = PHI/DERWRS
WRITE(6,9060) S(NX),TERM
S(NX) = S(NX)-TERM
C
C CHECK FOR CONVERGENCE
IF (ABS(TERM) .GT. EPS) GO TO 90
CALL STNDRD
S(NX+1) = S(NX)
C OUTPUT
400 WRITE(6,9070)
DO 2 J=1,NP,8
2 WRITE(6,9100) J,ETA(J),F(J),U(J),V(J)
DELST1 = ETA(NP) - F(NP)
THETA1 = (S(NX)-P(NX)*DELST1)/(1.5*P(NX)+0.5)
WRITE(6,9200) DELST1,THETA1
C
NX = NX+1
IF (NX .LE. NXT .AND. IT .LE. ITMAX) GO TO 60
STOP
C----------------------------------------------------------------
8000 FORMAT(2I3,4F10.0)
8100 FORMAT(F10.0)
9000 FORMAT(1H ,25HITERATIONS EXCEED MAXIMUM)
9050 FORMAT(1H ,11X,1HS,13X,3H-DS)
9060 FORMAT(1H ,5X,2E14.6)
9070 FORMAT(1H ,2X,1HJ,4X,3HETA,9X,1HF,13X,1HU,13X,1HV/)
9100 FORMAT(1H ,I3,F10.4,4E14.6)
9200 FORMAT(1H ,7HDELST1=,E14.6,3X,7HTHETA1=,E14.6//)
9300 FORMAT(1H ,3HNX=,I3,5X,2HP=,F10.6,5X,2HS=,F10.6)
END
6/12/2004 4:34 PM 3
Subroutine STNDRD
STDRD Defines the boundary and initial conditions given by Eqs. (1.2a) and
(1.3) at the wall and the system of equations given by Eq. (1.1). Also,
s in Eq. (1.4a) is computed.
SUBROUTINE STNDRD
COMMON/SHARE/F(101),U(101),V(101),PNX1,NP,DX,NX,ETA(101),P(15),
1 S(15),PHI,ETAINF,DERWS
DIMENSION C(3),B(3),Z(3),G(12)
C--------------------------------------------------------------------
C DEFINITION OF FIRST-ORDER SYSTEM
C INITIAL VALUES OF DEPENDENT VARIABLES
N = 3
X = 0.0
IS = 0
B(1) = 0.0
B(2) = 0.0
B(3) = S(NX)
F(1) = B(1)
U(1) = B(2)
V(1) = B(3)
C
DO 100 J=2,NP
DO 110 LL=1,4
C(1) = B(2)
C(2) = B(3)
C(3) = PNX1*B(1)*B(3)-P(NX)*(1.0-B(2)**2)
110 CALL RKM(X,B,C,DX,N,Z,G,IS)
C
C SAVE CURRENT VALUES
F(J) = B(1)
U(J) = B(2)
V(J) = B(3)
100 ETA(J) = X
PHI = U(NP)-1.0
RETURN
END
Subroutine VARS
VARS Defines the variational equations and their initial conditions given by
Eqs. (1.6) and (1.7). U (η e , sν ) in Eq. (1.5) is computed here.
SUBROUTINE VARS
COMMON/SHARE/F(101),U(101),V(101),PNX1,NP,DX,NX,ETA(101),P(15),
1 S(15),PHI,ETAINF,DERWRS
DIMENSION C(3),B(3),Z(3),G(12)
C--------------------------------------------------------------------
C INITIAL VALUES OF DEPENDENT VARIABLES
6/12/2004 4:34 PM 4
N = 3
X = 0.0
IS = 0
B(1) = 0.0
B(2) = 0.0
B(3) = 1.0
FF = F(1)
UU = U(1)
VV = V(1)
C SOLUTION FOR GIVEN F,FP,FPP PROFILES
DO 100 J=2,NP
FJ = F(J)
UJ = U(J)
VJ = V(J)
DO 10 LL=1,4
GO TO (4,2,4,3),LL
2 FF = (FF+FJ)/2.0
UU = (UU+UJ)/2.0
VV = (VV+VJ)/2.0
GO TO 4
3 FF = FJ
UU = UJ
VV = VJ
4 C(1) = B(2)
C(2) = B(3)
C(3) = PNX1*(VV*B(1)+FF*B(3))+2.0*P(NX)*B(2)*UU
10 CALL RKM(X,B,C,DX,N,Z,G,IS)
100 CONTINUE
C
DERWRS = B(2)
RETURN
END
Subroutine RKM
6/12/2004 4:34 PM 5
k1 = hf ( x n , y n )
k 2 = hf ( x n + 12 h, y n + 12 k1 )
(1.12)
k 3 = hf ( x n + 12 h, y n + 12 k 2 )
k 4 = hf ( x n + h, y n + k 3 )
Thus, in each step in (or x ), RKM must be called four times. The arguments X to
IS have the following explanation.
• The independent variable . The initial value for X must be input.
• A floating point array that is dimensioned N . The B(I ) are the current values of the
dependent variables. For example,
f B (1)
u = B ( 2)
v B (3)
Initial values f (0) , u0 , and v(0) must be input.
SUBROUTINE RKM(A,B,C,DX,N,F,G,IS)
DIMENSION C(N),B(N),F(N),G(4*N)
C--------------------------------------------------------------------
IS = IS+1
GO TO (10,30,60,80), IS
C FIRST ENTRY
10 E = A
DO 20 I=1,N
6/12/2004 4:34 PM 6
F(I) = B(I)
G(4*I-3) = C(I)*DX
20 B(I) = F(I)+G(4*I-3)/2.0
GO TO 50
C SECOND ENTRY
30 DO 40 I=1,N
G(4*I-2) = C(I)*DX
40 B(I) = F(I)+G(4*I-2)/2.0
50 A = E+DX/2.0
GO TO 100
C THIRD ENTRY
60 DO 70 I=1,N
G(4*I-1) = C(I)*DX
70 B(I) = F(I)+G(4*I-1)
A = E+DX
GO TO 100
C FOURTH ENTRY
80 DO 90 I=1,N
G(4*I) = C(I)*DX
B(I) = G(4*I-3)+2.0*(G(4*I-2)+G(4*I-1))
90 B(I) = (B(I)+G(4*I))/6.0+F(I)
IS = 0
100 RETURN
END
Applications
To demonstrate the applications of the computer program and its output, we present
results for Blasius similar flow m = 0 , which corresponds to NXT = 1 . We take
ITMAX = 6 , ∆η -increment (DX) 0.1, wall shear (1) at NX = 1 as 0.300, η e as 8 and
convergence parameter as 10 −6 .
The output presented below shows that the profiles f j , u j , v j as functions of η j
and j together with the rate of convergence of the solutions and dimensionless
boundary-layer parameters δ 1∗ and θ1 for each value of m .
The results for m = 0 show that, for an assumed wall shear value of 0.3, the rate of
convergence of the solutions in quadratic, requiring only three iterations. To obtain
solutions for m = 0.5 , we have used increments of ∆m = 0.1 . Again, the convergence
rate is quadratic. Similar results are also obtained for m = 1 . Results are only presented
for m = 0 , 0.5 and 1.0.
6/12/2004 4:34 PM 7
9 0.8000 0.106109E+00 0.264711E+00 0.327391E+00
17 1.6000 0.420323E+00 0.516760E+00 0.296665E+00
25 2.4000 0.922295E+00 0.728986E+00 0.228093E+00
33 3.2000 0.156910E+01 0.876086E+00 0.139128E+00
41 4.0000 0.230576E+01 0.955522E+00 0.642340E-01
49 4.8000 0.308534E+01 0.987794E+00 0.218711E-01
57 5.6000 0.388031E+01 0.997482E+00 0.543197E-02
65 6.4000 0.467938E+01 0.999616E+00 0.980645E-03
73 7.2000 0.547925E+01 0.999960E+00 0.128584E-03
81 8.0000 0.627924E+01 0.100000E+01 0.122445E-04
DELST1= 0.172075E+01 THETA1= 0.664119E+00
6/12/2004 4:34 PM 8
Source Code, input data and test cases
6/12/2004 4:34 PM 9