summaryrefslogtreecommitdiff
path: root/Applied_Thermodynamics/Chapter13.ipynb
blob: 1d963cc2ca2d420cb932ef20114d8c5f32b0348b (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
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
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
{
 "metadata": {
  "name": "",
  "signature": "sha256:3c23e07bbff73d50716bb3f0344f5f19803ca8de755edfb991f464d2a6411a44"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 13: Nozzles"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 1, page no. 584"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "from __future__ import division\n",
      "  \n",
      "#Variable Declaration: \n",
      "p1 = 10 #Pressure of dry steam(in bar):\n",
      "C1 = 100 #Velocity of steam entering(in m/s):\n",
      "C2 = 300 #Velocity of steam leaving the nozzle(in m/s):\n",
      "p2 = 5 #Pressure of steam at exit(in bar):\n",
      "m = 16 #Mass flow rate(in kg/s):\n",
      "q = 10 #Heat loss to surroundings(in kJ/kg):\n",
      "#From steam tables:\n",
      "h1 = 2778.1                 #kJ/kg\n",
      "hf = 640.23                 #kJ/kg\n",
      "hfg = 2108.5                #kJ/kg\n",
      "\n",
      "#Calculations:\n",
      "dh = (q*10**3+(C1**2-C2**2)/2)/1000\t#Heat drop in the nozzle(in kJ/kg):\n",
      "dQ = -dh*m #Total heat drop(in kJ/s):\n",
      "h2 = h1+dh #Enthalpy at state 2(in kJ/kg):\n",
      "x2 = (h2-hf)/hfg #Dryness fraction at state 2:\n",
      "\n",
      "#Results: \n",
      "print \"Heat drop in the nozzle: \",round(-dh,2),\"kJ/kg\" \n",
      "print \"Total heat drop: \",round(dQ,2),\"kJ/s\"\n",
      "print \"Dryness fraction at exit: \",round(x2,4)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Heat drop in the nozzle:  30.0 kJ/kg\n",
        "Total heat drop:  480.0 kJ/s\n",
        "Dryness fraction at exit:  0.9997\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 2, page no. 585"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "from __future__ import division\n",
      "   \n",
      "from math import sqrt\n",
      "\n",
      "#Variable Declaration: \n",
      "p1 = 10 #Steam entering at pressure(in bar):\n",
      "p2 = 6 #Pressure at which steam leaves(in bar):\n",
      "A2 = 20 #Cross-section area of exit of nozzle(in cm**2):\n",
      "#From steam tables:\n",
      "h1 = 3478.5                 #kJ/kg \n",
      "s1 = 7.7622                 #kJ/kg.K\n",
      "T2 = 418.45                 #C(by interpolation)\n",
      "h2 = 3309.51                #kJ/kg\n",
      "v2 = 0.5281                 #m**3/kg\n",
      "\n",
      "#Calculations:\n",
      "s2 = s1\n",
      "C2 = sqrt(2*(h1-h2)*10**3) #Velocity at exit(in m/s):\n",
      "m = A2*10**(-4)*C2/v2     #Mass flow rate(in kg/s):\n",
      "\n",
      "#Result: \n",
      "print \"Mass flow rate: \",round(m,3),\"kg/s\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Mass flow rate:  2.202 kg/s\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3, page no. 587"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "from __future__ import division\n",
      "\n",
      "from math import sqrt \n",
      "\n",
      "#Variable Declaration: \n",
      "p1 = 12 #Pressure of steam entering(in bar):\n",
      "p2 = 6 #Pressure at exit(in bar):\n",
      "m1 = 5 #Mass flow rate(in kg/s):\n",
      "m2 = m1\n",
      "m3 = m1\n",
      "C3a = 500 #Exit velocity(in m/s):\n",
      "#From steam tables:\n",
      "h1 = 3045.8                 #kJ/kg \n",
      "h2 = 2900.05                #kJ/kg\n",
      "s2 = 7.0317                 #kJ/kg.K\n",
      "v2 = 0.3466                 #m**3/kg\n",
      "h3 = 2882.55                #kJ/kg\n",
      "v3 = 0.3647                 #m**3/kg\n",
      "n = 1.3     #For superheated steam:\n",
      "\n",
      "#Calculations:\n",
      "s1 = s2\n",
      "s3 = s2\n",
      "p2 = p1*(2/(n+1))**(n/(n-1)) #Pressue at state 2(in bar):\n",
      "C2 = sqrt(2*(h1-h2)*10**3) #Velocity at throat(in m/s):\n",
      "A2 = m2*v2/C2 #Cross-sectional area at throat(in m**2):\n",
      "C3 = sqrt(2*(h1-h3)*10**3) #Ideal velocity at exit(in m/s):\n",
      "A3 = m3*v3/C3a #Cross-sectional area at exit(in m**2):    \n",
      "r = C3a/C3  #Coefficient of velocity:\n",
      "\n",
      "#Results: \n",
      "print \"Cross-sectional area at throat: \",round(A2*10**3,3),\" x 10^-3 m^2\"\n",
      "print \"Cross-sectional area at exit: \",round(A3*10**3,3),\" x 10^-3 m^2\"\n",
      "print \"Coefficient of velocity: \",round(r,3)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Cross-sectional area at throat:  3.21  x 10^-3 m^2\n",
        "Cross-sectional area at exit:  3.647  x 10^-3 m^2\n",
        "Coefficient of velocity:  0.875\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4, page no. 588"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "from __future__ import division\n",
      "\n",
      "from math import sqrt\n",
      "\n",
      "#Variable Declaration: \n",
      "p1 = 16 #Pressure of steam entering(in bar):\n",
      "p3 = 5 #Pressure at exit(in bar):\n",
      "m1 = 1 #Mass flow rate(in kg/s):\n",
      "m2 = m1\n",
      "m3 = m1\n",
      "#From steam tables:\n",
      "#For case 1:\n",
      "h1 = 3034.8                 #kJ/kg\n",
      "s1 = 6.8844                 #kJ/kg.K\n",
      "v1 = 0.15862                #m**3/kg\n",
      "n = 1.3\n",
      "h2 = 2891.39                #kJ/kg\n",
      "h3 = 2777                   #kJ/kg\n",
      "v2 = 0.2559                 #m**3/kg\n",
      "v3 = 0.3882                 #m**3/kg\n",
      "#For case 2:\n",
      "h2a = 2905.73               #kJ/kg\n",
      "v2a = 0.2598                #m**3/kg\n",
      "v3a = 0.40023               #m**3/kg\n",
      "\n",
      "#Calculations:\n",
      "p2 = p1*(2/(n+1))**(n/(n-1)) #Pressure at the throat of nozzle(in bar):\n",
      "q12 = h1-h2 #Heat drop up to throat section(in kJ/kg):\n",
      "C2 = sqrt(2*(h1-h2)*10**3) #Velocity at throat(in m/s):\n",
      "q23 = h2-h3 #Heat drop from exit(in kJ/kg):\n",
      "C3 = sqrt(2*(h2-h3)*10**3+C2**2) #Velocity at exit(in m/s):\n",
      "A2 = m2*v2/C2 #Throat area(in m**2):\n",
      "A3 = m3*v3/C3 #Exit area(in m**2):\n",
      "q12a = 0.9*q12 #Considering expansion to have 10% friction loss:\n",
      "C2a = sqrt(2*q12a*10**3) #Actual velocity at throat(in m/s):\n",
      "A2a = m2*v2a/C2a #Actual throat area(in m**2):\n",
      "q23a = 0.9*q23 #Actual drop at the exit of the nozzle(in kJ/kg):\n",
      "h3a = h2a-q23a #Actual enthalpy at state 3(in kJ/kg):\n",
      "C3a = sqrt(2*q23a*10**3+C2a**2) #Actual velocity at exit(in m/s):\n",
      "A3a = m3*v3a/C3a #Actual area at exit(in m**2):\n",
      "\n",
      "#Results:\n",
      "print \"Throat area, without friction consideration: \",round(A2*10**4,2),\"cm**2\"\n",
      "print \"Exit area, without friction consideration: \",round(A3*10**4,2),\"cm**2\"\n",
      "print \"Throat area, with friction consideration: \",round(A2a*10**4,2),\"cm**2\"\n",
      "print \"Exit area, with friction consideration: \",round(A3a*10**4,3),\"cm**2\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Throat area, without friction consideration:  4.78 cm**2\n",
        "Exit area, without friction consideration:  5.41 cm**2\n",
        "Throat area, with friction consideration:  5.11 cm**2\n",
        "Exit area, with friction consideration:  5.875 cm**2\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 5, page no. 590"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "from __future__ import division\n",
      " \n",
      "from math import sqrt,pi\n",
      "#Variable Declaration: \n",
      "P = 1 #Power of turbine(in MW):\n",
      "p1 = 20 #Pressure of steam entering(in bar):\n",
      "m = 8 #Steam consumption rate(in kg/kW.h):\n",
      "p3 = 0.2 #Pressure at which steam leaves(in bar):\n",
      "d = 0.01 #Throat diameter(in m):\n",
      "#From Mollier diagram:\n",
      "q12 = 142              #kJ/kg \n",
      "v2 = 0.20              #m**3/kg\n",
      "q13 = 807              #kJ/kg\n",
      "v3 = 7.2               #m**3/kg\n",
      "\n",
      "#Calculations:\n",
      "C2 = sqrt(2*q12*10**3) #Velocity at throat(in m/s):\n",
      "m2 = pi*d**2/4*C2/v2 #Mass flow rate:\n",
      "m3 = m2\n",
      "n = 10**3*m/(3600*m2) #Number of nozzles:\n",
      "q13a = 0.90*q13 #Useful heat drop:\n",
      "C3 = sqrt(2*10**3*q13a)#Velocity at exit(in m/s):\n",
      "A3 = m3*v3/C3 #Area at exit(in m**2):\n",
      "\n",
      "#Results: \n",
      "print \"Number of nozzles required: \",round(n) \n",
      "print \"Area at exit: \",round(A3*10**4,2),\"cm**2\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Number of nozzles required:  11.0\n",
        "Area at exit:  12.5 cm**2\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 6, page no. 591"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "\n",
      "from math import pi, atan, sqrt\n",
      "#Variable Declaration: \n",
      "p1 = 0.7 #Pressure at which steam is supplied(in MPa):\n",
      "l = 0.06 #Length of diverging nozzle(in m):\n",
      "d = 0.005 #Throat diameter(in mm):\n",
      "p3 = 0.1 #Pressure at which steam leaves the nozzle(in MPa):\n",
      "#From Mollier diagram:\n",
      "q12 = 138                   #kJ/kg\n",
      "v2 = 0.58                   #m**3/kg\n",
      "T = 203                     #\u00b0C\n",
      "q23 = 247                   #kJ/kg\n",
      "q23a = 209.95               #kJ/kg\n",
      "v3a = 1.7                   #m**3/kg\n",
      "\n",
      "#Calculations:\n",
      "C2 = sqrt(2*q12*10**3) #Velocity at throat(in m/s):\n",
      "m1 = pi*d**2/4*C2/v2   #Mass flow rate(in kg/s):\n",
      "m2 = m1\n",
      "m3 = m1\n",
      "q = q12+q23a   #Total heat drop(in kJ/kg):\n",
      "C3 = sqrt(2*10**3*q) #Velocity at exit(in m/s):\n",
      "A3 = m3*v3a/C3 #Area at exit(in m**2):\n",
      "d1 = (sqrt(A3*4/pi))*10**3 #Diameter at exit(in mm):\n",
      "a = atan((d1-d*10**3)/(2*60))*180/pi\n",
      "\n",
      "#Results: \n",
      "print \"With no losses, temperature at throat: \",round(T,2),\"\u00b0C\"\n",
      "print \"Velocity at throat: \",round(C2,2),\"m/s\"\n",
      "print \"With losses, cone angle: \",round(2*a,2),\"\u00b0\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "With no losses, temperature at throat:  203.0 \u00b0C\n",
        "Velocity at throat:  525.36 m/s\n",
        "With losses, cone angle:  1.71 \u00b0\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 7, page no. 593"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "\n",
      "from math import sin,pi,sqrt\n",
      "\n",
      "#Variable Declaration:\n",
      "P = 5000 #Power of the turbine(in hp):\n",
      "m = P*6/3600 #Steam required(in kg of steam/hp-hr):\n",
      "n = 0.90 #Efficiency of nozzle:\n",
      "a = 12 #Nozzle angle:\n",
      "p = 5 #Pitch(in cm):\n",
      "t = 0.3 #Thickness(in cm):\n",
      "#From steam tables:\n",
      "h1 = 2794                   #kJ/kg\n",
      "s1 = 6.4218                 #kJ/kg.K\n",
      "x2 = 0.9478\n",
      "h2 = 2662.2                 #kJ/kg\n",
      "x2a = 0.9542\n",
      "v2a = 0.2294                #m**3/kg\n",
      "\n",
      "#Calculations:\n",
      "s2 = s1\n",
      "h12 = h1-h2 #Change in enthalpy(in kJ/kg):\n",
      "h12a = n*h12 #Actual change(in kJ/kg):\n",
      "C2 = sqrt(2*h12a*10**3) #Velocity at inlet(in m/s):\n",
      "A2 = m*v2a/C2*10**4 #Area at exit of nozzle(in cm**2):\n",
      "l = 60*pi/3  #Approximate length of the nozzle(in cm):\n",
      "n = int(l/p)+1 #Number of nozzles:\n",
      "l1 = n*p #Correct length of nozzle arc:\n",
      "h = A2/((p*sin(a*pi/180)-t)*n)#Radial height of nozzle(in cm):\n",
      "\n",
      "#Results:\n",
      "print \"Length of nozzle: \",round(l1,2),\"cm\"\n",
      "print \"Radial height of nozzle: \",round(h,2),\"cm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Length of nozzle:  65.0 cm\n",
        "Radial height of nozzle:  4.08 cm\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8, page no. 594"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "\n",
      "from math import sqrt\n",
      "\n",
      "#Variable Declaration: \n",
      "p1 = 13 #Pressure at which steam enters(in bar):\n",
      "p2 = 6 #Pressure at which steam leaves(in bar):\n",
      "T1 = 150+273 #Temperature of steam entering(in K):\n",
      "r = 1.4 #Adibatic insex of compression:\n",
      "\n",
      "#Calculations:\n",
      "T2 = T1*(p2/p1)**((r-1)/r) #Final temperature of steam(in K):\n",
      "C2 = sqrt(2*1.005*(T1-T2)) #Exit velocity(in m/s):\n",
      "\n",
      "#Results: \n",
      "print \"Exit velocity: \",round(C2,2),\"m/s\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Exit velocity:  12.98 m/s\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9, page no. 595"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "\n",
      "from math import sqrt\n",
      "\n",
      "#Variable Declaration: \n",
      "F = 350 #Force on the plate(in N):\n",
      "p1 = 8 #Initial pressure(in bar):\n",
      "p3 = 1 #Final pressure(in bar):\n",
      "A2 = 5*10**(-4) #Throat cross-sectional area(in m**2):\n",
      "#From steam tables:\n",
      "h1 = 2769.1                 #kJ/kg\n",
      "s1 = 6.6628                 #kJ/kg.K\n",
      "x2 = 0.9717\n",
      "h2 = 2685.17                #kJ/kg\n",
      "v2 = 0.3932                 #m**3/kg\n",
      "x3 = 0.8238\n",
      "h3 = 2277.6                 #kJ/kg\n",
      "\n",
      "#Calculations:\n",
      "s2 = s1\n",
      "s3 = s1\n",
      "h12 = h1-h2 #Enthalpy change(in kJ/kg):\n",
      "C2 = sqrt(2*h12*10**3) #Velocity at throat(in m/s):\n",
      "m = A2*C2/v2 #Discharge at throat(in kg/s):\n",
      "C3a = F/m #Actual exit velocity(in m/s):\n",
      "h23 = h2-h3 #Theoretical enthalpy drop(in kJ/kg):\n",
      "n = C3a**2/(2*h23*10**3) #Nozzle efficiency:\n",
      "\n",
      "#Results:\n",
      "print \"Discharge at throat: \",round(m,3),\"kg/s\"\n",
      "print \"Nozzle efficiency: \",round(n*100,2),\"%\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Discharge at throat:  0.521 kg/s\n",
        "Nozzle efficiency:  55.37 %\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 10, page no. 597"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "   \n",
      "from math import sqrt,pi\n",
      "\n",
      "#Variable Declaration: \n",
      "m = 5/60 #Mass flow rate(in kg/s):\n",
      "p3 = 1 #Pressure at which steam is discharged(in bar):\n",
      "p1 = 10 #Initial pressure(in bar):\n",
      "T1 = 200+273 #Initial temperature(in K)\n",
      "n = 1.3 #Adiabatic index of compression:\n",
      "\n",
      "#From steam tables:\n",
      "h1 = 2827.9                 #kJ/kg\n",
      "s1 = 6.6940                 #kJ/kg.K\n",
      "v1 = 0.2060                 #m**3/kg\n",
      "h2a = 2711.23               #kJ/kg\n",
      "s2a = 6.6749                #kJ/kg.K\n",
      "h3 = 2420.08                #kJ/kg\n",
      "v3 = 1.5025                 #m**3/kg\n",
      "psat = 3.44                 #bar (at T = 138.18 \u00b0C)\n",
      "Tsat = 155.12               #C (at p = 5.45 bar)\n",
      "\n",
      "#Calculations:\n",
      "s3 = s2a\n",
      "p2 = p1*(2/(n+1))**(n/(n-1)) #Pressure at throat(in bar):\n",
      "C3 = sqrt(2*(h1-h3)*10**3) #Velocity at exit(in m/s):\n",
      "A3 = m*v3/C3 #Exit area(in m**2):\n",
      "d = sqrt(A3*4/pi) #Diameter of nozzle at exit(in m):\n",
      "T2 = T1*(p2/p1)**((n-1)/n) #Temperature at throat(in K):\n",
      "d1 = p2/psat #Degree of supersaturation:\n",
      "u = Tsat-(T2-273) #Amount of undercooling(in \u00b0C):\n",
      "\n",
      "#Results: \n",
      "print \"Degree of supersaturation: \",round(d1,2) \n",
      "print \"Amount of undercooling: \",round(u,2),\"\u00b0C\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Degree of supersaturation:  1.59\n",
        "Amount of undercooling:  16.82 \u00b0C\n"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11, page no. 599"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "\n",
      "\n",
      "#Variable Declaration: \n",
      "p1 = 4 #Initial pressure(in bar):\n",
      "T1 = 180+273 #Initial temperature(in K):\n",
      "p2 = 1.5 #Final pressure(in bar):\n",
      "n = 1.3 #Index of compression:\n",
      "nn = 0.95 #Efficiency due to heat loss:\n",
      "C = 2.174 #Specific heat(in kJ/kg.K):\n",
      "#From steam tables:\n",
      "v1 = 0.5088                 #m**3/kg \n",
      "Tsat = 111.37+273           #K (at p = 1.5 bar)\n",
      "\n",
      "#Calculations:\n",
      "h1 = p1*v1*10**2+2614      #Enthalpy at state 1(in kJ/kg):\n",
      "v2 = v1*(p1/p2)**(1/n) #Specific volume at state 2(in m**3/kg):\n",
      "h2 = p2*v2*10**2+2614 #Enthalpy at state 2(in kJ/kg):\n",
      "dh = nn*(h1-h2) #Actual heat drop(in kJ/kg):\n",
      "T2 = T1*(p2/p1)**((n-1)/n) #Temperature at state 2(in K):\n",
      "dT = (1-nn)*(h1-h2)/C #Temperature rise due to supersaturation:\n",
      "T2a = T2+dT #Actual temperature at state 2(in K):\n",
      "u = Tsat-T2a #Amount of undercooling(in \u00b0C):\n",
      "\n",
      "#Results:\n",
      "print \"Actual heat drop: \",round(dh,2),\"kJ/kg\"\n",
      "print \"Amount of undercooling: \",round(u,2),\"\u00b0C\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Actual heat drop:  39.16 kJ/kg\n",
        "Amount of undercooling:  22.18 \u00b0C\n"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12, page no. 600"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      " \n",
      "from math import sqrt\n",
      "\n",
      "#Variable Declaration: \n",
      "p1 = 14 #Initial pressure(in bar):\n",
      "T1 = 400+273 #Initial temperature(in K):\n",
      "N = 16 #Number of nozzles:\n",
      "p2 = 10 #Final pressure(in bar):\n",
      "m = 5  #Discharge(in kg/s):\n",
      "nn = 0.90 #Nozzle efficiency:\n",
      "C1 = 100 #Inlet velocity(in m/s):\n",
      "n = 1.3 #Insex of compression:\n",
      "\n",
      "#From steam tables:\n",
      "h1 = 3257.5                 #kJ/kg \n",
      "s1 = 7.3026                 #kJ/kg.K\n",
      "T2 = 350.46                 #\u00b0C\n",
      "h2 = 3158.7                 #kJ/kg\n",
      "v2 = 0.2827                 #m**3/kg\n",
      "\n",
      "#Calculations:\n",
      "h12 = (h1-h2)*nn #Actual enthalpy change(inn kJ/kg):\n",
      "C2 = sqrt(2*h12*10**3) #Velocity at exit(in m/s):\n",
      "A2 = m*v2/(C2*N)*10**4 #Cross-sectional area at exit(in cm**2):\n",
      "C2a = sqrt(2*h12*10**3+C1**2)#Modified velocity at nozzle exit(in m/s):\n",
      "ma = 16*2.13*433.41*10**(-4)/0.2827#ma = A2*C2a*N/v2*10**(-4) \n",
      "p = (ma-m)/m*100       #% increase in discharge:\n",
      "\n",
      "#Results: \n",
      "print \"Cross-sectional area at exit of nozzle: \",round(A2,2),\"cm**2\"\n",
      "print \"Percentage increase in discharge: \",round(p,2),\"%\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Cross-sectional area at exit of nozzle:  2.09 cm**2\n",
        "Percentage increase in discharge:  4.5 %\n"
       ]
      }
     ],
     "prompt_number": 21
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 13, page no. 602"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "\n",
      "#Variable Declaration: \n",
      "p1 = 20       #Initial pressure(in bar):\n",
      "p3 = 5       #Final pressure(in bar):\n",
      "n = 1.3\n",
      "#From steam tables:\n",
      "T1 = 212.42+273         #K\n",
      "Tsat = 186.43+273       #K (at 11.6 bar)\n",
      "psat = 5.452            #bar (at 155.14 \u00b0C)\n",
      "h1 = 2799.5             #kJ/kg\n",
      "v1 = 0.009963           #m**3/kg\n",
      "s1 = 6.3409             #kJ/kg.K\n",
      "h2aa = 2693.98          #kJ/kg\n",
      "s2a = 6.5484            #kJ/kg.K\n",
      "h3a = 2632.76           #kJ/kg\n",
      "h3 = 2544.21            #kJ/kg\n",
      "p2 = p1*0.58 #Pressure at throat(in bar):\n",
      "\n",
      "#Calculations:\n",
      "s2aa = s1\n",
      "s3a = s2a\n",
      "s3 = s1\n",
      "T2 = T1*(p2/p1)**((n-1)/n)\t#Temperature at state 2(in K):\n",
      "d = p2/psat #Degree of supersaturation:\n",
      "d1 = Tsat-T2 #Degree of undercooling:\n",
      "h12 = (n/(n-1))*p1*10**2*v1*(1-(T2/T1)) #Isentropic enthalpy drop:\n",
      "h2 = h1-h12 #Enthalpy at state 2(in kJ/kg):\n",
      "h12aa = h1-h2aa #Heat drop with no saturation(in kJ/kg):\n",
      "L = h12aa-h12 #Loss of available heat drop(in kJ/kg):\n",
      "s12a = L/Tsat #Increase in entropy(in kJ/kg.K):\n",
      "L1 = h3a-h3 #Loss due to undercooling(in kJ/kg):\n",
      "p = L1/(h1-h3)*100 #Percentage loss:\n",
      "\n",
      "#Results: \n",
      "print \"Degree of supersaturation: \",round(d,2)\n",
      "print \"Degree of undercooling: \",round(d1,2),\"\u00b0C\"\n",
      "print \"Entropy change: \",round(s12a,4),\"kJ/kg.K\"\n",
      "print \"Loss due to undercooling: \",round(L1,2),\"kJ/kg\"\n",
      "print \"Percentage loss: \",round(p,2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Degree of supersaturation:  2.13\n",
        "Degree of undercooling:  31.35 \u00b0C\n",
        "Entropy change:  0.2075 kJ/kg.K\n",
        "Loss due to undercooling:  88.55 kJ/kg\n",
        "Percentage loss:  34.69\n"
       ]
      }
     ],
     "prompt_number": 24
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 14, page no. 604"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "  \n",
      "from math import sqrt,pi\n",
      "\n",
      "#Variable Declaration: \n",
      "m1 = 150/60 #Mass flow rate(in kg/s):\n",
      "H = 5  #Height of water level from the axis of injector(in m):\n",
      "p4 = 20 #Pressuer at which steam is injected(in bar):\n",
      "Z4 = 0.8 #Water level in boiler from the injector(in m):\n",
      "x1 = 0.95 #Dryness fraction at state 1:\n",
      "C4 = 20 #Velocity in delivery pipe(in m/s):\n",
      "p3 = 1.013 #Atmospheric pressure(in bar):\n",
      "d = 10**3 #Density(in kg/m**3):\n",
      "g = 9.81 #Acceleration due to gravity(in m/s**2):\n",
      "Cps = 3.18 #Specific heat of steam(in kJ/kg.K):\n",
      "Cpw = 4.18 #Specific heat of water(in kJ/kg.K):\n",
      "#From steam tables:\n",
      "T1 = 212.42                 #\u00b0C\n",
      "Tw = 25                     #\u00b0C\n",
      "p2 = 0.7*p4\n",
      "h1 = 2704.95                #kJ/kg\n",
      "hfg1 = 1890.7               #kJ/kg\n",
      "s1 = 6.1462                 #kJ/kg.K\n",
      "x2 = 0.923\n",
      "h2 = 2639.10                #kJ/kg\n",
      "v2 = 0.13                   #m**3/kg\n",
      "\n",
      "#Calculations:\n",
      "s2 = s1\n",
      "C2 = sqrt(2*(h1-h2)*10**3) #Velocity of steam at throat(in m/s):\n",
      "C3 = sqrt(2*(g*Z4+p4*10**5/d+C4**2/2-p3*10**5/d))#Velocity at state 3(in m/s):\n",
      "m = (C2-C3)/(sqrt(2*g*H)+C3) #Mass of water pumped per kg of steam(in kg):\n",
      "m3 = m1+m1/m #Mass of mixture passing through state 3(in kg/s):\n",
      "A3 = m3/(d*C3)*10**4 #Area of throat of mixing nozzle(in cm**2):\n",
      "d3 = sqrt(A3*4/pi)     #Diameter of throat of the mixing nozzle(in cm):\n",
      "ms = m1/m #Mass of steam required for given flow rate(in kg/s):\n",
      "A2 = ms*v2/C2*10**4 #Area at state 2(in cm**2):\n",
      "d2 = sqrt(A2*4/pi) #Diameter of throat of steam nozzle(in cm):\n",
      "T3 = (x1*hfg1+Cps*T1+m*Cpw*Tw)/(m*Cpw+Cps)#Temperature of water coming out of the injector(in C):\n",
      "\n",
      "#Results: \n",
      "print \"Mass of water pumped per kg of steam: \",round(m,2),\"kg\"\n",
      "print \"Diameter of throat of the mixing nozzle: \",round(d3,3),\"cm\"\n",
      "print \"Diameter of throat of steam nozzle: \",round(d2,2),\"cm\"\n",
      "print \"Temperature of water coming out of the injector: \",round(T3,2),\"\u00b0C\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Mass of water pumped per kg of steam:  3.98 kg\n",
        "Diameter of throat of the mixing nozzle:  0.783 cm\n",
        "Diameter of throat of steam nozzle:  1.69 cm\n",
        "Temperature of water coming out of the injector:  145.63 \u00b0C\n"
       ]
      }
     ],
     "prompt_number": 27
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 15, page no. 607"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "\n",
      "from math import sqrt\n",
      "\n",
      "#Variable Declaration: \n",
      "p4 = 20 #Pressure at which steam is generated(in bar):\n",
      "p1 = 1.5 #Pressure at inlet(in bar):\n",
      "x1 = 0.9 #Dryness fraction:\n",
      "M = 5000 #Mass of water taken from feed water tank(in kg/hr):\n",
      "d = 10**3 #Density(in kg/m**3):\n",
      "#From steam tables:\n",
      "h1 = 2470.96                #kJ/kg \n",
      "s1 = 6.6443                 #kJ/kg.K\n",
      "s2 = s1\n",
      "x2 = 0.88\n",
      "h2 = 2396.72                #kJ/kg\n",
      "v2 = 1.7302                 #m**3/kg\n",
      "\n",
      "#Calculations:\n",
      "C2 = sqrt(2*(h1-h2)*10**3) #Steam velocity(in m/s):\n",
      "C3 = sqrt(1.2*p4*2*10**5/d) #Velocity at 3(in m/s):\n",
      "m = C2/C3-1  #Mass entrained per kg of steam:\n",
      "ms = M/(3600*m) #Mass of steam supplied per second(in kg/s):\n",
      "A2 = ms*v2/C2*10**4 #Area of steam nozzle(in cm**2):\n",
      "D = M/3600+ms #Total discharge from injector(in kg/s):\n",
      "A = D/(C3*d)*10**4 #Area of discharge orifice(in cm**2):\n",
      "\n",
      "#Results: \n",
      "print \"Mass of water pumped per kg of steam: \",round(m,2),\"kg water/kg of steam\"\n",
      "print \"Area of steam nozzle: \",round(A2,2),\"cm**2\"\n",
      "print \"Area of discharge orifice: \",round(A,3),\"cm**2\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Mass of water pumped per kg of steam:  4.56 kg water/kg of steam\n",
        "Area of steam nozzle:  13.67 cm**2\n",
        "Area of discharge orifice:  0.244 cm**2\n"
       ]
      }
     ],
     "prompt_number": 29
    }
   ],
   "metadata": {}
  }
 ]
}