Sunteți pe pagina 1din 4

AE 6009 Fall 2016

Computer Problem (Due 12:00pm Fri 11/18/2016)

Numerical solution for plane stagnation point flow

With a slight change in notation, the similarity solution for Hiemenz flow discussed
in class can be expressed by the non-dimensional stream function F (η) satisfying the
ordinary differential equation

F 000 + F F 00 + 1 − F 02 = 0 , (1)

subject to the boundary conditions

F (0) = 0 ; F 0 (0) = 0 ; F 0 (∞) = 1 . (2)

This is known as a two-point boundary value problem, since the conditions are im-
posed at two different locations. In practice, of course, on a computer we replace
[0, ∞) by a finite interval: White (p. 156) argues that up to η = 4.8 is sufficient.
In general, an ODE of order n may be re-cast into a system of n coupled first order
equations. Thus, defining the variables Y1 = F , Y2 = F 0 and Y3 = F 00 , Eq. 1 may be
replaced by the set
dY1
= Y2

dY2
= Y3

dY3
= Y22 − Y1 Y3 − 1 , (3)

with the boundary conditions Y1 (0) = 0, Y2 (0) = 0 and Y2 (∞) = 1. Notice that
Y3 (0) is unknown. However, if we guess a value for it, we can integrate the system
(3) forward from η = 0 by many numerical methods designed to solve ODEs posed
as initial-value problems. If the guessed value of Y3 (0) is not correct, then we will
not satisfy the condition Y2 = 1 at large η. However, one can always carry out an
iterative process in which the improved guesses are made in a systematic manner.
From this discussion, the two major tasks we need to perform are: (1) write a
subroutine that will produce Y1 , Y2 and Y3 at a chosen “large” value of η, from a
guessed value of Y3 (0), and (2) embed it within a program that selects successive
guesses to the correct value of Y3 (0) such that the boundary condition Y2 (∞) = 1
is satisfied within some prescribed tolerance level. Methods for each task are now
described briefly.
Task 1 involves the numerical integration of ODEs with prescribed “initial” con-
ditions, which is conceptually quite similar to finding the area under a curve between

1
prescribed end-points. We divide the range of integration into many smaller inter-
vals, and try to approximate the slope of the curve within each interval by various
schemes. A page taken from a formula list in Handbook of Mathematical Functions
(Abramowitz & Stegun, 1964) is provided. In the interest of higher accuracy for a
given interval size, you are to use the fourth-order Runge-Kutta method. Carefully
generalize the method to a vector of three elements (i.e., Y1 , Y2 , Y3 ).
For Task 2, you may use any iterative scheme you like (provided it converges to
the true solution!). A straightforward scheme I recommend is the bisection method,
which determines the root of an equation of the form f (x) = 0 within a specified
interval. Starting from the mid-point of the interval as an initial guess, one checks
for changes in sign of the function f , and successively refines the search interval to
converge upon the root. Usually, after a certain number of iterations, the absolute
value of f falls below some prescribed tolerance, whereupon convergence is declared.
To apply the bisection method to the present problem, we can consider the value of
Y2 at η = 4.8 as a function g (say) of the guessed Y3 (0), and in effect try to solve the
equation
g[Y3 (0)] − 1 = 0 . (4)

The method suggested here is just one of several possible. For your interest, a
broader discussion of numerical methods for two-point boundary-value can be found
in Chapter 16 of the book Numerical Recipes (Press et al., 1986). If you want to
learn more about numerical methods in fluid mechanics then courses in numerical
analysis, computational fluid dynamics, or even high-performance computing, may
be of interest.

Assignment

1. Write a computer program to solve for the function F using the approach de-
scribed above. You must write your own program—using a programming lan-
guage such as Fortran or C. Also, you must not copy any part of your code from
a book.

2. Include a program listing with comment statements in sufficient detail to show


the logic of your algorithm. If you use an iterative scheme other than the
bisection method, include a written description of your method.

3. Include a printout of the results (for F , its derivatives, and the flow velocities)
in tabulated form.

Equal credit (in 4.5% each of course grade) will be given for both the numerical
results and your presentation of the method. If you are unable to obtain correct
answers you must explain in detail why you were not able to do better.

2
Some Remarks about Computer Programming

To me, success in computer programming requires the following:

1. A thorough understanding of the logic or algorithm

2. Ability to communicate instructions to the computer

3. A healthy skepticism of the results (from the program that we wrote)

4. Preseverance through many trials, and doing things as carefully as possible

All of these traits will serve us well in our scholarly pursuits.

S-ar putea să vă placă și