All modules for which code is available
41 |- AeroPy 42 |
- aero_module 43 |
- xfoil_module 44 |
├── requirements.txt ├── docs ├── tutorial.rst ├── _build │ ├── html │ │ ├── _sources │ │ │ ├── tutorial.txt │ │ │ ├── pyxfoil_doc.txt │ │ │ ├── airfoil_module.txt │ │ │ ├── xfoil_functions.txt │ │ │ ├── xfoil_module.txt │ │ │ ├── main_module.txt │ │ │ ├── aero_doc.txt │ │ │ ├── aero_module.txt │ │ │ └── index.txt │ │ ├── objects.inv │ │ ├── _static │ │ │ ├── down.png │ │ │ ├── file.png │ │ │ ├── logo.png │ │ │ ├── plus.png │ │ │ ├── up.png │ │ │ ├── minus.png │ │ │ ├── comment.png │ │ │ ├── ajax-loader.gif │ │ │ ├── up-pressed.png │ │ │ ├── comment-bright.png │ │ │ ├── comment-close.png │ │ │ ├── down-pressed.png │ │ │ ├── pygments.css │ │ │ ├── doctools.js │ │ │ ├── underscore.js │ │ │ └── alabaster.css │ │ ├── _images │ │ │ └── elliptical_LLT.png │ │ ├── .buildinfo │ │ ├── pyxfoil_doc.html │ │ ├── _modules │ │ │ ├── index.html │ │ │ └── AeroPy.html │ │ ├── search.html │ │ ├── tutorial.html │ │ ├── py-modindex.html │ │ ├── airfoil_module.html │ │ ├── aero_doc.html │ │ ├── searchindex.js │ │ ├── genindex.html │ │ ├── main_module.html │ │ ├── index.html │ │ └── aero_module.html │ └── doctrees │ │ ├── index.doctree │ │ ├── aero_doc.doctree │ │ ├── tutorial.doctree │ │ ├── aero_module.doctree │ │ ├── environment.pickle │ │ ├── main_module.doctree │ │ ├── pyxfoil_doc.doctree │ │ ├── airfoil_module.doctree │ │ ├── xfoil_module.doctree │ │ └── xfoil_functions.doctree ├── images │ ├── logo.png │ ├── elliptical_LLT.png │ └── logo.svg ├── _static │ └── logo.png ├── airfoil_module.rst ├── xfoil_module.rst ├── main_module.rst ├── aero_module.rst ├── index.rst ├── make.bat ├── Makefile └── conf.py ├── pplot.exe ├── pxplot.exe ├── xfoil.exe ├── README.md ├── CST_aerodynamic_performance.py ├── LICENSE ├── plotting.py ├── test_inflections.py ├── .gitignore ├── sampled_airfoil_data.csv ├── shape_study.p └── AeroPy.py /requirements.txt: -------------------------------------------------------------------------------- 1 | numpy 2 | -------------------------------------------------------------------------------- /docs/tutorial.rst: -------------------------------------------------------------------------------- 1 | Tutorial 2 | ======== 3 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/tutorial.txt: -------------------------------------------------------------------------------- 1 | Tutorial 2 | ======== 3 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/pyxfoil_doc.txt: -------------------------------------------------------------------------------- 1 | pyxfoil_doc 2 | ======== 3 | -------------------------------------------------------------------------------- /pplot.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AeroPython/AeroPy-1/master/pplot.exe -------------------------------------------------------------------------------- /pxplot.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AeroPython/AeroPy-1/master/pxplot.exe -------------------------------------------------------------------------------- /xfoil.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AeroPython/AeroPy-1/master/xfoil.exe -------------------------------------------------------------------------------- /docs/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AeroPython/AeroPy-1/master/docs/images/logo.png -------------------------------------------------------------------------------- /docs/_static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AeroPython/AeroPy-1/master/docs/_static/logo.png -------------------------------------------------------------------------------- /docs/_build/html/objects.inv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AeroPython/AeroPy-1/master/docs/_build/html/objects.inv -------------------------------------------------------------------------------- /docs/images/elliptical_LLT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AeroPython/AeroPy-1/master/docs/images/elliptical_LLT.png -------------------------------------------------------------------------------- /docs/_build/html/_static/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AeroPython/AeroPy-1/master/docs/_build/html/_static/down.png -------------------------------------------------------------------------------- /docs/_build/html/_static/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AeroPython/AeroPy-1/master/docs/_build/html/_static/file.png -------------------------------------------------------------------------------- /docs/_build/html/_static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AeroPython/AeroPy-1/master/docs/_build/html/_static/logo.png -------------------------------------------------------------------------------- /docs/_build/html/_static/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AeroPython/AeroPy-1/master/docs/_build/html/_static/plus.png -------------------------------------------------------------------------------- /docs/_build/html/_static/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AeroPython/AeroPy-1/master/docs/_build/html/_static/up.png -------------------------------------------------------------------------------- /docs/_build/doctrees/index.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AeroPython/AeroPy-1/master/docs/_build/doctrees/index.doctree -------------------------------------------------------------------------------- /docs/_build/html/_static/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AeroPython/AeroPy-1/master/docs/_build/html/_static/minus.png -------------------------------------------------------------------------------- /docs/_build/doctrees/aero_doc.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AeroPython/AeroPy-1/master/docs/_build/doctrees/aero_doc.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/tutorial.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AeroPython/AeroPy-1/master/docs/_build/doctrees/tutorial.doctree -------------------------------------------------------------------------------- /docs/_build/html/_static/comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AeroPython/AeroPy-1/master/docs/_build/html/_static/comment.png -------------------------------------------------------------------------------- /docs/_build/doctrees/aero_module.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AeroPython/AeroPy-1/master/docs/_build/doctrees/aero_module.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/environment.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AeroPython/AeroPy-1/master/docs/_build/doctrees/environment.pickle -------------------------------------------------------------------------------- /docs/_build/doctrees/main_module.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AeroPython/AeroPy-1/master/docs/_build/doctrees/main_module.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/pyxfoil_doc.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AeroPython/AeroPy-1/master/docs/_build/doctrees/pyxfoil_doc.doctree -------------------------------------------------------------------------------- /docs/_build/html/_static/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AeroPython/AeroPy-1/master/docs/_build/html/_static/ajax-loader.gif -------------------------------------------------------------------------------- /docs/_build/html/_static/up-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AeroPython/AeroPy-1/master/docs/_build/html/_static/up-pressed.png -------------------------------------------------------------------------------- /docs/_build/doctrees/airfoil_module.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AeroPython/AeroPy-1/master/docs/_build/doctrees/airfoil_module.doctree -------------------------------------------------------------------------------- /docs/_build/doctrees/xfoil_module.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AeroPython/AeroPy-1/master/docs/_build/doctrees/xfoil_module.doctree -------------------------------------------------------------------------------- /docs/_build/html/_images/elliptical_LLT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AeroPython/AeroPy-1/master/docs/_build/html/_images/elliptical_LLT.png -------------------------------------------------------------------------------- /docs/_build/html/_static/comment-bright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AeroPython/AeroPy-1/master/docs/_build/html/_static/comment-bright.png -------------------------------------------------------------------------------- /docs/_build/html/_static/comment-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AeroPython/AeroPy-1/master/docs/_build/html/_static/comment-close.png -------------------------------------------------------------------------------- /docs/_build/html/_static/down-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AeroPython/AeroPy-1/master/docs/_build/html/_static/down-pressed.png -------------------------------------------------------------------------------- /docs/_build/doctrees/xfoil_functions.doctree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AeroPython/AeroPy-1/master/docs/_build/doctrees/xfoil_functions.doctree -------------------------------------------------------------------------------- /docs/_build/html/.buildinfo: -------------------------------------------------------------------------------- 1 | # Sphinx build info version 1 2 | # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. 3 | config: 43ce4afafbc7b21ca51f3e159561c44c 4 | tags: 645f666f9bcd5a90fca523b33c5a78b7 5 | -------------------------------------------------------------------------------- /docs/airfoil_module.rst: -------------------------------------------------------------------------------- 1 | Airfoil Module Documentation 2 | ********************************* 3 | 4 | The functions herein defined are purposely made for generating NACA airfoils, flapped airfoils and CST airfoils. 5 | 6 | Core Function 7 | =========================== 8 | 9 | Auxiliary Functions 10 | =========================== 11 | 12 | Utility Functions 13 | ==================== 14 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/airfoil_module.txt: -------------------------------------------------------------------------------- 1 | Airfoil Module Documentation 2 | ********************************* 3 | 4 | The functions herein defined are purposely made for generating NACA airfoils, flapped airfoils and CST airfoils. 5 | 6 | Core Function 7 | =========================== 8 | 9 | Auxiliary Functions 10 | =========================== 11 | 12 | Utility Functions 13 | ==================== 14 | -------------------------------------------------------------------------------- /docs/xfoil_module.rst: -------------------------------------------------------------------------------- 1 | Xfoil Module Documentation 2 | ********************************* 3 | 4 | The functions herein defined are purposely made for use with Xfoil. 5 | 6 | Core Function 7 | =========================== 8 | .. autofunction:: xfoil_module.call 9 | 10 | Auxiliary Functions 11 | =========================== 12 | .. automodule:: xfoil_module 13 | :members: 14 | :exclude-members: call, find_alpha_L_0, M_crit, find_coefficients 15 | 16 | Utility Functions 17 | ==================== 18 | .. autofunction:: xfoil_module.find_coefficients 19 | .. autofunction:: xfoil_module.find_alpha_L_0 20 | .. autofunction:: xfoil_module.M_crit 21 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/xfoil_functions.txt: -------------------------------------------------------------------------------- 1 | Documentation for Xfoil Functions 2 | ********************************* 3 | 4 | The functions herein defined are purposely made for use with Xfoil. 5 | 6 | Core Function 7 | =========================== 8 | .. autofunction:: xfoil_tools.call 9 | 10 | Auxiliary Functions 11 | =========================== 12 | .. automodule:: xfoil_tools 13 | :members: 14 | :exclude-members: call, find_alpha_L_0, M_crit, find_coefficients 15 | 16 | Utility Functions 17 | ==================== 18 | .. autofunction:: xfoil_tools.find_coefficients 19 | .. autofunction:: xfoil_tools.find_alpha_L_0 20 | .. autofunction:: xfoil_tools.M_crit -------------------------------------------------------------------------------- /docs/_build/html/_sources/xfoil_module.txt: -------------------------------------------------------------------------------- 1 | Xfoil Module Documentation 2 | ********************************* 3 | 4 | The functions herein defined are purposely made for use with Xfoil. 5 | 6 | Core Function 7 | =========================== 8 | .. autofunction:: xfoil_module.call 9 | 10 | Auxiliary Functions 11 | =========================== 12 | .. automodule:: xfoil_module 13 | :members: 14 | :exclude-members: call, find_alpha_L_0, M_crit, find_coefficients 15 | 16 | Utility Functions 17 | ==================== 18 | .. autofunction:: xfoil_module.find_coefficients 19 | .. autofunction:: xfoil_module.find_alpha_L_0 20 | .. autofunction:: xfoil_module.M_crit 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [](https://zenodo.org/badge/latestdoi/20401/leal26/AeroPy) 2 | 3 | # AeroPy 4 | AeroPy is an library for calculating aerodynamic properties. The main feature of this library is the Python interface with XFOIL. The main objective of this library is to be able to use XFOIL via Python iteratively in a total of 4 lines total (one line for most uses). Through this interface coupling with other softwares (Abaqus, Ansys, etc) is possible and iterative processes (optimization, design sensitivity) are possible. For a thorough explanation please check the documentation and the tutorials. For thorough documentation and tutorials please check the [AeroPy website](http://aeropy.readthedocs.org/) 5 | -------------------------------------------------------------------------------- /CST_aerodynamic_performance.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import matplotlib.pyplot as plt 3 | 4 | import xfoil_module as xf 5 | from CST_module import * 6 | from aero_module import Reynolds 7 | from airfoil_module import CST, create_x 8 | 9 | Au = [0.23993240191629417, 0.34468227138908186, 0.18125405377549103, 10 | 0.35371349126072665, 0.2440815012119143, 0.25724974995738387] 11 | Al = [0.18889012559339036, -0.24686758992053115, 0.077569769493868401, 12 | -0.547827192265256, -0.0047342206759065641, -0.23994805474814629] 13 | c_avian = 0.36 #m 14 | deltaz = 0.0093943568219451313*c_avian 15 | 16 | airfoil = 'avian' 17 | x = create_x(1., distribution = 'linear') 18 | y = CST(x, 1., [deltaz/2., deltaz/2.], Au = Au, Al= Al) 19 | # Create file for Xfoil to read coordinates 20 | xf.create_input(x, y['u'], y['l'], airfoil, different_x_upper_lower = False) 21 | print 'Reynolds: ', Reynolds(10000, 30, c_avian) 22 | Data = xf.find_coefficients(airfoil, 2., Reynolds=Reynolds(10000, 30, c_avian), iteration=100, NACA=False) 23 | print Data -------------------------------------------------------------------------------- /docs/main_module.rst: -------------------------------------------------------------------------------- 1 | AeroPy Documentation 2 | ********************* 3 | 4 | This project was elaborated because of the need of optimizing an airfoil 5 | according to its aerodynamic and structural performance (conference paper). 6 | Contrary to available options such as XFLR5, AeroPy aims to be an open source 7 | Python code. It is a quick and easy way to find the aerodynamic pressure and the 8 | drag and lift coefficients through the use of MIT's XFOIL embedded in Python. 9 | Contrary to the other libraries, AeroPy does not have a GUI and is intended 10 | to be used in Python codes for optimizations or any other process that requires 11 | several aerodynamic analysis. 12 | 13 | AeroPy is separated in three modules: (it is programmed in such a way that a new 14 | module can be easily inserted) 15 | 16 | - xfoil: contains all the functions relating to XFOIL. 17 | - aero: contains all functions related to aerodynamics, but not related to XFOIL. 18 | - AeroPy: imports all functions and acts as the intersection of all different 19 | modules 20 | 21 | Code 22 | ==== 23 | 24 | .. automodule:: AeroPy 25 | :members: 26 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/main_module.txt: -------------------------------------------------------------------------------- 1 | AeroPy Documentation 2 | ********************* 3 | 4 | This project was elaborated because of the need of optimizing an airfoil 5 | according to its aerodynamic and structural performance (conference paper). 6 | Contrary to available options such as XFLR5, AeroPy aims to be an open source 7 | Python code. It is a quick and easy way to find the aerodynamic pressure and the 8 | drag and lift coefficients through the use of MIT's XFOIL embedded in Python. 9 | Contrary to the other libraries, AeroPy does not have a GUI and is intended 10 | to be used in Python codes for optimizations or any other process that requires 11 | several aerodynamic analysis. 12 | 13 | AeroPy is separated in three modules: (it is programmed in such a way that a new 14 | module can be easily inserted) 15 | 16 | - xfoil: contains all the functions relating to XFOIL. 17 | - aero: contains all functions related to aerodynamics, but not related to XFOIL. 18 | - AeroPy: imports all functions and acts as the intersection of all different 19 | modules 20 | 21 | Code 22 | ==== 23 | 24 | .. automodule:: AeroPy 25 | :members: 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 leal26 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/aero_doc.txt: -------------------------------------------------------------------------------- 1 | Documentation for Aerodynamic Functions 2 | *************************************** 3 | 4 | Lifting Line Theory 5 | =================== 6 | If :math:`\theta_0` is an arbitrary span-wise location: 7 | 8 | .. math:: 9 | \alpha (\theta_o)=\frac{2b}{\pi c(\theta_o)} \sum_1^N A_n sin(n \theta_o) + \alpha_{L=0}(\theta_o) + \sum_1^N n A_n \frac{sin(n\theta_o)}{sin(\theta_o)} 10 | :label: LLT_full 11 | 12 | Each equation has :math:`N` unknowns (:math:`A_n`), so if there are N :math:`\theta_o`, we have NxN system, which in Einstein notation can be written as: 13 | 14 | .. math:: 15 | C_{ij}A_{i}=D_{i} 16 | :label: LLT_simple 17 | 18 | where, :math:`i=0,...,N`, :math:`j=0,...,N` and : 19 | 20 | .. math:: 21 | C_{ij}= \left( \frac{2b}{\pi c(j)} + \frac{n}{sin \theta(i)} \right) sin(n \theta(i)) 22 | :label: C 23 | 24 | .. math:: 25 | A_i=A(i) 26 | :label: A 27 | 28 | .. math:: 29 | D_i=\alpha(i)-\alpha_{L=0}(i) 30 | :label: D 31 | 32 | where :math:`n=1,3,5,...,N-1`. Since we are considering a symmetric wing, all of the even terms would cancel each other 33 | 34 | .. figure:: images/elliptical_LLT.png 35 | :align: center 36 | -------------------------------------------------------------------------------- /docs/aero_module.rst: -------------------------------------------------------------------------------- 1 | Aerodynamic Module Documentation 2 | *************************************** 3 | 4 | Lifting Line Theory 5 | =================== 6 | If :math:`\theta_0` is an arbitrary span-wise location: 7 | 8 | .. math:: 9 | \alpha (\theta_o)=\frac{2b}{\pi c(\theta_o)} \sum_1^N A_n sin(n \theta_o) + \alpha_{L=0}(\theta_o) + \sum_1^N n A_n \frac{sin(n\theta_o)}{sin(\theta_o)} 10 | :label: LLT_full 11 | 12 | Each equation has :math:`N` unknowns (:math:`A_n`), so if there are N :math:`\theta_o`, we have NxN system, which in Einstein notation can be written as: 13 | 14 | .. math:: 15 | C_{ij}A_{i}=D_{i} 16 | :label: LLT_simple 17 | 18 | where, :math:`i=0,...,N`, :math:`j=0,...,N` and : 19 | 20 | .. math:: 21 | C_{ij}= \left( \frac{2b}{\pi c(j)} + \frac{n}{sin \theta(i)} \right) sin(n \theta(i)) 22 | :label: C 23 | 24 | .. math:: 25 | A_i=A(i) 26 | :label: A 27 | 28 | .. math:: 29 | D_i=\alpha(i)-\alpha_{L=0}(i) 30 | :label: D 31 | 32 | where :math:`n=1,3,5,...,N-1`. Since we are considering a symmetric wing, all of the even terms would cancel each other 33 | 34 | .. figure:: images/elliptical_LLT.png 35 | :align: center 36 | 37 | The code 38 | ======== 39 | .. automodule:: aero_module 40 | :members: 41 | -------------------------------------------------------------------------------- /docs/_build/html/_sources/aero_module.txt: -------------------------------------------------------------------------------- 1 | Aerodynamic Module Documentation 2 | *************************************** 3 | 4 | Lifting Line Theory 5 | =================== 6 | If :math:`\theta_0` is an arbitrary span-wise location: 7 | 8 | .. math:: 9 | \alpha (\theta_o)=\frac{2b}{\pi c(\theta_o)} \sum_1^N A_n sin(n \theta_o) + \alpha_{L=0}(\theta_o) + \sum_1^N n A_n \frac{sin(n\theta_o)}{sin(\theta_o)} 10 | :label: LLT_full 11 | 12 | Each equation has :math:`N` unknowns (:math:`A_n`), so if there are N :math:`\theta_o`, we have NxN system, which in Einstein notation can be written as: 13 | 14 | .. math:: 15 | C_{ij}A_{i}=D_{i} 16 | :label: LLT_simple 17 | 18 | where, :math:`i=0,...,N`, :math:`j=0,...,N` and : 19 | 20 | .. math:: 21 | C_{ij}= \left( \frac{2b}{\pi c(j)} + \frac{n}{sin \theta(i)} \right) sin(n \theta(i)) 22 | :label: C 23 | 24 | .. math:: 25 | A_i=A(i) 26 | :label: A 27 | 28 | .. math:: 29 | D_i=\alpha(i)-\alpha_{L=0}(i) 30 | :label: D 31 | 32 | where :math:`n=1,3,5,...,N-1`. Since we are considering a symmetric wing, all of the even terms would cancel each other 33 | 34 | .. figure:: images/elliptical_LLT.png 35 | :align: center 36 | 37 | The code 38 | ======== 39 | .. automodule:: aero_module 40 | :members: 41 | -------------------------------------------------------------------------------- /plotting.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pickle 3 | import math 4 | import matplotlib.pyplot as plt 5 | 6 | from airfoil_module import CST 7 | from xfoil_module import output_reader 8 | 9 | data = pickle.load(open('shape_study.p','rb')) 10 | 11 | n=5 12 | print 'For n=', n, ': ' 13 | print '\t error: ', data['error'][n-1] 14 | print '\t deltaz: ', data['deltaz'][n-1] 15 | print '\t Au: ', data['Au'][n-1] 16 | print '\t Al: ', data['Al'][n-1] 17 | 18 | filename = 'sampled_airfoil_data.csv' 19 | raw_data = output_reader(filename, separator = ', ', header = ['x', 'y']) 20 | 21 | # Rotating airfoil 22 | x_TE = (raw_data['x'][0] + raw_data['x'][-1])/2. 23 | y_TE = (raw_data['y'][0] + raw_data['y'][-1])/2. 24 | 25 | theta_TE = math.atan(-y_TE/x_TE) 26 | 27 | # position trailing edge at the x-axis 28 | processed_data = {'x':[], 'y':[]} 29 | for i in range(len(raw_data['x'])): 30 | x = raw_data['x'][i] 31 | y = raw_data['y'][i] 32 | c_theta = math.cos(theta_TE) 33 | s_theta = math.sin(theta_TE) 34 | x_rotated = c_theta*x - s_theta*y 35 | y_rotated = s_theta*x + c_theta*y 36 | processed_data['x'].append(x_rotated) 37 | processed_data['y'].append(y_rotated) 38 | raw_data = processed_data 39 | 40 | # determine what is the leading edge and the rotation angle beta 41 | processed_data = {'x':[], 'y':[]} 42 | min_x_list = [] 43 | min_y_list = [] 44 | 45 | min_x = min(raw_data['x']) 46 | min_index = raw_data['x'].index(min_x) 47 | min_y = raw_data['y'][min_index] 48 | 49 | chord = max(raw_data['x']) - min(raw_data['x']) 50 | beta = math.atan((y_TE - min_y)/(x_TE - min_x)) 51 | 52 | for i in range(len(raw_data['x'])): 53 | processed_data['x'].append((raw_data['x'][i] - min_x)/chord) 54 | processed_data['y'].append(raw_data['y'][i]/chord) 55 | raw_data = processed_data 56 | 57 | psi = np.linspace(0,1,200) 58 | xi = CST(psi, 1., [data['deltaz'][n-1]/2., data['deltaz'][n-1]/2.], Au = data['Au'][n-1], Al= data['Al'][n-1]) 59 | plt.figure() 60 | plt.plot(psi, xi['u'], psi, xi['l']) 61 | plt.scatter(raw_data['x'], raw_data['y']) 62 | n = 8 63 | plt.xlim(0,1) 64 | x = np.linspace(2,2*n,n) 65 | plt.gca().set_aspect('equal', adjustable='box') 66 | plt.show() 67 | 68 | plt.figure() 69 | plt.plot(x, data['error']) 70 | plt.scatter(x, data['error']) 71 | plt.xlabel('Number of shape functions') 72 | plt.ylabel('Hausdorff distance (adimensional)') 73 | plt.grid() 74 | plt.show() -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | .. AeroPy Documentation 2 | 3 | .. include xfoil_functions.rsf 4 | 5 | Welcome to AeroPy's, an easy to use aerodynamic tool 6 | ================================================================== 7 | AeroPy is an library for calculating aerodynamic properties. The main feature of 8 | this library is the Python interface with XFOIL. The main objective of this library is to be able 9 | to use XFOIL via Python iteratively in a total of 4 lines total (one line for most uses). 10 | Through this interface coupling with other softwares (Abaqus, Ansys, etc) is possible 11 | and iterative processes (optimization, design sensitivity) are possible. 12 | For a thorough explanation please check the documentation and the tutorials. 13 | 14 | Contents: 15 | 16 | .. toctree:: 17 | :numbered: 18 | :titlesonly: 19 | :maxdepth: 2 20 | 21 | main_module 22 | xfoil_module 23 | aero_module 24 | airfoil_module 25 | tutorial 26 | 27 | To Do 28 | ====== 29 | 30 | - Include asymmetric wing 31 | - Create airfoil and wing classes 32 | 33 | Recommended Collaborations 34 | ========================== 35 | 36 | Please use and adapt this library to your needs. There are several 37 | functionalities I wished to implement, but did not have the time. Hence 38 | I am *strongly* recommending the following collaborations: 39 | 40 | - Airfoil generator with a GUI 41 | - Atmospheric module (use the library already available in aero_module) 42 | - Extend aero_module for wings with non-constant cross sections 43 | 44 | Indices and tables 45 | ================== 46 | 47 | * :ref:`genindex` 48 | * :ref:`modindex` 49 | * :ref:`search` 50 | 51 | Examples 52 | ================== 53 | 54 | A simple example demonstrating how to use AeroPy to calculate lift, drag and 55 | moment coefficients for a NACA0012 airfoil at angle of attack of 12 degrees. 56 | 57 | .. code-block:: python 58 | 59 | from AeroPy import find_coefficients 60 | find_coefficients(airfoil='naca0012'alpha=12.) 61 | >>> {'CM': 0.0134, 'CL': 1.2453, 'Top_Xtr': 0.0194, 'CD': 0.01934, 'CDp': 0.01379, 'alpha': 12.0, 'Bot_Xtr': 1.0} 62 | 63 | Another example showing how to use AeroPy to calculate pressure coefficients for a 64 | NACA0012 in viscous flow at Reynolds = 10000000 and angle of attack of 12 degrees 65 | 66 | .. code-block:: python 67 | 68 | from AeroPy import find_pressure_coefficients 69 | find_pressure_coefficients(airfoil='naca0012', Reynolds = 1e6, alpha=12.,NACA=True) 70 | >>> 'y': [0.00126, ..., -0.00126], 'x': [1.0, ..., 1.0], 'Cp': [0.41501, ..., 0.41501]} -------------------------------------------------------------------------------- /docs/_build/html/_sources/index.txt: -------------------------------------------------------------------------------- 1 | .. AeroPy Documentation 2 | 3 | .. include xfoil_functions.rsf 4 | 5 | Welcome to AeroPy's, an easy to use aerodynamic tool 6 | ================================================================== 7 | AeroPy is an library for calculating aerodynamic properties. The main feature of 8 | this library is the Python interface with XFOIL. The main objective of this library is to be able 9 | to use XFOIL via Python iteratively in a total of 4 lines total (one line for most uses). 10 | Through this interface coupling with other softwares (Abaqus, Ansys, etc) is possible 11 | and iterative processes (optimization, design sensitivity) are possible. 12 | For a thorough explanation please check the documentation and the tutorials. 13 | 14 | Contents: 15 | 16 | .. toctree:: 17 | :numbered: 18 | :titlesonly: 19 | :maxdepth: 2 20 | 21 | main_module 22 | xfoil_module 23 | aero_module 24 | airfoil_module 25 | tutorial 26 | 27 | To Do 28 | ====== 29 | 30 | - Include asymmetric wing 31 | - Create airfoil and wing classes 32 | 33 | Recommended Collaborations 34 | ========================== 35 | 36 | Please use and adapt this library to your needs. There are several 37 | functionalities I wished to implement, but did not have the time. Hence 38 | I am *strongly* recommending the following collaborations: 39 | 40 | - Airfoil generator with a GUI 41 | - Atmospheric module (use the library already available in aero_module) 42 | - Extend aero_module for wings with non-constant cross sections 43 | 44 | Indices and tables 45 | ================== 46 | 47 | * :ref:`genindex` 48 | * :ref:`modindex` 49 | * :ref:`search` 50 | 51 | Examples 52 | ================== 53 | 54 | A simple example demonstrating how to use AeroPy to calculate lift, drag and 55 | moment coefficients for a NACA0012 airfoil at angle of attack of 12 degrees. 56 | 57 | .. code-block:: python 58 | 59 | from AeroPy import find_coefficients 60 | find_coefficients(airfoil='naca0012'alpha=12.) 61 | >>> {'CM': 0.0134, 'CL': 1.2453, 'Top_Xtr': 0.0194, 'CD': 0.01934, 'CDp': 0.01379, 'alpha': 12.0, 'Bot_Xtr': 1.0} 62 | 63 | Another example showing how to use AeroPy to calculate pressure coefficients for a 64 | NACA0012 in viscous flow at Reynolds = 10000000 and angle of attack of 12 degrees 65 | 66 | .. code-block:: python 67 | 68 | from AeroPy import find_pressure_coefficients 69 | find_pressure_coefficients(airfoil='naca0012', Reynolds = 1e6, alpha=12.,NACA=True) 70 | >>> 'y': [0.00126, ..., -0.00126], 'x': [1.0, ..., 1.0], 'Cp': [0.41501, ..., 0.41501]} -------------------------------------------------------------------------------- /test_inflections.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import matplotlib.pyplot as plt 3 | 4 | import xfoil_module as xf 5 | from CST_module import * 6 | from aero_module import Reynolds 7 | from airfoil_module import CST, create_x 8 | 9 | Au = [0.23993240191629417, 0.34468227138908186, 0.18125405377549103, 10 | 0.35371349126072665, 0.2440815012119143, 0.25724974995738387] 11 | Al = [0.18889012559339036, -0.24686758992053115, 0.077569769493868401, 12 | -0.547827192265256, -0.0047342206759065641, -0.23994805474814629] 13 | c_avian = .36 #m 14 | deltaz = 0.0093943568219451313*c_avian 15 | 16 | airfoil = 'avian' 17 | x = create_x(c_avian, distribution = 'linear') 18 | y = CST(x, c_avian, [deltaz/2., deltaz/2.], Au = Au, Al= Al) 19 | # Create file for Xfoil to read coordinates 20 | xf.create_input(x, y['u'], y['l'], airfoil, different_x_upper_lower = False) 21 | 22 | Data = xf.find_coefficients(airfoil, 2., Reynolds=Reynolds(10000, 30, c_avian), iteration=100, NACA=False) 23 | print Data 24 | 25 | 26 | psi_u_inflection, psi_l_inflection = find_inflection_points(Au, Al) 27 | print 'upper: ', psi_u_inflection 28 | print 'lower: ', psi_l_inflection 29 | psi = np.linspace(0.001,0.999,100) 30 | xi = CST(psi, 1, [deltaz/2., deltaz/2.], Au, Al) 31 | plt.plot(psi, xi['u'], 'b', label = 'Upper outer mold line') 32 | plt.plot(psi, xi['l'],'b--', label = 'Lower outer mold line') 33 | 34 | xi_u_inflection = CST(psi_u_inflection, 1, [deltaz/2., deltaz/2.], Au, Al) 35 | plt.scatter(psi_u_inflection, xi_u_inflection['u']) 36 | 37 | xi_l_inflection = CST(psi_l_inflection, 1, [deltaz/2., deltaz/2.], Au, Al) 38 | plt.scatter(psi_l_inflection, xi_l_inflection['l']) 39 | plt.xlabel('$\psi$', fontsize = 40) 40 | plt.ylabel(r'$\xi$', fontsize = 40) 41 | plt.grid() 42 | # plt.show() 43 | 44 | # plt.figure() 45 | # plt.plot(psi,dxi_u(psi,Au, deltaz), 'g', label = r'$d\xi_u$') 46 | # plt.plot(psi,dxi_l(psi,Al,deltaz), 'g--', label = r'$d\xi_l$') 47 | 48 | plt.plot(psi,ddxi_u(psi,Au), 'r', label = 'Upper second derivative') 49 | plt.plot(psi,ddxi_l(psi,Al), 'r--', label = 'Lower second derivative') 50 | 51 | # Plot camber 52 | camber = calculate_camber(psi, Au, Al, deltaz/c_avian) 53 | plt.plot(psi,camber, 'k', label = 'camber') 54 | psi_camber, xi_camber = calculate_max_camber(Au, Al, deltaz/c_avian) 55 | print psi_camber, xi_camber, type(psi_camber), type(xi_camber) 56 | print 'average camber: ', calculate_average_camber( Au, Al, deltaz/c_avian) 57 | plt.scatter(psi_camber, xi_camber, label = 'Inflection points') 58 | plt.ylim([-0.1,0.1]) 59 | plt.legend(loc='best') 60 | plt.show() 61 | -------------------------------------------------------------------------------- /docs/_build/html/pyxfoil_doc.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 |
7 | 8 | 9 |
89 |
90 |
91 |
92 |
93 |
94 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | #################
2 | ## Eclipse
3 | #################
4 |
5 | *.pydevproject
6 | .project
7 | .metadata
8 | bin/
9 | tmp/
10 | *.tmp
11 | *.bak
12 | *.swp
13 | *~.nib
14 | local.properties
15 | .classpath
16 | .settings/
17 | .loadpath
18 |
19 | # External tool builders
20 | .externalToolBuilders/
21 |
22 | # Locally stored "Eclipse launch configurations"
23 | *.launch
24 |
25 | # CDT-specific
26 | .cproject
27 |
28 | # PDT-specific
29 | .buildpath
30 |
31 |
32 | #################
33 | ## Visual Studio
34 | #################
35 |
36 | ## Ignore Visual Studio temporary files, build results, and
37 | ## files generated by popular Visual Studio add-ons.
38 |
39 | # User-specific files
40 | *.suo
41 | *.user
42 | *.sln.docstates
43 |
44 | # Build results
45 |
46 | [Dd]ebug/
47 | [Rr]elease/
48 | x64/
49 | build/
50 | [Bb]in/
51 | [Oo]bj/
52 |
53 | # MSTest test Results
54 | [Tt]est[Rr]esult*/
55 | [Bb]uild[Ll]og.*
56 |
57 | *_i.c
58 | *_p.c
59 | *.ilk
60 | *.meta
61 | *.obj
62 | *.pch
63 | *.pdb
64 | *.pgc
65 | *.pgd
66 | *.rsp
67 | *.sbr
68 | *.tlb
69 | *.tli
70 | *.tlh
71 | *.tmp
72 | *.tmp_proj
73 | *.log
74 | *.vspscc
75 | *.vssscc
76 | .builds
77 | *.pidb
78 | *.log
79 | *.scc
80 |
81 | # Visual C++ cache files
82 | ipch/
83 | *.aps
84 | *.ncb
85 | *.opensdf
86 | *.sdf
87 | *.cachefile
88 |
89 | # Visual Studio profiler
90 | *.psess
91 | *.vsp
92 | *.vspx
93 |
94 | # Guidance Automation Toolkit
95 | *.gpState
96 |
97 | # ReSharper is a .NET coding add-in
98 | _ReSharper*/
99 | *.[Rr]e[Ss]harper
100 |
101 | # TeamCity is a build add-in
102 | _TeamCity*
103 |
104 | # DotCover is a Code Coverage Tool
105 | *.dotCover
106 |
107 | # NCrunch
108 | *.ncrunch*
109 | .*crunch*.local.xml
110 |
111 | # Installshield output folder
112 | [Ee]xpress/
113 |
114 | # DocProject is a documentation generator add-in
115 | DocProject/buildhelp/
116 | DocProject/Help/*.HxT
117 | DocProject/Help/*.HxC
118 | DocProject/Help/*.hhc
119 | DocProject/Help/*.hhk
120 | DocProject/Help/*.hhp
121 | DocProject/Help/Html2
122 | DocProject/Help/html
123 |
124 | # Click-Once directory
125 | publish/
126 |
127 | # Publish Web Output
128 | *.Publish.xml
129 | *.pubxml
130 | *.publishproj
131 |
132 | # NuGet Packages Directory
133 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line
134 | #packages/
135 |
136 | # Windows Azure Build Output
137 | csx
138 | *.build.csdef
139 |
140 | # Windows Store app package directory
141 | AppPackages/
142 |
143 | # Others
144 | sql/
145 | *.Cache
146 | ClientBin/
147 | [Ss]tyle[Cc]op.*
148 | ~$*
149 | *~
150 | *.dbmdl
151 | *.[Pp]ublish.xml
152 | *.pfx
153 | *.publishsettings
154 |
155 | # RIA/Silverlight projects
156 | Generated_Code/
157 |
158 | # Backup & report files from converting an old project file to a newer
159 | # Visual Studio version. Backup files are not needed, because we have git ;-)
160 | _UpgradeReport_Files/
161 | Backup*/
162 | UpgradeLog*.XML
163 | UpgradeLog*.htm
164 |
165 | # SQL Server files
166 | App_Data/*.mdf
167 | App_Data/*.ldf
168 |
169 | #############
170 | ## Windows detritus
171 | #############
172 |
173 | # Windows image file caches
174 | Thumbs.db
175 | ehthumbs.db
176 |
177 | # Folder config file
178 | Desktop.ini
179 |
180 | # Recycle Bin used on file shares
181 | $RECYCLE.BIN/
182 |
183 | # Mac crap
184 | .DS_Store
185 |
186 |
187 | #############
188 | ## Python
189 | #############
190 |
191 | *.py[cod]
192 | *.pyc
193 |
194 | # Packages
195 | *.egg
196 | *.egg-info
197 | dist/
198 | build/
199 | eggs/
200 | parts/
201 | var/
202 | sdist/
203 | develop-eggs/
204 | .installed.cfg
205 |
206 | # Installer logs
207 | pip-log.txt
208 |
209 | # Unit test / coverage reports
210 | .coverage
211 | .tox
212 |
213 | #Translations
214 | *.mo
215 |
216 | #Mr Developer
217 | .mr.developer.cfg
218 | Cp_*
219 | Polar_*
220 | Coordinates*
221 | naca*
222 | flapped
223 | flapped
224 |
--------------------------------------------------------------------------------
/docs/_build/html/search.html:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | 52 | Please activate JavaScript to enable the search 53 | functionality. 54 |
55 |57 | From here you can search these documents. Enter your search 58 | words into the box below and click "search". Note that the search 59 | function will automatically search for all of the words. Pages 60 | containing fewer words won't appear in the result list. 61 |
62 | 67 | 68 |
102 |
103 |
104 |
105 |
106 |
107 |
--------------------------------------------------------------------------------
/docs/_build/html/tutorial.html:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
100 |
101 |
102 |
103 |
104 |
105 |
--------------------------------------------------------------------------------
/docs/_build/html/_static/pygments.css:
--------------------------------------------------------------------------------
1 | .highlight .hll { background-color: #ffffcc }
2 | .highlight { background: #eeffcc; }
3 | .highlight .c { color: #408090; font-style: italic } /* Comment */
4 | .highlight .err { border: 1px solid #FF0000 } /* Error */
5 | .highlight .k { color: #007020; font-weight: bold } /* Keyword */
6 | .highlight .o { color: #666666 } /* Operator */
7 | .highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */
8 | .highlight .cp { color: #007020 } /* Comment.Preproc */
9 | .highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */
10 | .highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */
11 | .highlight .gd { color: #A00000 } /* Generic.Deleted */
12 | .highlight .ge { font-style: italic } /* Generic.Emph */
13 | .highlight .gr { color: #FF0000 } /* Generic.Error */
14 | .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
15 | .highlight .gi { color: #00A000 } /* Generic.Inserted */
16 | .highlight .go { color: #333333 } /* Generic.Output */
17 | .highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
18 | .highlight .gs { font-weight: bold } /* Generic.Strong */
19 | .highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
20 | .highlight .gt { color: #0044DD } /* Generic.Traceback */
21 | .highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
22 | .highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
23 | .highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
24 | .highlight .kp { color: #007020 } /* Keyword.Pseudo */
25 | .highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
26 | .highlight .kt { color: #902000 } /* Keyword.Type */
27 | .highlight .m { color: #208050 } /* Literal.Number */
28 | .highlight .s { color: #4070a0 } /* Literal.String */
29 | .highlight .na { color: #4070a0 } /* Name.Attribute */
30 | .highlight .nb { color: #007020 } /* Name.Builtin */
31 | .highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
32 | .highlight .no { color: #60add5 } /* Name.Constant */
33 | .highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */
34 | .highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */
35 | .highlight .ne { color: #007020 } /* Name.Exception */
36 | .highlight .nf { color: #06287e } /* Name.Function */
37 | .highlight .nl { color: #002070; font-weight: bold } /* Name.Label */
38 | .highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
39 | .highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */
40 | .highlight .nv { color: #bb60d5 } /* Name.Variable */
41 | .highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */
42 | .highlight .w { color: #bbbbbb } /* Text.Whitespace */
43 | .highlight .mb { color: #208050 } /* Literal.Number.Bin */
44 | .highlight .mf { color: #208050 } /* Literal.Number.Float */
45 | .highlight .mh { color: #208050 } /* Literal.Number.Hex */
46 | .highlight .mi { color: #208050 } /* Literal.Number.Integer */
47 | .highlight .mo { color: #208050 } /* Literal.Number.Oct */
48 | .highlight .sb { color: #4070a0 } /* Literal.String.Backtick */
49 | .highlight .sc { color: #4070a0 } /* Literal.String.Char */
50 | .highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
51 | .highlight .s2 { color: #4070a0 } /* Literal.String.Double */
52 | .highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
53 | .highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */
54 | .highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
55 | .highlight .sx { color: #c65d09 } /* Literal.String.Other */
56 | .highlight .sr { color: #235388 } /* Literal.String.Regex */
57 | .highlight .s1 { color: #4070a0 } /* Literal.String.Single */
58 | .highlight .ss { color: #517918 } /* Literal.String.Symbol */
59 | .highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */
60 | .highlight .vc { color: #bb60d5 } /* Name.Variable.Class */
61 | .highlight .vg { color: #bb60d5 } /* Name.Variable.Global */
62 | .highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */
63 | .highlight .il { color: #208050 } /* Literal.Number.Integer.Long */
--------------------------------------------------------------------------------
/docs/_build/html/py-modindex.html:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | | 58 | a | ||
| 61 | |
62 | aero_module | 63 | |
| 66 | |
67 | AeroPy | 68 | |
| 71 | x | ||
| 74 | |
75 | xfoil_module | 76 | |
123 |
124 |
125 |
126 |
127 |
128 |
--------------------------------------------------------------------------------
/docs/_build/html/airfoil_module.html:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
122 |
123 |
124 |
125 |
126 |
127 |
--------------------------------------------------------------------------------
/docs/_build/html/aero_doc.html:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | If \(\theta_0\) is an arbitrary span-wise location:
47 |Each equation has \(N\) unknowns (\(A_n\)), so if there are N \(\theta_o\), we have NxN system, which in Einstein notation can be written as:
50 |where, \(i=0,...,N\), \(j=0,...,N\) and :
53 |where \(n=1,3,5,...,N-1\). Since we are considering a symmetric wing, all of the even terms would cancel each other
60 |
62 |
|
68 |
|
78 |
|
92 |
|
102 |
|
120 |
|
130 |
|
140 |
|
150 |
|
160 |
|
170 |
|
176 |
|
186 |
|
196 |
246 |
247 |
248 |
249 |
250 |
251 |
--------------------------------------------------------------------------------
/docs/_build/html/main_module.html:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | This project was elaborated because of the need of optimizing an airfoil 45 | according to its aerodynamic and structural performance (conference paper). 46 | Contrary to available options such as XFLR5, AeroPy aims to be an open source 47 | Python code. It is a quick and easy way to find the aerodynamic pressure and the 48 | drag and lift coefficients through the use of MIT’s XFOIL embedded in Python. 49 | Contrary to the other libraries, AeroPy does not have a GUI and is intended 50 | to be used in Python codes for optimizations or any other process that requires 51 | several aerodynamic analysis.
52 |AeroPy is separated in three modules: (it is programmed in such a way that a new 53 | module can be easily inserted)
54 |xfoil: contains all the functions relating to XFOIL.
56 |aero: contains all functions related to aerodynamics, but not related to XFOIL.
58 |modules
62 |Created on Sun Aug 16 20:59:22 2015
69 |@author: Pedro
70 |AeroPy.find_3D_coefficients(airfoil, alpha, Reynolds=0, iteration=10, NACA=True, N=10, span=10.0, taper=1.0, chord_root=1, alpha_root=1.0, velocity=1.0)[source]¶Calculate the 3D distribution using the Lifting Line Theory.
74 || Parameters: |
|
100 |
|---|
172 |
173 |
174 |
175 |
176 |
177 |
--------------------------------------------------------------------------------
/docs/_build/html/_static/doctools.js:
--------------------------------------------------------------------------------
1 | /*
2 | * doctools.js
3 | * ~~~~~~~~~~~
4 | *
5 | * Sphinx JavaScript utilities for all documentation.
6 | *
7 | * :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
8 | * :license: BSD, see LICENSE for details.
9 | *
10 | */
11 |
12 | /**
13 | * select a different prefix for underscore
14 | */
15 | $u = _.noConflict();
16 |
17 | /**
18 | * make the code below compatible with browsers without
19 | * an installed firebug like debugger
20 | if (!window.console || !console.firebug) {
21 | var names = ["log", "debug", "info", "warn", "error", "assert", "dir",
22 | "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace",
23 | "profile", "profileEnd"];
24 | window.console = {};
25 | for (var i = 0; i < names.length; ++i)
26 | window.console[names[i]] = function() {};
27 | }
28 | */
29 |
30 | /**
31 | * small helper function to urldecode strings
32 | */
33 | jQuery.urldecode = function(x) {
34 | return decodeURIComponent(x).replace(/\+/g, ' ');
35 | };
36 |
37 | /**
38 | * small helper function to urlencode strings
39 | */
40 | jQuery.urlencode = encodeURIComponent;
41 |
42 | /**
43 | * This function returns the parsed url parameters of the
44 | * current request. Multiple values per key are supported,
45 | * it will always return arrays of strings for the value parts.
46 | */
47 | jQuery.getQueryParameters = function(s) {
48 | if (typeof s == 'undefined')
49 | s = document.location.search;
50 | var parts = s.substr(s.indexOf('?') + 1).split('&');
51 | var result = {};
52 | for (var i = 0; i < parts.length; i++) {
53 | var tmp = parts[i].split('=', 2);
54 | var key = jQuery.urldecode(tmp[0]);
55 | var value = jQuery.urldecode(tmp[1]);
56 | if (key in result)
57 | result[key].push(value);
58 | else
59 | result[key] = [value];
60 | }
61 | return result;
62 | };
63 |
64 | /**
65 | * highlight a given string on a jquery object by wrapping it in
66 | * span elements with the given class name.
67 | */
68 | jQuery.fn.highlightText = function(text, className) {
69 | function highlight(node) {
70 | if (node.nodeType == 3) {
71 | var val = node.nodeValue;
72 | var pos = val.toLowerCase().indexOf(text);
73 | if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) {
74 | var span = document.createElement("span");
75 | span.className = className;
76 | span.appendChild(document.createTextNode(val.substr(pos, text.length)));
77 | node.parentNode.insertBefore(span, node.parentNode.insertBefore(
78 | document.createTextNode(val.substr(pos + text.length)),
79 | node.nextSibling));
80 | node.nodeValue = val.substr(0, pos);
81 | }
82 | }
83 | else if (!jQuery(node).is("button, select, textarea")) {
84 | jQuery.each(node.childNodes, function() {
85 | highlight(this);
86 | });
87 | }
88 | }
89 | return this.each(function() {
90 | highlight(this);
91 | });
92 | };
93 |
94 | /*
95 | * backward compatibility for jQuery.browser
96 | * This will be supported until firefox bug is fixed.
97 | */
98 | if (!jQuery.browser) {
99 | jQuery.uaMatch = function(ua) {
100 | ua = ua.toLowerCase();
101 |
102 | var match = /(chrome)[ \/]([\w.]+)/.exec(ua) ||
103 | /(webkit)[ \/]([\w.]+)/.exec(ua) ||
104 | /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
105 | /(msie) ([\w.]+)/.exec(ua) ||
106 | ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
107 | [];
108 |
109 | return {
110 | browser: match[ 1 ] || "",
111 | version: match[ 2 ] || "0"
112 | };
113 | };
114 | jQuery.browser = {};
115 | jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true;
116 | }
117 |
118 | /**
119 | * Small JavaScript module for the documentation.
120 | */
121 | var Documentation = {
122 |
123 | init : function() {
124 | this.fixFirefoxAnchorBug();
125 | this.highlightSearchWords();
126 | this.initIndexTable();
127 | },
128 |
129 | /**
130 | * i18n support
131 | */
132 | TRANSLATIONS : {},
133 | PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; },
134 | LOCALE : 'unknown',
135 |
136 | // gettext and ngettext don't access this so that the functions
137 | // can safely bound to a different name (_ = Documentation.gettext)
138 | gettext : function(string) {
139 | var translated = Documentation.TRANSLATIONS[string];
140 | if (typeof translated == 'undefined')
141 | return string;
142 | return (typeof translated == 'string') ? translated : translated[0];
143 | },
144 |
145 | ngettext : function(singular, plural, n) {
146 | var translated = Documentation.TRANSLATIONS[singular];
147 | if (typeof translated == 'undefined')
148 | return (n == 1) ? singular : plural;
149 | return translated[Documentation.PLURALEXPR(n)];
150 | },
151 |
152 | addTranslations : function(catalog) {
153 | for (var key in catalog.messages)
154 | this.TRANSLATIONS[key] = catalog.messages[key];
155 | this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')');
156 | this.LOCALE = catalog.locale;
157 | },
158 |
159 | /**
160 | * add context elements like header anchor links
161 | */
162 | addContextElements : function() {
163 | $('div[id] > :header:first').each(function() {
164 | $('\u00B6').
165 | attr('href', '#' + this.id).
166 | attr('title', _('Permalink to this headline')).
167 | appendTo(this);
168 | });
169 | $('dt[id]').each(function() {
170 | $('\u00B6').
171 | attr('href', '#' + this.id).
172 | attr('title', _('Permalink to this definition')).
173 | appendTo(this);
174 | });
175 | },
176 |
177 | /**
178 | * workaround a firefox stupidity
179 | * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075
180 | */
181 | fixFirefoxAnchorBug : function() {
182 | if (document.location.hash)
183 | window.setTimeout(function() {
184 | document.location.href += '';
185 | }, 10);
186 | },
187 |
188 | /**
189 | * highlight the search words provided in the url in the text
190 | */
191 | highlightSearchWords : function() {
192 | var params = $.getQueryParameters();
193 | var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : [];
194 | if (terms.length) {
195 | var body = $('div.body');
196 | if (!body.length) {
197 | body = $('body');
198 | }
199 | window.setTimeout(function() {
200 | $.each(terms, function() {
201 | body.highlightText(this.toLowerCase(), 'highlighted');
202 | });
203 | }, 10);
204 | $('' + _('Hide Search Matches') + '
') 206 | .appendTo($('#searchbox')); 207 | } 208 | }, 209 | 210 | /** 211 | * init the domain index toggle buttons 212 | */ 213 | initIndexTable : function() { 214 | var togglers = $('img.toggler').click(function() { 215 | var src = $(this).attr('src'); 216 | var idnum = $(this).attr('id').substr(7); 217 | $('tr.cg-' + idnum).toggle(); 218 | if (src.substr(-9) == 'minus.png') 219 | $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); 220 | else 221 | $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); 222 | }).css('display', ''); 223 | if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { 224 | togglers.click(); 225 | } 226 | }, 227 | 228 | /** 229 | * helper function to hide the search marks again 230 | */ 231 | hideSearchWords : function() { 232 | $('#searchbox .highlight-link').fadeOut(300); 233 | $('span.highlighted').removeClass('highlighted'); 234 | }, 235 | 236 | /** 237 | * make the url absolute 238 | */ 239 | makeURL : function(relativeURL) { 240 | return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; 241 | }, 242 | 243 | /** 244 | * get the current relative url 245 | */ 246 | getCurrentURL : function() { 247 | var path = document.location.pathname; 248 | var parts = path.split(/\//); 249 | $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { 250 | if (this == '..') 251 | parts.pop(); 252 | }); 253 | var url = parts.join('/'); 254 | return path.substring(url.lastIndexOf('/') + 1, path.length - 1); 255 | } 256 | }; 257 | 258 | // quick alias for translations 259 | _ = Documentation.gettext; 260 | 261 | $(document).ready(function() { 262 | Documentation.init(); 263 | }); 264 | -------------------------------------------------------------------------------- /sampled_airfoil_data.csv: -------------------------------------------------------------------------------- 1 | 0.9988986784140971, -0.025548487131926728 2 | 0.9962555066079296, -0.025547038024576835 3 | 0.9936123348017621, -0.024558746811963794 4 | 0.9896475770925112, -0.023569731045675835 5 | 0.98568281938326, -0.022251767910966808 6 | 0.9784140969162997, -0.020274098655228334 7 | 0.9718061674008812, -0.018296791676327362 8 | 0.9665198237885463, -0.016978103987943416 9 | 0.9612334801762116, -0.015659416299559442 10 | 0.9566079295154185, -0.01434109088801297 11 | 0.9519823788546257, -0.012364870739624362 12 | 0.945704845814978, -0.010716692267563166 13 | 0.9400881057268723, -0.009068876072339416 14 | 0.9301762114537445, -0.007089757709251077 15 | 0.9222466960352423, -0.0044538314398330225 16 | 0.9129955947136564, -0.0018171806167400495 17 | 0.9050660792951543, 0.00016085091583586952 18 | 0.8958149779735683, 0.0027975017389288426 19 | 0.8872246696035243, 0.0051048429167633025 20 | 0.8759911894273129, 0.007742580570368668 21 | 0.8654185022026433, 0.010708903315557627 22 | 0.8574889867841411, 0.012357987479712507 23 | 0.8515418502202644, 0.014005984813354966 24 | 0.8455947136563877, 0.015325034778576413 25 | 0.8409691629955948, 0.016643360190122886 26 | 0.8330396475770926, 0.018621391722698832 27 | 0.8264317180616741, 0.019940803964757697 28 | 0.8211453744493393, 0.02191738638998378 29 | 0.8105726872246697, 0.024554761766751698 30 | 0.8006607929515419, 0.026533880129840037 31 | 0.791409691629956, 0.029170530952932983 32 | 0.7814977973568283, 0.03114964931602132 33 | 0.7709251101321587, 0.03378702469278924 34 | 0.7610132158590309, 0.03576614305587758 35 | 0.7504405286343613, 0.0384035184326455 36 | 0.7359030837004407, 0.04170096220728031 37 | 0.7240088105726873, 0.044339062137723165 38 | 0.7140969162995595, 0.046318180500811504 39 | 0.6995594713656389, 0.04961562427544633 40 | 0.681057268722467, 0.05357313644794806 41 | 0.6685022026431717, 0.05621159865522839 42 | 0.6572687224669603, 0.05819144157199166 43 | 0.6440528634361233, 0.060830266056109444 44 | 0.6328193832599118, 0.06281010897287272 45 | 0.6176211453744493, 0.06545002028750291 46 | 0.6077092511013216, 0.06742913865059125 47 | 0.5931718061674008, 0.07006868768838398 48 | 0.5806167400881057, 0.07204925515882218 49 | 0.5667400881057268, 0.07468844191977744 50 | 0.5508810572687225, 0.07667082077440299 51 | 0.5356828193832599, 0.07865283735219107 52 | 0.5185022026431718, 0.08129383549733366 53 | 0.5006607929515419, 0.08393519591931373 54 | 0.49008810572687234, 0.08459888708555531 55 | 0.4696035242290749, 0.08724169661488523 56 | 0.4497797356828195, 0.08988414386737771 57 | 0.4365638766519825, 0.09054928414096917 58 | 0.42334801762114543, 0.09187231915140275 59 | 0.40616740088105735, 0.09319752782286113 60 | 0.3896475770925111, 0.09386447948063993 61 | 0.3671806167400882, 0.09585048110364017 62 | 0.3506607929515419, 0.09618848539299792 63 | 0.32951541850220273, 0.096857972988639 64 | 0.30770925110132163, 0.0965409807558544 65 | 0.29251101321585904, 0.09654931312311617 66 | 0.2786343612334802, 0.09589902619986089 67 | 0.26674008810572686, 0.0952476524460932 68 | 0.25418502202643173, 0.09459664096916301 69 | 0.24295154185022028, 0.09460279967539997 70 | 0.2218061674008811, 0.09329860306051474 71 | 0.20792951541850224, 0.09199042140041735 72 | 0.19768722466960353, 0.09068024721771391 73 | 0.18810572687224675, 0.09002760549501508 74 | 0.1775330396475771, 0.0883886650823093 75 | 0.16563876651982382, 0.08609255448643637 76 | 0.15506607929515423, 0.08478256144215164 77 | 0.14185022026431723, 0.0828161227683747 78 | 0.13061674008810575, 0.08019070252724324 79 | 0.12004405286343617, 0.07789386737769535 80 | 0.10947136563876653, 0.07559703222814748 81 | 0.10088105726872248, 0.07362805761650824 82 | 0.09361233480176212, 0.07100046371435198 83 | 0.08568281938325992, 0.06837323208903318 84 | 0.07643171806167404, 0.06508883028054718 85 | 0.06916299559471367, 0.062461236378390905 86 | 0.05792951541850222, 0.05786213192673313 87 | 0.05000000000000003, 0.05457700556457222 88 | 0.03744493392070487, 0.04932073092974727 89 | 0.02488986784140973, 0.04143287734755391 90 | 0.015638766519823807, 0.03354321238117319 91 | 0.009030837004405295, 0.026967887781126826 92 | 0.0037444933920705026, 0.019733943890563432 93 | -0.00022026431718058515, 0.009867696498956663 94 | -0.0015418502202642903, 0.004605263157894751 95 | -0.0015418502202642903, -0.0013157894736841869 96 | -0.0008810572687224377, -0.007895099118942706 97 | 0.004405286343612355, -0.015792734175747725 98 | 0.009691629955947148, -0.019085106074657965 99 | 0.01762114537444935, -0.02106313760723391 100 | 0.02488986784140973, -0.02172501738928817 101 | 0.03281938325991192, -0.021071469974495688 102 | 0.04207048458149783, -0.021076541850220232 103 | 0.05066079295154188, -0.020423356712265223 104 | 0.06057268722466963, -0.018455106654300946 105 | 0.06784140969163, -0.017472249594249922 106 | 0.07444933920704849, -0.016489030257361453 107 | 0.08634361233480178, -0.013863972293067434 108 | 0.09757709251101324, -0.011896446788778076 109 | 0.10947136563876653, -0.009271388824484111 110 | 0.1193832599118943, -0.007303138766519807 111 | 0.1273127753303965, -0.00533380187804311 112 | 0.1352422907488987, -0.004022359726408492 113 | 0.15044052863436128, -0.00008332367261765228 114 | 0.16167400881057273, 0.002542096568513813 115 | 0.17158590308370048, 0.004510346626478118 116 | 0.18215859030837006, 0.006478234407604949 117 | 0.1966960352422908, 0.010417632738233262 118 | 0.20792951541850224, 0.012385158242522593 119 | 0.21850220264317183, 0.014353046023649424 120 | 0.23171806167400882, 0.017964221539531644 121 | 0.2455947136563877, 0.020917140041734283 122 | 0.25616740088105727, 0.022885027822861115 123 | 0.2687224669603524, 0.025180776141896594 124 | 0.2806167400881057, 0.027476886737769546 125 | 0.29251101321585904, 0.030759839438905617 126 | 0.30506607929515417, 0.03206874565267795 127 | 0.3182819383259913, 0.03469307906329702 128 | 0.33149779735682827, 0.03665951773707399 129 | 0.3407488986784142, 0.03797023533503363 130 | 0.3572687224669604, 0.04059275736146534 131 | 0.3698237885462556, 0.041901663575237655 132 | 0.3837004405286344, 0.04386773997217715 133 | 0.3962555066079296, 0.04583454092279156 134 | 0.4081497797356829, 0.04648591467655924 135 | 0.4246696035242291, 0.047134752492464654 136 | 0.4359030837004406, 0.04844438325991189 137 | 0.44845814977973575, 0.048108552631578955 138 | 0.46762114537444943, 0.049742783445397634 139 | 0.4834801762114538, 0.04907619406445629 140 | 0.5, 0.049067137143519596 141 | 0.5099118942731278, 0.04939065035937862 142 | 0.5208149779735683, 0.04905572542313934 143 | 0.5356828193832599, 0.048389679457454204 144 | 0.5495594713656388, 0.04739522953860423 145 | 0.5674008810572687, 0.04574071122188732 146 | 0.5832599118942731, 0.04474517447252492 147 | 0.5958149779735683, 0.04375144910734988 148 | 0.6070484581497797, 0.04242950092742871 149 | 0.6202643171806167, 0.04110646591699513 150 | 0.6387665198237886, 0.03846474321817761 151 | 0.6552863436123347, 0.03648200208671459 152 | 0.663215859030837, 0.035161865290980754 153 | 0.6718061674008811, 0.03384136621840947 154 | 0.6850220264317181, 0.03186043647113379 155 | 0.6995594713656389, 0.02922088743334106 156 | 0.7114537444933922, 0.027240682239740327 157 | 0.7233480176211454, 0.025260477046139596 158 | 0.7372246696035243, 0.022621290285184337 159 | 0.7471365638766521, 0.02064217192209597 160 | 0.7590308370044054, 0.01800407199165316 161 | 0.769603524229075, 0.015366696614885239 162 | 0.7801762114537446, 0.013387215974959427 163 | 0.791409691629956, 0.010749478321354061 164 | 0.8066079295154186, 0.007451672269881748 165 | 0.8125550660792953, 0.006132622304660357 166 | 0.8211453744493393, 0.004154228495246964 167 | 0.8310572687224671, 0.0015172153953164902 168 | 0.8429515418502204, -0.00046298979828424125 169 | 0.8508810572687225, -0.0024410213308601603 170 | 0.8588105726872247, -0.004419052863436107 171 | 0.8660792951541851, -0.005738827382332473 172 | 0.8733480176211454, -0.007716496638070919 173 | 0.8812775330396476, -0.009365580802225798 174 | 0.8898678414096917, -0.01101502724321815 175 | 0.8971365638766521, -0.012992696498956624 176 | 0.9057268722466961, -0.014971090308370016 177 | 0.9162995594713658, -0.01695057094829583 178 | 0.9222466960352423, -0.018269620913517248 179 | 0.9281938325991189, -0.019588670878738668 180 | 0.9341409691629957, -0.02024982610711798 181 | 0.9400881057268723, -0.0215688760723394 182 | 0.9460352422907491, -0.02223003130071874 183 | 0.9526431718061675, -0.02387839091119867 184 | 0.9579295154185022, -0.024868131231161578 185 | 0.963876651982379, -0.026187181196383025 186 | 0.9711453744493393, -0.02750695571527939 187 | 0.9770925110132159, -0.028826005680500838 188 | 0.9820484581497798, -0.029157670125202872 189 | 0.9870044052863437, -0.030147229306747042 190 | 0.990308370044053, -0.03047798805935545 191 | 0.994273127753304, -0.030151214351959194 192 | 0.9988986784140971, -0.031469539763505694 193 | -------------------------------------------------------------------------------- /shape_study.p: -------------------------------------------------------------------------------- 1 | (dp0 2 | S'deltaz' 3 | p1 4 | (lp2 5 | cnumpy.core.multiarray 6 | scalar 7 | p3 8 | (cnumpy 9 | dtype 10 | p4 11 | (S'f8' 12 | p5 13 | I0 14 | I1 15 | tp6 16 | Rp7 17 | (I3 18 | S'<' 19 | p8 20 | NNNI-1 21 | I-1 22 | I0 23 | tp9 24 | bS'\x91\xa6\x15;\xe7\xaf\x8b?' 25 | p10 26 | tp11 27 | Rp12 28 | ag3 29 | (g7 30 | S'\x89\x7f\xa2p\x14\xaeO?' 31 | p13 32 | tp14 33 | Rp15 34 | ag3 35 | (g7 36 | S',\x81\xbe\x16&\x9b\x86?' 37 | p16 38 | tp17 39 | Rp18 40 | ag3 41 | (g7 42 | S'y\xf8\xd3\xa8\xe3s^?' 43 | p19 44 | tp20 45 | Rp21 46 | ag3 47 | (g7 48 | S'\x1di\x94\xacQ\xc6\x83?' 49 | p22 50 | tp23 51 | Rp24 52 | ag3 53 | (g7 54 | S"\xdc\xfc'\xc0\xc8\xd8f?" 55 | p25 56 | tp26 57 | Rp27 58 | ag3 59 | (g7 60 | S'\xeb\xaap\x8aoKp?' 61 | p28 62 | tp29 63 | Rp30 64 | ag3 65 | (g7 66 | S'\xe7\xa2\xa2\x17\x1d\xe0\x7f?' 67 | p31 68 | tp32 69 | Rp33 70 | asS'order' 71 | p34 72 | (lp35 73 | I1 74 | aI2 75 | aI3 76 | aI4 77 | aI5 78 | aI6 79 | aI7 80 | aI8 81 | asS'Au' 82 | p36 83 | (lp37 84 | (lp38 85 | g3 86 | (g7 87 | S',\xdeq\xec\x17\xc4\xd1?' 88 | p39 89 | tp40 90 | Rp41 91 | ag3 92 | (g7 93 | S'{M\x13\xbdsW\xd0?' 94 | p42 95 | tp43 96 | Rp44 97 | aa(lp45 98 | g3 99 | (g7 100 | S'\xf0D\xfd\x06\xf3?\xcf?' 101 | p46 102 | tp47 103 | Rp48 104 | ag3 105 | (g7 106 | S'\xd0q\xa7\xd6\xdag\xd3?' 107 | p49 108 | tp50 109 | Rp51 110 | ag3 111 | (g7 112 | S'b\x01\xa5\x1b\xb4\xca\xce?' 113 | p52 114 | tp53 115 | Rp54 116 | aa(lp55 117 | g3 118 | (g7 119 | S'\t\xb4\xd8!\xad^\xd1?' 120 | p56 121 | tp57 122 | Rp58 123 | ag3 124 | (g7 125 | S'h\xd7\x9f\xf3\xbf\xe4\xce?' 126 | p59 127 | tp60 128 | Rp61 129 | ag3 130 | (g7 131 | S'K\xe0\xbcYOY\xd4?' 132 | p62 133 | tp63 134 | Rp64 135 | ag3 136 | (g7 137 | S'\xa4D\xd9e#\xea\xc8?' 138 | p65 139 | tp66 140 | Rp67 141 | aa(lp68 142 | g3 143 | (g7 144 | S'\xa7\xb9qGb\x08\xd2?' 145 | p69 146 | tp70 147 | Rp71 148 | ag3 149 | (g7 150 | S'fbr\x7f\xd7c\xd2?' 151 | p72 152 | tp73 153 | Rp74 154 | ag3 155 | (g7 156 | S'\xae%\x8d
42 | # -*- coding: utf-8 -*-
43 | """
44 | Created on Sun Aug 16 20:59:22 2015
45 |
46 | @author: Pedro
47 | """
48 | from aero_module import *
49 | from xfoil_module import *
50 |
51 | [docs]def find_3D_coefficients(airfoil, alpha, Reynolds=0, iteration=10, NACA=True,
52 | N=10, span=10., taper=1., chord_root=1, alpha_root=1.,
53 | velocity=1.):
54 | """ Calculate the 3D distribution using the Lifting Line Theory.
55 |
56 | :param airfoil: if NACA is false, airfoil is the name of the plain
57 | filewhere the airfoil geometry is stored (variable airfoil).
58 | If NACA is True, airfoil is the naca series of the airfoil
59 | (i.e.: naca2244). By default NACA is False.
60 |
61 | :param Reynolds: Reynolds number in case the simulation is for a
62 | viscous flow. In case not informed, the code will assume
63 | inviscid. (Use the aero_module function to calculate reynolds)
64 |
65 | :param alpha: list/array/float/int of angles of attack.
66 |
67 | :param iteration: changes how many times XFOIL will try to make the
68 | results converge. Specialy important for viscous flows
69 |
70 | :param NACA: Boolean variable that defines if the code imports an
71 | airfoil from a file or generates a NACA airfoil.
72 |
73 | :param N: number of cross sections on the wing
74 |
75 | :param span: span in meters
76 |
77 | :param taper: unidimendional taper (This options is still not 100%
78 | operational)
79 |
80 | :param chord_root: value of the chord at the the root
81 |
82 | :param alpha_root: angle of attack of the chord at the root (degrees)
83 |
84 | :param velocity: velocity in m/s
85 |
86 | """
87 | coefficients = find_coefficients(airfoil, alpha, Reynolds, iteration,
88 | NACA)
89 | alpha_L_0_root = find_alpha_L_0(airfoil, Reynolds, iteration, NACA)
90 | return LLT_calculator(alpha_L_0_root, coefficients['CD'], N, span, taper, chord_root,
91 | alpha_root, velocity)
92 |
93 |
94 | if __name__ == '__main__':
95 | print find_3D_coefficients(airfoil='naca0012', alpha=1.)
96 |
143 |
144 |
145 |
146 |
147 |
148 |
--------------------------------------------------------------------------------
/docs/_build/html/index.html:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | AeroPy is an library for calculating aerodynamic properties. The main feature of 44 | this library is the Python interface with XFOIL. The main objective of this library is to be able 45 | to use XFOIL via Python iteratively in a total of 4 lines total (one line for most uses). 46 | Through this interface coupling with other softwares (Abaqus, Ansys, etc) is possible 47 | and iterative processes (optimization, design sensitivity) are possible. 48 | For a thorough explanation please check the documentation and the tutorials.
49 |Contents:
50 |Please use and adapt this library to your needs. There are several 78 | functionalities I wished to implement, but did not have the time. Hence 79 | I am strongly recommending the following collaborations:
80 |A simple example demonstrating how to use AeroPy to calculate lift, drag and 97 | moment coefficients for a NACA0012 airfoil at angle of attack of 12 degrees.
98 |from AeroPy import find_coefficients
99 | find_coefficients(airfoil='naca0012'alpha=12.)
100 | >>> {'CM': 0.0134, 'CL': 1.2453, 'Top_Xtr': 0.0194, 'CD': 0.01934, 'CDp': 0.01379, 'alpha': 12.0, 'Bot_Xtr': 1.0}
101 | Another example showing how to use AeroPy to calculate pressure coefficients for a 104 | NACA0012 in viscous flow at Reynolds = 10000000 and angle of attack of 12 degrees
105 |from AeroPy import find_pressure_coefficients
106 | find_pressure_coefficients(airfoil='naca0012', Reynolds = 1e6, alpha=12.,NACA=True)
107 | >>> 'y': [0.00126, ..., -0.00126], 'x': [1.0, ..., 1.0], 'Cp': [0.41501, ..., 0.41501]}
108 |
176 |
177 |
178 |
179 |
180 |
181 |
--------------------------------------------------------------------------------
/docs/_build/html/aero_module.html:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | If \(\theta_0\) is an arbitrary span-wise location:
47 |Each equation has \(N\) unknowns (\(A_n\)), so if there are N \(\theta_o\), we have NxN system, which in Einstein notation can be written as:
50 |where, \(i=0,...,N\), \(j=0,...,N\) and :
53 |where \(n=1,3,5,...,N-1\). Since we are considering a symmetric wing, all of the even terms would cancel each other
60 |
62 | Current funcionatilities: 67 | - Lifting line theory 68 | - generate field pressures for Abaqus or other softwares 69 | - air properties calculator 70 | - Reynolds calculator 71 | Created on Mon Jul 20 17:26:19 2015
72 |@author: Pedro Leal
73 |aero_module.LLT_calculator(alpha_L_0_root, c_D_xfoil, N=10, b=10.0, taper=1.0, chord_root=1, alpha_root=0.0, V=1.0)[source]¶Calculate the coefficients for a Wing. 77 | TODO : - Include elliptical wing
78 |79 |85 |80 |
84 |- When alpha_L_0_root = zero, nan!
81 |- Include non rectangular wings
82 |- something else?
83 |
aero_module.Reynolds(height, V, c)[source]¶Simple function to calculate Reynolds for a given height.
91 |@author: Pedro Leal 92 | Created in Jul 17 2015
93 |aero_module.air_properties(height, unit='feet')[source]¶Function to calculate air properties for a given height (m or ft).
99 |Created on Thu May 15 14:59:43 2014 108 | @author: Pedro Leal
109 |aero_module.calculate_moment_coefficient(x, y, Cp, alpha, c=1.0, x_ref=0.0, y_ref=0.0)[source]¶Calculate the moment coeffcient. Inputs are x and y coordinates, and 115 | pressure coefficients (Cp). Inputs can be in a list in xfoil format 116 | (counterclockwise starting from the trailing edge, in case necessary, 117 | check create_input function from xfoil_module) or dictionaries with 118 | ‘upper’ and ‘lower’ keys.
119 |
195 |
196 |
197 |
198 |
199 |
200 |
--------------------------------------------------------------------------------
/docs/conf.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | #
3 | # pyXFOIL documentation build configuration file, created by
4 | # sphinx-quickstart on Tue Aug 11 23:35:51 2015.
5 | #
6 | # This file is execfile()d with the current directory set to its
7 | # containing dir.
8 | #
9 | # Note that not all possible configuration values are present in this
10 | # autogenerated file.
11 | #
12 | # All configuration values have a default; values that are commented out
13 | # serve to show the default.
14 |
15 | import sys
16 | import os
17 | import shlex
18 | import alabaster
19 |
20 | from mock import Mock # To include C dependent libs in ReadtheDocs
21 |
22 | # If extensions (or modules to document with autodoc) are in another directory,
23 | # add these directories to sys.path here. If the directory is relative to the
24 | # documentation root, use os.path.abspath to make it absolute, like shown here.
25 | #sys.path.insert(0, os.path.abspath('.'))
26 | sys.path.insert(0, os.path.abspath('..'))
27 |
28 | # -- General configuration ------------------------------------------------
29 |
30 | # If your documentation needs a minimal Sphinx version, state it here.
31 | #needs_sphinx = '1.0'
32 |
33 | # Add any Sphinx extension module names here, as strings. They can be
34 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
35 | # ones.
36 | extensions = [
37 | 'sphinx.ext.autodoc',
38 | 'sphinx.ext.intersphinx',
39 | 'sphinx.ext.todo',
40 | 'sphinx.ext.mathjax',
41 | 'sphinx.ext.viewcode',
42 | 'alabaster'
43 | ]
44 |
45 | # Add any paths that contain templates here, relative to this directory.
46 | templates_path = ['_templates']
47 |
48 | # The suffix(es) of source filenames.
49 | # You can specify multiple suffix as a list of string:
50 | # source_suffix = ['.rst', '.md']
51 | source_suffix = '.rst'
52 |
53 | # The encoding of source files.
54 | #source_encoding = 'utf-8-sig'
55 |
56 | # The master toctree document.
57 | master_doc = 'index'
58 |
59 | # General information about the project.
60 | project = u'AeroPy'
61 | copyright = u'2015, Pedro Leal'
62 | author = u'Pedro Leal'
63 |
64 | # The version info for the project you're documenting, acts as replacement for
65 | # |version| and |release|, also used in various other places throughout the
66 | # built documents.
67 | #
68 | # The short X.Y version.
69 | version = '0.0.2'
70 | # The full version, including alpha/beta/rc tags.
71 | release = '0.0.2'
72 |
73 | # The language for content autogenerated by Sphinx. Refer to documentation
74 | # for a list of supported languages.
75 | #
76 | # This is also used if you do content translation via gettext catalogs.
77 | # Usually you set "language" from the command line for these cases.
78 | language = None
79 |
80 | # There are two options for replacing |today|: either, you set today to some
81 | # non-false value, then it is used:
82 | #today = ''
83 | # Else, today_fmt is used as the format for a strftime call.
84 | #today_fmt = '%B %d, %Y'
85 |
86 | # List of patterns, relative to source directory, that match files and
87 | # directories to ignore when looking for source files.
88 | exclude_patterns = ['_build']
89 |
90 | # The reST default role (used for this markup: `text`) to use for all
91 | # documents.
92 | #default_role = None
93 |
94 | # If true, '()' will be appended to :func: etc. cross-reference text.
95 | #add_function_parentheses = True
96 |
97 | # If true, the current module name will be prepended to all description
98 | # unit titles (such as .. function::).
99 | #add_module_names = True
100 |
101 | # If true, sectionauthor and moduleauthor directives will be shown in the
102 | # output. They are ignored by default.
103 | #show_authors = False
104 |
105 | # The name of the Pygments (syntax highlighting) style to use.
106 | pygments_style = 'sphinx'
107 |
108 | # A list of ignored prefixes for module index sorting.
109 | #modindex_common_prefix = []
110 |
111 | # If true, keep warnings as "system message" paragraphs in the built documents.
112 | #keep_warnings = False
113 |
114 | # If true, `todo` and `todoList` produce output, else they produce nothing.
115 | todo_include_todos = True
116 |
117 |
118 | # -- Options for HTML output ----------------------------------------------
119 |
120 | # The theme to use for HTML and HTML Help pages. See the documentation for
121 | # a list of builtin themes.
122 | html_theme = 'alabaster'
123 |
124 | # Theme options are theme-specific and customize the look and feel of a theme
125 | # further. For a list of options available for each theme, see the
126 | # documentation.
127 | html_theme_options = {'logo': 'logo.png',
128 | 'description': 'An easy to use aerodynamic tool',
129 | 'github_user': 'leal26',
130 | 'github_repo': 'AeroPy',
131 | 'logo_name': 'AeroPy',
132 | 'github_banner': True}
133 |
134 | # Add any paths that contain custom themes here, relative to this directory.
135 | html_theme_path = [alabaster.get_path()]
136 |
137 | # The name for this set of Sphinx documents. If None, it defaults to
138 | # "