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
|
{
"metadata": {
"name": "",
"signature": "sha256:64b2bde681c49f44be3d13a15f35c64ef003a99e40d1652062b755d6b3ba1ad3"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter 4 : molecular transport and the general property balance"
]
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 4.1 - Page No :99\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"import math\n",
"\n",
"# Variables\n",
"# given\n",
"id_ = 2.067; \t\t\t #[in] - inside diameter\n",
"t = 0.154; \t\t\t #[in] - wall thickness\n",
"od = id_+2*t; \t\t\t #[in] - outer diameter\n",
"a = 1.075; \t\t\t #[in**2] - wall sectional area of metal\n",
"A = a*(1./144); \t\t #[ft**2] - wall sectional area of metal in ft**2\n",
"deltaz = 5./12; \t\t #[ft] - length of transfer in z direction\n",
"T2 = 10+273.15; \t\t #[K] - temperature at the top\n",
"T1 = 0+273.15; \t\t #[K] - temperature at the bottom\n",
"q = -3.2; \t\t\t #[Btu/hr] - heat transferred\n",
"\n",
"# Calculations\n",
"deltaT = (T2-T1)+8; \t\t\t #[degF]\n",
"k = round(-(q/A)/(deltaT/deltaz),2);\n",
"\n",
"# Results\n",
"print \"Thermal conductivity = %.2f Btu h**-1 ft**-1 degF**-1\"%(k);\n",
"Alm = round((2*math.pi*deltaz*((od-id_)/(2*12)))/math.log(od/id_),3); \t\t\t #[ft**2] log-mean area\n",
"kincorrect = round(k*(A/Alm),3);\n",
"print \"kincorrect = %.3f Btu h**-1 ft**-1 degF**-1 \"%(kincorrect);\n",
"print \"The error is a factor of %.1f\"%(32.4)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Thermal conductivity = 9.92 Btu h**-1 ft**-1 degF**-1\n",
"kincorrect = 0.306 Btu h**-1 ft**-1 degF**-1 \n",
"The error is a factor of 32.4\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 4.2 - Page No :100\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"import math \n",
"\n",
"\n",
"# Variables\n",
"# given\n",
"T1 = 0.; \t\t\t #[degC]\n",
"T2 = 10.; \t \t\t #[degC]\n",
"km = 17.17; \t\t\t #[W/m*K]\n",
"l = 1.; \t\t \t #[m]\n",
"r2 = 1.1875;\n",
"r1 = 1.0335;\n",
"deltaT = T1-T2;\n",
"\n",
"# Calculations\n",
"# umath.sing the formula Qr = -km*((2*pi*l)/ln(r2/r1))*deltaT;\n",
"Qr = -km*((2*math.pi*l)/math.log(r2/r1))*deltaT;\n",
"\n",
"# Results\n",
"print \"Heat loss = %.0f W \\nThe plus sign indicates that the heat flow is radially out from the center\"%(Qr);\n",
"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Heat loss = 7767 W \n",
"The plus sign indicates that the heat flow is radially out from the center\n"
]
}
],
"prompt_number": 3
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 4.3 - Page No :100\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"\n",
"# Variables\n",
"# given\n",
"km = 9.92; \t \t\t #[Btu/h*ft*degF]\n",
"Alm = round(0.242*(12./5),3); \t\t\t #[ft**2]\n",
"T1 = 0.; \t\t\t #[degC]\n",
"T2 = 10.; \t\t\t #[degC]\n",
"deltaT = (T1-T2)*1.8; \t\t\t #[degF]\n",
"r2 = 1.1875;\n",
"r1 = 1.0335;\n",
"deltar = round((r2-r1)/12,3); \t\t\t #[ft]\n",
"\n",
"# Calculations\n",
"# using the formula Qr/Alm = -km*(deltaT/deltar)\n",
"Qr = (-km*Alm*(deltaT/deltar));\n",
"\n",
"# Results\n",
"print \" qr by log-mean area method = %.0f Btu/h\"%(Qr);\n",
"\n",
"\n",
"# in SI units \n",
"Alm = 0.177; \t\t\t #[m**2]\n",
"T1 = 0; \t\t\t #[degC]\n",
"T2 = 10; \t\t\t #[degC]\n",
"km = 17.17; \t\t\t #[W/m*K]\n",
"r2 = 1.1875;\n",
"r1 = 1.0335;\n",
"deltaT = T1-T2;\n",
"deltar = (r2-r1)*0.0254; \t\t\t #[m]\n",
"\n",
"# umath.sing the same formula\n",
"Qr = (-km*(deltaT/deltar))*Alm;\n",
"print \" qr in SI units = %.0f W\"%(Qr);\n",
"\n",
"# Note : Answers are wrong in book. Please calculate manually."
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
" qr by log-mean area method = 7980 Btu/h\n",
" qr in SI units = 7769 W\n"
]
}
],
"prompt_number": 7
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 4.4 - Page No :101\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"from scipy.integrate import quad \n",
"\n",
"# Variables\n",
"# given\n",
"x1 = 0; \t\t\t #[cm]\n",
"x2 = 30; \t\t\t #[cm]\n",
"p1 = 0.3; \t\t\t #[atm]\n",
"p2 = 0.03; \t\t\t #[atm]\n",
"D = 0.164; \t\t\t #[am**2/sec]\n",
"R = 82.057; \t\t\t #[cm**3*atm/mol*K]\n",
"T = 298.15; \t\t\t #[K]\n",
"\n",
"# Calculations\n",
"# using the formula Nax*int(dx/Ax) = -(D/RT)*int(1*dpa)\n",
"def f4(x): \n",
"\t return 1./((math.pi/4)*(10-(x/6))**2)\n",
"\n",
"a = quad(f4,x1,x2)[0]\n",
"\n",
"def f5(p): \n",
"\t return 1\n",
"\n",
"b = quad(f5,p1,p2)[0]\n",
"Nax = -((D/(R*T))*b)/a;\n",
"\n",
"# Results\n",
"print \"Mass transfer rate = %.2e mol/sec = %.2e mol/h \\nthe plus sign indicates diffusion to the right\"%(Nax,Nax*3600);\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Mass transfer rate = 2.37e-06 mol/sec = 8.53e-03 mol/h \n",
"the plus sign indicates diffusion to the right\n"
]
}
],
"prompt_number": 9
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 4.5 - Page No :105\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"from sympy import *\n",
"\n",
"# Variables\n",
"# given\n",
"r = Symbol('r')\n",
"ro = 0.5; \t\t\t #[inch] - outside radius\n",
"ro = 0.0127; \t\t #[m] - outside radius in m\n",
"Tg = 2.*10**7; \t #[J/m**3*sec] - heat generated by electric current\n",
"Tw = 30.; \t\t\t #[degC] - outside surface temperature\n",
"km = 17.3; \t\t #[W/m*K] - mean conductivity\n",
"\n",
"# Calculations\n",
"# using the formula T = Tw+(Tg/4*km)*(ro**2-r**2)\n",
"T = Tw+(Tg/(4*km))*(ro**2-r**2);\n",
"\n",
"# Results\n",
"print \"T = \",T,\n",
"print \" where r is in meters and T is in degC\"\n",
"def t(r):\n",
" return Tw+(Tg/(4*km))*(ro**2-r**2);\n",
"\n",
"print \"At the centre line r = 0, the maximum temperature is %.1f degC. \\\n",
"\\nAt the outside the temperature reduces to the boundary condition value of %.2f degC.\\\n",
"\\nThe distribution is parabolic between these 2 limits\"%(t(0),t(0.0127));\n",
"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"T = -289017.341040462*r**2 + 76.6156069364162 where r is in meters and T is in degC\n",
"At the centre line r = 0, the maximum temperature is 76.6 degC. \n",
"At the outside the temperature reduces to the boundary condition value of 30.00 degC.\n",
"The distribution is parabolic between these 2 limits\n"
]
}
],
"prompt_number": 11
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Example 4.7 - Page No :119\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"import math\n",
"\n",
"# Variables\n",
"# given\n",
"r = 10.**-3; \t\t\t #[m] - radius\n",
"l = 1.; \t\t\t #[m] - length\n",
"Q = 10.**-7; \t\t\t #[m**3/s] - flow rate\n",
"pressure = 1.01325*10**5\n",
"sPage_No = 1.1;\n",
"pwater = 1000.; \t\t #[kg/m**3] - density of water at 4degC\n",
"\n",
"# Calculations\n",
"deltap = round((145 * pressure)/14.696,-4)\n",
"pfluid = sPage_No *pwater;\n",
"mu = abs(r*-(deltap)*(math.pi*r**3))/((4*Q)*(2*l));\n",
"mupoise = mu*10;\n",
"mucentipoise = mupoise*100;\n",
"\n",
"# Results\n",
"print \" mu = %.3f Ns-m**-2 = %.2f poise = %.0f cP\"%(mu,mupoise,mucentipoise);\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
" mu = 3.927 Ns-m**-2 = 39.27 poise = 3927 cP\n"
]
}
],
"prompt_number": 2
}
],
"metadata": {}
}
]
}
|