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
|
{
"metadata": {
"name": "",
"signature": "sha256:e6bfcf139b40c8bb0a720cb8a5d777909d42ae46922a9515532a8aeacdd6716f"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter 02:Properties of Fluids"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2.2-1, Page Number 41"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
" \n",
"#Variable Decleration\n",
"l=6 #Length in m\n",
"b=4 #Breadth in m\n",
"h=5 #Height in m\n",
"R=0.287 #Gas Constant in kPa.m^3/kg.K\n",
"P=100 # pressure in kPa\n",
"T=25 # Temperature in degree Centigrade\n",
"To=273.15 #Temperature conversion in Kelvin\n",
"rho_H2O=1000 #Density of water\n",
"\n",
"#Calculations\n",
"rho=P/(R*(T+To)) #Density in kg/m^3\n",
"SG=rho/rho_H2O #Specific Gravity of Air\n",
"V=l*b*h #Volume of the room in m^3\n",
"m=rho*V #mass of air in kg\n",
"\n",
"#Results\n",
"print\"The density of Air is\", round(rho,2), \"kg/m^3\"\n",
"print\"The Specific Gravity of Air is\",round(SG,5)\n",
"print\"The mass of air is\",round(m),\"kg\"\n",
"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The density of Air is 1.17 kg/m^3\n",
"The Specific Gravity of Air is 0.00117\n",
"The mass of air is 140.0 kg\n"
]
}
],
"prompt_number": 15
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2.2-2, Page Number 42"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#Variable Decleration\n",
"T=30 #Temperature in the System in Degree Centigrade\n",
"#Value from the table for corresponding Temperature\n",
"P=4.25 #Pressure in kPa\n",
"\n",
"#Calculations\n",
"Pmin=P #Minimum Pressure to avoid Cavitation in kPa\n",
"\n",
"#Result\n",
"print\"The minimum pressure required to avoid cavitation is\",Pmin,\"kPa\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The minimum pressure required to avoid cavitation is 4.25 kPa\n"
]
}
],
"prompt_number": 5
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2.2-3, Page No:47"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"#The variables repeat hence a different notation has been used to code the following example\n",
"#Variable Decleration\n",
"T1=20 #Temperature of water Initially in Degree Centigrade\n",
"P1=1 #Pressure initially in atm\n",
"T2=50 #Temperature of water after heating in Degree Centigrade\n",
"P2=100 #Pressure after Compression in atm\n",
"rho=998 # density of water at 1 atm in kg/m^3\n",
"alpha=4.8*10**-5 #isothermal compressibility of water in atm^-1\n",
"beta=0.337*10**-3 #Coefficient of volume expansion at avg temp in K^-1\n",
"\n",
"#Calculations\n",
"\n",
"#Part (a)\n",
"deltarho1=-beta*rho*(T2-T1) #Change in density in kg/m^3\n",
"rho2a=deltarho1+rho #density of water at 50 degrees in kg/m^3\n",
"\n",
"#Part(b)\n",
"deltarho2=alpha*rho*(P2-P1) #Change in density in kg/m^3\n",
"rho2b=rho+deltarho2 #density of water at 100atm and 20 degrees in kg/m^3\n",
"\n",
"#Result\n",
"print\"The density changes to\", round(rho2a),\"kg/m^3 when heated to 50 degrees\"\n",
"print\"The density changes to\",round(rho2b,1),\"kg/m^3 when compressed to 100atm isothermally\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The density changes to 988.0 kg/m^3 when heated to 50 degrees\n",
"The density changes to 1002.7 kg/m^3 when compressed to 100atm isothermally\n"
]
}
],
"prompt_number": 16
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2.2-4, Page No: 50"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#Variable Decleration\n",
"V=200 #Speed of air in m/s\n",
"T=30 #Temperature in degree centigrade\n",
"k=1.4 #Specific Heat Ratio\n",
"R=0.287 #Gas Constant in kJ/kg K\n",
"To=273.15 #Temperature conversion factor\n",
"f=1000 #conversion factor in m^2/s^2\n",
"\n",
"#Calculations\n",
"\n",
"#Part(a)\n",
"c=(k*R*(T+To)*(f))**0.5 #Speed of sound in m/s\n",
"\n",
"#Part(b)\n",
"Ma=V/c #Mach Number\n",
"\n",
"#Result\n",
"print\"The speed of sound in air at 30degrees is\",round(c),\"m/s\"\n",
"print\"The mach number is\",round(Ma,3),\" which is subsonic since Ma<1\"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The speed of sound in air at 30degrees is 349.0 m/s\n",
"The mach number is 0.573 which is subsonic since Ma<1\n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2.2-5, Page No:55"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#Variable Decleration\n",
"L=0.4 #Length of viscometer in m\n",
"T=1.8 #Torque measured in N.m\n",
"l=0.0015 #Gap between the two cylinders in m\n",
"R=0.06 #Radius if inner shaft in m\n",
"ndot=300/60 #speed of the shaft\n",
"\n",
"#Calculations\n",
"mu=(T*l)/(4*pi**2*R**3*ndot*L) #Viscosity in s/m^2\n",
"\n",
"#Result\n",
"print\"The viscosity of the liquid is\",round(mu,3),\"s/m^2\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The viscosity of the liquid is 0.158 s/m^2\n"
]
}
],
"prompt_number": 18
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2.2-6, Page No:59"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#Variable Decleration\n",
"R=0.3*10**-3 #Radius of glass tube in m\n",
"sigma_s=0.073 #Surface Tension in water at 20 degrees in N/m\n",
"phi=0 #Angle made by the water surface in degrees\n",
"g=9.81 #Acceleration due to gravity in m/s^2\n",
"rho=1000 #Density of water in kg/m^3\n",
"\n",
"#Calculations\n",
"h_m=(2*sigma_s*cos(phi))/(rho*g*R) #Capillary rise in m\n",
"h=h_m*100 #Capillary rise in cm\n",
"\n",
"#Result\n",
"print\"The capillary rise is\",round(h),\"cm\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The capillary rise is 5.0 cm\n"
]
}
],
"prompt_number": 21
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example No:2.2-7, Page No:60"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"\n",
"#Variable Decleration\n",
"rho_water=1000 #Density of water in kg/m^3\n",
"g=9.81 #Acceleration due to gravity in m/s^2\n",
"h=0.05 #Capillary Rise in m\n",
"\n",
"#Calculations\n",
"deltaP=(rho_water*g*h)/(1000*100) #Pressure difference in atm\n",
"\n",
"#Result\n",
"print\"The pressure difference is\",round(deltaP,3),\"atm\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The pressure difference is 0.005 atm\n"
]
}
],
"prompt_number": 23
}
],
"metadata": {}
}
]
}
|