summaryrefslogtreecommitdiff
path: root/Thermodynamics_by_F_P_Durham/chapter12.ipynb
blob: 466838d26dffacb68a41655efc63cd46fcfa25af (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
{
 "metadata": {
  "name": "",
  "signature": "sha256:369d727c64e74475d8c5bb63540cbc246cbdecc5bfe067dfd2c4f31c8ec059a2"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 12: Mixtures"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.1, page no 235"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#initialization\n",
      "w1 = 2 #lbm\n",
      "w2 = 1 #lbm\n",
      "P = 30 #lbm/in^2\n",
      "T = 60+460 #R\n",
      "\n",
      "#calculation\n",
      "R1 = 35.1\n",
      "R2 = 55.1\n",
      "Rm = (w1*R1+w2*R2)/(w1+w2)\n",
      "vm = (w1+w2)*Rm*T/(144*P)\n",
      "p1 = w1*R1*T/(144*vm)\n",
      "p2 = w2*R2*T/(144*vm)\n",
      "\n",
      "#result\n",
      "print \"Gas constant of the mixture  = \", round(Rm, 1), \"lb/in^2\"\n",
      "print \"Volume of the mixture  =  \", round(vm, 1), \"ft^3\"\n",
      "print \"Partial pressure of CO2  =  \", round(p1, 1), \"lb/in^2\"\n",
      "print \"Partial pressure of N2  =  \", round(p2, 1), \"lb/in^2\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Gas constant of the mixture  =  41.8 lb/in^2\n",
        "Volume of the mixture  =   15.1 ft^3\n",
        "Partial pressure of CO2  =   16.8 lb/in^2\n",
        "Partial pressure of N2  =   13.2 lb/in^2\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.3, page no. 238"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import scipy.integrate\n",
      "\n",
      "#initialization\n",
      "cpm = 0.2523\n",
      "Rm = 54.7\n",
      "T1 = 60+460.0                           #R\n",
      "T2 = 400+460.0                          #R\n",
      "\n",
      "#calculation\n",
      "cvm = cpm-Rm/778.0\n",
      "Q = cpm*(T2-T1)\n",
      "W = Rm*(T2-T1)\n",
      "#Rm is divided and multiplied by 778.!\n",
      "def s(T):\n",
      "    cp = cpm/T\n",
      "    return cp\n",
      "ds = scipy.integrate.quadrature(s, T1, T2)[0]\n",
      "\n",
      "#result\n",
      "print \"Entropy change  = \", round(ds, 3), \"B/lbm\"\n",
      "print \"specific work  = \", W, \"ft-lb/lbm\"\n",
      "print \"Heat added per pound of mixture  = \", round(Q, 1), \"B/lbm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Entropy change  =  0.127 B/lbm\n",
        "specific work  =  18598.0 ft-lb/lbm\n",
        "Heat added per pound of mixture  =  85.8 B/lbm\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.4, page no. 239"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#initialization\n",
      "P = 14.7                        #lb/in^2\n",
      "T = 80+460.0                    #R\n",
      "\n",
      "#calculation\n",
      "#From steam tables\n",
      "Ps = 0.5069                     #lb/in^2\n",
      "v = 633.1                       #ft^3/lbm\n",
      "Pair = P-Ps\n",
      "vair = 53.3*T/(144*Pair)\n",
      "wair = 1/(1+vair/v)\n",
      "wwater = vair/v/(1+vair/v)\n",
      "\n",
      "#result\n",
      "print \"Partial pressure of air  =  \", round(Pair, 1), \"ft^3/lbm\"\n",
      "print \"Partial pressure of water vapor  =  \", Ps, \"ft^3/lbm\"\n",
      "print \"Gravimetric analysis of air  =  \", round(wair, 4)\n",
      "print \"Gravimetric analysis of water  = \", round(wwater, 4)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Partial pressure of air  =   14.2 ft^3/lbm\n",
        "Partial pressure of water vapor  =   0.5069 ft^3/lbm\n",
        "Gravimetric analysis of air  =   0.9782\n",
        "Gravimetric analysis of water  =  0.0218\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.5, page no. 240"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#initialization\n",
      "P = 14.7                            #lb/in^2\n",
      "T = 80+460.0                        #R\n",
      "M = 18\n",
      "Ps = 0.5069                         #lb/in^2\n",
      "\n",
      "#calculation\n",
      "Pair = P-Ps\n",
      "R = 1544/M\n",
      "v = R*T/(144*Ps)\n",
      "vair = 53.3*T/(144*Pair)\n",
      "wair = 1/(1+vair/v)\n",
      "wwater = vair/v/(1+vair/v)\n",
      "\n",
      "#result\n",
      "print \"Partial pressure of air  =  \", round(Pair, 2), \"ft^3/lbm\"\n",
      "print \"Specific volume = \", round(v), \"ft^3/lbm\"\n",
      "print \"Gravimetric analysis of air  = \", round(wair, 4)\n",
      "print \"Gravimetric analysis of water  =  \", round(wwater, 4)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Partial pressure of air  =   14.19 ft^3/lbm\n",
        "Specific volume =  629.0 ft^3/lbm\n",
        "Gravimetric analysis of air  =  0.9781\n",
        "Gravimetric analysis of water  =   0.0219\n"
       ]
      }
     ],
     "prompt_number": 17
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.6, page no. 242"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#initialization\n",
      "RH = 0.62\n",
      "T = 80+460.0                        #R\n",
      "\n",
      "#calculation\n",
      "#From stram tables\n",
      "P = RH*0.5069\n",
      "\n",
      "#result\n",
      "print \"Partial pressure of water vapor  = \", round(P, 4), \"lb/in^2\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Partial pressure of water vapor  =  0.3143 lb/in^2\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Exmaple 12.7, page no. 243"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#initialization\n",
      "P = 14.5                        #lb/in^2\n",
      "T = 70+460.0                    #R\n",
      "rh = 0.34\n",
      "\n",
      "#calculation\n",
      "#From steam tables\n",
      "Pg = 0.3631                     #lb/in^2\n",
      "Pair = P-Pg\n",
      "wratio = rh*0.622*Pg/Pair\n",
      "\n",
      "#result\n",
      "print \"Specific humidity  =  %.5f lbm/lbm\" %wratio"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Specific humidity  =  0.00543 lbm/lbm\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Exmaple 12.8, page no. 244"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#initialization\n",
      "T = 100+460.0                       #R\n",
      "rh = 0.6\n",
      "\n",
      "#calculation\n",
      "#From steam tables\n",
      "Pg = 0.9492                         #lb/in^2\n",
      "Pwv = rh*Pg\n",
      "T = 83                              #F\n",
      "\n",
      "#result\n",
      "print \"Dew point is obtained from saturation pressure table and is equal to %d F\" %T"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Dew point is obtained from saturation pressure table and is equal to 83 F\n"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.9, page no. 246"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#initialization\n",
      "T1 = 80+460.0                       #R\n",
      "T2 = 90+460.0                       #R\n",
      "P = 14.5                            #lb/in^2\n",
      "cp = 0.24\n",
      "\n",
      "#calculation\n",
      "#From steam tables\n",
      "hg2 = 1096.6\n",
      "hf3 = 48.02\n",
      "Pg2 = 0.5069\n",
      "hf2 = hf3\n",
      "Pair = P-Pg2\n",
      "wg2 = 0.622*Pg2/Pair\n",
      "hgv1 = 1100.9\n",
      "wwv1 = (cp*(T1-T2)+wg2*(hg2-hf3))/(hgv1-hf3)\n",
      "Pg = 0.6982\n",
      "xi = wwv1*(P-Pg)/(Pg*0.622)\n",
      "\n",
      "#result\n",
      "print \"Specific humidity  =  \", round(wwv1, 4), \"lbm/lbm\"\n",
      "print \"relative humidity  =  \", round(xi, 3)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Specific humidity  =   0.0202 lbm/lbm\n",
        "relative humidity  =   0.641\n"
       ]
      }
     ],
     "prompt_number": 20
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.10, page no. 247"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#initialization\n",
      "T1 = 69.0                           #F\n",
      "T2 = 84.0                           #F\n",
      "P = 14.7                            #lb/in^2\n",
      "\n",
      "#calculation\n",
      "# from wet bulb n dry bulb temperature charts\n",
      "sh = 82.0/7000.0\n",
      "rh = 47.0\n",
      "Pwv = 0.27\n",
      "T = 62.0                            #F\n",
      "h = 33.3\n",
      "\n",
      "#result\n",
      "print \"Specific humidity  =  \", round(sh, 4), \"lbm/lbm\"\n",
      "print \"Relative  humidity  = \" , rh, \"%\"\n",
      "print \"Partial pressure  =  \", round(Pwv, 2), \"lb/in^2\"\n",
      "print \"Dew point  = \", T, \"F\"\n",
      "print \"Enthalpy per pound of air  = \", round(h, 1), \"V/lbm dry air\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Specific humidity  =   0.0117 lbm/lbm\n",
        "Relative  humidity  =  47.0 %\n",
        "Partial pressure  =   0.27 lb/in^2\n",
        "Dew point  =  62.0 F\n",
        "Enthalpy per pound of air  =  33.3 V/lbm dry air\n"
       ]
      }
     ],
     "prompt_number": 24
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.11, page no. 250"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math\n",
      "\n",
      "#initialization\n",
      "g1 = [0.489, 100, 700, 35.1, 0.154]\n",
      "g2 = [0.483, 15, 600, 55.2, 0.177]\n",
      "g3 = [0.028, 30, 500, 386, 0.754]\n",
      "\n",
      "#calculation\n",
      "v1 = g1[0] *g1[3] *g1[2] /(144*g1[1])\n",
      "v2 = g2[0] *g2[3] *g2[2] /(144*g2[1])\n",
      "v3 = g3[0] *g3[3] *g3[2] /(144*g3[1])\n",
      "vm = v1+v2+v3\n",
      "Tm = (g1[0] *g1[4] *g1[2] +g2[0] *g2[4] *g2[2] +g3[0] *g3[4] *g3[2])/(g1[0] *g1[4] +g2[0] *g2[4] +g3[0] *g3[4])\n",
      "Pm = (g1[0] *g1[3] +g2[0] *g2[3] +g3[0] *g3[3]) *Tm/(vm*144)\n",
      "ds1 = g1[0] *(g1[4] *math.log(Tm/g1[2]) +g1[3] /778.0 *math.log(vm/v1))\n",
      "ds2 = g2[0] *(g2[4] *math.log(Tm/g2[2]) +g2[3] /778.0 *math.log(vm/v2))\n",
      "ds3 = g3[0] *(g3[4] *math.log(Tm/g3[2]) +g3[3] /778.0 *math.log(vm/v3))\n",
      "ds = ds1+ds2+ds3\n",
      "\n",
      "#result\n",
      "print \"Pressure  =  \", round(Pm, 1), \"lb/in^2\"\n",
      "print \"Temperature  =  \", round(Tm), \"R\"\n",
      "print \"Entropy change  =  \", round(ds, 4), \"B/R\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Pressure  =   25.2 lb/in^2\n",
        "Temperature  =   630.0 R\n",
        "Entropy change  =   0.0914 B/R\n"
       ]
      }
     ],
     "prompt_number": 26
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.13, page no. 254"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "vdot1 = 8500.0         #cfm of air\n",
      "v1 = 12.775            #from chart\n",
      "wdot = vdot1/v1\n",
      "\n",
      "h2 = 20.3              #from chart\n",
      "h1 = 13.85             #from chart\n",
      "h4 = 29.0              #from chart\n",
      "h3 = 20.3              #from chart\n",
      "\n",
      "#Part a\n",
      "Q12 = h2 - h1\n",
      "Q12 = wdot*Q12\n",
      "print \"Capacity of preheater: \", round(Q12, 2), \"B/min\"\n",
      "\n",
      "#Part b\n",
      "Q34 = h4 - h3\n",
      "Q34 = wdot*Q34\n",
      "print \"Capacity of reheater: \", round(Q34, 2), \"B/min\"\n",
      "\n",
      "#Part c\n",
      "\n",
      "w2 = 20.0/7000.0     #from chart\n",
      "w3 = 54.0/7000.0     #from chart\n",
      "W = w3 - w2\n",
      "W = wdot*W\n",
      "print \"Rate of water addition: \", round(W, 2), \"lbm/min\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Capacity of preheater:  4291.59 B/min\n",
        "Capacity of reheater:  5788.65 B/min\n",
        "Rate of water addition:  3.23 lbm/min\n"
       ]
      }
     ],
     "prompt_number": 3
    }
   ],
   "metadata": {}
  }
 ]
}