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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
|
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Appendix E"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 1"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Stagnation Temperature: 319.9 K\n",
"Stagnation Pressure: 187.9 KPa\n"
]
}
],
"source": [
"# -*- coding: utf8 -*-\n",
"from __future__ import division\n",
"#Example: 17.1\n",
"'''Air flows in a duct at a pressure of 150 kPa with a velocity of 200 m/s. The temperature\n",
"of the air is 300 K. Determine the isentropic stagnation pressure and temperature.'''\n",
"\n",
"#Variable Declaration: \n",
"T = 300\t\t\t\t\t#Temperature of air in K\n",
"P = 150\t\t\t\t\t#Pressure of air in kPa\n",
"v = 200\t\t\t\t\t#velocity of air flow n m/s\n",
"Cp = 1.004\t\t\t\t#specific heat at constant pressure in kJ/kg\n",
"\n",
"#Calculations:\n",
"To = v**2/(2000*Cp)+T\t#stagnation temperature in K\n",
"k = 1.4\t\t \t\t#constant\n",
"Po = P*(To/T)**(k/(k-1))#stagnation pressure in kPa\n",
"\n",
"#Results:\n",
"print 'Stagnation Temperature: ',round(To,1),'K'\n",
"print 'Stagnation Pressure:',round(Po,1),'KPa'"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 3"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Thrust acting in x direction: 10.68 KN\n"
]
}
],
"source": [
"# -*- coding: utf8 -*-\n",
"from __future__ import division\n",
"#Example: 17.3\n",
"'''A jet engine is being tested on a test stand (Fig. 17.5). The inlet area to the compressor is\n",
"0.2 m2, and air enters the compressor at 95 kPa, 100 m/s. The pressure of the atmosphere\n",
"is 100 kPa. The exit area of the engine is 0.1 m2, and the products of combustion leave the\n",
"exit plane at a pressure of 125 kPa and a velocity of 450 m/s. The air–fuel ratio is 50 kg\n",
"air/kg fuel, and the fuel enters with a low velocity. The rate of air flow entering the engine\n",
"is 20 kg/s. Determine the thrust, Rx, on the engine.'''\n",
"\n",
"#Keys\n",
"#i = inlet\n",
"#e = exit\n",
"\n",
"#Variable Declaration: \n",
"#using momentum equation on control surface in x direction\n",
"me = 20.4\t\t#mass exiting in kg\n",
"mi = 20\t\t\t#mass entering in kg\n",
"ve = 450\t\t#exit velocity in m/s\n",
"vi = 100\t\t#exit velocity in m/s\n",
"Pi = 95\t\t\t#Pressure at inlet in kPa\n",
"Pe = 125\t\t#Pressure at exit in kPa\n",
"Po = 100\t\t#surrounding pressure in kPa\n",
"Ai = 0.2\t\t#inlet area in m**2\n",
"Ae = 0.1\t\t#exit area in m**2\n",
"\n",
"#Calculations:\n",
"Rx = (me*ve-mi*vi)/1000-(Pi-Po)*Ai+(Pe-Po)*Ae\t\t#thrust in x direction in kN\n",
"\n",
"#Results:\n",
"print 'Thrust acting in x direction: ',Rx,'KN' "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 5"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Speed of sound at 300K: 347.2 m/s\n",
"Speed of sound at 1000K: 633.9 m/s\n"
]
}
],
"source": [
"# -*- coding: utf8 -*-\n",
"from __future__ import division\n",
"from math import sqrt\n",
"#Example: 17.5\n",
"'''Determine the velocity of sound in air at 300 K and at 1000 K.'''\n",
"\n",
"#Variable Declaration: \n",
"k = 1.4\t\t\t#constant\n",
"R = 0.287\t\t#gas constant\n",
"#At 300K\n",
"T1 = 300\t\t#K\n",
"T2 = 1000\t\t#K\n",
"\n",
"#Calculations:\n",
"c1 = sqrt(k*R*T1*1000)\n",
"c2 = sqrt(k*R*T2*1000)\n",
"\n",
"#Results:\n",
"print 'Speed of sound at 300K: ',round(c1,1),'m/s'\n",
"print 'Speed of sound at 1000K: ',round(c2,1),'m/s'"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 6"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Mass flow rate at the throat section: 1.0646 Kg/s\n",
"Mass flow rate at the exit section: 0.8711 Kg/s\n"
]
}
],
"source": [
"# -*- coding: utf8 -*-\n",
"from __future__ import division\n",
"from math import sqrt\n",
"#Example: 17.6\n",
"'''A convergent nozzle has an exit area of 500 mm2. Air enters the nozzle with a stagnation\n",
"pressure of 1000 kPa and a stagnation temperature of 360 K. Determine the mass rate of\n",
"flow for back pressures of 800 kPa, 528 kPa, and 300 kPa, assuming isentropic flow'''\n",
"\n",
"#Variable Declaration: \n",
"k = 1.4\t\t\t\t#constant\n",
"R = 0.287\t\t\t#gas constant\n",
"To = 360\t\t\t#stagnation Temperature in K \n",
"P = 528\t\t\t\t#stagnation pressure in kPa\n",
"A = 500*10**-6\t\t#area in m**2\n",
"Me = 0.573\t\t\t#Mach number\n",
"Pe = 800\t\t\t#exit pressure in kPa\n",
"\n",
"#Calculations:\n",
"T = To*0.8333\t\t#Temperature of air in K, 0.8333 stagnation ratio from table\n",
"v = sqrt(k*R*T*1000)#velocity in m/s\n",
"d = P/(R*T)\t\t\t#stagnation density in kg/m**3\n",
"ms = d*A*v\t\t\t#mass flow rate in kg/s\n",
"Te = To*0.9381\t\t#exit temperature in K, ratio from table\n",
"ce = sqrt(k*R*Te*1000)#exit velocity of sound in m/s\n",
"ve = Me*ce\n",
"de = Pe/R/Te\n",
"mse = de*A*ve\n",
"\n",
"#Results:\n",
"print 'Mass flow rate at the throat section: ',round(ms,4),'Kg/s'\n",
"print 'Mass flow rate at the exit section: ',round(mse,4),'Kg/s'"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 7"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"__When diverging section act as a nozzle__\n",
"Exit pressure: 93.9 Kpa\n",
"Exit Temperature: 183.2 K\n",
"Exit velocity: 596.1 m/s\n",
"__When diverging section act as a diffuser__\n",
"Exit pressure: 93.6 Kpa\n",
"Exit Temperature: 353.2 K\n",
"Exit velocity: 116.0 m/s\n"
]
}
],
"source": [
"# -*- coding: utf8 -*-\n",
"from __future__ import division\n",
"from math import sqrt\n",
"#Example: 17.7\n",
"'''A converging-diverging nozzle has an exit area to throat area ratio of 2. Air enters this\n",
"nozzle with a stagnation pressure of 1000 kPa and a stagnation temperature of 360 K. The\n",
"throat area is 500 mm2. Determine the mass rate of flow, exit pressure, exit temperature,\n",
"exit Mach number, and exit velocity for the following conditions:\n",
"a. Sonic velocity at the throat, diverging section acting as a nozzle.\n",
"(Corresponds to point d in Fig. 17.13.)\n",
"b. Sonic velocity at the throat, diverging section acting as a diffuser.\n",
"(Corresponds to point c in Fig. 17.13.)'''\n",
"\n",
"#Variable Declaration: \n",
"Po = 1000\t\t \t#stagnation pressure in kPa\n",
"To = 360\t\t \t#stagnation temperature in K\n",
"#when diverging section acting as nozzle\n",
"Pe1 = 0.0939*Po\t\t\t#exit pressure of air in kPa\n",
"Te1 = 0.5089*To\t\t\t#exit temperature in K\n",
"k = 1.4\t\t \t\t#constant\n",
"R = 0.287\t\t \t#gas constant for air\n",
"Me = 2.197\t\t \t#mach number from table\n",
"#when diverging section act as diffuser\n",
"Me2 = 0.308\n",
"Pe2 = 0.0936*Po\t\t#exit pressure of air in kPa\n",
"Te2 = 0.9812*To\t\t#exit temperature in K\n",
"\n",
"#Calculations:\n",
"ce = sqrt(k*R*Te1*1000)\t#velocity of sound in exit section in m/s\n",
"ve1 = Me*ce\t\t\t\t#velocity of air at exit section in m/s\n",
"ce = sqrt(k*R*Te2*1000)\t\t#velocity of sound in exit section in m/s\n",
"ve2 = Me2*ce\n",
"\n",
"#Results:\n",
"print '__When diverging section act as a nozzle__'\n",
"print 'Exit pressure: ',round(Pe1,1),\"Kpa\"\n",
"print 'Exit Temperature: ',round(Te1,1),\"K\"\n",
"print 'Exit velocity: ',round(ve1,1),\"m/s\"\n",
"print '__When diverging section act as a diffuser__'\n",
"print 'Exit pressure: ',round(Pe2,1),\"Kpa\"\n",
"print 'Exit Temperature: ',round(Te2,1),\"K\"\n",
"print 'Exit velocity: ',round(ve2,1),\"m/s\"\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 8"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Static Pressure in downstream: 512.7 Kpa\n",
"Static Temperature in downstream: 339.7 K\n",
"Stagnation Pressure in downstream: 630.0 Kpa\n"
]
}
],
"source": [
"# -*- coding: utf8 -*-\n",
"from __future__ import division\n",
"#Example: 17.8\n",
"'''Consider the convergent-divergent nozzle of Example 17.7, in which the diverging section\n",
"acts as a supersonic nozzle (Fig. 17.16). Assume that a normal shock stands in the exit\n",
"plane of the nozzle. Determine the static pressure and temperature and the stagnation\n",
"pressure just downstream of the normal shock.'''\n",
"\n",
"#Variable Declaration:\n",
"Px = 93.9 \t\t\t#Static Pressure in Upstream(Kpa)\n",
"Tx = 183.2 \t\t\t#Static Temperature in Upstream(K)\n",
"Pox = 1000\t\t\t#Total Pressure in Upstream(Kpa)\n",
"Mx = 2.197\t\t\t#X-direction Mach No (Using table A.13)\n",
"My = 0.547\t\t\t#Y-direction Mach No (Using table A.13)\n",
"rP = 5.46\t\t\t#Py/Px (Using table A.13)\n",
"rT = 1.854\t\t\t#Ty/Tx (Using table A.13)\n",
"rPo = 0.63\t\t\t#Poy/Pox (Using table A.13)\n",
"\n",
"#Calculations:\n",
"Py = rP*Px\n",
"Ty = rT*Tx\n",
"Poy = rPo*Pox\n",
"\n",
"#Results:\n",
"print 'Static Pressure in downstream: ',round(Py,1),'Kpa'\n",
"print 'Static Temperature in downstream: ',round(Ty,1),'K'\n",
"print 'Stagnation Pressure in downstream: ',round(Poy,1),'Kpa'"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 9"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Exit pressure: 669.6 Kpa\n",
"Exit temperature: 327.8 K\n",
"Exit stagnation pressure: 929.8 Kpa\n"
]
}
],
"source": [
"# -*- coding: utf8 -*-\n",
"from __future__ import division\n",
"#Example: 17.9\n",
"'''Consider the convergent-divergent nozzle of Examples 17.7 and 17.8. Assume that there\n",
"is a normal shock wave standing at the point where M = 1.5. Determine the exit-plane\n",
"pressure, temperature, and Mach number. Assume isentropic flow except for the normal\n",
"shock (Fig. 17.18).'''\n",
"\n",
"#Key\n",
"#x = inlet\n",
"#y = exit\n",
"\n",
"#Variable Declaration: \n",
"Mx = 1.5\t\t\t\t#mach number for inlet\n",
"My = 0.7011\t\t\t\t#mach number for exit\n",
"Px = 272.4\t\t\t\t#inlet pressure in kPa\n",
"Tx = 248.3\t\t\t\t#inlet temperature in K\n",
"Pox = 1000\t\t\t\t#stagnation pressure for inlet\n",
"\n",
"#Calculations:\n",
"Py = 2.4583*Px\t\t\t#Exit Pressure in kPa\n",
"Ty = 1.320*Tx\t\t\t#Exit temperature in K\n",
"Poy = 0.9298*Pox\t\t#Exit pressure in kPa\n",
"\n",
"#Results:\n",
"print 'Exit pressure: ',round(Py,1),\"Kpa\"\n",
"print 'Exit temperature: ',round(Ty,1),\"K\"\n",
"print 'Exit stagnation pressure: ',round(Poy,1),\"Kpa\""
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
|