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
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
|
{
"metadata": {
"name": "",
"signature": "sha256:277bc4cb4b4cbb4032c88d8fd8301e41a2fcfc6cb9b7c57adbca5a396d6c0dce"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter 12:Compressible Flow"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 12.12-1, Page No:638"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#Variable Decleration\n",
"V_1=250 #Velocity in m/s\n",
"c_p=1.005 #Constant Pressure specific heat in kJ/kg.K\n",
"k=1.4 #Specific heat ratio \n",
"T1=255.7 #\n",
"C=10**-3 #COnversion factor\n",
"P1=54.05 #Atmospheric Pressure in kPa\n",
"SPR=8 #Stagnation pressure ratio \n",
"\n",
"#Calculations\n",
"#Part(a)\n",
"T_01=T1+((V_1**2/(2*c_p))*C) #Stagnation temperature in K\n",
"\n",
"P_01=P1*((T_01/T1)**(k/(k-1))) #Stagnation Pressure in kPa\n",
"\n",
"#Part(b)\n",
"T_02=T_01*((SPR)**((k-1)/k)) #Stagnation Temperature at compressor exit in K\n",
"\n",
"Win=c_p*(T_02-T_01) #Work per unit mass of air in kJ/kg\n",
"\n",
"#Result\n",
"print \"The stagnation pressure is\",round(P_01,2),\"kPa\"\n",
"print \"The required compressor work per unit mass is\",round(Win,1),\"kJ/kg\"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The stagnation pressure is 80.77 kPa\n",
"The required compressor work per unit mass is 233.9 kJ/kg\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 12.12-2, Page No:639"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#Variable Decleration\n",
"cp=0.846 #Specific Heat in kJ/kg.K\n",
"k=1.289 #Specific heat ratio\n",
"R=0.1889 #gas constant for Carbon dioxide in kJ/kg.K\n",
"T_0=473 #Temperature in K\n",
"P0=1.4*10**3 #Pressure in kPa\n",
"P=1.2*10**3 #Pressure in kPa\n",
"m_dot=3 #Mass flow rate in kg/s\n",
"\n",
"#Calcualtions\n",
"x=((k-1)/k)\n",
"b=float(P/P0)\n",
"T=T_0*((b)**x) #Temperature where pressure is P in K\n",
"V=(2*cp*(T0-T)*10**3)**0.5 #Velocity in m/s\n",
"\n",
"#Using The Ideal Gas relation\n",
"rho=P/(R*T) #Density of the fluid in kg/m^3\n",
"\n",
"#Using the mass flow rate relation\n",
"A=m_dot/(rho*V) #Area in m^2\n",
"\n",
"c=(k*R*T*10**3)**0.5 #speed of sound in m/s\n",
"\n",
"#Mach Number\n",
"Ma=V/c #Mach's Number\n",
"\n",
"#Result\n",
"print \"Similarly we can compute data for other pressures as well\"\n",
"print \"The denisty of air is\",round(rho,5),\"kg/m^3\"\n",
"print \"The area is\",A,\"m^2\"\n",
"print \"The speed of sound is\",round(c,2),\"m/s\"\n",
"print \"The Mach Number is\",round(Ma,3)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Similarly we can compute data for other pressures as well\n",
"The denisty of air is 13.90266 kg/m^3\n",
"The area is 0.00130869674184 m^2\n",
"The speed of sound is 333.56 m/s\n",
"The Mach NUmber is 0.494\n"
]
}
],
"prompt_number": 29
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 12.12-3,Page No:645"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#Variable Decleration\n",
"k=1.289 #Specific Heat Ratio\n",
"To=473 #Stagnation temperature in K\n",
"Po=1400 #Stagnation pressure in kPa\n",
"\n",
"#Calculations\n",
"#Notation has been changed for simplicity of computation\n",
"T_ratio=2/(k+1) #ratio of T star to To\n",
"P_ratio=(2/(k+1))**(k/(k-1)) #Ratio of P star to Po\n",
"\n",
"T_star=T_ratio*To #Critical Temperature in K\n",
"P_star=P_ratio*Po #Critical Pressure in kPa\n",
"\n",
"#Result\n",
"print \"the critical temperature and pressrue are\",round(T_star),\"K and\",round(P_star),\"kPa\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"the critical temperature and pressrue are 413.0 K and 767.0 kPa\n"
]
}
],
"prompt_number": 30
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 12.12-4, Page No:648"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#Variable decleration\n",
"Vi=150 #Velocity at the inlet in m/s\n",
"cp=1.005 #Specific heat in kJ/Kg.K\n",
"k=1.4 #Specific heat ratio\n",
"Ti=873 #Temperature at the inlet in K\n",
"Pi=1 #Pressure at the inlet in Mpa\n",
"Pb1=0.7 #Back pressure in part a in Mpa\n",
"Pb2=0.4 #Back pressure in part b in Mpa\n",
"R=0.287 #Gas Constant in kPa.m^3/kg.K\n",
"At=50*10**-4 #Area in m^2\n",
"\n",
"#Values taken from the table\n",
"P_ratio=0.67 #Presure ratio\n",
"T_ratio=0.892 #Temperature ratio\n",
"Mat=0.778 #Mach Number \n",
"\n",
"#Calculations\n",
"Toi=Ti+((Vi**2/(2*cp))*10**-3) #Stagnation Temperature in K\n",
"\n",
"Poi=Pi*((Toi/Ti)**(k/(k-1))) #Stagnation Presure in mPa\n",
"\n",
"#Stagnation pressure and temperature values remain constant throughout\n",
"\n",
"#Part(A)\n",
"#Notation will be changed to avoid computational complexicity\n",
"BPR1=Pb1/Poi #Back Pressure ratio\n",
"\n",
"Tt=T_ratio*Toi #Temperature in K\n",
"rhot=(Pb1*10**3)/(R*Tt) #Density in kg/m^3\n",
"Vt=Mat*((k*R*Tt*10**3)**0.5) #Velocity in m/s\n",
"m_dot1=rhot*At*Vt #Mass flow rate in kg/s\n",
"\n",
"#Part(B)\n",
"#Notation will be changed\n",
"BPR2=Pb2/Poi #Back pressure ratio\n",
"\n",
"m_dot2=(At*Poi*10**3)*((k/(Toi*R))**0.5)*((2/(k+1))**((k+1)/(2*(k-1))))*1000**0.5 #mass flow rate in kg/s\n",
"\n",
"#Result\n",
"print \"The mass flow rate at the nozzle is\",round(m_dot1,2),\"kg/s\"\n",
"print \"The mass flow rate through the nozzleis calculated to be\",round(m_dot2,2),\"kg/s\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The mass flow rate at the nozzle is 6.77 kg/s\n",
"The mass flow rate through the nozzleis calculated to be 7.11 kg/s\n"
]
}
],
"prompt_number": 53
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 12.12-5, Page No:650"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#Variable Decleration\n",
"Pgauge=220 #Gauge Pressure in the tire in kPa\n",
"Patm=94 #Atmospheric Pressure in kPa\n",
"R=0.287 #Gas Constant in kPa.m^3/kg.K\n",
"k=1.4 #Specific heat ratio\n",
"T=298 #Temperature in K\n",
"D=0.004 #Diamter in m\n",
"\n",
"#Calculations\n",
"P=Pgauge+Patm #Absolute Pressure in the tre in kPa\n",
"\n",
"#Critical Presure in the tire from table\n",
"Pstar=round(0.5283*P) #Critical Presure in kPa\n",
"\n",
"#Flow is choked\n",
"rho0=P/(R*T) #Denisty of the fluid in kg/m^3\n",
"rho_star=rho0*((2/(k+1))**(1/(k-1))) #Critical Density in kg/m^3\n",
"T_star=(2/(k+1))*T #Critical Temperature in K\n",
"\n",
"V=(k*R*T_star*1000)**0.5 #Velocity in m/s\n",
"m_dot=rho_star*((pi*D**2)/4)*V #mass flow rate in kg/s\n",
"\n",
"#Result\n",
"print \"The initial mass flow rate is\",round(m_dot,5),\"kg/s\"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The initial mass flow rate is 0.00924 kg/s\n"
]
}
],
"prompt_number": 63
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 12.12-6, Page No:653"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#Variable Decleration\n",
"k=1.4 #Specific Heat ratio\n",
"R=0.287 #Gas Constant in kJ/kg.K\n",
"Ma=2 #Mach Number\n",
"A=20*10**-4 #Throat Area in m^2\n",
"P0=1000 #Pressure in kPa\n",
"T0=800 #Temperature in K\n",
"\n",
"#Calculations\n",
"rho0=P0/(R*T0) #Density of the fluid in kg/m^3\n",
"\n",
"#Part(a) When Ma=1\n",
"#Notation has been changed\n",
"#Taking values from the table\n",
"P_ratio=0.5283 #Pressure ratio\n",
"T_ratio=0.8333 #Temperature Ratio\n",
"rho_ratio=0.6339 #Density Ratio\n",
"\n",
"#Thus\n",
"P_star=P_ratio*P0 #Critical Pressure in kPa\n",
"T_star=T_ratio*T0 #Critical Temperature in K\n",
"rho_star=rho_ratio*rho0 #Critical Denisty in kg/m^3\n",
"\n",
"V_star=(k*R*T_star*1000)**0.5 #Critical Velocity in m/s\n",
"\n",
"#Part(b) When Ma=2\n",
"P_ratio2=0.1278 #Pressure ratio in part b\n",
"T_ratio2=0.5556 #Temperature ratio in part b\n",
"rho_ratio2=0.23 #Density ratio in part b\n",
"Ma_star=1.633 #Critical Mach Number\n",
"A_ratio=1.6875 #Area ratio in part b\n",
"\n",
"#Thus\n",
"Pe=P_ratio2*P0 #Pressure at the exit plane in kPa\n",
"Te=T_ratio2*T0 #Temperature at the exit plane in K\n",
"rho_e=rho_ratio2*rho0 #Density at the exit plane in kg/m^3\n",
"Ae=A_ratio*A #Area at the exit plane in m^2\n",
"Ve=Ma_star*V_star #Velocity at the exit plane in m/s\n",
"\n",
"#Part(c)\n",
"m_dot=rho_star*A*V_star #Mass flow rate in kg/s\n",
"\n",
"\n",
"#Result\n",
"print \"The throat conditions are as follows\"\n",
"print \"P*=\",round(P_star),\"kPa\",\"T*=\",round(T_star,1),\"K\",\"rho*=\",round(rho_star,3),\"kg/m^3\"\n",
"print \"The exit plane conditions are as follows\"\n",
"print \"Pe=\",round(Pe),\"kPa\",\"Te=\",round(Te,1),\"K\",\"rho_e=\",round(rho_e,3),\"kg/m^3\"\n",
"print \"Ae=\",Ae,\"m^2\"\n",
"print \"The mass flow rate is\",round(m_dot,2),\"kg/s\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The throat conditions are as follows\n",
"P*= 528.0 kPa T*= 666.6 K rho*= 2.761 kg/m^3\n",
"The exit plane conditions are as follows\n",
"Pe= 128.0 kPa Te= 444.5 K rho_e= 1.002 kg/m^3\n",
"Ae= 0.003375 m^2\n",
"The mass flow rate is 2.86 kg/s\n"
]
}
],
"prompt_number": 69
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 12.12-8, Page No:659"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#NOTE:The variable names have been changed\n",
"\n",
"#Variable Decleration\n",
"k=1.4 #Specific Heat ratio\n",
"R=0.287 #gas Constant in kJ/kg.K\n",
"cp=1.005 #Specfic heat at constant pressure in kJ/kg.K\n",
"#Table Values\n",
"P01=1 #pressure in MPa\n",
"P1=0.1278 #Pressure in MPa\n",
"T1=444.5 #Temperature in K\n",
"rho1=1.002 #Denisty in kg/m^3\n",
"Ma1=2 #Mach Number \n",
"Ma2=0.5774 #Mach Number \n",
"Po_ratio=0.7209 #Presure ratio\n",
"P_ratio=4.5 #Pressure ratio\n",
"T_ratio=1.6875 #Temperature Ratio\n",
"rho_ratio=2.6667 #Density Ratio\n",
"A=20*10**-4 #Area in m^2\n",
"\n",
"#Calculations\n",
"#Part(a)\n",
"\n",
"P02=Po_ratio*P01 #Stagnation Pressure after the shockwave in MPa\n",
"P2=P1*P_ratio #Static Pressure after the shockwave in MPa\n",
"T2=T_ratio*T1 #Temperature after the shockwave in K\n",
"rho2=rho_ratio*rho1 #Denisty after the shockwave in kg/m^3\n",
"\n",
"#Part(b)\n",
"e_change=cp*(np.log(T2/T1))-(R*np.log(P2/P1)) #Entropy change across the shock in kJ/kg.K\n",
"\n",
"#Part(c)\n",
"V2=Ma2*(k*R*T2*1000)**0.5 #Velocity in m/s\n",
"\n",
"#Part(d)\n",
"#Same as example 12-6 above\n",
"m_dot=2.86 #Mass Flow rate in kg/s\n",
"\n",
"#Result\n",
"print \"The Following are the values\"\n",
"print \"Stagnation Pressure\",round(P02,3),\"MPa\"\n",
"print \"Static Pressure\",round(P2,3),\"MPa\"\n",
"print \"Static Temperature\",round(T2,1),\"K\"\n",
"print \"Static Denisty\",round(rho2,2),\"kg/m^3\"\n",
"print \"The entropy change is\",round(e_change,5),\"kJ/kg.K\"\n",
"print \"The exit velocity is\",round(V2),\"m/s\"\n",
"print \"The mass flow rate is\",round(m_dot,3),\"kg/s\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The Following are the values\n",
"Stagnation Pressure 0.721 MPa\n",
"Static Pressure 0.575 MPa\n",
"Static Temperature 750.1 K\n",
"Static Denisty 2.67 kg/m^3\n",
"The entropy change is 0.09419 kJ/kg.K\n",
"The exit velocity is 317.0 m/s\n",
"The mass flow rate is 2.86 kg/s\n"
]
}
],
"prompt_number": 77
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 12.12-9, Page No:667"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#Variable Decleration\n",
"u=19 #angle of Mach lines in Degrees\n",
"\n",
"#Calculations\n",
"Ma1=1/(sin((u*pi)/180)) #Mach Number \n",
"\n",
"#Result\n",
"print \"The Mach Number is\",round(Ma1,2)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The Mach Number is 3.07\n"
]
}
],
"prompt_number": 81
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 12.12-10, Page No:667"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#NOTE:Some Variable names have been changed\n",
"\n",
"#Variable Decleration\n",
"Ma1=2 #Mach Number\n",
"k=1.4 #Specific heat ratio\n",
"theta=10 #Deflection in degrees\n",
"beta_weak=39.3 #Oblique shock angle in degrees\n",
"beta_strong=83.7 #Oblique shock angle in degrees\n",
"P1=75 #Pressure in kPa\n",
"Ma2_n_w=0.8032 #Mach Number on Downstream side\n",
"Ma2_n_s=0.5794 #Mach Number on Downstream Side \n",
"\n",
"#Calculations\n",
"\n",
"#Weak shock\n",
"Ma1_n_w=Ma1*sin((beta_weak*pi)/180) #Mach Number\n",
"\n",
"#Strong Shock\n",
"Ma1_n_s=Ma1*sin((beta_strong*pi)/180) #Mach Number\n",
"\n",
"#Pressure Calculations\n",
"\n",
"#Weak Shock\n",
"P2_w=((2*k*(Ma1_n_w**2)-k+1)/(k+1))*P1 #Pressure in kPa\n",
"\n",
"#Strong Shock\n",
"P2_s=((2*k*(Ma1_n_s**2)-k+1)/(k+1))*P1 #Pressure in kPa\n",
"\n",
"Ma2_w=Ma2_n_w/sin(((beta_weak-theta)*pi)/180) #Mach NUmber on the downstream side\n",
"\n",
"Ma2_s=Ma2_n_s/sin(((beta_strong-theta)*pi)/180) #Mach NUmber on the downstream side\n",
"\n",
"#Result\n",
"print \"The Mach number on the downstream side of the oblique shock are\"\n",
"print \"Ma in weak shock\",round(Ma2_w,3),\"Ma in strong shock\",round(Ma2_s,3)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The Mach number on the downstream side of the oblique shock are\n",
"Ma in weak shock 1.641 Ma in strong shock 0.604\n"
]
}
],
"prompt_number": 85
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 12.12-11, Page no:668"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#Variable Decleration\n",
"Ma1=2 #Mach Number \n",
"P1=230 #Pressure in kPa\n",
"k=1.4 #Specific Heat ratio\n",
"theta=10 #Degrees\n",
"Ma2=2.38 #Mach Number \n",
"\n",
"#Calculations\n",
"#Simplfying the calculation\n",
"a=((k+1)/(k-1))**0.5\n",
"b=((Ma1**2)-1)**0.5\n",
"c=((k-1)/(k+1))**0.5\n",
"d=arctan(b)*180*pi**-1\n",
"e=arctan(c*b)*180*pi**-1\n",
"\n",
"vMa1=a*e-d #Upstream Prandtl-Meyer Function in degrees\n",
"vMa2=theta+vMa1 #Degrees\n",
"\n",
"#Pressure Calculations\n",
"#Simplifying Calculations\n",
"a1=(k-1)*0.5\n",
"b1=k/(k-1)\n",
"f=(1+a1*Ma2**2)**(-b1)\n",
"g=(1+a1*Ma1**2)**(-b1)\n",
"P2=P1*(f/g) #Pressure in kPa\n",
"\n",
"#Result\n",
"print \"The Mach Number on the Downstream Side is\",round(Ma2,2)\n",
"print \"The Pressure at the downstream side is\",round(P2),\"kPa\"\n",
"#The answer in the textbook has not been rounded and hence differes "
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The Mach Number on the Downstream Side is 2.38\n",
"The Pressure at the downstream side is 127.0 kPa\n"
]
}
],
"prompt_number": 128
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 12.12-14, Page No:677"
]
},
{
"cell_type": "code",
"collapsed": true,
"input": [
"import math\n",
"\n",
"#Variable Decleration\n",
"k=1.4 #Specific Heat Ratio\n",
"cp=1.005 #Specific Heat in kJ/kg.K\n",
"R=0.287 #Gas COnstant in kJ/kg.K\n",
"P1=480 #Pressure in kPa\n",
"T1=550 #Temperature in K\n",
"D=0.15 #Diameter in m\n",
"AF=40 #Air-Fuel mass ratio\n",
"HV=42000 #Heating Value in kJ/kg\n",
"V=80 #Velocity in m/s\n",
"\n",
"#Values from Tables\n",
"T_ratio=0.1291 #Temperature ratio\n",
"T_ratio1=0.1541 #Temperature Ratio\n",
"P_ratio1=2.3065 #Pressure ratio\n",
"V_ratio1=0.0668 #Velocity Ratio\n",
"T_ratio2=0.4389 #Temperature Ratio\n",
"P_ratio2=2.1086 #Pressure Ratio\n",
"V_ratio2=0.2082 #Velocity ratio\n",
"\n",
"#Calculations\n",
"rho1=P1/(R*T1) #Density in kg/m^3\n",
"A1=(pi*D**2)/4 #Area in m^2\n",
"m_dot_air=rho1*A1*V #Mass flow rate of air in kg/s\n",
"m_dot_fuel=m_dot_air/AF #Mass flow rate of the fuel in kg/s\n",
"Q_dot=m_dot_fuel*HV #Heat in kW\n",
"q=Q_dot/m_dot_air #HEat Transfer rate in kJ/kg\n",
"\n",
"#Stagnation Temperature and Mach Number at INLET\n",
"T01=T1+(V**2/(2*cp))*10**-3 #Stagnation Temperature in K\n",
"c1=(k*R*T1*1000)**0.5 #Speed in m/s\n",
"Ma1=V/c1 #Mach Number\n",
"\n",
"#EXIT stagnation Temperature and Mach Number\n",
"T02=T01+(q/cp) #Stagnation Temperature in K\n",
"\n",
"T0_star=T01/T_ratio #Critical Temperature in K\n",
"\n",
"#Value for Ma2 is taken form the table corresponding to the Temperature ratio given below\n",
"T_rat=T02/T0_star #Temperature Ratio\n",
"Ma2=0.314 #Mach Number\n",
"\n",
"#Exit Values\n",
"T2=T1*(T_ratio2/T_ratio1) #Temperature in K\n",
"P2=P1*(P_ratio2/P_ratio1) #Pressure in kPa\n",
"V2=V*(V_ratio2/V_ratio1) #Velocity in m/s\n",
"\n",
"#Result\n",
"print \"The Temperature at the exit is\",round(T2),\"K\"\n",
"print \"The pressure at the exit is\",round(P2),\"kPa\"\n",
"print \"The velocity at the exit is\",round(V2),\"m/s\"\n",
"#The answer for temperature in tetbook is incorrect\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The Temperature at the exit is 1566.0 K\n",
"The pressure at the exit is 439.0 kPa\n",
"The velocity at the exit is 249.0 m/s\n"
]
}
],
"prompt_number": 3
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 12.12-15, Page No:685"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#Varialble Decleration\n",
"k=1.4 #Specific Heat ratio\n",
"cp=1.005 #Specific Heat in kJ/kg.K\n",
"R=0.287 #Gas Constant in kJ/kg.K\n",
"v=1.58*10**-5 #Kinematic Viscosity in m^2/s\n",
"P1=150 #Pressure in kPa\n",
"T1=300 #Temperature in K\n",
"Ma1=0.4 #Mach Number\n",
"D=0.03 #Diameter in m\n",
"f=0.0148 #Friction factor\n",
"#Values from tables\n",
"P_ratio1=1.5901 \n",
"T_ratio1=1.1628\n",
"P_ratio2=2.6958\n",
"V_ratio=0.4313\n",
"fL1_D=2.3085\n",
"\n",
"#Calculations\n",
"c1=(k*R*T1*1000)**0.5 #Inlet Velocity in m/s\n",
"V1=Ma1*c1 #Velocity in m/s\n",
"Re1=(V1*D)/v #Reynolds Number\n",
"\n",
"L1_star=(fL1_D*D)/f #Duct Length in m\n",
"T_star=T1/T_ratio1 #Temperature in K\n",
"P_star=P1/P_ratio2 #Pressure in kPa\n",
"V_star=V1/V_ratio #Velocity in m/s\n",
"\n",
"fraction=1-(1/P_ratio1) #Fraction of the inlet stagnation pressure lost \n",
"\n",
"#Result\n",
"print \"The duct length is\",round(L1_star,2),\"m\"\n",
"print \"The Temperature is\",round(T_star),\"K\"\n",
"print \"The Pressure is\",round(P_star,1),\"kPa\"\n",
"print \"The Velocity is\",round(V_star),\"m/s\"\n",
"print round(fraction,3),\"Fraction of the total stagnation pressure is lost in the duct\"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The duct length is 4.68 m\n",
"The Temperature is 258.0 K\n",
"The Pressure is 55.6 kPa\n",
"The Velocity is 322.0 m/s\n",
"0.371 Fraction of the total stagnation pressure is lost in the duct\n"
]
}
],
"prompt_number": 5
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 12.12-16,Page No:686"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#Variable Decleration\n",
"k=1.4 #Specific Heat ratio\n",
"cp=1.005 #Specific Heat in kJ/kg.K\n",
"R=0.287 #Gas Constant in kJ/kg.K\n",
"V1=85 #Velocity in m/s\n",
"P1=220 #Pressure in kPa\n",
"T1=450 #Temperature in K\n",
"f=0.023 #Friction factor \n",
"L=27 #Length in m\n",
"D=0.05 #Diameter in m\n",
"\n",
"#Value from table\n",
"fl_D=14.5333\n",
"\n",
"#Calculations\n",
"c1=(k*R*T1*1000)**0.5 #Velocity in m/s\n",
"Ma1=V1/c1 #Mach Number\n",
"\n",
"#Notation has been changed\n",
"fL_D1=(f*L)/D #Function\n",
"fL_D2=fl_D-fL_D1 #Function\n",
"\n",
"#Mach NUmber corresponding to this value is 0.42\n",
"Ma2=0.420 #Mach Number\n",
"\n",
"rho1=P1/(R*T1) #Density of the fluid in kg/m^3\n",
"A1=(pi*D**2)/4 #Area in m^2\n",
"m_air=rho1*V1*A1 #Mass flow rate in kg/s\n",
"\n",
"#Discussion Calculations\n",
"L_max1=(fl_D*D)/f #MAx Duct length in m\n",
"L_max2=(fL_D2*D)/f #Max Duct length in m\n",
"\n",
"#Result\n",
"print \"The Mach Number is\",round(Ma2,3)\n",
"print \"The mass flow rate is\",round(m_air,3),\"kg/s\"\n",
"print \"The max length at inlet is\",round(L_max1,1),\"m\"\n",
"print \"The max length at exit is\",round(L_max2,1),\"m\"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The Mach Number is 0.42\n",
"The mass flow rate is 0.284 kg/s\n",
"The max length at inlet is 31.6 m\n",
"The max length at exit is 4.6 m\n"
]
}
],
"prompt_number": 16
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {},
"outputs": []
}
],
"metadata": {}
}
]
}
|