summaryrefslogtreecommitdiff
path: root/Elements_of_thermal_technology_by_John_H._Seely/viscosity.ipynb
blob: 300755290ee124ce878d093ca8ab55d226656ad2 (plain)
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
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 4: viscosity"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 4.1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "SI units (Pa s) =  1.00e-03\n",
      " \n",
      " BE units (lbm/ft s) =  6.73e-02\n",
      " \n",
      " Reyns units (reyn) =  1.45e-05\n",
      "press enter key to exit\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "''"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#At 68F the experimental value of absolute viscosity for water is 1 cp.\n",
    "#What is the equivalent value in (a)SI units (b) BTU and (c)reyns?\n",
    "import math\n",
    "#initialisation of variables\n",
    "V= 1. \t\t\t\t\t\t\t\t#cp\n",
    "#CALCULATIONS\n",
    "#An extra 100 is multiplied to convert poise to lbf s \n",
    "SI= V/100./10. \t\t\t\t\t\t#Pa.s\n",
    "BE= (V*32.2*100/100)/(4.788*100.) \t#lbf s/ft^2\n",
    "RE= V*100/100./(4.788*100*144.) \t#reyn\n",
    "#RESULTS\n",
    "print '%s %.2e' % ('SI units (Pa s) = ',SI)\n",
    "print '%s %.2e' % (' \\n BE units (lbm/ft s) = ',BE)\n",
    "print '%s %.2e' % (' \\n Reyns units (reyn) = ',RE)\n",
    "raw_input('press enter key to exit')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 4.2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "SI Units (m^2/s) =  1.00e-06\n",
      " \n",
      " British Units (ft/s) =  1.08e-05\n",
      "press enter key to exit\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "''"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#Determine the kinematic viscosity of water at 68F in (a)SI units (b) BTU\n",
    "import math\n",
    "#initialisation of variables\n",
    "T= 68 \t\t\t\t\t\t\t#F\n",
    "d= 1.0\t\t\t\t\t \t\t#gm/cm^3\n",
    "mu= math.pow(10,-2) \t\t\t#gm/cm s\n",
    "SIm= math.pow(10,-4) \t\t\t#m^2/s\n",
    "m= 10.76 \t\t\t\t\t\t#ft\n",
    "#CALCULATIONS\n",
    "SI= mu*SIm \t\t\t\t\t\t#kinematic viscosity in SI\n",
    "BU= SI*m \t\t\t\t\t\t#kinematic viscosity in BTU\n",
    "#RESULTS\n",
    "print '%s %.2e' % ('SI Units (m^2/s) = ',SI)\n",
    "print '%s %.2e' % (' \\n British Units (ft/s) = ',BU)\n",
    "raw_input('press enter key to exit')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 4.3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Stoke Units (stoke) =  0.0430\n",
      "press enter key to exit\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "''"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#Determine the kinematic viscosity of 40 SUS oil.\n",
    "import math\n",
    "#initialisation of variables\n",
    "Ku= 40. \t\t\t\t\t\t#SUS\n",
    "#CALCULATIONS\n",
    "SU= 0.0022*Ku-(1.8/Ku) \t\t\t#stoke units\n",
    "#RESULTS\n",
    "print '%s %.4f' % ('Stoke Units (stoke) = ',SU)\n",
    "raw_input('press enter key to exit')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 4.4"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Re=  2.604e+05\n",
      " \n",
      " Re=   2.604e+05\n",
      "press enter key to exit\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "''"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#Air at 70F flows through a duct at 50 fps. Calculate the Reynolds number\n",
    "#if the duct is (a) 10 in in diameter (b) 10 in square\n",
    "import math\n",
    "#initialisation of variables\n",
    "v= 50 \t\t\t\t\t\t\t\t\t#fps\n",
    "mu= 1.6*math.pow(10,-4) \t\t\t\t#ft^2/s\n",
    "d1= 10. \t\t\t\t\t\t\t\t#in\n",
    "d2= 10. \t\t\t\t\t\t\t\t#in square\n",
    "#CALACULATIONS\n",
    "D= (math.pi*4*d1*d1/4)/(math.pi*d2*12) \t#Modified diameter\n",
    "Re= (v*D)/mu \t\t\t\t\t\t\t#Reynolds number\n",
    "D1= (d1*d1/(4*d2*3)) \t\t\t\t\t#Modified diameter\n",
    "Re1= (v*D1)/mu \t\t\t\t\t\t\t#Reynolds number\n",
    "#RESULTS\n",
    "print '%s %.3e' % ('Re= ',Re)\n",
    "print '%s %.3e' % (' \\n Re=  ',Re1)\n",
    "raw_input('press enter key to exit')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 4.5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Q (m^3/s) =  8.77e-07\n",
      "press enter key to exit\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "''"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#A fluid with a viscosity of 1.75x 10^-3 pa.s. flows through a tube of 0.5 mm\n",
    "#diameter. if the pressure drop across a 1m length of the tube is 1 MPa, and \n",
    "#the flow is fully developed and laminar, what is the flow rate?\n",
    "import math\n",
    "#initialisation of variables\n",
    "v= 1.75*math.pow(10,-3) \t\t\t\t\t\t\t\t\t#pa s\n",
    "l= 1 \t\t\t\t\t\t\t\t\t\t\t\t\t\t#m\n",
    "P= 1 \t\t\t\t\t\t\t\t\t\t\t\t\t\t#Mpa\n",
    "d= 0.5 \t\t\t\t\t\t\t\t\t\t\t\t\t\t#mm\n",
    "#CALCULATIONS\n",
    "Q= (math.pi*P*1000000.*math.pow(((d/2)/1000.),4))/(l*8*v)\t#Flow rate\n",
    "#RESULTS \n",
    "print '%s %.2e' % ('Q (m^3/s) = ',Q)\n",
    "raw_input('press enter key to exit')"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}