Assignment Paper
Assignment Paper
Aerodynamics - TMMV01
Airfoil Analysis
Contents
1 Introduction 2
4 Assignment 3 - XFOIL 9
4.1 Basic Use . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.2 Create a NACA Airfoil . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.3 Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.4 Convergence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.5 Adding a Flap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.6 Inverse Formulation - Geometry Design . . . . . . . . . . . . . . . . . . . . . . . . . 14
4.7 To Do - Assignment 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5 Report 14
5.1 Comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5.2 Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.3 Report Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2008 1
Aerodynamics-TMMV01 2 ASSIGNMENT 1 - A MATLAB WARM UP!
1 Introduction
You are going to do three assignments that are coupled together. In the first assignment you will
calculate the coordinates for your individually assigned NACA airfoil. You will also get a small
introduction to Matlab (if needed). In the second assignment you will use the coordinates from the
first assignment and implement some expressions in a Hess-Smith panel method solver to compute
the pressure distrubution and lift coefficient for different angles of attack. Finally, in the third as-
signment you will use a software called XFOIL to compute lift, drag and other parameters for the
same airfoil.
This paper is divided into three main parts, one for each assignment. Each part will end with
a section called ”To Do” where the tasks and requirements for each assignment are presented. You
are to write one report on all three assignments, and in the end of this paper there is a section about
what must be included in the report and some guidelines.
>> A = [1:3;4:6]
>> A(1,:)
>> A(:,2)
What is the difference between this command and the one above?
>> N = 10, M = 20
>> T(1:N,1:M) = 0
If you do not understand the differences, refer to the Arithmetic Operators section in the built-in
help (press F1).
2008 2
Aerodynamics-TMMV01 2 ASSIGNMENT 1 - A MATLAB WARM UP!
2.1.3 For-loop
For-loops are useful when dealing with expressions that require indices. One example is Equation 1
in section 2.2 which can be done with a double for-loop.
for i = 1:N
for j = 1:N
beta(i,j) = mathematical expression
end
end
For-loops can often be replaced with Matlab’s own built-in matrix operation which is faster. For
example:
for j = 1:N
variable(j) = 1+sin(pi*j/10)
end
can easliy be done with:
variable(1:N) = 1+sin(pi*(1:N)/10)
or even shorter as:
variable = 1+sin(pi*(1:N)/10)
You can either put them in a text file and use A = load(’text_file.txt’) or simply assign a
variable the numbers. Then you need to calculate (xmi , ymi ), which is the midpoint on each
panel. The midpoint is defined as the average value of the two coordinates of each panel, and
this can be done with a for-loop, or simply something like xm = (1/2)*(x(1:N)+x(2:N+1)) where
N = number_of_panels. After the midpoints are calculated you can continue to calculate β. Using
basic trigonometry it is easily found that every angle can be calculated as:
ymi − yj+1 ymi − yj
βij = arctan − arctan (1)
xmi − xj+1 xm i − xj
2008 3
Aerodynamics-TMMV01 2 ASSIGNMENT 1 - A MATLAB WARM UP!
However, Equation 1 can produce numerical errors and therefore it is re-written with the arctangent
subtraction rule:
a−b
arctan(a) − arctan(b) = arctan (2)
1 + ab
Equation 1 then becomes
arctan (ymi −yj+1 )(xmi −xj )−(xmi −xj+1 )(ymi −yj ) i 6= j
(xmi −xj+1 )(xmi −xj )+(ymi −yj+1 )(ymi −yj )
βij (3)
π i=j
Why βii = π is explained in the Hess-Smith panel method assignment. In this case it is important
to use the atan2 function instead of the normal atan function in Matlab when calculating the
arctangent (why?). After you have calculated β it will be a 12x12 matrix with the following elements:
3.1416 -0.0076 -0.0016 -0.0102 -0.0212 -0.0365 -0.0502 -0.0564 -0.0492 -0.0532 -0.2218 -2.6338
-0.0038 3.1416 -0.0011 -0.0120 -0.0240 -0.0415 -0.0591 -0.0739 -0.0924 -0.3028 -2.3439 -0.1872
-0.0017 -0.0009 3.1416 -0.0186 -0.0310 -0.0543 -0.0848 -0.1383 -0.3968 -1.9773 -0.3816 -0.0562
-0.0018 -0.0036 -0.0186 3.1416 -0.0506 -0.0851 -0.1620 -0.4755 -1.6850 -0.5054 -0.1237 -0.0303
-0.0026 -0.0073 -0.0215 -0.0623 3.1416 -0.1832 -0.5014 -1.5156 -0.5820 -0.1734 -0.0718 -0.0206
-0.0043 -0.0135 -0.0347 -0.0819 -0.3404 3.1416 -1.6119 -0.6682 -0.2163 -0.1032 -0.0515 -0.0157
-0.0073 -0.0245 -0.0633 -0.1711 -0.7382 -1.5224 3.1416 -0.3492 -0.1365 -0.0757 -0.0406 -0.0127
-0.0126 -0.0459 -0.1370 -0.5748 -1.5033 -0.4316 -0.1968 3.1416 -0.1341 -0.0616 -0.0334 -0.0105
-0.0228 -0.0974 -0.4699 -1.6856 -0.4137 -0.1395 -0.1010 -0.1099 3.1416 -0.0638 -0.0291 -0.0090
-0.0483 -0.3387 -1.9719 -0.3687 -0.0989 -0.0691 -0.0692 -0.0713 -0.0636 3.1416 -0.0335 -0.0084
-0.1731 -2.3292 -0.2833 -0.0595 -0.0394 -0.0454 -0.0552 -0.0588 -0.0466 -0.0411 3.1416 -0.0101
-2.6193 -0.2226 -0.0237 -0.0169 -0.0237 -0.0372 -0.0495 -0.0539 -0.0428 -0.0320 -0.0201 3.1416
When your program calculates β correctly you can proceed to section 2.3, to generate the geometry
of your own airfoil.
NACA − |{z}
X |{z}
X XX
|{z} (4)
m p t
The first digit is called m and is the maximum camber in percentage of the chord. The second digit
is called p and tells the position of the maximum camber in tenths of chord from the leading edge.
The last two digits are the thickness t of the airfoil in percentage of chord.
As an example, consider the NACA 2412 airfoil. It has a maximum thickness of 12% (t = 12),
and a camber of 2% (m = 2) located at 40% (p = 4) behind the leading edge. With these coeffi-
cients it is possible to determine the shape of the 4 digit airfoil by doing the following steps:
1. Choose x-coordinates from the leading edge (x = 0) to the trailing edge (x = c).
2. Calculate the thickness distrubution yt with:
t √
yt = 0.2969 x − 0.126x − 0.35160x2 + 0.2843x3 − 0.1015x4 (5)
0.2
2008 4
Aerodynamics-TMMV01 2 ASSIGNMENT 1 - A MATLAB WARM UP!
3. Calculate the mean camber line yc of the airfoil. For NACA profiles with 4 digits, the mean
camber line is defined as:
m
yc = 2 (2px − x2 ) for 0<x<p
p
m (6)
2
yc = (1 − 2p) + 2px − x for p<x<1
(1 − p)2
4. Finally, calculate the coordinates of the airfoil using the following relationships:
Xu = x − yt sin(θ)
Yu = yc + yt cos(θ)
(7)
Xl = x + yt sin(θ)
Yl = yc − yt cos(θ)
where θ is the angle of the mean camber line gradient at the coordinate x (see Figure 1) and
subscripts u and l stands for upper and lower side of the airfoil.
where the first three digits gives the Camber-line designation (ClD), the first digit gives the design
lift coefficient (cl ) in tenths when multiplied with 3/2, the next two digits gives the position of
maximum camber (p) in tenths of chord length when divided by 2, and the last two digits the
maximum thickness (t) in percentage of chord length. To calculate the shape the following steps are
performed:
1. Pick x-coordinates just as for the 4-digit profile.
2. Use Equation 5 to calculate the thickness distrubution.
3. Calculate the mean camber line yc as defined in Equation 9 by using Table 1.
k1 3
x − 3mx2 + m2 (3 − m)x
yc = for 0<x<m
6 (9)
k1 3
yc = (m (1 − x)) for m<x<1
6
Camber-line Position of
designation max camber (p) m k1
210 0.05 0.0580 361.400
220 0.10 0.1260 51.640
230 0.15 0.2025 15.957
240 0.20 0.2900 6.643
250 0.25 0.3910 3.230
2008 5
Aerodynamics-TMMV01 3 ASSIGNMENT 2 - HESS SMITH PANEL METHOD
2.4 To Do - Assignment 1
• Compute the coordinates for your individually assigned NACA airfoil (either 4 or 5 digits).
Type [x;y]’ at the promt in Matlab and copy/paste the coordinates into a text file (.txt) so
that Matlab can read it later using load. (You could also use dlmwrite to save the coordinates
and dlmread to read the file).
3.2 Derivation
Consider an airfoil in an onset flow of velocity V∞ and angle of attack α. Let ~n denote the unit
vector normal to the airfoil surface and directed from the body into the fluid, and ~t a unit vector
tangential to the surface. Let the inclination between the tangential unit vector and the x-axis be
given by θ. With ~i and ~j denoting unit vectors in x- and y-directions, respectively, it follows that:
Now assume that the airfoil contour is divided into N − 1 number of straight lines called panels. The
panels are defined by N boundary points (xj , yj ) and it is customary to start with the first coordinate
(x1 , y1 ) at the lower surface trailing edge and proceeding clockwise around the airfoil, ending at the
upper trailing edge with coordinate (xN , yN ). The panel between (xj , yj ) and (xj+1 , yj+1 ) is called
the j -th panel and the midpoint (xm , ym ) on the panel is refered to as the control point.
~ =U
V ~ + ~v (11)
~ is the free stream velocity and ~v the disturbance field due to the body. These two velocities
where U
can be calculated as:
~ = V∞ (cos α~i + sin α~j)
U (12)
Z Z
~v (x, y) = ~vs qj (s)dsj + ~vv τj (s)dsj (13)
In Equation 13 the disturbance field is calculated by source and vortex elementary flows. In the first
integral qj dsj is the source strength for element j and in the second integral τj dsj is the vorticity
strength for the same element. A source on a panel causes an induced source velocity ~vs at any
point (x, y) and a vortex on a panel causes an induced vortex velocity ~vv at the same point (x, y).
The induced velocities satisfy the irrotationality condition and the free stream boundary condition:
∂φ ∂ψ
u= = = V∞ cos α (14)
∂x ∂y
∂φ ∂ψ
v= =− = V∞ sin α (15)
∂y ∂x
To satisfy the boundary condition on the body, the surface of the body needs to be a streamline:
∂φ
ψ = constant or =0 (16)
∂n
2008 6
Aerodynamics-TMMV01 3 ASSIGNMENT 2 - HESS SMITH PANEL METHOD
If the normal and tangential components of the velocity at a control point i is denoted (V n )i and
(V t )i , respectively, then the boundary condition in Equation 16 yields:
(V n )i = 0 i = 1, 2, . . . , N (17)
N
X N
X
(V t )i = Atij qj + t
Bij τj + V∞ cos(α − θi ) (19)
j=1 j=1
Note that variables with one index are either column or row vectors while variables with two indicies
are matrices.
2008 7
Aerodynamics-TMMV01 3 ASSIGNMENT 2 - HESS SMITH PANEL METHOD
Using the Kutta condition, the magnitude of the tangential velocities at the trailing edge must be
equal and oppsite in sign:
(V t )N = −(V t )1 (23)
The vorticity is assumed to be constant on all panels, i.e.:
τj = τ (24)
With zero flow velocity in the normal direction (Equation 17) and constant τ , Equation 18 becomes:
N
X N
X
Anij qj +τ n
Bij + V∞ sin(α − θi ) = 0 i = 1, 2, . . . , N (25)
j=1 j=1
where the unknowns are qj (j = 1, 2, . . . , N ) and τ . A system of algebraic Equations can now be
written in the form:
A~c = ~b (26)
where
a1,1 a1,2 ... a1,N a1,N +1
a2,1 a2,2 ... a2,N a2,N +1
A=
.. .. .. .. ..
(27)
. . . . .
aN,1 aN,2 ... aN,N aN,N +1
aN +1,1 aN +1,2 ... aN +1,N aN +1,N +1
and
~c = (q1 , . . . , qN , τ )T and ~b = (b1 , . . . , bN , bN +1 )T (28)
Note the τ in the expression for ~c. The elements aij in A are as follows:
N
X
n
ai,N +1 = Bij i = 1, 2, . . . , N (30)
j=1
2008 8
Aerodynamics-TMMV01 4 ASSIGNMENT 3 - XFOIL
and
bN +1 = −V∞ cos(α − θ1 ) − V∞ cos(α − θN ) (34)
With both A and ~b known, ~c can easily be calculated by taking the inverse of A. When the sources
and vorticity is known, the velocities can be calculated with Equations 18 and 19.
When the velocities are known the pressure coefficient can be calculated as:
!2
Vit
cpi = 1 − i = 1, 2, . . . , N (35)
V∞
N
X
cn = fy,i (39)
i=1
Knowing the forces, the lift and moment coefficients can be calculated with:
cl = −ca sin(α) + cn cos(α) (40)
N
X
cm,LE = (fx,i ym,i − fy,i xm,i ) (41)
i=1
N
X
cm,c/4 = (fx,i ym,i − fy,i (xm,i − c/4)) (42)
i=1
3.3 To Do - Assignment 2
• Use the Hess-Smith Matlab code available on the course web page, and implement expressions
for velocity, forces, and pressure- lift- and moment coefficients.
• Plot the pressure distrubution around the airfoil at various angles of attack
• Plot the lift coefficient as a function of angle of attack.
• Try different number of panels in the model and see how it affects the results. You should try
at least 10-50-100-200-500-1000 panels (this means that you need to generate more coordinate
files from assignment 1.)
• Do you get numerical problems at the leading or trailing edge? If so, what can be done to
minimize those effects?
4 Assignment 3 - XFOIL
XFOIL is a high-order panel method program, written by Mark Drela at MIT. It is mainly used
for the design and analysis of subsonic airfoils. The program can simulate both inviscid and viscous
flows and calculate cp , cl , cd and other parameters which can be useful when designing an airfoil.
2008 9
Aerodynamics-TMMV01 4 ASSIGNMENT 3 - XFOIL
2008 10
Aerodynamics-TMMV01 4 ASSIGNMENT 3 - XFOIL
4.3 Calculations
To perform calculations, go to the OPER menu:
XFOIL c> OPER
The command prompt now changed from XFOIL to .OPERi where lowercase i does not indicate
integer, but instead inviscid calculation mode. To see all available commands in the OPER menu,
type:
.OPERi c> ?
To go from inviscid to viscous mode, type:
.OPERi c> visc
After pressing return, you have to enter a suitable Reynolds number, enter something like 3e6.
Notice how the command promt changes from .OPERi to .OPERv, where v stands for viscous. The
default number of interations in XFOIL is 10, which is a bit low. Change the number of iterations
to 100 with the ITER command:
.OPERv c> ITER
Current iteration limit: 10
Enter new iteration limit i> 100
Now it is time to do some calculations. To evaluate the airfoil at a certain angle of attack, type:
.OPERv c> alfa
Enter angle of attack (deg) r> 5
Calculating unit vorticity distributions ...
or more compact:
.OPERv c> alfa 5
Calculating unit vorticity distributions ...
The program starts to iterate and after a while the corresponding cp versus x-coordinate distrubution
is plotted. In the plot are also values for Re, α, cl , cm , cd , L/D, and Ncr . To do an alpha sweep, use
the ASEQ command:
.OPERv c> aseq
Enter first alfa value (deg) r> -10
Enter last alfa value (deg) r> 10
Enter alfa increment (deg) r> 2
That command will calculate the cp distubution (and the other parameters) of angles ranging from
-10 to 10 with an increment of 2. A more compact command that produces the same results would
be:
.OPERv c> aseq -10 10 2
To see the difference between an inviscid and a viscous calculation, type:
.OPERv c> cpx
The dashed lines are the inviscid calculation and the soild line the viscous calculation. Sometimes
the y-scale can be too small, which is easily fixed with CPMI:
.OPERv c> cpmi
Current CPmin = -2.000000
Enter new CPmin r> -5
2008 11
Aerodynamics-TMMV01 4 ASSIGNMENT 3 - XFOIL
To zoom in and out of the plot, just type Z and then use the mouse to click on the plot. To unzoom,
just type U.
Other useful commands could be PPLO for plotting the contents of a polar file, and PGET to read
previous polar files.
2008 12
Aerodynamics-TMMV01 4 ASSIGNMENT 3 - XFOIL
4.4 Convergence
Sometimes the solution does not converge:
VISCAL: Convergence failed
Type "!" to continue iterating
Continuing to iterate could give a converging result (try at least 300 iterations), but if there is
massive separation or supersonic flow a converging solution might not be possible. The iterations
are based on the previous calculation and if there is a big difference in α the calculation can become
unstable. To minimize the risk for this, a re-initialization of the boundary layers with the INIT
command can be done before the calculation is performed:
.OPERv c> init
BLs will be initialized on next point
2008 13
Aerodynamics-TMMV01 5 REPORT
4.7 To Do - Assignment 3
Play around with the program to get familiarized with the interface and commands before starting
with the assignments.
With the NACA airfoil number assigned to you earlier, perform alpha sweeps between -15◦ and
30◦ with the following conditions:
• Inviscid flow
• Viscous flow with a Reynolds number of 3 · 106 .
• Viscous flow with a flap at x = 0.75c, y = 0.5 y/t with a +30◦ deflection and the same
geometry.
• Viscous flow with the flap angle set to -30◦ (you will have to make a new geometry)
• Compare the viscous flow results with a symmetrical airfoil, i.e. if your airfoil number is
NACA 2412 then perform the same simulations for NACA 0012 (double zeros in the beginning
indicates a symmetrical airfoil).
Save values for α, cl , cd , and cm and remember to save the data after each simulation! If there is
a problem with convergence after more than 300 iterations, skip that/those angles.
Optional task: Use the inverse formulation on your airfoil, and try to optimize the shape with
respect to maximum lift and minimum drag. Where should the highest pressure be located? Then
do the opposite, optimize with respect to minimum lift and maximum drag. What are the differences
between the two airfoils?
5 Report
5.1 Comparison
Find your airfoil in NACA report 824 (can be found on the course web page), and extract data for
cl versus α and cd versus cl . Choose data for a Reynolds number as close as possible to 3 · 106 .
• Plot cl versus α for the Hess-Smith solution, the inviscid and viscous solution from XFOIL
and the measured values found in the report.
• Plot cp versus x/c for the Hess-Smith solution, inviscid and viscous simulation for some angles
of attack.
• Plot cl versus cd for the viscous simulation and the measured values.
• Plot cl versus cm for the viscous simulation and the measured values.
• Plot cl /cd versus α for the viscous simulation and the measured values.
• Chose suitable parameters and compare the effect of adding a flap ± 30◦ with a non-flapped
airfoil.
2008 14
Aerodynamics-TMMV01 5 REPORT
5.2 Analysis
Compare the results in the graphs. What are the differences between the simulations and how do
they affect the result? Which flap configuration (-30◦ , 0◦ or +30◦ ) is best suited for take-off? Land-
ing? Cruise?
Compare cp versus α for the inviscid simulation with the result from the Hess-Smith panel method
you did in assignment 2. Compare the viscous simulation (without the flap) with your Hess-Smith
panel method. Are they similar?
What are the assumptions in Hess-Smith and how do they affect the solution?
Are there any stagnation points in the pressure distrubution? Where and why?
• Table of Contents
• Introduction: A short introduction/background where the flow and task are presented. Also
state the aim of the work. Maximum 1/2 page.
• Method: Outline shortly the method you used (but no results here, only what you have done).
Maximum 2 pages.
• Results: Present all your results here. Be short and comment only on things that might
facilitate the understanding or for some other reason are important to highlight right now.
• Discussion: Here comes the analysis. Carefully evaluate your results and findings - Are they
expected? Are they reasonable? Why are they interesting? - are examples of question to be
answered in this section. Also comment on your work, did you encounter unexpected problems,
could something have been done differently, etc.
• Conclusion: Briefly (within a few rows) state the important conclusions of your work, but do
not present a repetition of the discussion (or an additional). This section may also be a part
of the discussion.
• References
• Appendix: Matlab code and other things that do not fit in the report.
Figures must be neat with informative captions, numbered and referred to in the text. Try to include
as much information in every figure as possible without making it difficult to interpret - but the
focus of the report must be on the text and not on the figures! A figure must not occupy more than
25% of a page. You may write the report in either swedish or english, but the latter is encouraged.
Good luck!
2008 15