You are on page 1of 4

Nick Renda ME 163 Project 2 October 28, 2013

Abstract
For this project I used MATLAB to create a function that calculates the ow past a two-dimensional
closed body using the vortex panel method. I then estimated the boundary layer separation points using
integral approximations. I tested my functions on a circular cylinder while varying the location of the Kutta
condition, as well as on a NACA 0012 Airfoil. Using my results, I was able to plot the Cp values as a function
of the bodys x coordinate, and compare them with the graphs for the analytical solutions to the pressure
distribution. I was also able to calculate the points where the ow separates from the cylinder.
1 Problem Description
For the rst portion of the project I was presented with a circular cylinder and asked to solve for its pressure coecient
distribution. To do this, I implemented the vortex panel method with linearly varying panels. The potential function of
the combined eld of uniform ow and vortex panels is
(x, y) = Uxcos +Uysin +

j
_
j
(s
j
)
2
tan
1
_
y y
j
x x
j
_
ds
j
(1)
Where the vortex panel strength varies linearly
(s
j
) =
j
+ (
j+1

j
)
s
j
S
j
(2)
At the control points i, the normal velocity comments vanish such that

i
= 0 (3)
Carrying out the dierentiation and integration turns into an inversion of the following matrix to determine
i
m

j=1
_
C
n1
ij

j
+C
n2
ij

j+1
_
= 2Usin(
i
) (4)
where the coecients are given as
C
n1
ij
= 0.5DF +CGC
n2
ij
C
n2
ij
= D + 0.5QF/S
j
(AC +DE)G/S
j
A = (x
i
X
j
)cos
j
(y
i
Y
j
)sin
j
B = (x
i
X
j
)
2
+ (y
i
Y
j
)
2
C = sin(
i

j
)
D = cos(
i

j
)
E = (x
i
X
j
)sin
j
(y
i
Y
j
)cos
j
F = ln
_
1 +
S
2
j
+ 2AS
j
B
_
G = tan
1
_
ES
j
B +AS
j
_
P = (x
i
X
j
)sin(
i
2
j
) + (y
i
Y
j
)cos(
i
2
j
)
Q = (x
i
X
j
)cos(
i
2
j
) + (y
i
Y
j
)sin(
i
2
j
) (5)
Nick Renda ME 163 Project 2 October 28, 2013
2 Code Formulation
2.1 Circular Cylinder
To implement my code, I computed the panel start and endpoints given M panels. Based on these points, I calculated
the coordinates of the control points and the distances between each set of points. To ensure a smooth ow at the
trailing edge, the Kutta condition can be applied:

1
+

m+1
= 0 (6)
I then rewrote the system of equations formed from equations (4) and (6) in a more clear form:
m+1

j=1
A
n
ij

j
= RHS
i
; i = 1, 2, ..., m+ 1 (7)
where the following conditions apply for i < m+ 1
A
n
i1
= C
n1
i1
A
n
ij
= C
n1
ij
+C
n2
i,j1
; j = 2, 3, ..., m
A
n
i,m+1
= C
n2
im
RHS
i
= sin(
i
) (8)
and the following conditions apply for i = m+ 1
A
n
i1
= A
n
i,m+1
= 1
A
n
ij
= 0; j = 2, 3, ..., m
RHS
i
= 0 (9)
After determining the unknown circulation densities, I calculated the velocity and pressure at the control points:
V
i
= cos(
i
) +
m

j=1
_
C
t1
ij

j
+C
t2
ij

j+1
_
; i = 1, 2, ..., m (10)
where, similar to equation (5)
C
t1
ij
= 0.5CF DGC
t2
ij
C
t2
ij
= C + 0.5PF/S
j
+ (AD CE)G/S
j
C
t1
ii
= C
t2
ii
= /2 (11)
To implement these equations in my code, I rewrote equation (10) as
V
i
= cos(
i
) +
m+1

j=1
A
t
ij

j
; i = 1, 2, ..., m (12)
where the tangential-velocity inuence coecients are:
A
t
i1
= C
t1
i1
A
t
ij
= C
t1
ij
+C
t2
i,j1
; j = 2, 3, ..., m
A
t
i,m+1
= C
t2
im
(13)
and the pressure coecients at the ith control point are calculated as
C
pi
= 1 V
2
i
(14)
2.2 NACA 0012 Airfoil
The only changes when using my code for this airfoil were that I loaded the provided coordinates into MATLAB in
advance, and used N 1 panels where N is the number of given data points.
Nick Renda ME 163 Project 2 October 28, 2013
3 Results
After setting my code and verifying that it worked with the given example of the NACA 2412 airfoil ying at = 8

, I
ran it with dierent numbers of vortex panels on a circular cylinder. My results are shown below:
3.1 Circular cylinder, Kutta condition at = 180

and = 150

.
The following plots describe the C
p
values as a function of x coordinate on a circular cylinder with 32, 64, and 128 vortex
panels. I also included the plot of the analytical solution to ow past a circular cylinder, which I will derive below.
As shown in the plots, increasing the number of vortex panels results in an answer closer to the analytical solution.
When the Kutta condition is placed at = 180

, the plot is symmetric across x = 0. However, in the second plot


the Kutta condition is not placed at the very left of the cylinder, so the plot is no longer symmetric and the C
p
values
change signicantly. To analytically solve for the pressure coecient on the cylinder surface, I used Bernoillis equation
to obtain
C
p
= 1
_
2sin +

2aU
_
2
(15)
This equation is derived from the stream function for the uniform ow combined with a doublet, which models the ow
around around a circular cylinder in a uniform stream. When the Kutta condition is placed at = 180

, the cylinder
has no circulation, so the value goes to zero and the analytic solution to the rst problem is
C
p
= 1 4sin
2
(16)
The analytic solution to the second problem is a bit more complicated. I started with the stream function for a circular
cylinder in a uniform stream:
= U

y
_
1
a
2
r
2
_
+

2
ln
_
r
a
_
(17)
The velocity components are found by dierentiating equation (17):
u
r
=
1
r

= U

cos
_
1
a
2
r
2
_
(18)
u

r
= U

sin
_
1 +
a
2
r
2
_


2r
(19)
On the surface of the cylinder, r = a and u
r
disappears. When the stagnation value = 150

is imposed, u

also
vanishes and the equation becomes
= 4aU

sin
s
= 4sin(150

) = 2 (20)
Plugging this value of back into equation (15) results in the analytic solution to the circular cylinder with a Kutta
condition of = 150

:
C
p
= 1
_
2sin +
2
2aU
_
2
= 1 (2sin + 1)
2
(21)
Nick Renda ME 163 Project 2 October 28, 2013
The separation points can be calculated very easily both analytically and numerically. Using the Thwaites method, the
boundary layer separation criterion can be evaluated as
0.45
U
6
e
_
dU
e
dx
__
x
0
U
5
e
()d = 0.09 (22)
Plugging in U
e
= 2sin for the rst case with a standard Kutta condition at = 180, we get
0.45
cos
sin
6

_
cos
_

1
5
sin
4

4
15
sin
2

8
15
_
+
8
15
_
= 0.09 (23)
which predicts a ow separation (measured from the leading edge) at

s
= 103.1

and
s
= 103.1

(24)
For the Kutta condition at = 150

, the math is a bit more complicated. Using equation (19) the velocity solves to
U
e
= 2sin + 1 which is then plugged into equation (22):
0.45
2cos
(2sin + 1)
6
_
51 30sin2 +
5
2
sin4 90cos + 10cos3
2
5
cos5 +
402
5
_
= 0.09 (25)
which predicts a ow separation (measured from the leading edge) at

s
= 106

and
s
= 99

(26)
To solve for separation points numerically, I calculated equation (22) using values from my code: U
e
is the value of the
velocity,
dUe
dx
is the value of the slope calculated from points before and after the chosen point, and the integral was taken
using the trapz function in MATLAB to measure the area under the curve. The integral was ran until the equation
equaled -0.09, and the resultant values for x matched the predicted angles for both Kutta conditions.
3.2 NACA 0012 Airfoil at a 7

Angle of Attack
The results of this plot agree with the airfoil theory we have studied in class, as well as the plot of the same airfoil
at a similar angle of attack in the book on page 140. The lower surface goes to a C
p
of 1.0 and the upper to -3.5 at the
leading edge, and both go to zero at the trailing edge. This general plot shape is characteristic of many dierent types
of airfoils at dierent angles of attack.
4 Conclusions
This project allowed me to utilize my programming skills to calculate the pressure distribution along the surfaces of
cylinders and airfoils using the vortex panel method. By tracking the control points for each panel and applying the
Kutta condition, I was able to create an approximation of the surface and the pressure due to the ow. The plots my
code generated were conrmed with the derived analytical solutions to the pressure distributions, as well as with plots
within the book. Over the course of this project I was able to gain a much better understanding of vortex-panel method
and how it can be implemented in MATLAB to calculate pressure distributions and separation points.

You might also like