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
|
{
"metadata": {
"name": "",
"signature": "sha256:452c6dcc441bc91e8f34d763554249fd3e1009077055510d7afc6705627abbf4"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter12-ideal gas mixtures and humid air"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example1-pg 338"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"#calculate molecular weight of air\n",
"##initialisation of variables\n",
"x= 0.78\n",
"x1= 0.21\n",
"x2= 0.008\n",
"x3= 0.002\n",
"MN2= 28.013 ##gms\n",
"MO2= 32. ##gms\n",
"MAr= 39.948 ##gms\n",
"MH2O= 18.016 ##gms\n",
"##CALCULATIONS\n",
"M= x*MN2+x1*MO2+x2*MAr+x3*MH2O\n",
"##RESULTS\n",
"print'%s %.3f %s'% ('molecular wight of air=',M,'kg/kmol')\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"molecular wight of air= 28.926 kg/kmol\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example2-pg341"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"#calculate average value and mass\n",
"##initialisation of variables\n",
"M= 30.04 ##kg/kmol\n",
"R= 8.3143 ##J/mol K\n",
"p= 100. ##kPa\n",
"V= 0.2 ##m^3\n",
"T= 25. ##C\n",
"##CALCULATIONS\n",
"R1= R/M\n",
"m= p*V/(R1*(273.15+T))\n",
"##RESULTS\n",
"print'%s %.4f %s'% ('average value of R=',R1,'kJ/kg K')\n",
"print'%s %.3f %s'% ('mass=',m,'kg')\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"average value of R= 0.2768 kJ/kg K\n",
"mass= 0.242 kg\n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example3-pg343"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"#calculate final temperature and final pressure and change in entropy\n",
"##initialisation of variables\n",
"m1= 0.5 ##kg\n",
"cv1= 0.6496 ##kJ/kg K\n",
"T1= 80. ##C\n",
"m2= 1. ##kg\n",
"cv2= 0.6299 ##kJ/kg K\n",
"T2= 150. ##C\n",
"M= 32. ##kg\n",
"M1= 44. ##kg\n",
"V1= 0.11437 ##m^3\n",
"V2= 0.1 ##m^2\n",
"R= 8.314 ##J/mol K\n",
"##CALCULATIONS\n",
"T= (m1*cv1*(273.15+T1)+m2*cv2*(273.15+T2))/(m1*cv1+m2*cv2)\n",
"p= ((m1/M)+(m2/M1))*R*T/(V1+V2)\n",
"S= m1*(cv1*math.log(T/(273.15+T1))+(R/M)*math.log((V1+V2)/V1))+m2*(cv2*math.log(T/(273.15+T2))+(R/M1)*math.log((V1+V2)/V2))\n",
"##RESULTS\n",
"print'%s %.1f %s'% ('final temperature=',T,'kPa')\n",
"print'%s %.1f %s'% ('final pressure=',p,'kPa')\n",
"print'%s %.4f %s'% ('change in entropy=',S,'kJ/K')\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"final temperature= 399.3 kPa\n",
"final pressure= 594.0 kPa\n",
"change in entropy= 0.2291 kJ/K\n"
]
}
],
"prompt_number": 3
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example4-pg354\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"#calculate wet-bulb temoerature and minimum temperature and amount of water injected\n",
"##initialisation of variables\n",
"Twb= 22. ##C\n",
"Tmin= 22.3 ##C\n",
"w2= 0.0170 ##kg/kg dry air\n",
"w1= 0.0093 ##kg/kg dry air\n",
"##CALCULATIONS\n",
"m= w2-w1\n",
"##RESULTS\n",
"print'%s %.f %s'% (' wet-bulb temperature=',Twb,'C')\n",
"print'%s %.f %s'% ('minimum temperature=',Tmin,'1C')\n",
"print'%s %.4f %s'% ('amount of water injected=',m,'kg/kg dry air')\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
" wet-bulb temperature= 22 C\n",
"minimum temperature= 22 1C\n",
"amount of water injected= 0.0077 kg/kg dry air\n"
]
}
],
"prompt_number": 4
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example5-pg356"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"#calculate state after mixing\n",
"##initialisation of variables\n",
"w3= 0.0178 ##kg/kgair\n",
"w4= 0.0172 ##kg/kgair\n",
"##CALCULATIONS\n",
"dw= w3-w4\n",
"##RESULTS\n",
"print'%s %.4f %s'% (' state after mixing=',dw,'kg/kgair')\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
" state after mixing= 0.0006 kg/kgair\n"
]
}
],
"prompt_number": 5
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example6-pg357"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"#calculate air mass flow rate and amount of water to be added\n",
"##initialisation of variables\n",
"m= 20000. ##kg/h\n",
"T1= 42. ##C\n",
"T2= 22. ##C\n",
"J= 4.186 ##cal\n",
"h1= 54. ##kJ/kg\n",
"h2= 94.8 ##kJ/kg\n",
"w1= 0.0105 ##kg/h kg\n",
"w2= 0.0244 ##kg/h kg\n",
"##CALCULATIONS\n",
"ma= m*(T1-T2)*J/((h2-h1-J*T2*(w2-w1)))\n",
"mw= ma*(w2-w1)\n",
"m4= m-mw\n",
"##RESULTS\n",
"print'%s %.1f %s'%('air mass flow rate=',ma,'kg/hr')\n",
"print'%s %.f %s'%('amount of water to be added=',m4,'kg/hr')\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"air mass flow rate= 42368.5 kg/hr\n",
"amount of water to be added= 19411 kg/hr\n"
]
}
],
"prompt_number": 6
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example7-pg359"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"#calculate maximum useful work\n",
"##initialisation of variables\n",
"x= 0.79\n",
"P0= 101 ##kPa\n",
"P= 20 ##Mpa\n",
"V= 0.032 ##m^3\n",
"##CALCULATIONS\n",
"p= x*P0\n",
"Wrev= P*10*10*10*V*(math.log(P/(p*math.pow(10,-3)))+((p*math.pow(10,-3))/P)-1)\n",
"##RESULTS\n",
"print'%s %.1f %s'% (' maximum useful work=',Wrev,'kJ')\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
" maximum useful work= 2898.0 kJ\n"
]
}
],
"prompt_number": 7
}
],
"metadata": {}
}
]
}
|