summaryrefslogtreecommitdiff
path: root/Elements_of_thermal_technology_by_John_H._Seely/First_Law.ipynb
blob: 3527510d556442df7791ecfb992e0fad0c3001e5 (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
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
345
346
347
348
349
350
351
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 7: First Law of Thermodynamics"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 7.1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Energy dissipated from the brakes (ft lbf) =  4.00e+05\n",
      "press enter key to exit\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "''"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#An automobile with a mass of 3000 lb comes over the top of a hill 50 ft high\n",
    "#with a velocity of 50 mph. Brakes are applied at the instant the automobile \n",
    "#reaches the top, and it comes to rest at the bottom of the hill. How much \n",
    "#energy is dissipated from the brakes?\n",
    "import math\n",
    "#initialisation of variables\n",
    "m= 3000 \t\t\t\t\t\t\t\t\t\t\t#lb\n",
    "Z1= 50 \t\t\t\t\t\t\t\t\t\t\t\t#ft\n",
    "V1= 50 \t\t\t\t\t\t\t\t\t\t\t\t#mph\n",
    "gc= 32.2 \t\t\t\t\t\t\t\t\t\t\t#ft/lbf s^2\n",
    "V2= 0 \t\t\t\t\t\t\t\t\t\t\t\t#mph\n",
    "g= 32.2 \t\t\t\t\t\t\t\t\t\t\t#ft/s^2\n",
    "Z2= 0 \t\t\t\t\t\t\t\t\t\t\t\t#ft\n",
    "#CALCULATIONS\n",
    "V1= V1*(73.3/50.) \t\t\t\t\t\t\t\t\t#Velocity\n",
    "Q2= ((m*(V2*V2-V1*V1))/(2*gc))+((m*g)/gc)*(Z2-Z1)\n",
    "#RESULTS\n",
    "print '%s %.2e' % ('Energy dissipated from the brakes (ft lbf) = ',-Q2)\n",
    "raw_input('press enter key to exit')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 7.2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "From keenan and keyes steam tables\n",
      "Temperature of the steam in the tank (C) =  453.40\n",
      "press enter key to exit\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "''"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#Steam at a pressure of 13 bar and a temperature of 300C flows adiabatically \n",
    "#and with negligible velocity into an evacuated tank. Using a closed system\n",
    "#analysis, determine the temperature of the steam in the tank reaches line\n",
    "#pressure.\n",
    "#initialisation of variables\n",
    "P= 15 \t\t\t\t\t\t#bar\n",
    "T= 300 \t\t\t\t\t\t#C\n",
    "h1= 3043.1 \t\t\t\t\t#J/gm\n",
    "#CALCULATIONS\n",
    "u2= h1 \n",
    "print '%s' %('From keenan and keyes steam tables')\n",
    "T= 453.4  \t\t\t\t\t#C temperature\n",
    "#RESULTS\n",
    "print '%s %.2f' % ('Temperature of the steam in the tank (C) = ',T)\n",
    "raw_input('press enter key to exit')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 7.3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Heat transferred to the tank (Btu) =  267.00\n",
      "press enter key to exit\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "''"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#A 10 lb mass of air at 120F is contained in a rigid tank. How much heat\n",
    "#is transferred to the tank to raise the air temperature of 275 F?\n",
    "#initialisation of variables\n",
    "m= 10 \t\t\t\t\t\t\t#lbf\n",
    "T= 120 \t\t\t\t\t\t\t#F\n",
    "T1= 275 \t\t\t\t\t\t#F\n",
    "u1= 98.9 \t\t\t\t\t\t#Btu/lbm\n",
    "u2= 125.6 \t\t\t\t\t\t#Btu/lbm\n",
    "#CALCULATIONS\n",
    "Q= m*(u2-u1) \t\t\t\t\t#Heat transferred\n",
    "#RESULTS\n",
    "print '%s %.2f' % ('Heat transferred to the tank (Btu) = ',Q)\n",
    "raw_input('press enter key to exit')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 7.4"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Maximum theotrical power that can be devoloped (J/s) =  1.00e+05\n",
      "press enter key to exit\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "''"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#Fluid enters a turbine with a velocity of 1 m/s and an enthalpy of 2000 j/gm;\n",
    "#it leaves with a velocity of 60 m/s and enthalpy of 1800 J/gm. Heat losses\n",
    "#are 500 J/s, and the flow rate is 0.5 kg/s. If the inlet of the turbine is \n",
    "#3 m higher than the outlet, what is the maximum theoretical power\n",
    "# that can be developed?\n",
    "#initialisation of variables\n",
    "v0= 1 \t\t\t\t\t\t\t\t\t\t\t\t\t#m/s\n",
    "vi= 60 \t\t\t\t\t\t\t\t\t\t\t\t\t#m/s\n",
    "Q= -500 \t\t\t\t\t\t\t\t\t\t\t\t#J/s\n",
    "m= 500 \t\t\t\t\t\t\t\t\t\t\t\t\t#gm/s\n",
    "hi= 2000 \t\t\t\t\t\t\t\t\t\t\t\t#J/gm\n",
    "h0= 1800 \t\t\t\t\t\t\t\t\t\t\t\t#J/gm\n",
    "zi= 3 \t\t\t\t\t\t\t\t\t\t\t\t\t#m\n",
    "z0= 0 \t\t\t\t\t\t\t\t\t\t\t\t\t#m\n",
    "g= 9.8 \t\t\t\t\t\t\t\t\t\t\t\t\t#m/s^2\n",
    "gc= 1000. \t\t\t\t\t\t\t\t\t\t\t\t#gm m/Ns^2\n",
    "#CALCULATIONS\n",
    "W= Q+m*((hi-h0)+(vi*vi-v0*v0)/(2*gc)+(g/gc)*(zi-z0)) \t#Work\n",
    "#RESULTS\n",
    "print '%s %.2e' % ('Maximum theotrical power that can be devoloped (J/s) = ',W)\n",
    "raw_input('press enter key to exit')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 7.5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Required steam flow rate (gm/s) =  36.36\n",
      "press enter key to exit\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "''"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#To produce 0.3 lt/s hot water at 82 C, low pressure steam at 2.4 bar and \n",
    "#80 percent quality is mixed with a stream of water at 16 C. What is the \n",
    "#required steam flow rate?\n",
    "#initialisation of variables\n",
    "m= 0.3 \t\t\t\t\t\t\t\t#lt/s\n",
    "T= 82 \t\t\t\t\t\t\t\t#C\n",
    "P= 2.4 \t\t\t\t\t\t\t\t#bar\n",
    "p= 80.\n",
    "Tw= 800 \t\t\t\t\t\t\t#C\n",
    "h1= 67.19 \t\t\t\t\t\t\t#J/gm\n",
    "h3= 343.3 \t\t\t\t\t\t\t#J/gm\n",
    "hf= 529.65 \t\t\t\t\t\t\t#J/gm\n",
    "hfg= 2185.4 \t\t\t\t\t\t#J/gm\n",
    "v3= 1.0305 \t\t\t\t\t\t\t#cm^3/gm\n",
    "V3= 300 \t\t\t\t\t\t\t#cm^3/s\n",
    "#CALCULATIONS\n",
    "h2= hf+(p/100.)*hfg\t\t\t\t\t#Enthalpy at 2\n",
    "m3= V3/v3 \t\t\t\t\t\t\t#Mass at 3\n",
    "m2= (m3*(h3-h1))/(h2-h1) \t\t\t#Mass at 2\n",
    "#RESULTS\n",
    "print '%s %.2f' % ('Required steam flow rate (gm/s) = ',m2)\n",
    "raw_input('press enter key to exit')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Exa 7.6"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Difference between the enthalpies of the system in the two phases ((h2-h1) J/gm) =  1.00\n",
      "press enter key to exit\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "''"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#Latent heat of transforation can be defined as the ratio of heat absorbed\n",
    "#to the mass which undergoes a change of phase(L=Q/m). Show that the heat of \n",
    "#transformation for any phase change equals the difference between the \n",
    "#enthalphies of the system in the two phases.\n",
    "#initialisation of variables\n",
    "h2= 2 \t\t\t\t\t#J/gm\n",
    "h1= 1 \t\t\t\t\t#J/gm\n",
    "#CALCULATIONS\n",
    "L= h2-h1 \t\t\t\t#Difference between enthalpies\n",
    "#RESULTS\n",
    "print '%s %.2f' % ('Difference between the enthalpies of the system in the two phases ((h2-h1) J/gm) = ',L)\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
}