summaryrefslogtreecommitdiff
path: root/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter10_1.ipynb
blob: 47e12831c7fc97c81f14fa4c6472842fabec34f6 (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
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 10 - Steam Plant"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 1: pg 292"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The equivalent evaporation, from and at 100 C is (kg steam/kg coal) =  8.96\n"
     ]
    }
   ],
   "source": [
    "#pg 292\n",
    "# determine the equivalent evaporation\n",
    "\n",
    "#  Given\n",
    "P = 1.4;#  [MN/m^2]\n",
    "m = 8.;#  mass of water,[kg]\n",
    "T1 = 39.;#  entering temperature,[C]\n",
    "T2 = 100.;#  [C]\n",
    "x = .95;#dryness fraction \n",
    "\n",
    "#  solution\n",
    "hf = 830.1;#  [kJ/kg]\n",
    "hfg = 1957.7;#  [kJ/kg]\n",
    "#  steam is wet so specific enthalpy of steam is\n",
    "h = hf+x*hfg;#  [kJ/kg]\n",
    "\n",
    "#  at 39 C\n",
    "h1 = 163.4;#  [kJ/kg]\n",
    "#  hence\n",
    "q = h-h1;#  [kJ/kg]\n",
    "Q = m*q;#  [kJ]\n",
    "\n",
    "evap = Q/2256.9;#  equivalent evaporation[kg steam/(kg coal)]\n",
    "\n",
    "#results\n",
    "\n",
    "print 'The equivalent evaporation, from and at 100 C is (kg steam/kg coal) = ',round(evap,2)\n",
    "\n",
    "# End\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 2: pg 292"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " The mass of oil used per hour is (kg) =  395.4\n",
      " The fraction of the enthalpy drop through the turbine that is converted into useful work is  =   0.841\n",
      " The heat transfer available in exhaust steam above 49.4 C is (kJ/kg) =  2450.4\n"
     ]
    }
   ],
   "source": [
    "#pg 292\n",
    "#aim : To determine the mass of oil used per hour and the fraction of enthalpy drop through the turbine\n",
    "# heat transfer available per kilogram of exhaust steam\n",
    "\n",
    "#  Given values\n",
    "ms_dot = 5000.;# generation of steam, [kg/h]\n",
    "P1 = 1.8;# generated steam pressure, [MN/m^2]\n",
    "T1 = 273.+325;# generated steam temperature, [K]\n",
    "Tf = 273+49.4;# feed temperature, [K]\n",
    "neta = .8;# efficiency of boiler plant \n",
    "c = 45500.;# calorific value, [kJ/kg]\n",
    "P = 500.;# turbine generated power, [kW]\n",
    "Pt = .18;# turbine exhaust pressure, [MN/m^2]\n",
    "x = .98;# dryness farction of steam\n",
    "\n",
    "#  solution\n",
    "#  using steam table at 1.8 MN/m^2\n",
    "hf1 = 3106.;# [kJ/kg]\n",
    "hg1 = 3080.;# [kJ/kg]\n",
    "#  so\n",
    "h1 = hf1-neta*(hf1-hg1);# [kJ/kg]\n",
    "#  again using steam table specific enthalpy of feed water is\n",
    "hwf = 206.9;# [kJ/kg]\n",
    "h_rais = ms_dot*(h1-hwf);# energy to raise steam, [kJ]\n",
    "\n",
    "h_fue = h_rais/neta;# energy from fuel per hour, [kJ]\n",
    "m_oil = h_fue/c;# mass of fuel per hour, [kg]\n",
    "\n",
    "#  from steam table at exhaust\n",
    "hf = 490.7;# [kJ/kg]\n",
    "hfg = 2210.8;#  [kJ/kg]\n",
    "#  hence\n",
    "h = hf+x*hfg;# [kJ/kg]\n",
    "#  now\n",
    "h_drop = (h1-h)*ms_dot/3600;# specific enthalpy drop in turbine [kJ]\n",
    "f = P/h_drop;# fraction ofenthalpy drop converted into work\n",
    "#  heat transfer available in exhaust is\n",
    "Q = h-hwf;# [kJ/kg]\n",
    "#results\n",
    "print ' The mass of oil used per hour is (kg) = ',round(m_oil,1)\n",
    "print ' The fraction of the enthalpy drop through the turbine that is converted into useful work is  =  ',round(f,3)\n",
    "print ' The heat transfer available in exhaust steam above 49.4 C is (kJ/kg) = ',round(Q,1)\n",
    "\n",
    "#  End\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 3: pg 293"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 10.3\n",
      " (a) The thermal efficiency of the boiler is (percent) =  66.3\n",
      " (b) The equivalent evaporation of boiler is (kg/kg coal) =  9.11\n",
      " (c) Mass of coal used in new condition is (kg) =  563.0\n",
      "      The saving in coal per hour is (kg) =  107.0\n"
     ]
    }
   ],
   "source": [
    "#pg 293\n",
    "print('Example 10.3');\n",
    "\n",
    "#  aim : To determine\n",
    "#  (a) the thermal efficiency of the boiler\n",
    "#  (b) the equivalent evaporation of the boiler\n",
    "#  (c) the new coal consumption \n",
    "\n",
    "#  given values\n",
    "ms_dot = 5400.;# steam feed rate, [kg/h]\n",
    "P = 750;# steam pressure, [kN/m**2]\n",
    "x = .98;# steam dryness fraction\n",
    "Tf1 = 41.5;# feed water temperature, [C]\n",
    "CV = 31000.;# calorific value of coal used in the boiler, [kJ/kg]\n",
    "mc1 = 670.;# rate of burning of coal/h, [kg]\n",
    "Tf2 = 100.;# increased water temperature, [C]\n",
    "\n",
    "# solution\n",
    "#   (a)\n",
    "SRC = ms_dot/mc1;# steam raised/kg coal, [kg]\n",
    "hf = 709.3;# [kJ/kg]\n",
    "hfg = 2055.5;# [kJ/kg]\n",
    "h1 = hf+x*hfg;# specific enthalpy of steam raised, [kJ/kg]\n",
    "#  from steam table \n",
    "hfw = 173.9;# specific enthalpy of feed water, [kJ/kg]\n",
    "EOB = SRC*(h1-hfw)/CV;# efficiency of boiler\n",
    "print ' (a) The thermal efficiency of the boiler is (percent) = ',round(EOB*100,1)\n",
    "\n",
    "# (b)\n",
    "he = 2256.9;# specific enthalpy of evaporation, [kJ/kg]\n",
    "Ee = SRC*(h1-hfw)/he;# equivalent evaporation[kg/kg coal]\n",
    "print ' (b) The equivalent evaporation of boiler is (kg/kg coal) = ',round(Ee,2)\n",
    "# (c)\n",
    "hw = 419.1;# specific enthalpy of feed water at 100 C, [kJ/kg]\n",
    "Eos = ms_dot*(h1-hw);# energy of steam under new condition, [kJ/h]\n",
    "neb = EOB+.05;# given condition new efficiency of boiler if 5%more than previous\n",
    "Ec = Eos/neb;# energy from coal, [kJ/h]\n",
    "mc2 = Ec/CV;# mass of coal used per hour in new condition, [kg]\n",
    "print ' (c) Mass of coal used in new condition is (kg) = ',round(mc2)\n",
    "print '      The saving in coal per hour is (kg) = ',round(mc1-mc2)\n",
    "\n",
    "#  End\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4: pg 294"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 10.4\n",
      " (a) The heat transfer/h in producing wet steam in the boiler is (MJ) =  1776396.0\n",
      " (b) The heat transfer/h in superheater is (MJ) =  777924.0\n",
      " (c) The volume of gas used/h is (m^3) =  73064.0\n",
      "There is calculation mistake in the book so our answer is not matching\n"
     ]
    }
   ],
   "source": [
    "#pg 294\n",
    "print('Example 10.4');\n",
    "\n",
    "#  aim : To determine the\n",
    "#  (a) Heat transfer in the boiler\n",
    "#   (b) Heat transfer in the superheater\n",
    "#  (c) Gas used\n",
    "\n",
    "#  given values\n",
    "P = 100.;# boiler operating pressure, [bar]\n",
    "Tf = 256.;# feed water temperature, [C]\n",
    "x = .9;# steam dryness fraction.\n",
    "Th = 450.;# superheater exit temperature, [C]\n",
    "m = 1200.;# steam generation/h, [tonne]\n",
    "TE = .92;# thermal efficiency\n",
    "CV = 38.;# calorific value of fuel, [MJ/m^3]\n",
    "\n",
    "# solution\n",
    "# (a)\n",
    "# from steam table\n",
    "hw = 1115.4;# specific enthalpy of feed water, [kJ/kg]\n",
    "# for wet steam\n",
    "hf = 1408.;# specific enthalpy, [kJ/kg]\n",
    "hg = 2727.7;# specific enthalpy, [kJ/kg]\n",
    "#  so\n",
    "h = hf+x*(hg-hf);# total specific enthalpy of wet steam, [kJ/kg]\n",
    "#  hence\n",
    "Qb = m*(h-hw);# heat transfer/h for wet steam, [MJ]\n",
    "print ' (a) The heat transfer/h in producing wet steam in the boiler is (MJ) = ',Qb\n",
    "\n",
    "# (b)\n",
    "# again from steam table\n",
    "# specific enthalpy of superheated stem at given condition is,\n",
    "hs = 3244;# [kJ/kg]\n",
    "\n",
    "Qs = m*(hs-h);# heat transfer/h in superheater, [MJ]\n",
    "print ' (b) The heat transfer/h in superheater is (MJ) = ',Qs\n",
    "\n",
    "# (c)\n",
    "V = (Qb+Qs)/(TE*CV);# volume of gs used/h, [m^3]\n",
    "print ' (c) The volume of gas used/h is (m^3) = ',round(V)\n",
    "\n",
    "print 'There is calculation mistake in the book so our answer is not matching'\n",
    "\n",
    "#  End\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 5: pg 300"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 10.5\n",
      "The flow rate of the cooling water is = 27.5 tonne/h\n"
     ]
    }
   ],
   "source": [
    "#pg 300\n",
    "print('Example 10.5');\n",
    "\n",
    "#aim : To determine \n",
    "# the flow rate of cooling water\n",
    "\n",
    "#Given values\n",
    "P=24;#pressure, [kN/m^2]\n",
    "ms_dot=1.8;#steam condense rate,[tonne/h]\n",
    "x=.98;#dryness fraction\n",
    "T1=21.;#entrance temperature of cooling water,[C]\n",
    "T2=57.;#outlet temperature of cooling water,[C]\n",
    "\n",
    "#solution\n",
    "#at 24 kN/m^2, for steam\n",
    "hfg=2616.8;#[kJ/kg]\n",
    "hf1=268.2;#[kJ/kg]\n",
    "#hence\n",
    "h1=hf1+x*(hfg-hf1);#[kJ/kg]\n",
    "\n",
    "#for cooling water\n",
    "hf3=238.6;#[kJ/kg]\n",
    "hf2=88.1;#[kJ/kg]\n",
    "\n",
    "#using equation [3]\n",
    "#ms_dot*(hf3-hf2)=mw_dot*(h1-hf1),so\n",
    "mw_dot=ms_dot*(h1-hf1)/(hf3-hf2);#[tonne/h]\n",
    "#results\n",
    "print 'The flow rate of the cooling water is =',round(mw_dot,1),'tonne/h'\n",
    "\n",
    "#End\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 6: pg 306"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 10.6\n",
      " (a) The energy supplied in boiler/kg steam is (kJ/kg) =  2914.2\n",
      " (b) The dryness fraction of steam entering the condenser is =  0.804\n",
      " (c) The Rankine efficiency is (percent) =  34.0\n"
     ]
    }
   ],
   "source": [
    "#pg 306\n",
    "print('Example 10.6');\n",
    "\n",
    "#  aim : To determine\n",
    "#  (a) the energy supplied in the boiler\n",
    "#  (b) the dryness fraction of the steam entering the condenser\n",
    "#  (c) the rankine efficiency\n",
    "\n",
    "#  given values\n",
    "P1 = 3.5;# steam entering pressure, [MN/m^2]\n",
    "T1 = 273+350;# entering temperature, [K]\n",
    "P2 = 10;#steam exhaust pressure, [kN/m^2]\n",
    "\n",
    "# solution\n",
    "#  (a)\n",
    "#  from steam table, at P1 is,\n",
    "hf1 = 3139;# [kJ/kg]\n",
    "hg1 = 3095;# [kJ/kg]\n",
    "h1 = hf1-1.5/2*(hf1-hg1);\n",
    "# at Point 3\n",
    "h3 = 191.8;# [kJ/kg]\n",
    "Es = h1-h3;# energy supplied, [kJ/kg]\n",
    "print ' (a) The energy supplied in boiler/kg steam is (kJ/kg) = ',Es\n",
    "\n",
    "# (b)\n",
    "# at P1\n",
    "sf1 = 6.960;# [kJ/kg K]\n",
    "sg1 = 6.587;# [kJ/kg K]\n",
    "s1 = sf1-1.5/2*(sf1-sg1);# [kJ/kg K]\n",
    "# at P2\n",
    "sf2 = .649;# [kJ/kg K] \n",
    "sg2 = 8.151;# [kJ/kg K]\n",
    "# s2=sf2+x2(sg2-sf2)\n",
    "# theoretically expansion through turbine is isentropic so s1=s2\n",
    "# hence\n",
    "s2 = s1;\n",
    "x2 = (s2-sf2)/(sg2-sf2);# dryness fraction\n",
    "print ' (b) The dryness fraction of steam entering the condenser is = ',round(x2,3)\n",
    "\n",
    "# (c)\n",
    "# at point 2\n",
    "hf2 = 191.8;# [kJ/kg]\n",
    "hfg2 = 2392.9;# [kJ/kg]\n",
    "h2 = hf2+x2*hfg2;# [kJ/kg]\n",
    "Re = (h1-h2)/(h1-h3);# rankine efficiency\n",
    "print ' (c) The Rankine efficiency is (percent) = ',round(Re*100,1)\n",
    "\n",
    "#  End\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 7: pg 307"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 10.7\n",
      " (a) The Rankine efficiency is (percent) =  26.9\n",
      " (b) The specific work done is  (kJ/kg) =  592.6\n",
      "     The specific work done (from rankine) is  (kJ/kg) =  687.2\n",
      "there is calculation mistake in the book so our answer is not matching\n"
     ]
    }
   ],
   "source": [
    "#pg 307\n",
    "print('Example 10.7');\n",
    "\n",
    "# aim : To determine\n",
    "#  the specific work done and compare this with that obtained when determining the rankine effficiency\n",
    "\n",
    "# given values\n",
    "P1 = 1000;# steam entering pressure, [kN/m^2]\n",
    "x1 = .97;# steam entering dryness fraction\n",
    "P2 = 15;#steam exhaust pressure, [kN/m^2]\n",
    "n = 1.135;# polytropic index\n",
    "\n",
    "# solution\n",
    "# (a)\n",
    "# from steam table, at P1 is\n",
    "hf1 = 762.6;# [kJ/kg]\n",
    "hfg1 = 2013.6;# [kJ/kg]\n",
    "h1 = hf1+hfg1; # [kJ/kg]\n",
    "\n",
    "sf1 = 2.138;# [kJ/kg K]\n",
    "sg1 = 6.583;# [kJ/kg K]\n",
    "s1 = sf1+x1*(sg1-sf1);# [kJ/kg K]\n",
    "\n",
    "# at P2\n",
    "sf2 = .755;# [kJ/kg K] \n",
    "sg2 = 8.009;# [kJ/kg K]\n",
    "# s2 = sf2+x2(sg2-sf2)\n",
    "# since expansion through turbine is isentropic so s1=s2\n",
    "# hence\n",
    "s2 = s1;\n",
    "x2 = (s2-sf2)/(sg2-sf2);# dryness fraction\n",
    "\n",
    "# at point 2\n",
    "hf2 = 226.0;# [kJ/kg]\n",
    "hfg2 = 2373.2;# [kJ/kg]\n",
    "h2 = hf2+x2*hfg2;# [kJ/kg]\n",
    "\n",
    "# at Point 3\n",
    "h3 = 226.0;# [kJ/kg]\n",
    "\n",
    "# (a)\n",
    "Re = (h1-h2)/(h1-h3);# rankine efficiency\n",
    "print ' (a) The Rankine efficiency is (percent) = ',round(Re*100,1)\n",
    "\n",
    "# (b)\n",
    "vg1 = .1943;# specific volume at P1, [m^3/kg]\n",
    "vg2 = 10.02;# specific volume at P2, [m^3/kg]\n",
    "V1 = x1*vg1;# [m^3/kg]\n",
    "V2 = x2*vg2;# [m^3/kg]\n",
    "\n",
    "W1 = n/(n-1)*(P1*V1-P2*V2);# specific work done, [kJ/kg]\n",
    "\n",
    "#  from rankine cycle\n",
    "W2 = h1-h2;# [kJ/kg]\n",
    "print ' (b) The specific work done is  (kJ/kg) = ',round(W1,1)\n",
    "print '     The specific work done (from rankine) is  (kJ/kg) = ',round(W2,1)\n",
    "\n",
    "print 'there is calculation mistake in the book so our answer is not matching'\n",
    "\n",
    "#  End\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 8: pg 309"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 10.8\n",
      " (a) The rankine efficiency is (percent) =  16.0\n",
      " (b) The specific steam consumption is (kJ/kWh) =  8.51\n",
      " (c) The carnot efficiency of the cycle is (percent) =  33.9\n"
     ]
    }
   ],
   "source": [
    "#pg 309\n",
    "print('Example 10.8');\n",
    "\n",
    "#  aim : To determine\n",
    "#  (a) the rankine fficiency\n",
    "#  (b) the specific steam consumption\n",
    "#  (c) the carnot efficiency of the cycle\n",
    "\n",
    "# given values\n",
    "P1 = 1100.;# steam entering pressure, [kN/m^2]\n",
    "T1 = 273.+250;# steam entering temperature, [K]\n",
    "P2 = 280.;# pressure at point 2, [kN/m^2]\n",
    "P3 = 35.;# pressure at point 3, [kN/m^2]\n",
    "\n",
    "# solution\n",
    "# (a)\n",
    "# from steam table, at P1  and T1 is\n",
    "hf1 = 2943.;# [kJ/kg]\n",
    "hg1 = 2902.;# [kJ/kg]\n",
    "h1 = hf1-.1*(hf1-hg1); # [kJ/kg]\n",
    "\n",
    "sf1 = 6.926;# [kJ/kg K]\n",
    "sg1 = 6.545;# [kJ/kg K]\n",
    "s1 = sf1-.1*(sf1-sg1);# [kJ/kg K]\n",
    "\n",
    "# at P2\n",
    "sf2 = 1.647;# [kJ/kg K] \n",
    "sg2 = 7.014;# [kJ/kg K]\n",
    "# s2=sf2+x2(sg2-sf2)\n",
    "# since expansion through turbine is isentropic so s1=s2\n",
    "# hence\n",
    "s2  = s1;\n",
    "x2 = (s2-sf2)/(sg2-sf2);# dryness fraction\n",
    "\n",
    "# at point 2\n",
    "hf2 = 551.4;# [kJ/kg]\n",
    "hfg2 = 2170.1;# [kJ/kg]\n",
    "h2 = hf2+x2*hfg2;# [kJ/kg]\n",
    "vg2 = .646;# [m^3/kg]\n",
    "v2 = x2*vg2;# [m^3/kg]\n",
    "\n",
    "# by Fig10.20.\n",
    "A6125 = h1-h2;# area of 6125, [kJ/kg]\n",
    "A5234 = v2*(P2-P3);# area 5234, [kJ/kg]\n",
    "W = A6125+A5234;# work done \n",
    "hf = 304.3;# specific enthalpy of water at condenser pressuer, [kJ/kg]\n",
    "ER = h1-hf;# energy received, [kJ/kg]\n",
    "Re = W/ER;# rankine efficiency\n",
    "print ' (a) The rankine efficiency is (percent) = ',round(Re*100)\n",
    "\n",
    "# (b)\n",
    "kWh = 3600;# [kJ]\n",
    "SSC = kWh/W;# specific steam consumption, [kJ/kWh]\n",
    "print ' (b) The specific steam consumption is (kJ/kWh) = ',round(SSC,2)\n",
    "\n",
    "# (c)\n",
    "# from steam table \n",
    "T3 = 273+72.7;# temperature at point 3\n",
    "CE = (T1-T3)/T1;# carnot efficiency\n",
    "print ' (c) The carnot efficiency of the cycle is (percent) = ',round(CE*100,1)\n",
    "\n",
    "#  End\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 9: pg 311"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 10.9\n",
      " (a) The theoretical power/kg steam/s is (kW) =  1332.0\n",
      " (b) The thermal efficiency of the cycle is (percent) =  35.9\n",
      " (c) The thermal efficiency of the cycle if there is no heat is (percent) =  35.7\n"
     ]
    }
   ],
   "source": [
    "#pg 311\n",
    "print('Example 10.9');\n",
    "\n",
    "# aim : To determine\n",
    "# (a) the theoretical power of steam passing through the turbine\n",
    "# (b) the thermal efficiency of the cycle\n",
    "# (c) the thermal efficiency of the cycle assuming there is no reheat\n",
    "\n",
    "# given values\n",
    "P1 = 6;# initial pressure, [MN/m^2]\n",
    "T1 = 450;# initial temperature, [C]\n",
    "P2 = 1;# pressure at stage 1, [MN/m^2]\n",
    "P3 = 1;# pressure at stage 2, [MN/m^2]\n",
    "T3 = 370;# temperature, [C]\n",
    "P4 = .02;# pressure at stage 3, [MN/m^2]\n",
    "P5 = .02;# pressure at stage 4, [MN/m^2]\n",
    "T5 = 320;# temperature, [C]\n",
    "P6 = .02;# pressure at stage 5, [MN/m^2]\n",
    "P7 = .02;# final pressure , [MN/m^2]\n",
    "\n",
    "# solution\n",
    "# (a) \n",
    "# using Fig 10.21\n",
    "h1 = 3305.;# specific enthalpy, [kJ/kg]\n",
    "h2 = 2850.;# specific enthalpy, [kJ/kg]\n",
    "h3 = 3202.;# specific enthalpy, [kJ/kg]\n",
    "h4 = 2810.;# specific enthalpy, [kJ/kg]\n",
    "h5 = 3115.;# specific enthalpy, [kJ/kg]\n",
    "h6 = 2630.;# specific enthalpy, [kJ/kg]\n",
    "h7 = 2215.;# specific enthalpy, [kJ/kg]\n",
    "W = (h1-h2)+(h3-h4)+(h5-h6);# specific work through the turbine, [kJ/kg]\n",
    "print ' (a) The theoretical power/kg steam/s is (kW) = ',W\n",
    "\n",
    "# (b)\n",
    "# from steam table\n",
    "hf6 = 251.5;# [kJ/kg]\n",
    "\n",
    "TE1 = ((h1-h2)+(h3-h4)+(h5-h6))/((h1-hf6)+(h3-h2)+(h5-h4));# thermal efficiency\n",
    "print ' (b) The thermal efficiency of the cycle is (percent) = ',round(TE1*100,1)\n",
    "\n",
    "# (c)\n",
    "# if there is no heat\n",
    "hf7 = hf6;\n",
    "TE2 = (h1-h7)/(h1-hf7);# thermal efficiency\n",
    "print ' (c) The thermal efficiency of the cycle if there is no heat is (percent) = ',round(TE2*100,1)\n",
    "\n",
    "#  End\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 10: pg 313"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 10.10\n",
      " (a) The mass of steam bled in feed heater 1 is (kg/kg supply steam) =  0.109\n",
      "      The mass of steam bled in feed heater 2 is (kg/kg supply steam) =  0.106\n",
      " (b) The thermal efficiency of the arrangement is (percent) =  31.6\n",
      "      The thermal efficiency if there is no feed heating is (percent) =  27.8\n"
     ]
    }
   ],
   "source": [
    "#pg 313\n",
    "print('Example 10.10');\n",
    "\n",
    "# aim : To determine\n",
    "# (a) the mass of steam bled to each feed heater in kg/kg of supply steam\n",
    "# (b) the thermal efficiency of the arrangement\n",
    "\n",
    "# given values\n",
    "P1 = 7.;# steam initial pressure, [MN/m^2]\n",
    "T1 = 273.+500;# steam initil temperature, [K]\n",
    "P2 = 2.;# pressure at stage 1, [MN/m^2]\n",
    "P3 = .5;# pressure at stage 2, [MN/m^2]\n",
    "P4 = .05;# condenser pressure,[MN/m^2]\n",
    "SE = .82;# stage efficiency of turbine\n",
    "\n",
    "# solution\n",
    "# from the enthalpy-entropy chart(Fig10.23) values of specific enthalpies are\n",
    "h1 = 3410.;# [kJ/kg]\n",
    "h2_prim = 3045.;# [kJ/kg]\n",
    "# h1-h2=SE*(h1-h2_prim), so\n",
    "h2 = h1-SE*(h1-h2_prim);# [kJ/kg]\n",
    "\n",
    "h3_prim = 2790.;# [kJ/kg]\n",
    "# h2-h3=SE*(h2-h3_prim), so\n",
    "h3 = h2-SE*(h2-h3_prim);# [kJ/kg]\n",
    "\n",
    "h4_prim = 2450;# [kJ/kg]\n",
    "# h3-h4 = SE*(h3-h4_prim), so\n",
    "h4 = h3-SE*(h3-h4_prim);# [kJ/kg]\n",
    "\n",
    "# from steam table\n",
    "# @ 2 MN/m^2\n",
    "hf2 = 908.6;# [kJ/kg]\n",
    "# @ .5 MN/m^2\n",
    "hf3 = 640.1;# [kJ/kg] \n",
    "# @ .05 MN/m^2\n",
    "hf4 = 340.6;# [kJ/kg]\n",
    "\n",
    "# (a) \n",
    "# for feed heater1\n",
    "m1 = (hf2-hf3)/(h2-hf3);# mass of bled steam, [kg/kg supplied steam]\n",
    "# for feed heater2\n",
    "m2 = (1-m1)*(hf3-hf4)/(h3-hf4);# \n",
    "print ' (a) The mass of steam bled in feed heater 1 is (kg/kg supply steam) = ',round(m1,3)\n",
    "print '      The mass of steam bled in feed heater 2 is (kg/kg supply steam) = ',round(m2,3)\n",
    "\n",
    "# (b)\n",
    "W = (h1-h2)+(1-m1)*(h2-h3)+(1-m1-m2)*(h3-h4);# theoretical work done, [kJ/kg]\n",
    "Eb = h1-hf2;# energy input in the boiler, [kJ/kg]\n",
    "TE1 = W/Eb;# thermal efficiency\n",
    "print ' (b) The thermal efficiency of the arrangement is (percent) = ',round(TE1*100,1)\n",
    "\n",
    "# If there is no feed heating\n",
    "hf5 = hf4;\n",
    "h5_prim = 2370;# [kJ/kg]\n",
    "# h1-h5 = SE*(h1-h5_prim), so\n",
    "h5 = h1-SE*(h1-h5_prim);# [kJ/kg]\n",
    "Ei = h1-hf5;#energy input, [kJ/kg]\n",
    "W = h1-h5;#  theoretical work, [kJ/kg]\n",
    "TE2 = W/Ei;# thermal efficiency\n",
    "print '      The thermal efficiency if there is no feed heating is (percent) = ',round(TE2*100,1)\n",
    "\n",
    "#  End \n"
   ]
  }
 ],
 "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.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}