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
|
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Chapter 5 : First Law of Thermodynamics"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 5.1 Page No : 115"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The mass flow rate of air in kg/min is : 20.0\n",
"The change in the work flow in kJ/min is : 740.0\n",
"Change in velocity of the air flow in m/min is : -13.32\n"
]
}
],
"source": [
"import math \n",
"\n",
"# Variables\n",
"v1_total = 7;\t\t\t# in m**3/min\n",
"v_s1 = 0.35;\t\t\t# in m**3/kg\n",
"v_s2 = 0.12;\t\t\t# in m**3/kg\n",
"p1 = 1;\t\t\t# in bar\n",
"p1 = p1 * 10**5;\t\t\t# in N/m**2\n",
"p2 = 6;\t\t\t# in bar\n",
"p2 = p2 * 10**5;\t\t\t# in N/m**2\n",
"D1 = 110;\t\t\t# in mm\n",
"D1 = D1 * 10**-3;\t\t\t# in m\n",
"D2 = 65;\t\t\t# in mm\n",
"D2 = D2 * 10**-3;\t\t\t# in m\n",
"\n",
"# Calculations and Results\n",
"Af1 = math.pi/4*D1**2;\t\t\t# in m**2\n",
"Af2 = math.pi/4*D2**2;\t\t\t# in m**2\n",
"# v1_total = m1 * v_s1\n",
"m1 = v1_total / v_s1;\t\t\t#in kg/min\n",
"print \"The mass flow rate of air in kg/min is :\",m1\n",
"\n",
"m2 = m1;\t\t\t# in kg/min\n",
"v2_total = m2 * v_s2;\t\t\t# in m**3/min\n",
"del_W_flow = (p2 * v2_total) - (p1 * v1_total);\t\t\t# in J/min\n",
"print \"The change in the work flow in kJ/min is : \",del_W_flow*10**-3\n",
"\n",
"v_f1 = v1_total/Af1;\t\t\t# in m/min\n",
"v_f2 = v2_total /Af2;\t\t\t#in m/min\n",
"del_v = v_f2 - v_f1;\t\t\t# in m/min\n",
"print \"Change in velocity of the air flow in m/min is : %.2f\"%del_v\n",
"\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 5.2 Page No : 118"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Rate of heat transfer to the water jacket in kJ/sec 16.67\n"
]
}
],
"source": [
"\n",
"# Variables\n",
"m = 2.;\t\t\t# in kg per min\n",
"m = m / 60;\t\t\t# in kg per sec\n",
"W = 20;\t\t\t# in kW\n",
"h1 = 1400;\t\t\t# in kJ/kg\n",
"h2 = 1300;\t\t\t# in kJ/kg\n",
"\n",
"# Calculations\n",
"Q = (m * (h2 - h1)) + W;\t\t\t# in kJ/s\n",
"\n",
"# Results\n",
"print \"Rate of heat transfer to the water jacket in kJ/sec %.2f\"%Q\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 5.3 Page No : 127"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"The power output of the turbine in MW is : -1.471\n",
"Total error introduced in % is : 0.4\n"
]
}
],
"source": [
"\n",
"# Variables\n",
"g= 9.81;\n",
"p1 = 3;\t\t\t# in Mpa\n",
"p2 = 10;\t\t\t# in kPa\n",
"T1 = 350;\t\t\t# in °C\n",
"T1 = T1 + 273;\t\t\t# in K\n",
"m = 1;\t\t\t# in kg per sec\n",
"v1 = 50;\t\t\t# in m per sec\n",
"v2 = 120;\t\t\t# in m per sec\n",
"z1 = 2;\t\t\t# in m\n",
"z2 = 5;\t\t\t# in m\n",
"C_p = 1.005;\t\t\t# in kJ per sec\n",
"Q = 5;\t\t\t# in kJ per sec\n",
"\n",
"# Calculations and Results\n",
"Q = -(Q) * 10**3;\t\t\t# in J per sec\n",
"T2 = (p2 * T1)/p1;\t\t\t# in K\n",
"del_h = C_p * (T2-T1);\t\t\t# in kJ\n",
"del_h = del_h * 10**3;\t\t\t# in J\n",
"t = m * ( del_h +(v2**2-v1**2)/2 + (g * (z2 - z1)));\t\t\t# t is variable taken for calculation\n",
"W_s = Q - t;\t\t\t# in J per sec\n",
"W_s = W_s * 10**-6;\t\t\t# in MW\n",
"print \"The power output of the turbine in MW is : %.3f\"%W_s\n",
"\n",
"# If kinetic and potential energy are ignored then\n",
"W_s2 = Q -(m * del_h);\t\t\t# in J per sec\n",
"W_s2 = W_s2 * 10**-6;\t\t\t# in MW\n",
"errorIntroduced= (abs(W_s)-abs(W_s2))/abs(W_s)*100;\t\t\t# in %\n",
"print \"Total error introduced in %% is : %.1f\"%errorIntroduced\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 5.4 Page No : 128"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Quantity of water circulated through the pipe in kg/hr is : 2189.69\n"
]
}
],
"source": [
"\n",
"# Variables\n",
"h1 = 246.6;\t\t\t# in kJ/kg\n",
"h2 = 198.55;\t\t\t# in kJ/kg\n",
"W = 0;\n",
"g= 9.8;\n",
"Q= -(105000);\t\t\t# in kJ per hr\n",
"\n",
"# Calculations\n",
"# m * (h1 + ((v1***2)/(2*1000)) + ((g * z1)/1000)) + Q = m * (h2 + ((v2**2)/(2*1000)) + ((g * z2)/1000)) + W\n",
"# v1 and v2 is change in velocity is neglected and z2 = z1 + 10\n",
"m = Q/( (h2-h1) + ((g * 10)/1000) );\t\t\t# kg per hr\n",
"\n",
"# Results\n",
"print \"Quantity of water circulated through the pipe in kg/hr is : %.2f\"%m\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 5.5 Page No : 128"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Power of the motor required to drive the compressor in kW is : 45.17\n",
"Ratio of inlet pipe diameter to outlet pipe diameter is : 2.24\n"
]
}
],
"source": [
"import math \n",
"\n",
"# Variables\n",
"#Given data \n",
"m=15.;\t\t\t # in kg/min\n",
"m= m/60;\t\t\t# in kg/sec\n",
"H1= 5;\t \t\t# in kJ/kg\n",
"H1= H1*10**3;\t\t\t# in J/kg\n",
"H2= 173;\t\t\t# in kJ/kg\n",
"H2= H2*10**3;\t\t\t# in J/kg\n",
"V1= 5;\t\t \t# in m/s\n",
"V2= 7.5;\t\t\t# in m/s\n",
"Q= 760;\t\t\t # in kJ/min\n",
"Q= Q*10**3/60;\t\t\t# in J/s\n",
"\n",
"# Calculations and Results\n",
"# Formula (H1+V1**2/2)+(-Q)= (H2+V2**2/2)+W\n",
"W= (H1+V1**2/2)+(-Q)-(H2+V2**2/2);\t\t\t# in W/kg\n",
"W= W*10**-3;\t\t\t# in kW/kg\n",
"# The work done will be\n",
"W= m*W;\t\t\t# in kW\n",
"P= abs(W);\t\t\t# in kW\n",
"print \"Power of the motor required to drive the compressor in kW is : %.2f\"%P\n",
"\n",
"# Part (b)\n",
"v1= 0.5;\t\t\t# in m**3/kg\n",
"v2= 0.15;\t\t\t# in m**3/kg\n",
"# A1/A2= rho2*V2/(rho1*V1) = v1*V2/(v2*V1)\n",
"ratioOFA1andA2= v1*V2/(v2*V1);\n",
"radioOFd1andd2= math.sqrt(ratioOFA1andA2);\n",
"print \"Ratio of inlet pipe diameter to outlet pipe diameter is : %.2f\"%radioOFd1andd2\n"
]
}
],
"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
}
|