aeropy documentation aeropy documentation 3 ... 5 tutorial 15 6 to do 17 7 ... contrary to available...

23
AeroPy Documentation Release 0.0.2 Pedro Leal Jun 01, 2018

Upload: vukhanh

Post on 24-Apr-2018

282 views

Category:

Documents


9 download

TRANSCRIPT

Page 1: AeroPy Documentation AeroPy Documentation 3 ... 5 Tutorial 15 6 To Do 17 7 ... Contrary to available options such as XFLR5, AeroPy aims to be an open source Python code

AeroPy DocumentationRelease 0.0.2

Pedro Leal

Jun 01, 2018

Page 2: AeroPy Documentation AeroPy Documentation 3 ... 5 Tutorial 15 6 To Do 17 7 ... Contrary to available options such as XFLR5, AeroPy aims to be an open source Python code
Page 3: AeroPy Documentation AeroPy Documentation 3 ... 5 Tutorial 15 6 To Do 17 7 ... Contrary to available options such as XFLR5, AeroPy aims to be an open source Python code

Contents

1 AeroPy Documentation 31.1 Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2 Xfoil Module Documentation 52.1 Core Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.2 Auxiliary Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.3 Utility Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

3 Aerodynamic Module Documentation 73.1 Lifting Line Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73.2 The code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

4 Airfoil Module Documentation 94.1 Core Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94.2 Auxiliary Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94.3 Utility Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

5 Tutorial 11

6 To Do 13

7 Recommended Collaborations 15

8 Indices and tables 17

9 Examples 19

i

Page 4: AeroPy Documentation AeroPy Documentation 3 ... 5 Tutorial 15 6 To Do 17 7 ... Contrary to available options such as XFLR5, AeroPy aims to be an open source Python code

ii

Page 5: AeroPy Documentation AeroPy Documentation 3 ... 5 Tutorial 15 6 To Do 17 7 ... Contrary to available options such as XFLR5, AeroPy aims to be an open source Python code

AeroPy Documentation, Release 0.0.2

AeroPy is an library for calculating aerodynamic properties. The main feature of this library is the Python interfacewith XFOIL. The main objective of this library is to be able to use XFOIL via Python iteratively in a total of 4 linestotal (one line for most uses). Through this interface coupling with other softwares (Abaqus, Ansys, etc) is possibleand iterative processes (optimization, design sensitivity) are possible. For a thorough explanation please check thedocumentation and the tutorials.

Contents:

Contents 1

Page 6: AeroPy Documentation AeroPy Documentation 3 ... 5 Tutorial 15 6 To Do 17 7 ... Contrary to available options such as XFLR5, AeroPy aims to be an open source Python code

AeroPy Documentation, Release 0.0.2

2 Contents

Page 7: AeroPy Documentation AeroPy Documentation 3 ... 5 Tutorial 15 6 To Do 17 7 ... Contrary to available options such as XFLR5, AeroPy aims to be an open source Python code

CHAPTER 1

AeroPy Documentation

This project was elaborated because of the need of optimizing an airfoil according to its aerodynamic and structuralperformance (conference paper). Contrary to available options such as XFLR5, AeroPy aims to be an open sourcePython code. It is a quick and easy way to find the aerodynamic pressure and the drag and lift coefficients through theuse of MIT’s XFOIL embedded in Python. Contrary to the other libraries, AeroPy does not have a GUI and is intendedto be used in Python codes for optimizations or any other process that requires several aerodynamic analysis.

AeroPy is separated in three modules: (it is programmed in such a way that a new module can be easily inserted)

• xfoil: contains all the functions relating to XFOIL.

• aero: contains all functions related to aerodynamics, but not related to XFOIL.

• AeroPy: imports all functions and acts as the intersection of all different modules

1.1 Code

3

Page 8: AeroPy Documentation AeroPy Documentation 3 ... 5 Tutorial 15 6 To Do 17 7 ... Contrary to available options such as XFLR5, AeroPy aims to be an open source Python code

AeroPy Documentation, Release 0.0.2

4 Chapter 1. AeroPy Documentation

Page 9: AeroPy Documentation AeroPy Documentation 3 ... 5 Tutorial 15 6 To Do 17 7 ... Contrary to available options such as XFLR5, AeroPy aims to be an open source Python code

CHAPTER 2

Xfoil Module Documentation

The functions herein defined are purposely made for use with Xfoil.

2.1 Core Function

2.2 Auxiliary Functions

2.3 Utility Functions

5

Page 10: AeroPy Documentation AeroPy Documentation 3 ... 5 Tutorial 15 6 To Do 17 7 ... Contrary to available options such as XFLR5, AeroPy aims to be an open source Python code

AeroPy Documentation, Release 0.0.2

6 Chapter 2. Xfoil Module Documentation

Page 11: AeroPy Documentation AeroPy Documentation 3 ... 5 Tutorial 15 6 To Do 17 7 ... Contrary to available options such as XFLR5, AeroPy aims to be an open source Python code

CHAPTER 3

Aerodynamic Module Documentation

3.1 Lifting Line Theory

If 𝜃0 is an arbitrary span-wise location:

𝛼(𝜃𝑜) =2𝑏

𝜋𝑐(𝜃𝑜)

𝑁∑︁1

𝐴𝑛𝑠𝑖𝑛(𝑛𝜃𝑜) + 𝛼𝐿=0(𝜃𝑜) +

𝑁∑︁1

𝑛𝐴𝑛𝑠𝑖𝑛(𝑛𝜃𝑜)

𝑠𝑖𝑛(𝜃𝑜)(3.1)

Each equation has 𝑁 unknowns (𝐴𝑛), so if there are N 𝜃𝑜, we have NxN system, which in Einstein notation can bewritten as:

𝐶𝑖𝑗𝐴𝑖 = 𝐷𝑖 (3.2)

where, 𝑖 = 0, ..., 𝑁 , 𝑗 = 0, ..., 𝑁 and :

𝐶𝑖𝑗 =

(︂2𝑏

𝜋𝑐(𝑗)+

𝑛

𝑠𝑖𝑛𝜃(𝑖)

)︂𝑠𝑖𝑛(𝑛𝜃(𝑖)) (3.3)

𝐴𝑖 = 𝐴(𝑖) (3.4)

𝐷𝑖 = 𝛼(𝑖)− 𝛼𝐿=0(𝑖) (3.5)

where 𝑛 = 1, 3, 5, ..., 𝑁 − 1. Since we are considering a symmetric wing, all of the even terms would cancel eachother

3.2 The code

7

Page 12: AeroPy Documentation AeroPy Documentation 3 ... 5 Tutorial 15 6 To Do 17 7 ... Contrary to available options such as XFLR5, AeroPy aims to be an open source Python code

AeroPy Documentation, Release 0.0.2

8 Chapter 3. Aerodynamic Module Documentation

Page 13: AeroPy Documentation AeroPy Documentation 3 ... 5 Tutorial 15 6 To Do 17 7 ... Contrary to available options such as XFLR5, AeroPy aims to be an open source Python code

CHAPTER 4

Airfoil Module Documentation

The functions herein defined are purposely made for generating NACA airfoils, flapped airfoils and CST airfoils.

4.1 Core Function

4.2 Auxiliary Functions

4.3 Utility Functions

9

Page 14: AeroPy Documentation AeroPy Documentation 3 ... 5 Tutorial 15 6 To Do 17 7 ... Contrary to available options such as XFLR5, AeroPy aims to be an open source Python code

AeroPy Documentation, Release 0.0.2

10 Chapter 4. Airfoil Module Documentation

Page 15: AeroPy Documentation AeroPy Documentation 3 ... 5 Tutorial 15 6 To Do 17 7 ... Contrary to available options such as XFLR5, AeroPy aims to be an open source Python code

CHAPTER 5

Tutorial

11

Page 16: AeroPy Documentation AeroPy Documentation 3 ... 5 Tutorial 15 6 To Do 17 7 ... Contrary to available options such as XFLR5, AeroPy aims to be an open source Python code

AeroPy Documentation, Release 0.0.2

12 Chapter 5. Tutorial

Page 17: AeroPy Documentation AeroPy Documentation 3 ... 5 Tutorial 15 6 To Do 17 7 ... Contrary to available options such as XFLR5, AeroPy aims to be an open source Python code

CHAPTER 6

To Do

• Include asymmetric wing

• Create airfoil and wing classes

13

Page 18: AeroPy Documentation AeroPy Documentation 3 ... 5 Tutorial 15 6 To Do 17 7 ... Contrary to available options such as XFLR5, AeroPy aims to be an open source Python code

AeroPy Documentation, Release 0.0.2

14 Chapter 6. To Do

Page 19: AeroPy Documentation AeroPy Documentation 3 ... 5 Tutorial 15 6 To Do 17 7 ... Contrary to available options such as XFLR5, AeroPy aims to be an open source Python code

CHAPTER 7

Recommended Collaborations

Please use and adapt this library to your needs. There are several functionalities I wished to implement, but did nothave the time. Hence I am strongly recommending the following collaborations:

• Airfoil generator with a GUI

• Atmospheric module (use the library already available in aero_module)

• Extend aero_module for wings with non-constant cross sections

15

Page 20: AeroPy Documentation AeroPy Documentation 3 ... 5 Tutorial 15 6 To Do 17 7 ... Contrary to available options such as XFLR5, AeroPy aims to be an open source Python code

AeroPy Documentation, Release 0.0.2

16 Chapter 7. Recommended Collaborations

Page 21: AeroPy Documentation AeroPy Documentation 3 ... 5 Tutorial 15 6 To Do 17 7 ... Contrary to available options such as XFLR5, AeroPy aims to be an open source Python code

CHAPTER 8

Indices and tables

• genindex

• modindex

• search

17

Page 22: AeroPy Documentation AeroPy Documentation 3 ... 5 Tutorial 15 6 To Do 17 7 ... Contrary to available options such as XFLR5, AeroPy aims to be an open source Python code

AeroPy Documentation, Release 0.0.2

18 Chapter 8. Indices and tables

Page 23: AeroPy Documentation AeroPy Documentation 3 ... 5 Tutorial 15 6 To Do 17 7 ... Contrary to available options such as XFLR5, AeroPy aims to be an open source Python code

CHAPTER 9

Examples

A simple example demonstrating how to use AeroPy to calculate lift, drag and moment coefficients for a NACA0012airfoil at angle of attack of 12 degrees.

from AeroPy import find_coefficientsfind_coefficients(airfoil='naca0012'alpha=12.)>>> {'CM': 0.0134, 'CL': 1.2453, 'Top_Xtr': 0.0194, 'CD': 0.01934, 'CDp': 0.01379,→˓'alpha': 12.0, 'Bot_Xtr': 1.0}

Another example showing how to use AeroPy to calculate pressure coefficients for a NACA0012 in viscous flow atReynolds = 10000000 and angle of attack of 12 degrees

from AeroPy import find_pressure_coefficientsfind_pressure_coefficients(airfoil='naca0012', Reynolds = 1e6, alpha=12.,NACA=True)>>> 'y': [0.00126, ..., -0.00126], 'x': [1.0, ..., 1.0], 'Cp': [0.41501, ..., 0.→˓41501]}

19