Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions Airfoil characteristics - amiya/2412.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
1.00000000 0.00000000
0.99910623 0.00020490
0.99617708 0.00081746
0.99130721 0.00183029
0.98451462 0.00323139
0.97582453 0.00500438
0.96526923 0.00712879
0.95288810 0.00958052
0.93872748 0.01233229
0.92284056 0.01535412
0.90528726 0.01861389
0.88613406 0.02207772
0.86545377 0.02571051
0.84332535 0.02947628
0.81983364 0.03333849
0.79506903 0.03726034
0.76912718 0.04120497
0.74210869 0.04513556
0.71411868 0.04901549
0.68526647 0.05280838
0.65566513 0.05647816
0.62543106 0.05998915
0.59468360 0.06330614
0.56354453 0.06639459
0.53213763 0.06922076
0.50058819 0.07175208
0.46902253 0.07395746
0.43756749 0.07580769
0.40634986 0.07727597
0.37529693 0.07829665
0.34467975 0.07876445
0.31467791 0.07866778
0.28541825 0.07800433
0.25702472 0.07677852
0.22961766 0.07500158
0.20331307 0.07269154
0.17822186 0.06987304
0.15444921 0.06657687
0.13209395 0.06283946
0.11124803 0.05870205
0.09199604 0.05420974
0.07441485 0.04941038
0.05857330 0.04435333
0.04453206 0.03908817
0.03234345 0.03366328
0.02205147 0.02812454
0.01369173 0.02251404
0.00729159 0.01686883
0.00287020 0.01121992
0.00043865 0.00559144
0.00000000 0.00000000
0.00153463 -0.00539298
0.00501509 -0.01043258
0.01042116 -0.01511322
0.01772511 -0.01942897
0.02689202 -0.02337383
0.03788006 -0.02694217
0.05064089 -0.03012931
0.06512002 -0.03293202
0.08125723 -0.03534918
0.09898696 -0.03738231
0.11823872 -0.03903610
0.13893742 -0.04031885
0.16100369 -0.04124275
0.18435415 -0.04182406
0.20890168 -0.04208311
0.23455554 -0.04204410
0.26122161 -0.04173481
0.28880246 -0.04118609
0.31719754 -0.04043123
0.34630326 -0.03950521
0.37601319 -0.03844392
0.40626883 -0.03728050
0.43709928 -0.03596314
0.46818695 -0.03448146
0.49941181 -0.03286467
0.53065289 -0.03114093
0.56178870 -0.02933684
0.59269771 -0.02747709
0.62325883 -0.02558417
0.65335187 -0.02367824
0.68285808 -0.02177712
0.71166061 -0.01989635
0.73964499 -0.01804943
0.76669961 -0.01624805
0.79271622 -0.01450235
0.81759035 -0.01282128
0.84122175 -0.01121291
0.86351486 -0.00968469
0.88437919 -0.00824370
0.90372973 -0.00689682
0.92148736 -0.00565085
0.93757920 -0.00451251
0.95193895 -0.00348846
0.96450725 -0.00258516
0.97523199 -0.00180877
0.98406854 -0.00116491
0.99098004 -0.00065856
0.99593762 -0.00029380
0.99892050 -0.00007369
1.00000000 0.00000000
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
{
"metadata": {
"name": "",
"signature": "sha256:08d7474f33be091c07ab73695ad32b733222f333e8c562b3b6af59f3e8923cc3"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "code",
"collapsed": false,
"input": [
"import numpy as np\n",
"import math\n",
"import matplotlib.pyplot as plt\n",
"import csv"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 7
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"with open (r'C:\\Users\\Amiya\\Documents\\GWU\\AeroHydro\\Project\\Airfoil characteristics/NACA_2412.dat') as file_name:\n",
" x_j, y_j = np.loadtxt(file_name, dtype=float, delimiter='\\t', unpack=True)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"ename": "ValueError",
"evalue": "could not convert string to float: NACA 2412",
"output_type": "pyerr",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mValueError\u001b[0m Traceback (most recent call last)",
"\u001b[1;32m<ipython-input-8-8baf207bb223>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[1;32mwith\u001b[0m \u001b[0mopen\u001b[0m \u001b[1;33m(\u001b[0m\u001b[1;34mr'C:\\Users\\Amiya\\Documents\\GWU\\AeroHydro\\Project\\Airfoil characteristics/NACA_2412.dat'\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0mfile_name\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 2\u001b[1;33m \u001b[0mx_j\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0my_j\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mloadtxt\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mfile_name\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mdtype\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mfloat\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mdelimiter\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;34m'\\t'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0munpack\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mTrue\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[1;32mC:\\Anaconda\\lib\\site-packages\\numpy\\lib\\npyio.pyc\u001b[0m in \u001b[0;36mloadtxt\u001b[1;34m(fname, dtype, comments, delimiter, converters, skiprows, usecols, unpack, ndmin)\u001b[0m\n\u001b[0;32m 854\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 855\u001b[0m \u001b[1;31m# Convert each value according to its column and store\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 856\u001b[1;33m \u001b[0mitems\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m[\u001b[0m\u001b[0mconv\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mval\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;32mfor\u001b[0m \u001b[1;33m(\u001b[0m\u001b[0mconv\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mval\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mzip\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mconverters\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mvals\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 857\u001b[0m \u001b[1;31m# Then pack it according to the dtype's nesting\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 858\u001b[0m \u001b[0mitems\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mpack_items\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mitems\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mpacking\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
"\u001b[1;31mValueError\u001b[0m: could not convert string to float: NACA 2412"
]
}
],
"prompt_number": 8
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"c = 1.0 #chord\n",
"thickness = 12 #thickness as a percent of chord\n",
"camber = 2.0 #max camber as a percent of chord\n",
"camber_loc = 4.0 #location of max camber as 1/10 percent of a chord\n",
"\n",
"t = thickness/100 #max thickness as a fraction of the chord\n",
"m = camber/100\n",
"p = camber_loc/10 \n",
"\n",
"N = 202 #number of points describing airfoil\n",
"theta_u = np.linspace(0, np.pi, N/2)\n",
"x = np.linspace(0, c, N/2)\n",
"theta_l = np.linspace(np.pi, 2*np.pi, N/2)\n",
"y_t = (t/0.2)*(0.2969*np.sqrt(x) - 0.126*x - 0.3516*x**2 + 0.2843*x**3 - 0.1015*x**4)\n",
"print theta_u.size, theta_l.size\n",
"print x.size\n",
"print y_t.size\n",
"print y_t[0]\n",
"plt.plot(x,y_t)"
],
"language": "python",
"metadata": {},
"outputs": []
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"x_u = np.zeros(x.size, dtype=float)\n",
"y_u = np.zeros(x.size, dtype=float)\n",
"x_l = np.zeros(x.size, dtype=float)\n",
"y_l = np.zeros(x.size, dtype=float)\n",
"y_c = np.zeros(x.size, dtype=float)\n",
"dyc_dx = np.zeros(x.size, dtype=float)\n",
"\n",
"for i in range(N/2-1):\n",
" if x[i]>p*c:\n",
" y_c[i] = (m/(1-p)**2)*((1-(2*p))+(2*p*x[i])-x[i]**2)\n",
" dyc_dx[i] = (2*m/(1-p)**2)*(p-x[i])\n",
" else:\n",
" y_c[i] = (m/p**2)*((2*p*x[i])-x[i]**2)\n",
" dyc_dx[i] = (2*m/p**2)*(p-x[i])\n",
"\n",
"plt.plot(x[0:N/4],y_c[0:N/4])\n",
"print y_c[0]"
],
"language": "python",
"metadata": {},
"outputs": []
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"x_u = x - y_t*np.sin(np.arctan(dyc_dx))\n",
"y_u = y_c + y_t*np.cos(np.arctan(dyc_dx))\n",
" #print i, x_u[i]\n",
" \n",
"x_l = x + y_t*np.sin(np.arctan(dyc_dx))\n",
"y_l = y_c - y_t*np.cos(np.arctan(dyc_dx))\n",
"\n",
"x_l[0], y_l[0] = x_u[0], y_u[0]\n",
"x_l[N/2 - 1], y_l[N/2 - 1] = x_u[N/2 - 1], y_u[N/2 - 1]\n",
"\n",
"print x_l[0], y_l[0],x_u[0], y_u[0]\n",
"print x_l[N/2 - 1], y_l[N/2 - 1],x_u[N/2 - 1], y_u[N/2 - 1]"
],
"language": "python",
"metadata": {},
"outputs": []
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#plt.plot(x_u, y_u, marker='x')\n",
"plt.plot(x_l, y_l, color='#CD2305')\n",
"plt.plot(x_u, y_u)\n",
"#plt.scatter(x_j, y_j, marker='o')\n"
],
"language": "python",
"metadata": {},
"outputs": []
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"cb = np.zeros(x.size, dtype=float)"
],
"language": "python",
"metadata": {},
"outputs": []
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"print x_j.size"
],
"language": "python",
"metadata": {},
"outputs": []
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"print x.size"
],
"language": "python",
"metadata": {},
"outputs": []
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {},
"outputs": []
}
],
"metadata": {}
}
]
}

Large diffs are not rendered by default.

Loading