summaryrefslogtreecommitdiff
path: root/Chemical_Engineering_Thermodynamics___by_S._Sundaram/ch3_1.ipynb
blob: 8385d1103fb0b6e1bf4430f03eb006a9d55ecedc (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
{
 "metadata": {
  "name": "",
  "signature": "sha256:753b89f4a49b587e649e81b025cbd0732ffa221e89b7d46871678d863ea83955"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 3 : First Law of Thermodynamics"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.1  Page No : 50"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Given\n",
      "W = -((2*745.6*(10**-3)/4.18)*3600) #work added to the system in Kcal/hr\n",
      "m = 10.0 #Amount of fluid in math.tank in Kg\n",
      "Q = -378.0 #Heat losses from the system in Kcal/hr\n",
      "\n",
      "#To calculate the change in internal energy\n",
      "delE=(Q-W)/m # Change in internal energy in Kcal/hr kg\n",
      "print \"Change in Internal energy is \",\n",
      "print \"%.6f\"%delE,\n",
      "print \"Kcal/hr Kg\"\n",
      "#end\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Change in Internal energy is  90.628708 Kcal/hr Kg\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.2  Page No : 53"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "#Given\n",
      "n = 1.0 #kg moles of a gas\n",
      "Cv = 5.0 #specific heat in Kcal/Kgmole\n",
      "delT = 15.0 #increase in temperature in deg celsius\n",
      "\n",
      "#To calculate the change in internal energy\n",
      "Q = n*Cv*delT #heat given to the system in Kcal\n",
      "W = 0 #work done\n",
      "delE = Q-W #Change in internal energy\n",
      "print \"Change in internal energy is \",\n",
      "print \"%.6f\"%delE,\n",
      "print \"Kcal\"\n",
      "#end\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Change in internal energy is  75.000000 Kcal\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.3  Page No : 55"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "#Given\n",
      "P = 1.0 #consmath.tant pressure throughout the process in atm\n",
      "T1 = 273.0 #Initial temperature in K\n",
      "T2 = 373.0 #Final temperature in K\n",
      "V1 = 0.0#Volume of liquid water or initial volume\n",
      "V0 = 22.4 #volume of vapour at smath.radians(numpy.arcmath.tan(ard condition in cubic meter\n",
      "Q = 9.7 #Heat of vapourisation in Kcal\n",
      "\n",
      "#To calculate the work done by the expanding gas and increase in internal energy\n",
      "#(i)Calculation of work done\n",
      "V2 = 22.4*(T2/T1)*(P)*(10**-3) #Volume of final vapour in cubic meter\n",
      "w = P*(V2-V1) #Work done in atm cubic meter\n",
      "W = w*(1.03*10**4)/427 #Work done in Kcal\n",
      "print \"i)Work done by the expanding gas is \",\n",
      "print \"%.6f\"%W,\n",
      "print \"Kcal\"\n",
      "\n",
      "#(ii)Calculation of change in internal energy\n",
      "delE = Q-W\n",
      "print \" ii)Increase in internal energy is \",\n",
      "print \"%.6f\"%delE,\n",
      "print \"Kcal\"\n",
      "#end\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "i)Work done by the expanding gas is  0.738250 Kcal\n",
        " ii)Increase in internal energy is  8.961750 Kcal\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.4  Page No : 58"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "#Given\n",
      "W = 0.0 #work done during the process\n",
      "P1 = 1.0 #Initial pressure in atm\n",
      "P2 = 10.0 #Final pressure in atm\n",
      "#V2 = V1;#Initial & final volume are equal\n",
      "Cv = 0.23#specific heat at consmath.tant volume in Kcal/Kg deg K\n",
      "#(delQ/delT)=Q\n",
      "Q = 1.3 #Rate of heat addition in Kcal/min\n",
      "m = 2.5 #Weight of an ideal gas in Kg\n",
      "T1 = 298.0 #Initial temperature in Kelvin\n",
      "\n",
      "#To calculate the time taken for the gas to attain 10 atm\n",
      "#Q = m*Cv*(delT/delt)=1.3\n",
      "T2 = (P2*T1)/(P1) #Final temperature in Kelvin\n",
      "t = ((m*Cv)/1.3)*(T2-T1) #time taken in minutes\n",
      "print \"The time taken to attain a pressure of 10 atm is \",\n",
      "print \"%.6f\"%(t/60),\n",
      "print \"hours\"\n",
      "#end\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The time taken to attain a pressure of 10 atm is  19.771154 hours\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.6  Page No : 61"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#Given\n",
      "R = 1.98 #gas consmath.tant in kcal/Kgmole deg K\n",
      "T = 293.0 #Temperature in K\n",
      "M = 29.0 #Molecular weight of air\n",
      "\n",
      "#To calculate the flow work per kg of air\n",
      "#W=(P*V)=(R*T)\n",
      "W = R*T #Flow work in Kcal/Kg mole\n",
      "W1 = W/M \n",
      "print \"Flow work is %f Kcal/Kg\"%W1\n",
      "#end\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Flow work is 20.004828 Kcal/Kg\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.7  Page No : 62"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "#Given\n",
      "m = 5000.0 #Amount of steam recived per hour in Kg\n",
      "H1 = 666.0 #Specific enthalpy when steam entered in the turbine in Kcal/Kg\n",
      "H2 = 540.0 #Specific enthalpy when steam left the turbine in Kcal/Kg\n",
      "u1 = 3000/60.0 #velocity at which steam entered in m/sec\n",
      "u2 = 600/60.0 #velocity at which steam left in m/sec\n",
      "Z1 = 5.0 #height at which steam entered in m\n",
      "Z2 = 1.0#height at which steam left in m\n",
      "Q = -4000.0 #heat lost in Kcal\n",
      "g = 9.81\n",
      "\n",
      "#To calculate the horsepuwer output of the turbine\n",
      "delH = H2-H1#change in enthalpy in Kcal\n",
      "delKE = ((u2**2)-(u1**2)/(2*g))/(9.8065*427) #change in kinetic energy in Kcal; 1kgf = 9.8065 N\n",
      "delPE = ((Z2-Z1)*g)/(9.8065*427) #change in potential energy in Kcal\n",
      "W = -(m*(delH+delKE+delPE))+Q #work delivered in Kcal/hr\n",
      "W1 = W*(427/(3600*75.0))#work delivered by turbine in hp\n",
      "print \"Work delivered by turbine is %f hp\"%W1\n",
      "#end\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Work delivered by turbine is 990.133290 hp\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.8  Page No : 63"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "#Given\n",
      "m = 183.0 #rate of water flow in Kg/min\n",
      "H1 = 95.0 #enthalpy of storage math.tank 1 in Kcal/Kg\n",
      "h = 15.0#height difference between two storage math.tanks in m\n",
      "Q = -10100.0 #extraced heat from storage math.tank 1 in a heat exchanger in Kcal/min\n",
      "W = -2.0 #work delivered by motor in hp\n",
      "\n",
      "# To find out the  enthalpy of water math.tank2 and the temperature of water in the second math.tank\n",
      "delPE = h/427.0 #change in potential energy in Kcal/Kg\n",
      "delKE = 0.0 #change in kinetic energy\n",
      "W1 = W*(75/427.0) #work delivered by motor in Kcal/sec\n",
      "W2 = W1*60.0#work delivered by motor in Kcal/min\n",
      "H2 = ((Q+W2)/m)-delKE-delPE+H1#enthalpy of storage math.tank 2 in Kcal/Kg\n",
      "print \"The enthalpy of storage tank 2 is %f Kcal/Kg\"%(H2)\n",
      "\n",
      "#The enthalpy H2=39.66 corresponds to the temperature T according to steam table\n",
      "T=40 #Temperature is in deg celsius\n",
      "print \" The temperature of water in the second tank is %d deg celsius\"%(T)\n",
      "#end\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The enthalpy of storage tank 2 is 39.658438 Kcal/Kg\n",
        " The temperature of water in the second tank is 40 deg celsius\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.9  Page No : 68"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "#To calculate the mass of steam required\n",
      "#Given\n",
      "m2 = 100.0 #mass of water to be heated\n",
      "#From diagram, \n",
      "#m3 = m1+m2;..(a)\n",
      "#Hs = H1;..(b) math.since throttling is a consmath.tant enthalpy process\n",
      "#m3*H3-(m1*H1+m2*H2)=0;..(c) math.since delH=0\n",
      "\n",
      "#From steam tables, \n",
      "Hs = 681.7 #enthalpy of steam at 200 deg cel bleeded at the rate of 5Kgf/(cm**2) in Kcal/Kg\n",
      "H2 = 5.03 #enthalpy of liquid water at 5 deg cel\n",
      "H3 = 64.98 #enthalpy of liquid water at 65 deg cel\n",
      "#from equn (a),(b)&(c);(page no 80)\n",
      "m1 = ((H3-H2)/(Hs-H3))*m2 #mass of steam required in Kg  (page no 80)\n",
      "print \"The mass of steam required to heat 100 Kg of water is %f Kg\"%(m1)\n",
      "#end \n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The mass of steam required to heat 100 Kg of water is 9.720781 Kg\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.10  Page No : 69"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "#Given\n",
      "V = 0.3 #Volume of the math.tank in m**3\n",
      "P1 = 1.0 #Initial pressure of the math.tank in atm\n",
      "P2 = 0.0 #Final pressure of the math.tank in atm\n",
      "T = 298.0 #Temperature of the math.tank in K\n",
      "t = 10.0 #evacuation time in min\n",
      "\n",
      "#delN=(V/(R*T)*delP)..(a) change in moles as V and T are consmath.tant\n",
      "#delW=delN*R*T*lnP..(b)pump work required\n",
      "#From (a)&(b),delW=V*delP*lnP\n",
      "\n",
      "#To calculate the pump work required\n",
      "#On doing integration of dW we will get\n",
      "\n",
      "W = V*(P1-P2);#pump work done in J/sec\n",
      "W1=(W*(1.033*10**4))/(75*600.0);\n",
      "print \"The pump work required is %f hp\"%(W1);\n",
      "#end\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The pump work required is 0.068867 hp\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.11  Page No : 71"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "#Given\n",
      "H1 = 680.6;#Enthalpy of entering steam at 6Kgf/cm**2 &200 deg cel in Kcal/Kg\n",
      "u1 = 60.0;#velocity at which steam entered the nozzle in m/sec\n",
      "u2 = 600.0;#velocity at which steam left the nozzle in m/sec\n",
      "g = 9.8;\n",
      "Hg = 642.8; Hlq = 110.2;#Enthalpy of saturated vapour & saturated liquid at 1.46 Kgf/cm**2 respectively\n",
      "\n",
      "#To calculate the quality of exit steam\n",
      "H2 = H1+((u1**2)-(u2**2))/(2*g*427);#enthalpy of leaving steam in Kcal/Kg\n",
      "x = (H2-Hlq)/(Hg-Hlq);\n",
      "print \"The quality of exit steam is %f percent\"%(x*100);\n",
      "#end\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The quality of exit steam is 99.101631 percent\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.12  Page No : 73"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "#Given\n",
      "W = 0.0;#pump work\n",
      "Mi = 0.0;#chamber is initially evacuated\n",
      "M2 = 0.0;#no exist stream\n",
      "H1 = 684.2;#enthalpy of steam at 200 deg cel & 3 Kgf/cm**2\n",
      "\n",
      "#To calculate the internal energy of the steam in the chamber\n",
      "#Q=150*m1;.. (a) heat lost from the chamber in Kcal/Kg\n",
      "#m1=mf;..(b) mass of steam added from large pipe is equal to steam in chamber\n",
      " #H1*M1-Q=Mf*Ef; umath.sing (a)&(b)\n",
      "Ef = H1-150;\n",
      "print \"The internal energy of steam in chamber is %f Kcal\"%(Ef);\n",
      "#end\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The internal energy of steam in chamber is 534.200000 Kcal\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.13  Page No : 76"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "import numpy\n",
      "\n",
      "#Given\n",
      "#Q=W=delPE=delKE=0;\n",
      "#M2=0; no exit stream\n",
      "Ti = 288.0;#initial temperature in K\n",
      "H = 7*Ti;#enthalpy of air in Kcal/Kgmole\n",
      "Ei = 5*Ti;# initial internal energy of air in Kcal/Kgmole\n",
      "#Ef=5*Tf;Final internal energy of air in Kcal/Kgmole\n",
      "Pi = 0.3;#initial pressure in atm\n",
      "V = 0.57;#volume of the math.tank in m**3\n",
      "R = 848.0;#gas consmath.tant in mKgf/Kg mole K\n",
      "Pf = 1.0;#final prssure in atm\n",
      "\n",
      "#To calculate the final weight and the final temperature of the air in the math.tank\n",
      "Mi = (Pi*V*1.03*10**4)/(R*Ti);#initial quantity of air in math.tank in Kg mole\n",
      "#Tf=(Pf*V*1.033*10**4)/(Mf*R)..(a) final temperature,Mf=final quantity of air in math.tank in Kg mole\n",
      "#M1=Mf-Mi..(b) M1 is mass of steam added in Kg mole\n",
      "#H*M1=(Ef*Mf)-(Ei*Mi)\n",
      "#H*M1=((5*Pf*V*1.033*10**4)/(Tf*R))*Tf-(Ei*Mi)...(c)\n",
      "A = [[1,-1],[0,-H]];\n",
      "B = [Mi,((Ei*Mi)-((5*Pf*V*1.03*10**4)/R))];\n",
      "x = numpy.divide(A,B)\n",
      "\n",
      "Mf = x[0][0];\n",
      "print  \"The final weight of air in the tank is %f Kg\"%Mf;\n",
      "\n",
      "Tf = (Pf*V*1.03*10**4)/(Mf*R);\n",
      "print \" The final temperature of air in the tank is %f K\"%(Tf);\n",
      "#end\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The final weight of air in the tank is 138.661216 Kg\n",
        " The final temperature of air in the tank is 0.049930 K\n"
       ]
      }
     ],
     "prompt_number": 17
    }
   ],
   "metadata": {}
  }
 ]
}