summaryrefslogtreecommitdiff
path: root/Fundamentals_Of_Aerodynamics_by_J._D._Anderson_Jr./CHAPTER07.ipynb
blob: d9d5597aa5b26e84f145497e619530e7b8445731 (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
{
 "metadata": {
  "name": "",
  "signature": "sha256:daee8dea306dcf3f243bce271ea4da56ca30a788427b14afefd3a09c75dc55c1"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "CHAPTER07:COMPRESSIBLE FLOW SOME PRELIMINARY ASPECTS"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E01 : Pg 222"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# All the quantities are expressed in SI units\n",
      "import math \n",
      "l = 5.;                # dimensions of the room\n",
      "b = 7.;\n",
      "h = 3.3;\n",
      "V = l*b*h;            # volume of the room\n",
      "p = 101000.;           # ambient pressure\n",
      "T = 273. + 25.;         # ambient temperature\n",
      "R = 287.;              # gas constant\n",
      "gam = 1.4;            # ratio of specific heats\n",
      "cv = R/(gam-1.);\n",
      "cp = gam*R/(gam-1.);\n",
      "\n",
      "# the density can by calculaled by the ideal gas law\n",
      "rho = p/R/T;\n",
      "\n",
      "# thus the mass is given by\n",
      "M = rho*V;\n",
      "\n",
      "# from eq.(7.6a), the internal energy per unit mass is\n",
      "e = cv*T;\n",
      "\n",
      "# thus internal energy in the room is\n",
      "E = e*M;\n",
      "\n",
      "# from eq.(7.6b), the enthalpy per unit mass is given by\n",
      "h = cp*T;\n",
      "\n",
      "# Thus the enthalpy in the room is\n",
      "H = M*h;\n",
      "\n",
      "print\"The internal energy in the room is: E =\", E/10**7\n",
      "print\"The Enthalpy in the room is: H = \",H/10**7"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The internal energy in the room is: E = 2.916375\n",
        "The Enthalpy in the room is: H =  4.082925\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E02 : Pg 223"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# All the quantities are expressed in SI units\n",
      "\n",
      "p_inf = 22790.9;            # ambient pressure at 36000 ft\n",
      "T_inf = 217.2;              # ambient temperature at 36000 ft\n",
      "p = 19152;                  # pressure at the given point\n",
      "gam = 1.4;\n",
      "\n",
      "# thus the temperature at the given point can be calculated by eq.(7.32) as\n",
      "T = T_inf*((p/p_inf)**((gam-1)/gam));\n",
      "\n",
      "print\"The temperature at the given point is: T =\",T,\"K\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The temperature at the given point is: T = 206.668775312 K\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example E03 : Pg 223"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# All the quantities are expressed in SI units\n",
      "\n",
      "p =101000;                # static pressure\n",
      "T = 320;                  # static temperature\n",
      "v = 1000;                 # velocity\n",
      "gam = 1.4;                # ratio of specific heats\n",
      "R = 287;                  # universal gas constant\n",
      "cp = gam*R/(gam-1);       # specific heat at constant pressure\n",
      "\n",
      "# from eq.(7.54), the total temperature is given by\n",
      "T0 = T + (v**2)/2/cp;\n",
      "\n",
      "# from eq.(7.32),the total pressure is given by\n",
      "p0 = p*((T0/T)**(gam/(gam-1)));\n",
      "\n",
      "p0_atm = p0/101000;\n",
      "\n",
      "\n",
      "print\"The total temperature and pressure are given by: T0 =\",T0,\"K\"\n",
      "print\"P0 =\",p0_atm,\"atm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The total temperature and pressure are given by: T0 = 817.760079642 K\n",
        "P0 = 26.678766535 atm\n"
       ]
      }
     ],
     "prompt_number": 3
    }
   ],
   "metadata": {}
  }
 ]
}