summaryrefslogtreecommitdiff
path: root/sample_notebooks/Vishnu Tej/CHAPTER12.ipynb
blob: cc64c399fdd506876ddcb7981f0ded2958005d19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
{
 "metadata": {
  "name": "",
  "signature": "sha256:9f892b4a818165ad52b348800d0ffa60b6a3224f73f3dcda15a72be66b12ba9f"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "CHAPTER12:LINEARIZED SUPERSONIC FLOW"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E01 : Pg 395"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# All the quantities are expressed in SI units\n",
      "import math \n",
      "from math import pi,sqrt\n",
      "alpha = 5*pi/180;                    # angle of attack\n",
      "M_inf = 3;                            # freestream mach number\n",
      "\n",
      "# from eq.(12.23)\n",
      "c_l = 4*alpha/sqrt(M_inf**2 - 1);\n",
      "\n",
      "# from eq.(12.24)\n",
      "c_d = 4*alpha**2/sqrt(M_inf**2 - 1);\n",
      "\n",
      "print\"The cl and cd according to the linearized theory are:cl =\", round(c_l,2)\n",
      "print\"The cl and cd according to the linearized theory are:cd =\",round(c_d,2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The cl and cd according to the linearized theory are:cl = 0.12\n",
        "The cl and cd according to the linearized theory are:cd = 0.01\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E02 : Pg 395"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# All the quantities are expressed in SI units\n",
      "import math \n",
      "from math import sqrt,pi\n",
      "M_inf = 2.;                       # freestream mach number\n",
      "rho_inf = 0.3648;                # freestream density at 11 km altitude\n",
      "T_inf = 216.78;                  # freestream temperature at 11 km altitude\n",
      "gam = 1.4;                       # ratio of specific heats\n",
      "R = 287.;                         # specific gas constant\n",
      "m = 9400.;                        # mass of the aircraft\n",
      "g = 9.8;                         # acceleratio due to gravity\n",
      "W = m*g;                         # weight of the aircraft\n",
      "S = 18.21;                       # wing planform area\n",
      "# thus\n",
      "a_inf = sqrt(gam*R*T_inf);\n",
      "V_inf = M_inf*a_inf;\n",
      "q_inf = 1./2.*rho_inf*V_inf**2.;\n",
      "\n",
      "# thus the aircraft lift coefficient is given as\n",
      "C_l = W/q_inf/S;\n",
      "\n",
      "alpha = 180./pi*C_l/4.*sqrt(M_inf**2. - 1.);\n",
      "\n",
      "print\"The angle of attack of the wing is:\",alpha,\"degrees\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The angle of attack of the wing is: 1.97493716351 degrees\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E03 : Pg 400"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# All the quantities are expressed in SI units\n",
      "# All the quantities are expressed in SI units\n",
      "import math \n",
      "from math import sqrt,pi\n",
      "# (a)\n",
      "M_inf = 2.;                       # freestream mach number\n",
      "rho_inf = 0.3648;                # freestream density at 11 km altitude\n",
      "T_inf = 216.78;                  # freestream temperature at 11 km altitude\n",
      "gam = 1.4;                       # ratio of specific heats\n",
      "R = 287.;                         # specific gas constant\n",
      "m = 9400.;                        # mass of the aircraft\n",
      "g = 9.8;                         # acceleratio due to gravity\n",
      "W = m*g;                         # weight of the aircraft\n",
      "S = 18.21;                       # wing planform area\n",
      "c = 2.2;                         # chord length of the airfoil\n",
      "alpha = 0.035;                   # angle of attack as calculated in ex. 12.2\n",
      "T0 = 288.16;                     # ambient temperature at sea level\n",
      "mue0 = 1.7894e-5;                # reference viscosity at sea level\n",
      "\n",
      "# thus\n",
      "a_inf = sqrt(gam*R*T_inf);\n",
      "V_inf = M_inf*a_inf;\n",
      "\n",
      "# according to eq.(15.3), the viscosity at the given temperature is\n",
      "mue_inf = mue0*(T_inf/T0)**1.5*(T0+110.)/(T_inf+110.);\n",
      "\n",
      "# thus the Reynolds number can be given by\n",
      "Re = rho_inf*V_inf*c/mue_inf;\n",
      "\n",
      "# from fig.(19.1), for these values of Re and M, the skin friction coefficient is\n",
      "Cf = 2.15*10**-3;\n",
      "\n",
      "# thus, considering both sides of the flat plate\n",
      "net_Cf = 2.*Cf;\n",
      "\n",
      "# (b)\n",
      "c_d = 4.*alpha**2./sqrt(M_inf**2. - 1.);\n",
      "\n",
      "print\"(a) Net Cf = \",net_Cf*1e3\n",
      "print\"(b) cd =\",c_d*1e3"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a) Net Cf =  4.3\n",
        "(b) cd = 2.82901631903\n"
       ]
      }
     ],
     "prompt_number": 3
    }
   ],
   "metadata": {}
  }
 ]
}