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
|
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter 2 : First Law of Thermodynamics"
]
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 2.1, Page no:26"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# To find change in internal energy\n",
"\n",
"# Variables\n",
"#Given\n",
"W = -2.25*745.7; \t\t\t#work done on system in J/s\n",
"Q = -3400.*(10.**3)/3600; \t\t\t#heat transferred to the surrounding in J/s\n",
"\n",
"# Calculations\n",
"#To find the change in internal energy\n",
"#Using equation 2.4 (Page no. 26)\n",
"U = Q-W; \t\t\t#change in internal energy in J/s\n",
"\n",
"# Results\n",
"print 'Internal energy of system increases by %f J/s'%U\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Internal energy of system increases by 733.380556 J/s\n"
]
}
],
"prompt_number": 15
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 2.2, Page no:26"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# To find heat liberated work done and change in internal energy\n",
"\n",
"#Given\n",
"T = 298.; \t\t\t#temperature in K\n",
"P = 101.; \t \t\t#pressure in kPa\n",
"n_iron = 2.; \t\t\t#moles of iron reacted\n",
"Q = -831.08; \t\t\t#heat liberated in kJ\n",
"R = 8.314; \t\t \t#ideal gas constant\n",
"\n",
"# Calculations and Results\n",
"#To find heat liberated work done and change in internal energy\n",
"print 'Heat liberated during the reaction is %f kJ'%Q\n",
"n_oxygen = 1.5; \t\t\t#moles of oxygen reacted\n",
"\n",
"#Using ideal gas equation P(Vf-Vi)=nRT and W=P(Vf-Vi)\n",
"W = -1.5*R*T; \t\t \t#work done by system in J\n",
"\n",
"#Using equation 2.4 (Page no. 26)\n",
"U = (Q*10**3)-W; \t\t\t#change in internal energy in J\n",
"print 'Work done by gas is %f J'%W\n",
"print 'Change in internal energy is %6.3e J'%U\n",
"\n",
"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Heat liberated during the reaction is -831.080000 kJ\n",
"Work done by gas is -3716.358000 J\n",
"Change in internal energy is -8.274e+05 J\n"
]
}
],
"prompt_number": 16
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 2.3, Page no:27"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# To find the heat energy dissipated by brakes\n",
"\n",
"# Variables\n",
"#Given\n",
"u = 20.; \t\t\t#speed of car in m/s\n",
"z = 30.; \t\t\t#height vertically above the bottom of hill in m\n",
"m = 1400.; \t\t\t#mass of car in kg\n",
"g = 9.81; #acceleration due to gravity \n",
"\n",
"# Calculations\n",
"#To find the heat energy dissipated by brakes\n",
"#Using equation 2.3 (Page no. 26)\n",
"KE = -0.5*m*(u**2); \t\t\t#change in kinetic energy in J\n",
"PE = -m*g*z; \t \t\t#change in potential energy in J\n",
"Q = -(KE+PE); \t\t\t#heat dissipated by brakes in J\n",
"\n",
"# Results\n",
"print 'Heat dissipated by brakes is %3.2e J'%Q\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Heat dissipated by brakes is 6.92e+05 J\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 2.4, Page no:27"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# To find internal energy change during each step and work done during adiabatic process\n",
"\n",
"# Variables\n",
"#Given:\n",
"#For step 1\n",
"W1 = -50.; \t\t\t#work received in J\n",
"Q1 = -25.; \t\t\t#heat gven out in J\n",
"\n",
"# Calculations and Results\n",
"U1 = Q1-W1; \t\t\t#internal energy change in J\n",
"print 'Change in internal energy for constant pressure process is %i J'%U1\n",
"\n",
"#For step 2\n",
"W2 = 0.; \t\t\t#work done for constant volume process is zero\n",
"Q2 = 75.; \t\t\t#heat received in J\n",
"U2 = Q2; \t\t\t#internal energy change in J\n",
"print 'Change in internal energy for constant volume process is %i J'%U2\n",
"\n",
"#For step 3\n",
"Q3 = 0.; \t\t\t#no heat exchange in adiabatic process\n",
"#Since the process is cyclic\n",
"#U3+U2+U1 = 0;\n",
"U3 = -(U1+U2);\n",
"W3 = -U3; \t\t\t#work done in J\n",
"print 'Work done during adiabatic process is %i J'%W3\n",
"\n",
"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Change in internal energy for constant pressure process is 25 J\n",
"Change in internal energy for constant volume process is 75 J\n",
"Work done during adiabatic process is 100 J\n"
]
}
],
"prompt_number": 18
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 2.5, Page no:29"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# To find change in internal energy and enthalpy\n",
"\n",
"# Variables\n",
"#Given:\n",
"n_water = 10.**3; \t\t\t#moles of water\n",
"T = 373.; \t\t\t #tempearture(K)\n",
"P = 101.3; \t\t\t #pressure(kPa)\n",
"sv_liquid = 0.00104; \t\t#specific volume of liquid(m**3/kmol)\n",
"sv_vapour = 1.675; \t\t\t#specific volume of vapour(m**3/kmol)\n",
"Q = 1.03*10**3; \t\t\t#heat added in kJ\n",
" \n",
"#To find change in internal energy and enthalpy\n",
"W = P*n_water*(sv_vapour-sv_liquid)*10**-3; \t\t\t#expansion work done in kJ\n",
"U = Q-W; \t\t\t #change in internal energy in kJ\n",
"#For constant pressure process\n",
"H = Q; \t\t\t #enthalpy change in kJ\n",
"\n",
"# Results\n",
"print 'Change in internal energy is %f kJ'%U\n",
"print 'Change in enthalpy is %3.2e J'%H\n",
"\n",
"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Change in internal energy is 860.427852 kJ\n",
"Change in enthalpy is 1.03e+03 J\n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 2.6, Page no:29"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# To find internal energy of saturated liquid and internal energy and enthalpy of saturated vapour\n",
"\n",
"# Variables\n",
"#Given:\n",
"T = 233.; \t\t\t #temperature in K\n",
"VP = 1.005*10**3; \t\t\t #vapour pressure of CO2 in kPa\n",
"sv_liquid = 0.9*10**-3; \t\t\t#specific volume of liquid CO2 in m**3/kg\n",
"sv_vapour = 38.2*10**-3; \t\t\t#specicific volume of CO2 vapour in m**3/kg\n",
"L = 320.5; \t\t\t #latent heat of vaporisation of CO2 in kJ/kg\n",
"#Assuming at these conditions CO2 is saturated liquid so\n",
"H1 = 0; \t\t\t #enthalpy in liquid state\n",
"\n",
"# Calculations\n",
"#To find internal energy of saturated liquid and internal energy and enthalpy of saturated vapour\n",
"#For saturated liquid\n",
"U1 = H1-(VP*sv_liquid); \t\t\t# internal energy in liquid state in kJ/kg\n",
"#For saturated vapour\n",
"Hv = H1+L; \t\t\t #enthalpy of saturated vapour in kJ/kg\n",
"Uv = Hv-(VP*sv_vapour); \t\t\t#internal energy in vapour state in kJ/kg\n",
"\n",
"# Results\n",
"print 'Internal Energy of saturated liquid is %f kJ/kg'%U1\n",
"print 'Enthalpy of vapour state is %f kJ/kg'%Hv\n",
"print 'Internal Energy of vapour state is %f kJ/kg'%Uv\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Internal Energy of saturated liquid is -0.904500 kJ/kg\n",
"Enthalpy of vapour state is 320.500000 kJ/kg\n",
"Internal Energy of vapour state is 282.109000 kJ/kg\n"
]
}
],
"prompt_number": 20
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 2.7, Page no:30"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# To calculate molar internal energy change and molar enthalpy change\n",
"\n",
"# Variables\n",
"#Given:\n",
"I = 0.5; \t\t\t#current in Amperes\n",
"V = 12.; \t\t\t#voltage in volts\n",
"t = 5*60.; \t\t\t#time in sec\n",
"m = 0.798; \t\t\t#mass of water vaporised in g\n",
"M = 18.; \t\t\t#molecular mass of water in g\n",
"R = 8.314*10**-3 #ideal gas constant\n",
"T = 373 #temperature\n",
"\n",
"# Calculations\n",
"#To calculate molar internal energy change and molar enthalpy change\n",
"Q = (I*V*t/1000.); \t\t\t#electric energy supplied in kJ\n",
"#Referring equation 2.10 (Page no. 29)\n",
"H = (Q*M)/m; \t\t\t#molar enthalpy change in kJ/mole\n",
"\n",
"#BY ideal gas equation PV=RT\n",
"#Referring equation 2.9 for constant pressure process (Page no. 29)\n",
"U = H-(R*T); \t\t\t#molar internal energy change in kJ/mole\n",
"\n",
"# Results\n",
"print 'Molar Enthalpy change during the process is %i kJ/mole'%H\n",
"print 'Molar Interanl Energy change during the process is %f kJ/mole'%U\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Molar Enthalpy change during the process is 40 kJ/mole\n",
"Molar Interanl Energy change during the process is 37.500382 kJ/mole\n"
]
}
],
"prompt_number": 3
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 2.8, Page no:32"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# To determine the theoretical horsepower developed\n",
"\n",
"# Variables\n",
"#Given:\n",
"m = 1650.; \t\t\t#mass of steam used in kg/hr\n",
"H1 = 3200.; \t\t\t#enthalpy at 1368 kPa and 645 K in kJ/kg\n",
"H2 = 2690.; \t\t\t#enthalpy at 137 kPa and 645 K in kJ/kg\n",
"\n",
"#To determine the theoretical horsepower developed\n",
"#Using equation 2.13 (Page no.32)\n",
"Q = 0; \t\t\t#since the process is adiabatic\n",
"z = 0; \t\t\t#assuming that inlet and discharge of turbine are at same level\n",
"u = 0; \t\t\t#feed and discharge velocities being equal\n",
"\n",
"# Calculations\n",
"Ws = -(H2-H1);\n",
"Wj = Ws*10**3*m/3600.; \t\t\t#work done by turbine in J\n",
"W = Wj/745.7; \t\t\t#work done by turbine in hp\n",
"\n",
"# Results\n",
"print 'Work done by turbine is %f hp'%W\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Work done by turbine is 313.463859 hp\n"
]
}
],
"prompt_number": 22
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 2.9, Page no:32"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# To find temperature of water delivered to second storage tank\n",
"\n",
"# Variables\n",
"#Given:\n",
"m = 25.*10**3; \t\t#mass flow rate of water in kg/h\n",
"P = 2.; \t\t\t#power supplied by motor in hp\n",
"q = 42000.; \t\t#heat given in kJ/min\n",
"z = 20.; \t\t\t#elevation in m\n",
"T = 368.; \t\t\t#temperature in K\n",
"To = 273.; \t\t\t#standard temperature in K\n",
"Cp = 4.2; \t\t\t#specific heat of water in kJ/kg K\n",
"g = 9.81 #acceleration due to gravity(m/s^2)\n",
"\n",
"# Calculations\n",
"#To find temperature of water delivered to second storage tank\n",
"W = (P*745.7*10**-3*3600)/m; \t\t\t#work done per kg of water pumped in kJ/kg\n",
"Q = q*60./m; \t\t\t #heat given out per kg of fluid\n",
"PE = g*z*10**-3; \t\t\t #change in potential energy in kJ/kg\n",
"\n",
"#Using equation 2.13 (Page no. 32)\n",
"H = -Q+W-PE;\n",
"#H = H2-H1\n",
"H1 = Cp*(T-To);\n",
"H2 = H1+H;\n",
"#Let T1 be the temperature at second storage tank\n",
"T1 = To+(H2/Cp);\n",
"\n",
"# Results\n",
"print 'Temperature of water at second storage tank is %i K'%T1\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Temperature of water at second storage tank is 344 K\n"
]
}
],
"prompt_number": 4
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 2.10, Page no:33"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# To find change in enthalpy and maximum enthalpy change\n",
"\n",
"# Variables\n",
"#Given:\n",
"D1 = 25.; \t\t\t#internal diameter of pipe in mm\n",
"u1 = 10.; \t\t\t#upstream velocity in m/s\n",
"D2 = 50.; \t\t\t#downstream diameter of pipe in mm\n",
"\n",
"# Calculations and Results\n",
"#(a)\n",
"#Let A1 nad A2 be upstream and downstream crosssectional areas of pipe\n",
"u2 = ((D1/D2)**2)*u1; \t\t\t#downstream velocity in m/s\n",
"H = 0.5*(u1**2-u2**2); \t\t\t#change in enthalpy in J/kg\n",
"print 'Change in enthalpy is %f J/kg'%H\n",
"\n",
"#(b)\n",
"#For maximum enthalpy change \n",
"u2 = 0;\n",
"Hmax = 0.5*u1**2; \t\t\t#(J/kg)\n",
"print 'Maximum enthalpy chnage for a sudden enlargement in pipe is %f J/kg'%Hmax\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Change in enthalpy is 46.875000 J/kg\n",
"Maximum enthalpy chnage for a sudden enlargement in pipe is 50.000000 J/kg\n"
]
}
],
"prompt_number": 24
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 2.11, Page no:35"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# To determine heat transfer rates\n",
"\n",
"# Variables\n",
"#At inlet:\n",
"T1 = 293.; \t\t\t#Temperature(K)\n",
"P1 = 300+136.8; \t\t\t#Pressure(kPa)\n",
"#At exit:\n",
"T2 = 453.; \t\t\t#Temperature(K)\n",
"P2 = 136.8; \t\t\t#Pressure(kPa)\n",
"Cp = 29.4; \t \t\t#specific heat capacity at constant pressure in kJ/kmol\n",
"m = 1000.; \t\t \t#mass of hydrogen in kg\n",
"M = 2.02; \t\t\t #molecular mass of hydrogen\n",
"\n",
"# Calculations\n",
"#To determine heat transfer rates\n",
"#Neglecting the kinetic nd potential energy changes\n",
"#Assuming the process to be occuring through a number of steps\n",
"#Step 1 be isothermal and step 2 be isobaric\n",
"H1 = 0; \t\t\t#change in enthalpy for step 1\n",
"H2 = (m/M)*Cp*(T2-T1)/1000; \t\t\t#change in enthalpy for step 2 in kJ\n",
"H = H2+H1;\n",
"Q = H; \t\t\t#heat transferred in coils in kJ\n",
"\n",
"# Results\n",
"print 'Heat transferred in coils is %f kJ'%Q\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Heat transferred in coils is 2328.712871 kJ\n"
]
}
],
"prompt_number": 25
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 2.12, Page no:35"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# To find change in internal energy enthalpy heat supplied and work done\n",
"\n",
"#Given:\n",
"m = 10.; \t\t\t#mass of air in kg\n",
"P1 = 100.; \t\t\t#initial pressure(kPa)\n",
"T1 = 300.; \t\t\t#initial temperature(K)\n",
"T2 = 600.; \t\t\t#final temperature(K)\n",
"R = 8.314; \t\t\t#ideal gas constant(kJ/kmol K)\n",
"Cp = 29.099;\t\t#specific heat capacity at constant pressure (kJ/kmol K)\n",
"Cv = 20.785;\t\t#specific heat capacity at constsant volume (kJ/kmol K)\n",
"M = 29.; \t\t\t#molecular weight of air\n",
"\n",
"# Calculations and Results\n",
"#To determine change in internal energy enthalpy heat supplied and work done\n",
"n = m/M; \t \t\t#number of moles of gas(kmol)\n",
"V1 = (n*R*T1)/P1; \t\t\t#initial volume of air (m**3)\n",
"\n",
"#(a)\n",
"#Constant volume process\n",
"V2 = V1 \t\t\t#final volume\n",
"#Change in internal energy U = n*intg(CvdT)...so\n",
"U = n*Cv*(T2-T1); \t\t\t#change in internal energy(kJ)\n",
"Q = U; \t\t\t #heat supplied(kJ)\n",
"W = 0; \t\t\t #work done\n",
"H = U+(n*R*(T2-T1)); \t\t#change in enthalpy(kJ)\n",
"print 'For constant volume process'\n",
"print 'Change in internal energy is %i kJ'%U\n",
"print 'Heat supplied is %i kJ'%Q\n",
"print 'Work done is %i kJ'%W\n",
"print 'Change in enthalpy is %i kJ'%H\n",
"\n",
"# (b)\n",
"# Constant pressure process\n",
"# Change in enthalpy H = n*intg(CpdT)...so \n",
"H = n*Cp*(T2-T1); \t\t\t#change in enthalpy(kJ)\n",
"Q = H;\t\t\t#heat supplied(kJ)\n",
"U = H-(n*R*(T2-T1));\t\t\t#change in internal energy(kJ)\n",
"W = Q-U; \t\t\t#work done(kJ)\n",
"print 'For constant pressure process'\n",
"print 'Change in internal energy is %i kJ'%U\n",
"print 'Heat supplied is %i kJ'%Q\n",
"print 'Work done is %i kJ'%W\n",
"print 'Change in enthalpy is %i kJ'%H\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"For constant volume process\n",
"Change in internal energy is 2150 kJ\n",
"Heat supplied is 2150 kJ\n",
"Work done is 0 kJ\n",
"Change in enthalpy is 3010 kJ\n",
"For constant pressure process\n",
"Change in internal energy is 2150 kJ\n",
"Heat supplied is 3010 kJ\n",
"Work done is 860 kJ\n",
"Change in enthalpy is 3010 kJ\n"
]
}
],
"prompt_number": 26
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 2.13, Page no:36\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# To determine change in internal energy and change in enthalpy\n",
"\n",
"# Variables\n",
"#Given:\n",
"R = 8.314; \t\t\t#ideal gas constant(kJ/kmol K)\n",
"Cv = 20.8; \t\t\t#specific heat capacity at constant volume(kJ/kmol K)\n",
"Cp = 29.1; \t\t\t#specific heat capacity at constant pressure(kJ/kmol K)\n",
"P1 = 10.; \t\t\t#initial pressure(bar)\n",
"T1 = 280.; \t\t\t#initial temperature in K\n",
"P2 = 1.; \t\t\t#final pressure(bar)\n",
"T2 = 340.; \t\t\t#final temperature(K)\n",
"\n",
"# Calculations\n",
"#To determine the change in internal energy and change in enthalpy\n",
"#Solution\n",
"n = 1 \t\t\t#basis: 1 kmol of ideal gas\n",
"V1 = (n*R*T1)/(P1*100); \t\t\t#initial volume in m**3\n",
"V2 = (n*R*T2)/(P2*100); \t\t\t#final volume in m**3\n",
"\n",
"Po = P2; \n",
"Vo = V1;\n",
"To = (Po*100*Vo)/(n*R);\n",
"U1 = Cv*(To-T1);\n",
"H1 = U1+(V1*100*(P2-P1));\n",
"W1 = 0;\n",
"Q1 = U1;\n",
"\n",
"H2 = Cp*(T2-To);\n",
"U2 = H2-100*(V2-V1);\n",
"Q2 = H2;\n",
"W2 = Q2-U2;\n",
"#For actual process\n",
"U = U1+U2; \t\t\t#change in internal energy(kJ)\n",
"H = H1+H2; \t\t\t#change in enthalpy(kJ)\n",
"\n",
"# Results\n",
"print 'Change in internal energy is %f kJ'%U\n",
"print 'Change in enthalpy is %f kJ'%H\n",
"\n",
"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Change in internal energy is 1243.632000 kJ\n",
"Change in enthalpy is 1742.472000 kJ\n"
]
}
],
"prompt_number": 27
}
],
"metadata": {}
}
]
}
|