0% found this document useful (0 votes)
12 views16 pages

Assignment Paper

The document outlines a series of assignments related to aerodynamics, specifically focusing on airfoil analysis using Matlab and XFOIL. It includes instructions for three assignments: calculating NACA airfoil coordinates, implementing the Hess-Smith panel method for pressure distribution, and using XFOIL for lift and drag calculations. Each assignment is detailed with specific tasks and guidelines for reporting results.

Uploaded by

yasir75
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views16 pages

Assignment Paper

The document outlines a series of assignments related to aerodynamics, specifically focusing on airfoil analysis using Matlab and XFOIL. It includes instructions for three assignments: calculating NACA airfoil coordinates, implementing the Hess-Smith panel method for pressure distribution, and using XFOIL for lift and drag calculations. Each assignment is detailed with specific tasks and guidelines for reporting results.

Uploaded by

yasir75
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Linköping Institute of Technology Aerodynamics

Dept. of Management and Engineering TMMV01


Applied Thermodynamics and Fluid Mechanics 2008

Aerodynamics - TMMV01
Airfoil Analysis

Jonas Lantz, Roland Gårdhagen, Andreas Bradley


April 9, 2008
Aerodynamics-TMMV01 CONTENTS

Contents
1 Introduction 2

2 Assignment 1 - A Matlab Warm Up! 2


2.1 Introduction to Matlab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2.1.1 Dot Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2.1.2 Colon operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2.1.3 For-loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.1.4 Other functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2 The β-matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.3 NACA profiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.3.1 4-digit NACA Airfoils . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.3.2 5-digit NACA Airfoils . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.4 To Do - Assignment 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

3 Assignment 2 - Hess Smith Panel Method 6


3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.2 Derivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.3 To Do - Assignment 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

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.

2 Assignment 1 - A Matlab Warm Up!


2.1 Introduction to Matlab
If you have previous knowledge in Matlab you can go directly to section 2.3 and start with NACA
profiles, this section will deal with fundamental commands such as dot and colon operations, and
for loops.

2.1.1 Dot Operator


Use the dot operator when performing single-element operation with matrices. The dot operator
works with */ˆ and some examples are:
>> [1 2;3 4]*[5 6;7 8] (without the dot)
>> [1 2;3 4].*[5 6;7 8] (with the dot)

>> [1 2;3 4]/[5 6;7 8]


>> [1 2;3 4]./[5 6;7 8]
>> [1 2;3 4]^2
>> [1 2;3 4].^2

What are the differences in the results and why?

2.1.2 Colon operator


Useful commands with the colon operator:
>> 1:3:100
>> -20:2:0

>> 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)

2.1.4 Other functions


Other useful functions that you should know (or learn!) are:
clear, clc, load, size, length, inv, plot, sum, \ (backslash),’ () and ... (three dots).
Use the built-in help in Matlab or type help plot at the promt to read about these commands.
You now have the necessary tools to start your Matlab adventure!

2.2 The β-matrix


As a beginning you are going to do a calculation of β, which is used in the Hess-Smith panel method
code. Here you will use 12 coordinates from a NACA 2412 airfoil, but your code should be general
enough to handle any type of airfoil and any number of coordinates. βij refers to the angle measured
from the midpoint of panel i to the boundary points of panel j. For a review of the theory behind
the panel method and some descriptive figures, see Assignment 2.
The coordinates are:
>> [x y]
1.0000 0
0.9330 -0.0050
0.7500 -0.0170
0.5000 -0.0330
0.2500 -0.0420
0.0670 -0.0330
0 0
0.0670 0.0450
0.2500 0.0760
0.5000 0.0720
0.7500 0.0440
0.9330 0.0130
1.0000 0

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.

2.3 NACA profiles


Airfoils can be classified by their geometrical shape or their aerodynamic properties. One of the
simplest are the NACA profiles with 4 or 5 digits, where the digits determine the mean camber line
and thickness distrubution of the section.

2.3.1 4-digit NACA Airfoils


The 4 digit airfoil can be interpreted as:

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.

2.3.2 5-digit NACA Airfoils


For a 5 digit profile, the shape is calculated slightly different from the 4 digit profile. The digits are
interpreted as:
ClD
z }| {
NACA − |{z}
X XX|{z} XX
|{z} (8)
cl p t

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

Table 1: Table for calculating the mean camber line.

4. Calculate the final coordinates with the relations found in Equation 7.

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 Assignment 2 - Hess Smith Panel Method


3.1 Introduction
You are going to use the Hess-Smith panel method to compute pressure-, lift- and moment coefficients
for your airfoil.

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:

~n = − sin θ~i + cos θ~j (10)


~t = cos θ~i + sin θ~j

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.

~ at any point (x, y) is defined as:


The velocity V

~ =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)

It is convenient to write Equation 11 in terms of velocity components (V n )i and (V t )i :


N
X N
X
(V n )i = Anij qj + n
Bij τj + V∞ sin(α − θi ) (18)
j=1 j=1

N
X N
X
(V t )i = Atij qj + t
Bij τj + V∞ cos(α − θi ) (19)
j=1 j=1

In Equations 18 and 19 Anij , Bij


n
, Atij , Bijt
are known as influence coefficients defined as induced
velocities at a control point (xm , ym ). They are related to the airfoil geometry by the following
expressions: ( h i
1 ri,j+1
sin(θ i − θ j ) ln + cos(θ i − θ j )β ij i 6= j
Anij 2π ri,j
(20)
1
2 i=j
( h ri,j+1
i
1
sin(θ i − θ j )β ij − cos(θ i − θ j ) ln i 6= j
Atij 2π ri,j
(21)
0 i=j
where
n
Bij = −Atij , t
Bij = Anij (22)
h i1/2
ri,j+1 = (xmi − xj+1 )2 + (ymi − yj+1 )2
h i1/2
ri,j = (xmi − xj )2 + (ymi − yj )2
1 1
xmi = (xi + xi+1 ), ymi = (yi + yi+1 )
2 ! 2 !
yi+1 − yi yj+1 − yj
θi = arctan , θj = arctan
xi+1 − xi xj+1 − xj
  
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
π i=j

Note that variables with one index are either column or row vectors while variables with two indicies
are matrices.

Figure 1: The geometry of a panel.

2008 7
Aerodynamics-TMMV01 3 ASSIGNMENT 2 - HESS SMITH PANEL METHOD

Figure 2: Definition of β and panel geometry.

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:

aij = Anij i, j = 1, 2, . . . , N (29)

N
X
n
ai,N +1 = Bij i = 1, 2, . . . , N (30)
j=1

aN +1,j = At1,j + AtN,j j = 1, 2, . . . , N (31)


N
X
t t
aN +1,N +1 = (B1,j + BN,j ) (32)
j=1

The components of ~b follow from Equation 25

bi = −V∞ sin(α − θi ) i = 1, 2, . . . , N (33)

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∞

The forces on each panel can then be calculated as:


fx,i = cp,i (yi+1 − yi ) (36)
fy,i = −cp,i (xi+1 − xi ) (37)
The total force in the x and y directions are then the sum of the force on each panel. Following the
naming convention in Anderson, the total forces becomes:
N
X
ca = fx,i (38)
i=1

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

The necessary software can be found at:


http://web.mit.edu/drela/Public/web/xfoil/
Choose the correct version for your computer, for most modern PCs the xfoilP4.zip (531947 bytes)
version is the most suitable but others might work as well. Extract the .zip-file and run the .exe-
file to start XFOIL. You will see that the interface of the program is an old-school DOS-type text
console, there are not any fancy graphics or buttons in XFOIL meaning that all commands have to
be typed in the console.

Figure 3: Main menu of XFOIL

4.1 Basic Use


Commands preceeded with a dot (like .OPER, .GDES or .PLOP) take you to a lower-level menu,
and commands without a dot (like QUIT, SAVE or NACA) are executed immediately. Pressing return
without a command in a lower-level menu brings you up one level in the menu system. The lowercase
i, r, f, s letters following some commands indicate the type of input needed; i for integer, r for real,
f for filename, and s for character string. The commands are not case sensitive, but here they will
be written in uppercase letters for clarity. Typing a ” ? ” as a command (without the ” ”) brings
up the available commands in that menu. To exit the program, type QUIT in the main menu.

4.2 Create a NACA Airfoil


To create a NACA airfoil, just type NACA XXXX, where XXXX is the four or five digit NACA profile
number.
XFOIL c> NACA 4412
produces the coordinates for a NACA 4412 airfoil. The coordinates are now stored in the memory
and ready for calculations. The default value for the number of panels is 140, but it can be changed
with the command ppar.

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

Figure 4: A vector plot of the pressure distribution

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.

The cp distrubution in vector form is visible by using CPV:


.OPERv c> cpv
To save the plot to a post script image file, type
.OPERv c> hard
to hardcopy the current plot. It will be saved in the same folder as the XFOIL .exe-file and named
plot.ps. Note that you can only get one plot, if you want to have more you have to quit the program,
rename the file and then redo the calculation. But it is possible to save data to a text file:
.OPERv c> cpwr
Enter filename s> data.txt
.OPERv c> dump
Enter filename s> my data dump.txt
The first command, CPWR, writes the cp distrubution to a file and the second command, DUMP, writes
Ue, Dstar, Theta, Cf vs s, x, y to file. One other way to save data is to enable polar accumulation.
This is done with the command PACC:
.OPERv c> pacc
Polar 1 newly created for accumulation
Airfoil archived with polar: NACA 4412
Enter polar save filename OR <return> for no file s> my polar.txt
New polar save file available
Enter polar dump filename OR <return> for no file s>
Polar dump file will NOT be written
Polar accumulation enabled
The PACC command toggles polar accumulation and asks for save and dump filenames. Here a file
called my polar.txt is created, but no dump file. After the polar accumulation is enabled you can
perfom ALFA or ASEQ calculations, and then disable the accumulation by typing PACC again. The
file now contains values for α, cl , cd , cdp , cm , TopXtr and BotXtr , as seen in Figure 5. If the polar
accumulation is not disabled after a calculation and another calculation is performed, the saved data
will be appended to the save file but only if the airfoil name and flow parameters in the file match
the current parameters.

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

Figure 5: The output of ASEQ saved with polar accumulation

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

4.5 Adding a Flap


To add a flap to the airfoil, go to the main menu in XFOIL and then type GDES to go to the geometry
design routine. Type ? to see all commands, and choose FLAP. Enter the x- and y-coordinates of the
hinge of the flap and the angle of the deflection:
XFOIL c> gdes
You are working with the buffer airfoil
.GDES c> flap 0.7 0.05 30
Here a hinge is created at (0.7,0.05) and the flap is deflected 30 degrees (down). It is also possible
to specify a y-coordinate determined by the thickness by doing:
.GDES c> flap
Enter flap hinge x location r> 0.7
Enter flap hinge y location (or 999 to specify y/t) r> 999
Enter flap hinge relative y/t location r> 0.5
Enter flap deflection in degrees (+ down) r> 30
To be able to use the flap in the calculations, it must be added to the airfoil in the memory. Do this
by typing EXEC:
.GDES c> exec
Current airfoil nodes set from buffer airfoil nodes ( 193 )
The calculations are then performed in the same way as before.

2008 13
Aerodynamics-TMMV01 5 REPORT

4.6 Inverse Formulation - Geometry Design


In XFOIL it is possible to do an inverse formulation, i.e. from a specified pressure distrubution
calculate the shape of the geometry. This is done in the submenu .MDES with the command MODI.
You will then get a window that display the pressure coefficient around the entire airfoil and where
you can change the values with the mouse. When done, execute the command EXEC to calculate
the new airfoil and then PANE in the main menu to store it in the memory. Note that the program
sometimes calculates a negative thickness which of course is a non-physical solution.

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?

Which angle of attack is best suited for take-off? Landing? Cruise?

5.3 Report Instructions


The report shall be well structured and with the Matlab code appended. The maximum number of
pages is 20 and the report must contain the following:
• Title Page
• Abstract

• 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

You might also like