Sunteți pe pagina 1din 10

MAC2282.

991 APPLIED CALCULUS PROJECT


Methods for Plotting Streamlines in Excel

ADAM KOWALESKI, University of South Florida


Advisor:
DR. STANLEY C KRANC, Civil and Environmental Engineering, University of South
Florida
Subject Area Advisor:
DR. GERALD L HEFLEY, Mathematics, University of South Florida

Fall Semester, 2014

Abstract: This project seeks to offer methods to locate and plot streamlines of
constant and incompressible flow using Excel, an accessible software. This is
accomplished by taking the stream function for uniform flow about a cylinder and
applying the Cauchy-Riemann condition followed by parametric differentiation.
Using Excel, we will build a multipurpose dataset which can be used to model and
plot streamlines.

TABLE OF CONTENTS
Problem Statement 3
Motivation. 3
Mathematical Description and Solution Approach 3
Discussion. 7
Conclusion and Recommendations.. 7
References 9

PROBLEM STATEMENT
Streamlines are lines always tangent to the velocity vector of the fluid
particles in flow (Shames 119). The stream functions for ideal and inviscid fluid flow
are well known and given as,

= 0

= 0

(1)
(2)

The strength of the doublet is represented by the variable a. In this analysis


lines of constant are the streamlines. The contour lines of form a family of
curves which intersect the streamlines orthogonally (Shames 562).

MOTIVATION
Coupled with the authors semester study in Calculus 3 at the University of
South Florida the motivation for this paper was to find streamlines.

MATHEMATICAL DESCRIPTION AND SOLUTION APPROACH


As a starting visual exercise consider an x-y grid with computed at each
combination of x and y. It is not difficult to imagine approximately where the
streamline would be, say for = 0.15 as roughly drawn in Table 1.
Table 1

Finding this line is the more difficult task at hand. Starting with the gradients
of we have the following.

= +
=

y
x

Next we consider the Cauchy-Riemann equations which tell us:


=
y
x

=
x
y
For our problem, Shames notes that in the study of 2-D potential flow, we express
the velocity V in terms

shown as (Shames 299).

( 2 2 )
=
= 0 + 2
( + 2 )2
y

(3)

2
= 2
( + 2 )2
x

(4)

Now we can take (1) and (2) and convert them to x and y as shown below in (5)
and (6), respectively.

= 0

2 + 2
2 + 2

= 0 +

= 0

2 + 2

2 + 2

(5)

(6)

By implicit differentiation of

2
( 2 + 2 )2
2 2

0 2
+
+ 2 ( 2 + 2 )2

(7)

Now, with (7) let us consider two methods to produce a streamline. First we
will apply Heuns method (Kranc 1). Second we will use linear interpolation.
In Excel, lay out columns for x, y, k1 and k2. We will also include cells for a,
dx and 0 . Next we program the following functions and march them down each
cell.

= +
1 = 0.5 (1 + 2)
1 = () =

= (4)

2 = ( + , + ) = 1

Note that a, 0 and 0 are chosen arbitrarily along with a uniform dx. A wise
user will lock these cells (except for 0 ) so as they are changed new computations
are generated immediately. As we will discuss later, finer increments (say 0.1
versus 0.01) generally produce more accurate graphs. Running these calculations
and plotting the x and y values yields the streamline of constant equal to the value
entered at 0 .
Here is an example setup.
Table 2

Second to Heuns method we use linear interpolation. Linear interpolation is a


method to locate unknown values on a line. Peltier provides a good commentary
and the following computation in Excel which correlates to the given solution for y
(Peltier, Peltier Tech Blog):

Table 3

A3: =MATCH(A2,A6:A18)
B2: =INDEX(B6:B18,A3) + (A2-INDEX(A6:A18,A3)) * (INDEX(B6:B18,A3+1)INDEX(B6:B18,A3)) / (INDEX(A6:A18,A3+1)-INDEX(A6:A18,A3))
Note that cell A3 is an arbitrary position (on the sheet), but should
correspond to the value we are looking for. Cell B3 will be our value for y. The
setup here will be similar with x and y columns. The constant will need to be
interpolated against all values -1 to 1 for each increment. Essentially, we are telling
Excel to search each column and return the closest value to the constant of our
choosing. After running the calculation for all x and y combinations we can
construct the streamline.
Table 3 shows an example of the operation in Excel. The equations are
marched down for all combinations of x and y. A second x and y column are setup
to the right to return the interpolated values for convenience.

Table 4

v0
dx
psi

0.7
0.01
0.26

x
-1.00
-0.99
-0.98
-0.97
-0.96
-0.95
-0.94
-0.93

psi
-1
-1
-1
-1
-1
-1
-1
-1

match
Interpolated y X
140
0.395872945

-0.675
-0.668001263
-0.661005101
-0.654011593
-0.647020816
-0.640032852
-0.633047781
-0.626065687

-1
-0.9
-0.8
-0.7
-0.6
-0.5
-0.4
-0.3

Y
0.3959
0.4009
0.4075
0.4163
0.4277
0.4423
0.4599
0.4786

DISCUSSION
Table 5

In Table 5 we can see several lines of constant graphed using Heuns


method. Interpolation would produce the same result at dx = 0.01. You can see
particles entering closer to 0 on the axis interact more closely to the cylinder in the
center.

Table 6

Table 6 is an example of the streamline produced by interpolation. The


generated result is the same as Heuns method with dx at 0.01 We can see this in
Table 7.
Table 7

Further, a line of at 0.25 has also been partially graphed. Compare and
. They intersect orthogonally. Note here in Table 7, our (x0, y0) is (01, 0.4) for
Heuns method which corresponds to the constant 0.25 (which was entered into the
interpolator).
Lastly, concerning Heuns method, graphically and mathematically, we see in
(8) the exact same data set. Equation (8) can make for a less burdensome entry
than equation (3) if sheets for and have already been created prior.
8

= =
(8)

CONCLUSION AND RECOMMENDATIONS


In conclusion, this project demonstrates easily attainable methods of finding
streamlines by applying Calculus coursework using common software. With this as
base other possibilities exist.
Table 8

Table 8 provides examples for other graphing similar components using the
same methods.
Another option that can be achieved after the streamlines have been attained
is to add rotation. This can be executed simply by adding equation (8) to the
interpolator. Or, it could be achieved by Heuns method if you were to implicitly
differentiate in (8) and add it to equation (7). For example, we can add rotation.
Shames gives the formula for clockwise rotation as

= 0

+
r

Which as before we can convert to x and y:

= 0

+
2 + 2 (8)
2
2
+
2

For counterclockwise rotation; simply reverse the second sign in (8).


Table 9

REFERENCES
Kranc, S.C. Plotting Streamlines and Pathlines on a Microcomputer. Comp. in Ed. Div. of
ASEE, (1986), V. VI, No. 3, pp. 20-21.
Peltier, Jon. "Excel Interpolation Formulas." Peltier Tech Blog. Jon Peltier, 18 Aug. 2014.
Web. 28 Nov. 2014.
Shames, Irving Herman. Mechanics of Fluids. New York: McGraw-Hill, 1962. Print.

10

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