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
|
{
"metadata": {
"name": "",
"signature": "sha256:93240c9461961fb318dd0bfb1fd759f5d83f741dfd8a4a76ea2b51b81a776bec"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter 1 : Fundamentals"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 1.1 Page No : 8"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# variables\n",
"T = 80.;\t\t#temperature of chlorine gas in degree F\n",
"p = 100.;\t\t#pressure in psia\n",
"W = 2*35.45;\t\t#molecular weight of chlorine \n",
"\n",
"# calculations \n",
"R = 1545/W;\t\t#specific gas constant in ft-lb/lb-degreeR\n",
"gam = p*(144/R)*(1/(460+T));\t\t#specific weight of chlorine in lb/cuft\n",
"Spec_vol = 1/gam;\t\t#specific volume in cuft/lb\n",
"rho = gam/32.2;\t\t#density of chlorine in slug/cuft\n",
"\n",
"# results \n",
"print 'Specific weight = %.3f lb/cuft \\nSpecific volume = %.3f cuft/lb \\ndensity = %.4f slug/cuft'%(gam,Spec_vol,rho);"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Specific weight = 1.224 lb/cuft \n",
"Specific volume = 0.817 cuft/lb \n",
"density = 0.0380 slug/cuft\n"
]
}
],
"prompt_number": 3
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 1.2 Page No : 12"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"import math \n",
"\n",
"# variables\n",
"gamma = 1.4;\n",
"T1 = 60.;\t\t#temperature of air in degree F\n",
"p1 = 14.7;\t\t#pressure in psia\n",
"k = 0.5;\t\t#(final volume/initial volume) = k\n",
"R = 53.3;\t\t#Engineering gas constant\n",
"\n",
"# calculations \n",
"gam1 = p1*(144/R)*(1/(460+T1));\t\t#lb/cuft\n",
"gam2 = gam1/k;\t\t#lb/cuft\n",
"p2 = (p1/(gam1**(gamma)))*(gam2**(gamma));\t\t# in psia\n",
"T2 = p2*(144/R)*(1/gam2);\t\t#in degree F\n",
"a1 = math.sqrt(gamma*32.2*R*(460+T1));\t\t# in fps\n",
"a2 = math.sqrt(gamma*32.2*R*(T2));\t\t# in fps\n",
"\n",
"# results \n",
"print 'Final pressure = %.1f psia \\\n",
"\\nFinal temperature = %d degreeR \\\n",
"\\nSonic velocity before compression = %d fps \\\n",
"\\nSonic velocity after compression = %.f fps'%(p2,T2,a1,a2);\n",
"\n",
"#the answers differ due to rounding-off errors"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"0.152749314475\n",
"Final pressure = 38.8 psia \n",
"Final temperature = 686 degreeR \n",
"Sonic velocity before compression = 1117 fps \n",
"Sonic velocity after compression = 1284 fps\n"
]
}
],
"prompt_number": 7
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 1.3 Page No : 17"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"import math \n",
"from scipy.integrate import quad \n",
"\n",
"# variables\n",
"r1 = 0.25;\t\t# radius of cylinder in feet\n",
"l = 2.;\t \t#length of cylnider in feet\n",
"r2 = 0.30;\t\t# radius of co-axial cylinder in feet\n",
"mu = 0.018;\t\t#lb-sec/ft**2\n",
"torque = 0.25;\t\t# in ft-lb\n",
"dv_dy1 = torque/(4*math.pi*mu*r1**2);\t\t#velocity gradient at radius = 0.25 in fps/ft\n",
"dv_dy2 = torque/(4*math.pi*mu*r2**2);\t\t#velocity gradient at radius = 0.30 in fps/ft\n",
"\n",
"# calculations \n",
"def f4(r): \n",
"\t return -torque/(4*math.pi*mu*r**2)\n",
"\n",
"V1 = quad(f4,r2,r1)[0]\n",
"\n",
"rpm1 = V1*60/(2*math.pi*r1);\n",
"V2 = torque*(r2-r1)/(4*math.pi*mu*r1**2);\t\t#in fps\n",
"rpm2 = V2*60/(2*math.pi*r1);\n",
"hp = 2*math.pi*r1*(rpm1/(550*60));\n",
"\n",
"# results \n",
"print 'Velocity gradient at the inner cylinder wall is %.1f fps/ft and at the outer cylinder wall is %.1f fps/ft'%(dv_dy1,dv_dy2);\n",
"print 'rpm = %.1f and approximate rpm = %.1f, hp = %.5f '%(rpm1,rpm2,hp);"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Velocity gradient at the inner cylinder wall is 17.7 fps/ft and at the outer cylinder wall is 12.3 fps/ft\n",
"rpm = 28.1 and approximate rpm = 33.8, hp = 0.00134 \n"
]
}
],
"prompt_number": 10
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 1.4 Page No : 20"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"# variables\n",
"T = 70. \t\t#degreeF\n",
"del_p = 0.1;\t\t# in psi\n",
"sigma = 0.00498;\t\t# lb/ft\n",
"\n",
"# calculations \n",
"R = (sigma*2)/(del_p*144);\t\t#in ft\n",
"d = 12*2*R;\t\t# in inches\n",
"\n",
"# results \n",
"print 'Diameter of the droplet of water = %.4f in'%(d);"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Diameter of the droplet of water = 0.0166 in\n"
]
}
],
"prompt_number": 11
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 1.5 Page No : 20"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"import math \n",
"\n",
"# variables\n",
"l = 12.;\t\t# length of the cylinder\n",
"T = 150.;\t\t#temperature of water in degreeF\n",
"p1 = 14.52;\t\t#atmospheric pressure in psia\n",
"p2 = 3.72;\t\t#the pressure on the inside of the piston in psia\n",
"\n",
"# calculations \n",
"F = 0.25*(p1-p2)*math.pi*l**2;\t\t#Force on the piston in lb\n",
"\n",
"# results \n",
"print 'Minimum force on the piston to be applied is, F = %d lb'%(F);\n",
"\n",
"#incorrect answer given in textbook"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Minimum force on the piston to be applied is, F = 1221 lb\n"
]
}
],
"prompt_number": 12
}
],
"metadata": {}
}
]
}
|