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
|
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter 12: Thermodynamic Property Relations"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 12-1 ,Page No.652"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#from Table A-17\n",
"#cp value approximately by replacing the differentials\n",
"h1=305.22;#in kJ/kg\n",
"T1=305;#in K\n",
"h2=295.17;#in kJ/kg\n",
"T2=295;#in K\n",
"\n",
"#calculations\n",
"#from the given equation we can calculate\n",
"cp=(h1-h2)/(T1-T2);\n",
"print'the cp of air at 300 K %f kJ/ kg - K'%round(cp,3)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"the cp of air at 300 K 1.005000 kJ/ kg - K\n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 12-2 ,Page No.654"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#given data\n",
"dT=302-300;#differnce in final and intial temperatures of air in K\n",
"dv=0.87-0.86;#differnce in final and intial volumnes of air in m^3/kg\n",
"T=(302+300)/2;#average temp in K\n",
"v=(0.87+0.86)/2;#average volumne in m^3/kg\n",
"\n",
"#constants used\n",
"R=0.287;#in kJ/kg-K\n",
"\n",
"#calculations\n",
"#using eq 12-3 by diffrentiating P= R*T/v\n",
"dP= R*dT/v - R*T*dv/v**2;\n",
"print'the change in the pressure of air %f kPa'%round(dP,3)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"the change in the pressure of air -0.491000 kPa\n"
]
}
],
"prompt_number": 4
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 12-5 ,Page No.659"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#given data\n",
"T=20+273.15;#temperature of refrigerant in K\n",
"\n",
"#from Table A\u201311\n",
"vf=0.0008161;#in m^3/kg\n",
"vg=0.035969;#in m^3/kg\n",
"\n",
"#calculations\n",
"#using Eq 12-22\n",
"# hfg= T*vfg*(dP/dT)sat\n",
"#(dP/dT)sat b/w 24 C - 16 C \n",
"dPT=(646.18-504.58)/(24-16);#dP/dT ; values from Table A\u201311\n",
"vfg=vg-vf;\n",
"hfg=T*vfg*dPT;\n",
"print'the value of the enthalpy of vaporization of refrigerant-134a %f kJ/kg'%round(hfg,2)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"the value of the enthalpy of vaporization of refrigerant-134a 182.400000 kJ/kg\n"
]
}
],
"prompt_number": 5
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 12-6 ,Page No.660"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from math import exp\n",
"\n",
"#given data\n",
"T2=-50+460.0;#temperature of refrigerant-134a on R \n",
"\n",
"#constants\n",
"R=0.01946;#in Btu/lbm\n",
"\n",
"#from Table A-11E\n",
"T1=-40+460.0;#converted into R from F\n",
"P1=7.432;\n",
"hfg=97.100;\n",
"\n",
"#calcualation\\\n",
"#using Equation 12\u201324\n",
"#ln(P2/P1)= hfg/R *(1/T1 - 1/T2)\n",
"P2=P1*exp(hfg/R *(1/T1 - 1/T2));\n",
"print'the saturation pressure of refrigerant-134a %f psia'%round(P2,2)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"the saturation pressure of refrigerant-134a 5.560000 psia\n"
]
}
],
"prompt_number": 7
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 12-11 ,Page No.373"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from math import log\n",
"\n",
"#given data\n",
"T1=220;#intial temperature in K\n",
"P1=5;#intial pressure in MPa\n",
"T2=300;#final temperature in K\n",
"P2=10;#final pressure in MPa\n",
"\n",
"#constants used\n",
"Ru=8.314;#on kJ/kmol- K\n",
"\n",
"#from Table A\u20131\n",
"Tcr=154.8;\n",
"Pcr=5.08;\n",
"\n",
"#calculations\n",
"\n",
"#part - a\n",
"print('part - a');\n",
"#by assuming ideal-gas behavior\n",
"#from Table A\u201319\n",
"h1=6404;\n",
"h2=8736;\n",
"s2=205.213;\n",
"s1=196.171;\n",
"h21i=h2-h1;#h2 - h1 ideal\n",
"s21i=(s2-s1)-Ru*log(P2/P1);#s2 - s1 ideal\n",
"print'the enthalpy change %i kJ/kmol'%round(h21i);\n",
"print'the entropy change %f kJ/kmol-K'%round(s21i,2);\n",
"\n",
"#part - b\n",
"print('part - b');\n",
"#by accounting for the deviation from ideal-gas behavior\n",
"TR1=T1/Tcr;\n",
"Pr1=P1/Pcr;\n",
"#from the generalized charts at each state\n",
"Zh1=0.53;\n",
"Zs1=0.25;\n",
"TR2=T2/Tcr;\n",
"Pr2=P2/Pcr;\n",
"#from the generalized charts at each state\n",
"Zh2=0.48;\n",
"Zs2=0.20;\n",
"h21=h21i-Ru*Tcr*(Zh2-Zh1);\n",
"s21=s21i-Ru*(Zs2-Zs1);\n",
"print'the enthalpy change %i in kJ/kmol'%round(h21);\n",
"print'the entropy change %f kJ/kmol-K'%round(s21,2);\n",
"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"part - a\n",
"the enthalpy change 2332 kJ/kmol\n",
"the entropy change 3.280000 kJ/kmol-K\n",
"part - b\n",
"the enthalpy change 2396 in kJ/kmol\n",
"the entropy change 3.690000 kJ/kmol-K\n"
]
}
],
"prompt_number": 1
}
],
"metadata": {}
}
]
}
|