summaryrefslogtreecommitdiff
path: root/Chemical_Engineering_Thermodynamics___by_S._Sundaram/ch4.ipynb
blob: 0e734b53edc4042fccf3bfd15c3cbc4647eaea03 (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
{
 "metadata": {
  "name": "",
  "signature": "sha256:cba11d6ad27a555b5f3aecc639d6f99831950fba74d42eb631521eded4620d06"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 4 : Second Law of Thermodynamics"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.1  Page No : 84"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "#Given\n",
      "Q1 = 250.0;#Heat absorbed in Kcal\n",
      "T1 = (260+273.0);#Temperature at which engine absorbs heat\n",
      "T0 = (40+273.0);#Temperature at which engine discards heat\n",
      "#To Calculate work output, heat rejected, entropy change of system,surronding & total change in entropy and the efficiency of the heat engine\n",
      "\n",
      "#(i)Calculation of work output\n",
      "W = (Q1*((T1-T0)/T1));#Work done umath.sing equations 4.7 & 4.9 given on page no 98\n",
      "print \"i)The work output of the heat engine is %f Kcal\"%(W);\n",
      "\n",
      "#(ii)Calculation of heat rejected\n",
      "Q2 = (Q1*T0)/T1;\n",
      "print \" ii)The heat rejected is %f Kcal\"%(Q2);\n",
      "\n",
      "#(iii)Calculation of entropy\n",
      "del_S1 = -(Q1/T1);#Change in the entropy of source in Kcal/Kg K\n",
      "del_S2 = Q2/T0;#Change in the entropy of math.sink in Kcal/Kg K\n",
      "del_St = del_S1+del_S2;#Total change in entropy in Kcal/Kg K\n",
      "print \" iii)Total change in entropy is %d confirming that the process is reversible\"%(del_St);\n",
      "\n",
      "#(iv)Calculation of efficiency\n",
      "n = (W/Q1)*100;\n",
      "print \" iv)The efficiency of the heat engine is %f percent\"%(n);\n",
      "#end\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "i)The work output of the heat engine is 103.189493 Kcal\n",
        " ii)The heat rejected is 146.810507 Kcal\n",
        " iii)Total change in entropy is 0 confirming that the process is reversible\n",
        " iv)The efficiency of the heat engine is 41.275797 percent\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.2  Page No : 89"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "#Given\n",
      "T1 = 373.0;#Temperature of the saturated steam in K\n",
      "T2 = 298.0;#Temperature of the saturated water in K\n",
      "#To calculate the total change in entropy and hence determine the reversibility of the process\n",
      "\n",
      "#del_H = del_Q+(V*del_P)\n",
      "#del_H =del_Q; math.since it is a consmath.tant pressure process\n",
      "\n",
      "#From steam table,\n",
      "#enthalpy of saturated steam at 373K is\n",
      "H1 = 6348.5;# in Kcal/Kg\n",
      "#enthalpy of saturated liquid water at 373K is\n",
      "H2 = 99.15;#in Kcal/Kg\n",
      "Q = H2-H1;#heat rejected in Kcal/Kg\n",
      "del_S1 = Q/T1;#change in entropy of the system in Kcal/Kg K\n",
      "del_S2 = Q/T2;#change in entropy of the surronding in Kcal/Kg K\n",
      "del_St = del_S1+del_S2;#total change in the entropy in Kcal/Kg K\n",
      "if(del_St == 0):\n",
      "    print \"Process is reversible\";\n",
      "else:\n",
      "    print \"Process is irreversible\";\n",
      "#end\n",
      "#end\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Process is irreversible\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.3  Page No : 91"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "#Given\n",
      "Cp = 0.09;#specific heat of metal block in Kcal/Kg K\n",
      "m = 10.0;#mass of metal block in Kg\n",
      "T1 = 323.0;#initial temperature of the block in K\n",
      "T2 = 298.0;#final temperature of the block in K\n",
      "#consmath.tant pressure process\n",
      "#To find out entropy change of block,air and total entropy change\n",
      "\n",
      "#(i)To calculate the entropy change of block\n",
      "del_S1 = m*Cp*math.log(T2/T1);\n",
      "print \"i)Entropy change of block is %f Kcal/Kg K\"%(del_S1);\n",
      "\n",
      "#(ii)To calculate the entropy change of air\n",
      "Q = m*Cp*(T1-T2);#heat absorbed by air = heat rejected by block in Kcal\n",
      "del_S2 = (Q/T2);\n",
      "print \" ii)Entropy change of air is %f Kcal/Kg K\"%(del_S2);\n",
      "\n",
      "#(iii)To calculate the total entropy change\n",
      "del_St = del_S1+del_S2;\n",
      "print \" iii)Total entropy change is %f Kcal/Kg K\"%(del_St);\n",
      "if(del_St == 0):\n",
      "    print \" Process is reversible\";\n",
      "else:\n",
      "    print \" Process is irreversible\";\n",
      "#end\n",
      "#end \n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "i)Entropy change of block is -0.072503 Kcal/Kg K\n",
        " ii)Entropy change of air is 0.075503 Kcal/Kg K\n",
        " iii)Total entropy change is 0.003000 Kcal/Kg K\n",
        " Process is irreversible\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.4  Page No : 94"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "#Given\n",
      "m1 = 10 #mass of metal block in Kg\n",
      "m2 = 50 #mass of water in Kg\n",
      "Cp1 = 0.09 #Specific heat of metal block in Kcal/Kg K\n",
      "Cp2 = 1 #Specific heat of water in Kcal/Kg K\n",
      "T1 = 50 #Initial temperature of block in deg celsius\n",
      "T2 = 25 #Final temperature of block in deg celsius\n",
      "\n",
      "#To calculate the total change in entropy\n",
      "#Heat lost by block = Heat gained by water\n",
      "Tf = ((m1*Cp1*T1)+(m2*Cp2*T2))/((m1*Cp1)+(m2*Cp2)) #final temperature of water in deg celsius\n",
      "Tf1 = Tf+273.16 #final temperature in K\n",
      "del_S1 = m1*Cp1*math.log(Tf1/(T1+273)) #change in entropy of the block in Kcal/K\n",
      "del_S2 = m2*Cp2*math.log(Tf1/(T2+273)) #change in entropy of the block in Kcal/K\n",
      "del_St = del_S1+del_S2\n",
      "print \"The total change entropy is \",\n",
      "print \"%.6f\" %del_St,\n",
      "print \"Kcal/K\"\n",
      "#end\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The total change entropy is  0.030226 Kcal/K\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.5  Page No : 96"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "#Given\n",
      "#Air at 20 deg celsius\n",
      "#P1 = 250;initial pressure in atm\n",
      "#P2 = 10;final pressure after throttling in atm\n",
      "\n",
      "#To calculate the entropy change\n",
      "#According to the given conditions from figure4.5(page no 103)\n",
      "S1 = -0.38;#initial entropy in Kcal/Kg K\n",
      "S2 = -0.15;#final entroy in Kcal/Kg K\n",
      "del_S = S2-S1;\n",
      "print \"Change in entropy for the throttling process is %f Kcal/Kg K\"%(del_S);\n",
      "#From figure 4.6(page no 104), the final temperature is -10 deg celsius\n",
      "#end \n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Change in entropy for the throttling process is 0.230000 Kcal/Kg K\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.7  Page No : 101"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "#Given\n",
      "#Basis: 1 hour\n",
      "m = 10.0;#mass of air in Kg\n",
      "T = 293.0;#Consmath.tant temperature throughout the process in K\n",
      "#P1 = 1;#Initial pressure in atm\n",
      "#P2 = 30;#Final pressure in atm\n",
      "#According to the given data and umath.sing the graph  or figure A.2.7 given in page no 105\n",
      "S1 = 0.02;#Initial entropy in Kcal/Kg\n",
      "S2 = -0.23;#Final entropy in Kcal/Kg\n",
      "H1 = 5.0;#Initial enthalpy in Kcal/Kg\n",
      "H2 = 3.0;#Final enthalpy in Kcal/Kg\n",
      "\n",
      "W = -((H2-H1)+T*(S2-S1))*m*(427/(3600*75.0));\n",
      "print \"The horse power of the compressor is %f hp\"%(W);\n",
      "#end\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The horse power of the compressor is 1.190065 hp\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.8  Page No : 104"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "#Given\n",
      "#Basis: 1 Kg of steam\n",
      "#P1 = 30;Intial pressure in Kgf/cm**2\n",
      "#P2 = 3;Final pressure in Kgf/cm**2\n",
      "#T = 300;#Operating temperature\n",
      "#From figure A.2.8, \n",
      "H1 = 715.0;#Initial enthalpy of steam in Kcal/Kg\n",
      "H2 = 625.0;#Final enthalpy of steam in Kcal/Kg\n",
      "S1 = 1.56;#Initial entropy of steam in Kcal/Kg K\n",
      "S2 = 1.61;#Final entropy of steam in Kcal/Kg K\n",
      "Q = -1.0;#heat loss in Kcal/Kg\n",
      "To = 298;#The lowest surronding temperature in K\n",
      "\n",
      "#To calculate the effectiveness of the process\n",
      "W = (-(H2-H1)+Q);#Actual work output by the turbine in Kcal\n",
      "#The maximum or available work can be calculated from equation 4.14\n",
      "del_B = -((H2-H1)-(To*(S2-S1)));# Maximum work that can be obtained in Kcal\n",
      "E = (W/del_B)*100.0;\n",
      "print \"The effectiveness of the process is %f percent\"%(E);\n",
      "#end\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The effectiveness of the process is 84.842707 percent\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4.9  Page No : 108"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "#Given\n",
      "m = 1.0;#mass of liquid water in Kg\n",
      "T1 = 1350.0;#initial temperature in deg celsius\n",
      "T2 = 400.0;#final temperature in deg celsius\n",
      "Cp = 1.0;#Specific heat of water in Kcal/Kg K\n",
      "Cpg = 0.2;#Specific heat of combustion gases in Kcal/Kg K\n",
      "Hv = 468.35;#Heat of vapourisation at 14 Kgf/cm**2 and 194.16 deg celsius in Kcak/Kg\n",
      "To = 298.0;#Surronding temperature\n",
      "Tb = 194.16+273;#Boiling point of liquid water\n",
      "\n",
      "#To Calculate the maximum work obtained and the entropy change\n",
      "#(i)Calculation of maximum work\n",
      "#Q = del_H = m*Cp*(T2-T1); gas can be assumed to cool at consmath.tant pressure\n",
      "#From equation 4.14 (page no 110)\n",
      "del_B = -((m*Cpg*(T2-T1))-(To*m*Cp*math.log((T2+273)/(T1+273))));\n",
      "print \"i)The maximum work that can be obtained is %f Kcal/Kg of gas\"%(del_B);\n",
      "\n",
      "#(ii)To Calculate the change in entropy\n",
      "del_S =(m*Cp*math.log(Tb/To))+((m*Hv)/Tb);\n",
      "print \"ii)The entropy change per Kg of water is %f\"%(del_S);\n",
      "#end\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "i)The maximum work that can be obtained is -72.325299 Kcal/Kg of gas\n",
        "ii)The entropy change per Kg of water is 1.452126\n"
       ]
      }
     ],
     "prompt_number": 7
    }
   ],
   "metadata": {}
  }
 ]
}