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
|
{
"metadata": {
"name": "",
"signature": "sha256:8e29dcea16eab605fcf93b95197200be339c1be6076d5413e7d70418a9a6df29"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter5:THE FIRST LAW OF THERMODYNAMICS"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex5.1:pg-131"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#example 1\n",
"#calculating height\n",
"\n",
"m=1100 #mass of car in kg\n",
"ke=400 #kinetic energy of car in kJ\n",
"V=(2*ke*1000/m)**0.5 #velocity of car in m/s\n",
"g=9.807 #acc. due to gravity in m/s^2\n",
"H=ke*1000/(m*g) #height to which the car should be lifted so that its potential energy equals its kinetic energy\n",
"print\"hence,the car should be raised to a height is\",round(H,1),\"m\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"hence,the car should be raised to a height is 37.1 m\n"
]
}
],
"prompt_number": 3
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex5.2:pg-134"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#example 2\n",
"#change in internal energy\n",
"\n",
"W=-5090 #work input to paddle wheel in kJ\n",
"Q=-1500 #heat transfer from tank in kJ\n",
"dU=Q-W #change in internal energy in kJ\n",
"print\"hence,change in internal energy is\",round(dU),\"kj\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"hence,change in internal energy is 3590.0 kj\n"
]
}
],
"prompt_number": 5
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex5.3:pg-134"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#example 3\n",
"#analysis of energy transfer\n",
"\n",
"g=9.806 #acceleration due to gravity in m/s^2\n",
"m=10 #mass of stone in kg\n",
"H1=10.2 #initial height of stone above water in metres\n",
"H2=0 #final height in metres\n",
"dKE1=-m*g*(H2-H1) #change in kinetic energy when stone enters state 2 in J\n",
"dPE1=-1 #change in potential energy when stone enters state 2 in J\n",
"print\"\\n hence,when stone is \",round(dKE1),\"J\"\n",
"print\"\\n and change in potential energy is \",round(dPE1),\"J\"\n",
"dPE2=0 #change in potential energy when stone enters state 3 in JQ2=0 //no heat transfer when stone enters state 3 in J\n",
"W2=0 #no work done when stone enters state 3 in J\n",
"dKE2=-1 #change in kinetic energy when stone enters state 3\n",
"dU2=-dKE2 #change in internal energy when stone enters state 3 in J\n",
"print\"\\n hence,when stone has just come to rest in the bucket is \",round(dKE2),\"J\" \n",
"print\"\\n and dU is\",round(dU2),\"J\" \n",
"dKE3=0 #change in kinetic energy when stone enters state 4\n",
"dPE=0 #change in potential energy when stone enters state 4 in J\n",
"W3=0 #no work done when stone enters state 4 in J\n",
"dU3=-1 #change in internal energy when stone enters state 4 in J\n",
"Q3=dU3 #heat transfer when stone enters state 4 in J\n",
"print\"\\n hence,when stone has entered state 4 is\",round(dU3),\"J\" \n",
"print\"\\n and Q3 is \",round(Q3),\"J\" "
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
" \n",
" hence,when stone is 1000.0 J\n",
"\n",
" and change in potential energy is -1.0 J\n",
"\n",
" hence,when stone has just come to rest in the bucket is -1.0 J\n",
"\n",
" and dU is 1.0 J\n",
"\n",
" hence,when stone has entered state 4 is -1.0 J\n",
"\n",
" and Q3 is -1.0 J\n"
]
}
],
"prompt_number": 7
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex5.4:pg-136"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#example 4\n",
"#Determinig the missing properties \n",
"\n",
"T1=300 #given temp. in Celsius\n",
"u1=2780 #given specific internal enrgy in kJ/kg\n",
"print\"From steam table, at T=300 C,ug=2563.0 kJ/kg.So,u1>ug ,it means the state is in the superheated vapor region.So, by interplotation,we find P=1648 kPa and v=0.1542 m^3/kg\" #hiven pressure in kPa\n",
"u2=2000 #given specific intrernal energy in kJ/kg\n",
"print\"at P=2000 kPa\"\n",
"uf=906.4 #in kJ/kg\n",
"ug=2600.3 #in kJ/kg \n",
"x2=(u2-906.4)/(ug-uf) \n",
"print\"Also, under the given conditions\"\n",
"vf=0.001177 #in m^3/kg \n",
"vg=0.099627 #in m^3/kg\n",
"v2=vf+x2*(vg-vf)#Specific volume for water in m^3/kg\n",
"print\"\\n hence,specific volume for water is \",round(v2,5),\"m^3/kg\" \n",
"print\"\\n Therefore ,this state is \",round(x2,4),\"N\" "
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"From steam table, at T=300 C,ug=2563.0 kJ/kg.So,u1>ug ,it means the state is in the superheated vapor region.So, by interplotation,we find P=1648 kPa and v=0.1542 m^3/kg\n",
"at P=2000 kPa\n",
"Also, under the given conditions\n",
"\n",
" hence,specific volume for water is 0.06474 m^3/kg\n",
"\n",
" Therefore ,this state is 0.6456 N\n"
]
}
],
"prompt_number": 12
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex5.5:pg-138"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#example 5\n",
"#calculating heat transfer for the given process\n",
"\n",
"Vliq=0.05 #volume of saturated liquid in m^3\n",
"vf=0.001043 #in m^3/kg\n",
"Vvap=4.95 #volume of saturated water vapour in m^3\n",
"vg=1.6940 #in m^3/kg\n",
"m1liq=Vliq/vf #mass of liquid in kg\n",
"m1liq=round(m1liq,2)\n",
"m1vap=Vvap/vg #mass of vapors in kg\n",
"m1vap=round(m1vap,2)\n",
"u1liq=417.36 #specific internal energy of liquid in kJ/kg\n",
"u1vap=2506.1 #specific internal energy of vapors in kJ/kg\n",
"U1=m1liq*u1liq + m1vap*u1vap #total internal energy in kJ\n",
"m=m1liq+m1vap #total mass in kg\n",
"V=5.0 #total volume in m^3\n",
"v2=V/m #final specific volume in m^3/kg\n",
"print\"by interplotation we find that for steam, if vg=0.09831 m^3/kg then pressure is 2.03 Mpa\"\n",
"u2=2600.5 #specific internal energy at final state in kJ/kg\n",
"U2=m*u2 #internal energy at final state in kJ\n",
"Q=U2-U1 #heat transfer for the process in kJ\n",
"print\"\\n hence,heat transfer for the process is\",round(Q),\"kJ\" "
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"by interplotation we find that for steam, if vg=0.09831 m^3/kg then pressure is 2.03 Mpa\n",
"\n",
" hence,heat transfer for the process is 104935.0 kJ\n"
]
}
],
"prompt_number": 36
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex5.6:pg-143"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#example 6\n",
"#calculating work and heat transfer for the process\n",
"\n",
"V1=0.1 #volume of cylinder in m^3\n",
"m=0.5 #mass of steam in kg\n",
"v1=V1/m #specific volume of steam in m^3/kg\n",
"vf=0.001084 #m^3/kg\n",
"vfg=0.4614 #m^3/kg\n",
"x1=(v1-vf)/vfg #quality\n",
"hf=604.74 #kJ/kg\n",
"hfg=2133.8#kJ/kg\n",
"h2=3066.8 #final specific heat enthalpy in kJ/kg\n",
"h1=hf+x1*hfg #initial specific enthalpy in kJ/kg\n",
"Q=m*(h2-h1) #heat transfer for this process in kJ\n",
"P=400 #pressure inside cylinder in kPa\n",
"v2=0.6548 #specific enthalpy in m^3/kg\n",
"W=m*P*(v2-v1) #work done for the process in kJ\n",
"print\"\\n hence, work done for the process is\",round(W),\"kJ\" \n",
"print\"\\n and heat transfer is \",round(Q,1),\"kJ\" "
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
" hence, work done for the process is 91.0 kJ\n",
"\n",
" and heat transfer is 771.1 kJ\n"
]
}
],
"prompt_number": 38
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex5.8:pg-151"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#example 8\n",
"#calculating change in enthalpy\n",
"import math\n",
"\n",
"h1=273.2 #specific heat enthalpy for oxygen at 300 K\n",
"h2=1540.2 #specific heat enthalpy for oxygen at 1500 K\n",
"T1=300 #initial temperature in K\n",
"T2=1500 #final temparature in K\n",
"\n",
"dh1=h2-h1 #this change in specific heat enthalpy is calculated using ideal gas tables \n",
"dh3=0.922*(T2-T1) #it is claculated if we assume specific heat enthalpy to be constant and uses its value at 300K\n",
"dh4=1.0767*(T2-T1) #it is claculated if we assume specific heat enthalpy to be constant and uses its value at 900K i.e mean of initial and final temperature\n",
"print\"\\n Hence,change in specific heat enthalpy if ideal gas tables are used is \",round(dh1,1),\"kJ/kg\"\n",
"print\"\\n if specific heat is assumed to be constant and using its value at T1 is\",round(dh3,1),\"kJ/kg\"\n",
"print\"\\n if specific heat is assumed to be constant at its value at (T1+T2)/2 is\",round(dh4,1),\"kJ/kg\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
" Hence,change in specific heat enthalpy if ideal gas tables are used is 1267.0 kJ/kg\n",
"\n",
" if specific heat is assumed to be constant and using its value at T1 is 1106.4 kJ/kg\n",
"\n",
" if specific heat is assumed to be constant at its value at (T1+T2)/2 is 1292.0 kJ/kg\n"
]
}
],
"prompt_number": 4
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex5.9:pg-152"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#example 9\n",
"#determining amount of heat transfer\n",
"\n",
"P=150 #pressure of nitrogen in cylinder in kPa\n",
"V=0.1 #initial volume of cylinder in m^3\n",
"T1=25 #initial temperature of nitrogen in celsius\n",
"T2=150 #final tempareture of nitrogen in celsius\n",
"R=0.2968 #in kJ/kg-K\n",
"m=P*V/(R*(T1+273)) #mass of nitrogen in kg\n",
"Cv=0.745 #constant volume specific heat for nitrogen in kJ/kg-K\n",
"W=-20 #work done on nitrogen gas in kJ\n",
"Q=m*Cv*(T2-T1)+W #heat transfer during the process in kJ\n",
"print\"\\n hence,the heat transfer for the above process is\",round(Q,1),\"kJ\" "
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
" hence,the heat transfer for the above process is -4.2 kJ\n"
]
}
],
"prompt_number": 43
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex5.10:pg-155"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#example 10\n",
"#calculating rate of increase of internal energy\n",
"\n",
"W=-12.8*20 #power consumed in J/s\n",
"Q=-10 #heat transfer rate from battery in J/s\n",
"r=Q-W #rate of increase of internal energy\n",
"print\"\\n hence,the rate of increase of internal energy is\",round(r),\"J/s\" "
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
" hence,the rate of increase of internal energy is 246.0 J/s\n"
]
}
],
"prompt_number": 45
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Ex5.11:pg-155"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#example 11\n",
"#rate of change of temperature\n",
"\n",
"Q=1500.0 #power produced by burning wood in J/s\n",
"mair=1 #mass of air in kg\n",
"mwood=5 #mass of soft pine wood in kg \n",
"miron=25 #mass of cast iron in kg\n",
"Cvair=0.717 #constant volume specific heat for air in kJ/kg\n",
"Cwood=1.38 #constant volume specific heat for wood in kJ/kg\n",
"Ciron=0.42 #constant volume specific heat for iron in kJ/kg\n",
"dT=75-20 #increase in temperature in Celsius\n",
"T=(Q/1000)/(mair*Cvair+mwood*Cwood+miron*Ciron) #rate of change of temperature in K/s\n",
"dt=(dT/T)/60 #in minutes\n",
"print\" hence,the rate of change of temperature is\",round(T,4),\"k/s\" \n",
"print\" and time taken to reach a temperature of T is\",round(dt),\"min\" "
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
" hence,the rate of change of temperature is 0.0828 k/s\n",
" and time taken to reach a temperature of T is 11.0 min\n"
]
}
],
"prompt_number": 49
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {},
"outputs": []
}
],
"metadata": {}
}
]
}
|