Teaching ideal fluid flows with personal computers

Teaching ideal fluid flows with personal computers

ComputersEduc. Vol. 14, No. 6, PP. 509-523, 1990 Printed in Great Britain. All rights reserved TEACHING 0360-13I S/90$3.00+ 0.00 Copyright 0 1990Per...

1MB Sizes 0 Downloads 40 Views

ComputersEduc. Vol. 14, No. 6, PP. 509-523, 1990 Printed in Great Britain. All rights reserved

TEACHING

0360-13I S/90$3.00+ 0.00 Copyright 0 1990Pergamon Press plc

IDEAL FLUID FLOWS WITH PERSONAL COMPUTERS

BERNARD H. CARSON Aerospace Engineering Department, U.S. Naval Academy, Annapolis, MD 21402, U.S.A. (Received 30 November 1988; received 5 April 1990)

Abstract-The subject of ideal fluid flows forms the basis for much of theoretical and applied aerodynamics and is, therefore, an indispensable element in an accredited curriculum in aerospace engineering. Traditionally, students encountering this subject for the first time have been frustrated by the level of mathematics required to model the most simple flow configurations, and the general difficulty they experience in graphically portraying such flows by classical methods. In recent times, more and more students enter this course either in possession of, or having ready access to, personal computers and a great predisposition toward using them. In this paper we present the results of an approach to teaching this subject that makes use of the finite difference method of flow calculations. This allows the student to graphically visualize each flow of interest as he or she progresses through the course. The algorithm itself is straightforward and an easy one to master conceptually, and the students have little difficulty creating and modifying their own programs as the need arises. This approach also serves as a natural transition from classical flow methodology to the modern field of computational aerodynamics. A number of examples are presented and discussed. It is found that this methodology provides a means of calculating pressure distributions with ease, and can be applied to virtually all flows encountered in potential fluid flow theory, including those derived from conformal transformations.

1.

INTRODUCTION

Although all flowing fluids obey the same set of conservation principles, the approach taken in formulating a specific flow problem depends principally on flow geometry. In one class of flows, a fluid passes between well defined boundaries, and in the other, a solid body is surrounded by a region of flowing fluid that is infinite in extent. These two general configurations, internal and external flows, require markedly different approaches in mathematical modeling. It is usually sufficient when treating internal flows to satisfy the conservation equations globally without regard to the detailed motions of individual fluid elements. Straightforward integral methods may often be applied directly to the configuration at hand with excellent results. In external flows, however, the amount of fluid involved is undefined and the influence of the body immersed in it extends theoretically in all directions to infinity. This dictates the differential approach, in which all fluid element are required to satisfy the conservation equations individually, and simultaneously, at all points in the flow. Thus, any given external flow problem must be treated as separate and distinct from all others, since it will require the solution of differential equations with unique boundary conditions. Presently, there are no known techniques that permit general closed-form solutions for external flows about bodies of arbitrarily specified shape, although a number of useful approximate methods have been developed, most of them many years in the past. Of the two approaches then, the external characterization is far more mathematically challenging and thus much more difficult for beginning students to comprehend. However, the study of external flows remains central to the fields of aerodynamics and hydrodynamics, and must be included in a comprehensive college course of study in these areas. In this paper, we describe one attempt to remove some of the mystery shared by beginning students on this subject by providing them with an opportunity to study classical external flow configurations on personal computers, at will, and virtually without restriction. The programming required by the student is minimal and the algorithm developed for this purpose, based on the method of finite differences, appears well-matched to the capabilities of typical small personal computers. 509

510

BERNARD H. CARWN

This approach has proved to be so motivational in the author’s course since it was first introduced that a number of students have struck out on their own, working out interesting examples of original design. The resulting upsurge of interest in the subject has proved quite remarkable, considering the attitude previously shared by most students towards this subject. This should actually come as no surprise; the present college generation has come to regard the computer as a natural extension of their intellect, and will show a great predisposition towards any subject that offers a new and challenging way to use them. 2. THE STREAM

FUNCTION

As was first shown by Stokes, the level of difficulty in obtaining solutions to differential equations valid throughout an entire external flow field is greatly reduced by incorporating the notions of internal flows in a piecewise fashion, In this formulation, the flow field is perceived to be an assemblage of internal flows constrained not only by any real physical boundaries that may exist, but also by the streamlines of the flow which separate them. Consequently, is thus immaterial whether a fluid element is constrained to flow between two streamlines, or between a streamline and solid surface. In essence, the mathematical modeling of a given external flow is thus reduced to that of finding a particular assemblage of streamlines that includes, as a necessary condition, one which is tangent to the solid body being studied, and others tangent to some direction arbitrarily far from the body. It can thus be proved that all other streamlines in between will be unique, thereby specifying the entire velocity field. A rather pleasing result of this approach is the discovery that, since streamlines and solid boundaries are now interchangeable, merely superimposing several known streamline patterns (or alternately, performing a coordinate transformation on a known streamline pattern) will, on occasion, accidentally produce a flow configuration that is of particular interest and practical importance. This approach is made possible through the introduction of a construct called the stream function. Although a legitimate physical interpretation of the stream function exists, the notion of a stream function itself is not an intuitively obvious one, especially to beginning students. In any event, it is usually the properties of the stream function, and not its physical significance that most recommends it. Thus deprived of a physical “feel” for the stream function, students often find the study of external flows to be highly enigmatic and far more difficult conceptually than the relatively simple and intuitive approaches taken in the analysis of internal flows of engineering interest. 3. INSTRUCTIONAL

CONSIDERATIONS

Following the national trend, students enrolled in an accredited 4-year program leading to a baccalaureate degree in Aerospace Engineering at the U.S. Naval Academy are introduced to external flows in a theoretical aerodynamics course during their third year of study. The mathematical preparation of these students includes integral, differential, and vector calculus, operational calculus, and the theory of differential equations. Even with this amount of preparation, however, most students find the abstractions used to model even the most simple external flows to be beyond their immediate powers of comprehension. Almost without exception, our graduating aerospace engineering students will point to this course when asked to name the most difficult subject they encountered during their undergraduate studies. Much of this perceived difficulty comes from their inability to see any direct relationship to practical aerodynamic problems resulting from arduous and abstract mathematical derivations. For example, to derive the incompressible and inviscid flow about a circular cylinder, the student will first have to assimilate the concepts embodied in irrotationality, stream functions, velocity potentials, and doublet flows. This classical approach has been taught essentially without modification to the post-Sputnik generation of American aeronautical engineering undergraduate students. The concepts have stood the test of time and in fact form the basis of modern-day fluid dynamical computational codes, so there is even more need today for this subject to be treated adequately in the aerospace curriculum than ever before.

511

Teaching ideal fluid flows with personal computers 4.

FORMULATION

OF POTENTIAL

COMPUTATIONAL

FLOW PROBLEMS PURPOSES

FOR

4.1. Basic concepts To set the stage for the simple computational code just referred to and its educational application, it is helpful to review briefly the basic formulation of ideal, or potential flows. In the study of idealized fluid flows, we discover a number of elementary flows satisfying conservation of mass and the condition of irrotationality, which, when combined in certain select ways, can yield additional, interesting flow configurations. The elementary flows are actually few in number, and may be listed as follows: (1) (2) (3) (4) (5) (6)

uniform flow Point source and sink flows Doublet flow Point vortex flow Distributed source and sink flows Distributed vortex flows.

Each of these flows may be described mathematically in two ways: either through a stream function Y unique to each elementary flow, or a corresponding velocity potential function, 4 which is adjoint to Y. In typical applications the stream function is usually chosen to characterize the flow because we are most often interested in graphically portraying the streamlines (i.e. curves along which the flow direction is everywhere tangent) whereas the equipotential lines (curves along which the flow direction is everywhere normal) while perhaps interesting, are usually of less technical importance. For irrotational, incompressible flow, both functions satisfy identical equations, i.e. V2Y =o and V’4 =o the form of which, known as Laplace’s equation, is a linear, second-order partial differential equation. The linear property permits known solutions for the stream and potential functions above to be combined linearly (i.e. simply added algebraically, and at will) with complete assurance that the result will continue to satisfy these basic equations, regardless of how algebraically ponderous the final expression might be. The technique of linearly combining simple solutions to form more complex solutions is referred to as superposition. 4.2. Streamlines and equipotential lines In two-dimensional flows, the stream function is defined as a function of coordinate position everywhere except at certain isolated points. The locus of points where stream function is constant describes a streamline. Therefore, the equation of a streamline will result when the stream function is set equal to a constant. Thus, if we are given Y = f (x, v), Then by setting Y = constant, we see immediately that the equation of a streamline in the x-y coordinate system becomes Y =

gv1

x>

providing this inversion can be carried out. The same rationale holds for equipotential lines; i.e. setting $J = constant yields an algebraic expression for an equipotential line. Thus, the entire flow field can be mapped out in principle by choosing successive values of Y and 4 as constants, and plotting the resulting algebraic expressions, again assuming that this is possible. For the elementary flows listed above, this is by far the most effective and straightforward method and is the one always included in texts on the subject. However, when the basic flows are combined to form more complex flows, it almost always happens that the resulting equations are transcendental and cannot be solved explicitly for y in terms of Y and x, as indicated above. Therefore, we must turn to alternative methods if we wish to obtain a graphical representation of the flow. While a number of such methods exist, they all

BERNARDH. CARSON

512

require various amounts of numerical computations. In the following, we will develop one possible computational scheme that permits us to plot out a flow of any complexity to good accuracy, without overly taxing the computational ability of a small computer, or the operator’s patience in awaiting the results. This scheme makes use of the finite difference technique of approximating derivatives in small intervals by taking the numerical difference of a function at the beginning and end of the interval, and dividing by the interval length. We recognize that as the interval length is decreased, the error of approximation diminishes, and indeed the quantity determined by finite differences becomes exactly equal to the function’s derivative as the interval length is taken to its zero limit. 4.3. Computational algorithm To develop the computational algorithm, we note that any scalar function of position (x, y, say, or r, 6) has a gradient vector which always points in the direction of maximum increase of the scalar. It follows then that the vector perpendicular to the gradient vector corresponds to the direction of zero increase in the scalar, or in other words, in the direction in which the scalar is constant. Finally, we recall that the condition specifying that two vectors be perpendicular is that their scalar (“dot”) product be zero. Thus, for the elementary length vector dS to lie along a streamline (i.e. where y is constant) it is necessary that VYodS=O where VY = (+/ax)i

+ (By/lJy)j

and dS = (dx)i + (dy)j thus @Y/c?x) dx + (N/Q)

dy = 0

where it is understood that dx, dy are along a streamline. Rearrangement that at any point in the flow, then, the local slope of a streamline is

of this expression shows

(dyldx), = - (~Y/~x)l(~Yl@). This may be seen schematically in Fig. 1. For small segments of the streamline, AS approximates

dS and thus

Ax = AS cos 8, and Ay = AS sin 8. But cos 8 =

(aY/ay)Zi//

and

sin 8 = ( - aY /&)/Z+

where zi+5 =

[(ayja++(ayl/ay)y.

Strearnline
X&Y2 (a\y/ayf+(dv/h)*

/

/AS ‘./..A

e

Sl Xl,Yl

Ay

-ayl/ax

AX aw/aY

Fig. 1. Streamline geometry.

cons0

Teaching ideal fluid flows with personal computers

513

Therefore,

(muaywz+

X,=X,+

and y, = y, - (avlax)Asjztj. It is obvious that this forms the basis of a computing scheme which will permit a streamline to be plotted outpoint by point, merely by calculating new values of the derivatives at each point and looping back through the above equations. 4.4. Calculating the derivatives by finite differences In simple flows, the derivatives appearing in the above expressions can often be determined exactly by direct differentiation. However, as complexity grows, it is far more appealing to approximate these derivatives with$nite dzfirence equations which we will now examine. The major advantage of this approach lies in the fact that we work with the stream function itself, and are not required to perform differentiation operations which quickly become arduous and error-prone for all but the most simple cases. Recall that the fundamental theorem of differential calculus defines a partial derivative as the limiting value, as some small quantity (h, say) tends to zero, in the expression aYi8.x =

tm (h4)

{‘u(x+ky)-‘W,y))/h.

In numerical computations, it is not possible to actually However, a highly accurate approximation to aY/ax can making h small enough, without actually forcing the above an approximation is called a forward dzfirence equation backward dzsrence equation which approaches the same aylax

perform the indicated limiting process. almost always be obtained merely by expression to the indicated limit. Such (or quotient), to distinguish it from a limit from the opposite direction, i.e.

= lirn(h-0) {Y(X, Y> - Y(X - k Y)}/h.

It can be shown that the level of approximation is improved if the average of these two difference equations is used, called a central difirence equation, which now apparently reads aY /ax % {Y(x + h, y) - p(X - h, y)}/(2h) clearly, by the same reasoning, aY/ay = {Y(x, Y + h) - ‘y(x, y - h))/GW as well. This now provides a direct computational method for plotting streamlines, given the stream function for a given flow. Using the same rationale, the corresponding potential equations are readily shown to be x2 = x1 + (a4/ay)As/z4 and Y, = Y, - (a4/ax)Asiz+ which completes the finite difference algorithm used in the following sections. 5. INSTRUCTIONAL

APPLICATIONS

As a first step toward developing their individual finite difference fluids programs, students are given the problem of a source located at the origin combined with a uniform stream parallel with the x-axis, to be programmed in a structured language capable of graphical output. The students are encouraged to experiment with the finite difference algorithm, step sizes, and so on until they are capable of producing some streamlines, nothing more, at this point. The next step is to write a more detailed program along the lines of the sample program listed in the Appendix. Two features worthy of note here are (1) the interactive nature of the program, where the student can arbitrarily select the point where the streamline is to pass, and (2) the logic that permits the streamline to be drawn to its end points before turning control back to the operator.

514

BERNARD H. CARSON

Experience indicates that most students will have little difficulty with this step but inevitably, several will not get their programs to run. This is remedied in a diagnostic session, where the students demonstrate their programs (which they have brought in on diskettes) on a classroom computer. Those who are having difficulty can usually be assisted by their classmates, adding a certain “team effort” aura to the evolution which they appear to find enjoyable. Thus, each student departs with a functioning program that needs only minor modifications to run virtually any potential flow problem. Students are then given a series of assignments, each one intended to demonstrate a particular flow or aspect of potential flow. For example, a sink can be added to the flow, creating a source-sink pair. When a uniform stream is added, a Rankine oval results. When the sourcesink pair approach each other, the flow approximates a doublet. Reversing the sign of the sink creates two sources, corresponding to the flow of a source near a wall, which demonstrates the method of images, and so forth. Typically, the only program modification needed is a change in the stream function, plus a restatement of the conditions dictating streamline integration reversal. Several ambitious students have programmed the corresponding equipotential line difference equations, resulting in the flow field seen in Fig. 2. 6. PRESSURE

DISTRIBUTION

ON

A BODY

The aim of aerodynamic theory is the prediction of forces developed on the surface of a body when it is immersed in a flowing fluid. With few exceptions, this turns out to be an inordinately difficult task for students when classical methods are employed, as will presently be discussed. However, the finite difference computing scheme permits the pressure distribution along any streamline of the flow to be calculated with surprising simplicity. The following example serves as a good illustration. As one exercise in their wind tunnel testing course, Aerospace Engineering students at the U.S. Naval Academy are required to measure the pressure distribution on a model Rankine oval and then to compare this with the distribution predicted by potential flow theory. To obtain the pressure coefficient distribution on the surface by classical methods has in the past required them to perform the following sequence of operations:

(1) Determine the ratio of free stream and source/sink strength needed to produce a zero streamline that conforms to the model dimensions.

(2) From this, write the stream function for the flow, set it equal to zero, and by iteration, determine the surface coordinates of the model. (3) By differentiating the stream function, determine the general expressions for the velocity components. (4) Substitute the surface coordinates developed in step (2) into the velocity component expressions at each pressure tap location and from this, determine the theoretical pressure coefficient at each location.

Fig. 2. Streamlines and potential lines. Circular cylinder with circulation generated by finite differences.

Teaching ideal fluid flows with personal computers

515

The second step can be done handily with a programmable pocket calculator, but the differentiation in step (3) proves to be algebraically cumbersome; few students are able to obtain the correct expression for the velocity components without assistance. As the reader can readily verify, the process of obtaining the surface coordinates and then determining the pressure coefficient at each desired point is tedious, even with the aid of a computer program written for this specific problem. It is worth noting that there is no possibility of obtaining the theoretical C, distribution in closed form, so that some form of numerical methodology must be resorted to eventually, no matter what approach is taken. As a welcome alternative to this ponderous and error-prone process, the finite difference approach allows the student to specify the stagnation point. The program then develops the surface coordinates corresponding to y = 0 (i.e. the dividing streamline) on its own. In fact, the surface coordinates themselves prove to be extraneous, since the pressure coefficient distribution may be determined directly from the expression. c,=

1 -(V/V,)‘=

1 -((u*+u*)/V;=

1 -[aY/ay)‘+(-aY/ax)‘]/v~

at any point in the flow. And since the derivatives W/ax and W lay are being continuously calculated by finite differences in the surface streamline integration anyway, the only additional refinement needed to plot or print the pressure coefficient at any desired point on the surface is the simple programming modification indicated immediately above. Figure 3 shows the results of the pressure coefficient distribution determined by this method on a family of Rankine ovals. Although not indicated here, these distributions are found to be correct to three decimal places when compared with those determined from classical methodology. (It should be kept in mind that the classical approach cannot itself be taken as fully exact, owing to the fact that the surface coordinates have been determined by iteration.) Since the pressure coefficient begins at a maximum of + 1 at the stagnation points and decreases steadily around the body, the student can easily see where the points C,, = 0 occur, as well as the regions in which C, is negative. This in enhanced on a color graphics screen by assigning different colors to C,,, depending on its algebraic sign. Numerical values of the C, at selected locations (corresponding to the pressure taps, for example) can naturally be printed out as the student chooses; or, the numerical values can simply be determined by scaling the graphical output, noting that the value of C, at a stagnation point equals + 1. The real benefit of this approach, however, lies in the fact that once the program has been developed for this specific application, the student can then go on to alter the values of the source/sink strength, their location, etc., at will, and study this example parametrically. Rather than being transfixed by a single Rankine oval of specified dimensions, the subject can be studied as a general class. Thus, students at other institutions who do not perform this particular experiment can nevertheless benefit from the approach. As an immediate benefit, the student can readily see that for strong sources and close spacing, the C, distribution on a Rankine oval appears qualitatively to be that seen on a cylinder in a uniform stream; i.e. the pressure decreases monotonically past the point of zero C, and reaches a minimum only at the vertical axis of symmetry. However, as the spacing is increased and the source strength decreased, the student sees the emergence of a negative pressure “peak”, much like that seen in the leading edge region of an airfoil. This is seen in Fig. 3. The rationale developed here obviously extends to studies of the pressure coefficient distribution on any closed body, with or without circulation, etc. Merely by changing the stream function, the student can study the pressure distribution on any body of his or her making. Figure 4 shows the effect of circulation on a cylinder on its pressure distribution, making the production of lift obvious. 7. THE

THIN

UNCAMBERED

AIRFOIL

As another example of the utility of the present computational scheme, we consider the example of the thin, uncambered airfoil. This is the next subject our students are introduced to after they have become familiar with basic potential flows. The objective here is to develop equations for the lift and pitching moment acting on the airfoil, or flat plate, when it is placed in a uniform stream at an angle of attack.

516

BERNARLIH. CARSON ‘CYLINDER”-TYPE PRESSURE DlSTRlBUTiffN

NEG. PRESSURE

:

POSITIVE PRESSURE

“AIRFOIL--TYPE PRESSURE

DISTRIBUTION

Fig. 3. Parametric studies of Rankine oval pressure distributions.

The problem is posed as follows: consider a flat surface of unit span, length c, and zero thickness aligned with the x-axis, with its leading edge put at the origin. The plate is immersed in an incompressible fluid of density p of infinite extent, flowing with a uniform velocity V that would make an angle c1with the x-axis were it not for the plate’s presence. As the ffow approaches the plate, it turns smoothly in the piate’s direction. The task at hand is to develop a mathematical model for this flow field that will permit the force on the plate, expressed as a function of the plate’s physical dimension c, and the flow variables V and Q, to be calculated. The classical solution of this problem appears in all advanced texts on aerodynamics, and for present purposes, will only be summarized here. The mathematical model makes use of an ad hoc construct known as a vortex sheet, having a value y assigned to every point on the chord, defined as the interval 0 < x < c; y might be thought of here as the vertical equivalent of the distributed load students typically have encountered before in structural mechanics. The strength of the vortex sheet anywhere along the plate is ydx and so

Teaching ideal fluid flows with personal computers

517

CIRCULATION

Fig. 4. Pressure distribution on cylinders by finite differences.

the increment of velocity dVi induced at a particular apparently

point x0 normal to the plate by y(x) is

When the cont~butions of all such incremental vortices are summed at any point along the plate, the result must be a velocity component normal to the plate just sufficient to cancel the normal

518

BERNARDH.CARSON

component of the free stream, Vsina, so that the plate becomes a streamline. Typically, LY is assumed to be small, so that the final result of this formulation reads

s

c ydx

()x,-x’

Assuming that y(x) is known, then the lift and moment about the leading edge, lift per unit span can be determined from L=pV

‘ydx s0

and MLB= -pV

‘yxdx. s0 Finally, the effective point of application of the lift X behind the leading edge is X = - MLE/L. At this point, several things need to be said about this formulation, presented here as may be found in numerous texts with little variation. First, the formulation appears to have little relationship with the previous notions the student has studied in the general potential flow theory. Note that no mention is made here of stream functions, velocity potentials, or any of the concepts introduced earlier. Second, the problem as just formulated involves an integral equation; the unknown in the problem is obviously y(x), which appears under a definite integral sign. Not only is this notion an unfamiliar one to the student; what is worse, the integrand becomes singular whenever x = x0. The result is that many students become overwhelmed at this point and are not capable of following the theory to the end. In the author’s opinion, there is no reason to introduce this level ofcomplexity to beginning students; all the major points of this example can be made by drawing on the knowledge and skills already developed by the student in the preparatory study of potential flows. Once this has been achieved, the general theory (which can easily be extended to cambered airfoils) then becomes self evident. The alternative to this approach is to build on the student’s knowledge by modeling the plate with a number of discrete vortices, rather than the continuous distribution just mentioned. The details can be found in[2]. It turns out that as few as five discrete vortices are sufficient to produce all the essential results of the exact solution, with unanticipated good accuracy. Even more to the point, the students can now easily reconfigure their programs and actually plot the streamlines for the 5-vortex “airfoil”, allowing them to see for themselves how the streamlines behave in the vicinity of the model. Figure 5 shows a comparison for a model made up of five, and then ten discrete vortices, with the flowfield determined from the exact y distribution (this program takes much more computing time, since each streamline point involves a 50-point integration of the vortex sheet). We can see at a glance that the flowfields for the latter two cases are virtually identical except for very small distances from the plate. 8.

ADVANCED

APPLICATIONS

Thus far, we have focused our discussions on computerized flow visualization techniques aimed at enhancing the learning process for beginning students. However, advanced students and even serious researchers can benefit equally as well from the general technique. It is appropriate to call certain aspects of this to the reader’s attention before drawing this subject to a close. Experienced workers in fluid mechanics will immediately recognize that in addition to those potential flows that can be developed by direct superposition of elementary flows, there is yet another class of flows that can be derived through the use of conformal mapping techniques. Classical works on ideal fluid flows abound with interesting and useful examples developed from this approach (cf.[l]) providing students with a rich and varied source of additional subjects that can be made visible and thus studied in detail, using computer graphics and the methodology described in this paper. Several examples are shown in Fig. 6. The technique also offers a simple way of proof-testing any new potential flows derived by those engaged in original studies.

Teaching idea? fluid flows with personal computers

FIVE DISCRFTE

V/l

TEN DISCRETE

CO~INUOUS

VORTICIES

VORTICIES

~ISTRi~UTlON

OF VORTICIES

Fig. 5. Uncambered airfoil Row--comparison

FLOW PAST A REARWARD-FACSNG

FLOW lM0

A CHANNEL TliROUGH

of madeis.

STEP

A SLIT IN A WALL

Fig. 6. Examples of potential flows derived by conformal mapping.

519

520

BERNARD H. CARSON

Of traditional interest to students studying aeronautics has been a particular conformal transformation that maps a circular cylinder into an airfoil shape, known as the Joukowski transformation. The mathematical formulation is too lengthy to be described here, and those unfamiliar with this methodology are referred to the literature for the specific details. The Joukowski family of airfoils, although interesting, did not prove out to be very useful for practical aircraft design, and the analysis involved in deriving them, although not particularly difficult, tends to be somewhat lengthy and involved. As a result, the Joukowski airfoil appears at present to be passing quietly into aeronautical obscurity. A number of recently appearing aerodynamics texts do not make even a passing reference to the subject. It may turn out that the retirement was premature. The author has found the Joukowski airfoil to be ideally suited for computerized aeronautical flow visualization applications; perhaps this may even prove to be its ultimate worth. In any case, when the parameters controlling the airfoil’s thickness and camber are varied within certain limits, a family of highly realistic and eye-pleasing aerodynamic shapes emerge. The transformation process is exceedingly simple on a computer; one merely computes a point on the cylinder’s circumference and instructs the computer to plot it somewhere else, yielding the airfoil shape. The same holds for any streamline; the flow about a cylinder of appropriate dimensions is readily mapped to the flow about the airfoil with the same transformation equations. The airfoil can be given an angle of attack and any amount of circulation simply by altering the cylinder’s stream function the appropriate amount. As this is done, the streamlines about the airfoil will be seen to adjust accordingly, exactly as expected on a real airfoil in a flowing fluid. When this is presented on an interactive computer graphics screen, the effect is what might best be described as a computational smoke tunnel, where streamlines can be seen flowing about an airfoil model. The operator can change models or control the flow parameters merely by changing the controlling parameters in the basic program. Although not a necessary requirement, realism can be heightened by using one of several commercially available computerized animation programs which projects a sequence of computergenerated still frames. The author has developed one such program in which the airfoil is smoothly stepped through a range of angles, and another in which circulation is continuously added until the flow streams smoothly off the trailing edge, demonstrating the development of lift on an airfoil started from rest. These have proved to be highly effective instructional aids. Figure 7 shows several

ZERO CIRCULATION

Fig. 7. Effect of circulation

on Joukowski

airfoil

Teaching ideai Auid AOWSwith personal computers

521

ANGLE OF ATTACK - 4 DEGREES

ANGLE OF ATTACK

- 8 DEGREES

Fig. 8. Pressure distribution on Joukowski airfoil by finite difference.

“stills” excerpted from these computerized movies. Figure 8 is also included to indicate the direct application of the pressure distribution technique described earlier to this class of problems. 9.

SUMMARY

AND

CONCLUSIONS

Emphasis has been placed here not on supplanting, but rather of augmenting the mathematical formalism employed in the study of ideal Auid Bows. As more and more engineering students have access to personal computers, it is natural that their advanced courses be restructured in a fashion that requires their use. At the same time, it must be fully recognized by those working or teaching in this field that as a subject, aerodynamics is presently in the midst of a rapid transition from the purely mathematical approach that has characterized the field since its beginning, to an everincreasing reliance on the computer as the primary tooi in solving practical aerodynamic problems. The methodology presented here represents the author’s attempt to accommodate both these realities into an instructional approach that, at least in the short term in which it has been applied, has proved highly successful. Most of the students thus far exposed to this approach have welcomed it enthusiastica~fy and many have developed an appetite for additional study in the field. For the instructor, this must be taken as a measure of successful teaching. REFERENCES 1. Milne-Thompson L. M. Theoretical Hydrodynamics, 2nd edn. Macmillan, New York (I950). 2. Ku&e A, M. and Chow C. Y., F~u~da~jo~~~~~e~~d~~~rnic: Bnses of ~~~~~~~a~j~ Design, 3rd edn. Wiley, New York (1976).

522

BERNARD H. CARSON APPENDIX

! SAMPLE PROGRAM - SOURCE AND UNIFORM STREAM ! PGM WRITTEN lN True BASICTMBY B H CARSON, AEROSPACE ENGINEERING ! USNA lo/88 SET WINDOW -3.54,3.54,-2.222,2.222

! Defines viewing area

! Resolve arctan problem DEF itn(z) IF z =>O then LET itn = am(z) else LET im = am(z) +pi END DEF

!********* STREAM FUNCTION FOR SOURCE AND UNIFORM STREAM ***** !* !* DEF S(x,y,V,L) = -V*y + (L/(2*pi))*iJn(y/x) !* ! ********************+sET

E-jW

VARIABLES

***************************

LETV=l ! SETS VELOCITY LETL=4 ! SETS SOURCE STRENGTH LETd= .Ol LET t = 2*d ! step size along streamline

BOX CIRCLE -.05,.05,-.05,.05

! draw a small circle indicating ! location of source ! and color it black

FLOGD 0,O Do GET POINT: x,y LETxl=x LETyl=y PLOT x,y; LET kl=O

! get initial points for streamline ! save original points for later use ! Plot initial point ! reset forward-backward integration counter

! ****** Now integrate a streamline passing through initial point Do

LET sl = S(x-d,y,V,L) LET s2 = S(x+d,y,V,L)

! sl---s4

difference calculations

LET s3 = S(x,y+d,V,L) LET s4 = S(x,y-d,V,L) LET Z = ((s2-sl)“2+(~3+4)*2)“.5 LET x = x+t*(s3-s4)/Z LET y = y-t*(s2-sl)/Z

! calculate new x,y point

! If streamline comes to screen edge or into the source center, ! go back to the beginning of the streamline and integrate the other way.

IF abs(x) c.03 and abs(y) c.03 or x>3.5 or x+3.5 or ~~2.2 or ~~-2.2 then

* * * * *

Teaching ideal fluid flows with personal computers

LETkl= kl +l ! pick up plotting pen PLOT ! go back to initial point LETx=xl LETy=yl LETt=-t ! and reverse the integration direction ENDIF IF kl> 1 then EXIT DO PLOT x,y ;

! plot streamline point

! This time, return control when streamline runs off window IF ~~3.5 or ~~-3.5 or y>2.2 or ~~-2.2 then EXIT DO LOOP PLOT

! continue plotting streamline until it is completed ! Lift pen before returning for another run

LOOP

! return control to get another streamline

523