summaryrefslogtreecommitdiff
path: root/Basic_Engineering_Thermodynamics_by_Rayner_Joel/Chapter12_1.ipynb
blob: a3a87a85c64b4c6242eb943c3575a8b031944e16 (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
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 12 - Nozzles"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 1: pg 361"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 12.1\n",
      " (a) The throat area is (mm^2) =  255.0\n",
      " (b) The exit area is (mm^2) =  344.0\n",
      " (c) The Mach number at exit is  =  1.49\n"
     ]
    }
   ],
   "source": [
    "#pg 361\n",
    "print('Example 12.1');\n",
    "\n",
    "#  aim : To determine the\n",
    "#  (a) throat area\n",
    "#   (b) exit area\n",
    "#   (c) Mach number at exit\n",
    "from math import sqrt\n",
    "# Given values\n",
    "P1 = 3.5;# inlet pressure of air, [MN/m**2]\n",
    "T1 = 273+500;# inlet temperature of air, [MN/m**2]\n",
    "P2 = .7;# exit pressure, [MN/m**2]\n",
    "m_dot = 1.3;# flow rate of air, [kg/s]\n",
    "Gamma = 1.4;# heat capacity ratio\n",
    "R = .287;# [kJ/kg K]\n",
    "\n",
    "# solution\n",
    "# given expansion may be considered to be adiabatic and to follow the law PV**Gamma=constant\n",
    "# using ideal gas law\n",
    "v1 = R*T1/P1*10**-3;# [m**3/kg]\n",
    "Pt = P1*(2/(Gamma+1))**(Gamma/(Gamma-1));# critical pressure, [MN/m**2]\n",
    "\n",
    "#  velocity at throat is\n",
    "Ct = sqrt(2*Gamma/(Gamma-1)*P1*10**6*v1*(1-(Pt/P1)**(((Gamma-1)/Gamma))));# [m/s]\n",
    "vt = v1*(P1/Pt)**(1/Gamma);# [m**3/kg]\n",
    "# using m_dot/At=Ct/vt\n",
    "At = m_dot*vt/Ct*10**6;# throat area, [mm**2]\n",
    "print ' (a) The throat area is (mm^2) = ',round(At)\n",
    "\n",
    "# (b)\n",
    "#  at exit\n",
    "C2 = sqrt(2*Gamma/(Gamma-1)*P1*10**6*v1*(1-(P2/P1)**(((Gamma-1)/Gamma))));# [m/s]\n",
    "v2 = v1*(P1/P2)**(1/Gamma);# [m**3/kg]\n",
    "A2 = m_dot*v2/C2*10**6;# exit area, [mm**2]\n",
    "\n",
    "print ' (b) The exit area is (mm^2) = ',round(A2)\n",
    "\n",
    "#  (c)\n",
    "M = C2/Ct;\n",
    "print ' (c) The Mach number at exit is  = ',round(M,2)\n",
    "\n",
    "#  End\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 2: pg 362"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 12.2\n",
      " The increase in pressure is (MN/m^2) =  2.44\n",
      " Increase in temperature is (K) =  358.0\n",
      " Increase in internal energy is  (kJ/kg) =  257.0\n",
      "there is minor variation in result due to rounding off error\n"
     ]
    }
   ],
   "source": [
    "#pg 362\n",
    "print('Example 12.2');\n",
    "\n",
    "#  aim : To determine the increases in pressure, temperature and internal energy per kg of air\n",
    "\n",
    "#  Given values\n",
    "T1 = 273.;# [K]\n",
    "P1 = 140.;# [kN/m**2]\n",
    "C1 = 900.;# [m/s]\n",
    "C2 = 300.;# [m/s]\n",
    "cp = 1.006;# [kJ/kg K]\n",
    "cv =.717;# [kJ/kg K]\n",
    "\n",
    "# solution\n",
    "R = cp-cv;# [kJ/kg K]\n",
    "Gamma = cp/cv;# heat capacity ratio\n",
    "#  for frictionless adiabatic flow, (C2**2-C1**2)/2=Gamma/(Gamma-1)*R*(T1-T2)\n",
    "\n",
    "T2 =T1-((C2**2-C1**2)*(Gamma-1)/(2*Gamma*R))*10**-3; #  [K]\n",
    "T_inc = T2-T1;# increase in temperature [K]\n",
    "\n",
    "P2 = P1*(T2/T1)**(Gamma/(Gamma-1));# [MN/m**2]\n",
    "P_inc = (P2-P1)*10**-3;# increase in pressure,[MN/m**2]\n",
    "\n",
    "U_inc = cv*(T2-T1);#  Increase in internal energy per kg,[kJ/kg]\n",
    "#results\n",
    "print ' The increase in pressure is (MN/m^2) = ',round(P_inc,2)\n",
    "print ' Increase in temperature is (K) = ',round(T_inc)\n",
    "print ' Increase in internal energy is  (kJ/kg) = ',round(U_inc)\n",
    "\n",
    "print 'there is minor variation in result due to rounding off error'\n",
    "\n",
    "#  End\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 3: pg 364"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 12.3\n",
      " (a) The throat area is (mm^2) =  2888.0\n",
      "      The exit area is (mm^2) =  4282.0\n",
      " (b) The Degree of undercooling at exit is (C) =  10.3\n",
      " There is some rounding mistake in the book so answer is not matching\n"
     ]
    }
   ],
   "source": [
    "#pg 364\n",
    "print('Example 12.3');\n",
    "from math import sqrt\n",
    "# aim : To determine the \n",
    "#  (a) throat and exit areas\n",
    "#   (b) degree of undercooling at exit\n",
    "# Given values\n",
    "P1 = 2.;# inlet pressure of air, [MN/m**2]\n",
    "T1 = 273.+325;# inlet temperature of air, [MN/m**2]\n",
    "P2 = .36;# exit pressure, [MN/m**2]\n",
    "m_dot = 7.5;# flow rate of air, [kg/s]\n",
    "n = 1.3;# polytropic index\n",
    "\n",
    "# solution\n",
    "# (a)\n",
    "#  using steam table\n",
    "v1 = .132;# [m**3/kg]\n",
    "# given expansion following law PV**n=constant\n",
    "\n",
    "Pt = P1*(2/(n+1))**(n/(n-1));# critical pressure, [MN/m**2]\n",
    "\n",
    "#velocity at throat is\n",
    "Ct = sqrt(2*n/(n-1)*P1*10**6*v1*(1-(Pt/P1)**(((n-1)/n))));# [m/s]\n",
    "vt = v1*(P1/Pt)**(1/n);# [m**3/kg]\n",
    "# using m_dot/At=Ct/vt\n",
    "At = m_dot*vt/Ct*10**6;# throat area, [mm**2]\n",
    "print ' (a) The throat area is (mm^2) = ',round(At)\n",
    "\n",
    "# at exit\n",
    "C2 = sqrt(2*n/(n-1)*P1*10**6*v1*(1-(P2/P1)**(((n-1)/n))));# [m/s]\n",
    "v2 = v1*(P1/P2)**(1/n);# [m**3/kg]\n",
    "A2 = m_dot*v2/C2*10**6;# exit area, [mm**2]\n",
    "\n",
    "print '      The exit area is (mm^2) = ',round(A2)\n",
    "\n",
    "#  (b)\n",
    "T2 = T1*(P2/P1)**((n-1)/n);#outlet temperature, [K]\n",
    "t2 = T2-273;#[C]\n",
    "#  at exit pressure saturation temperature is\n",
    "ts = 139.9;# saturation temperature,[C]\n",
    "Doc = ts-t2;# Degree of undercooling,[C]\n",
    "print ' (b) The Degree of undercooling at exit is (C) = ',round(Doc,1)\n",
    "\n",
    "print' There is some rounding mistake in the book so answer is not matching'\n",
    "\n",
    "#  End\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 4: pg 365"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Example 12.4\n",
      " (a) The throat velocity is (m/s) =  548.0\n",
      "      The exit velocity is  (m/s) =  800.0\n",
      " (b) The throat area is (mm^2) =  3213.0\n",
      "      The throat area is (mm^2) =  6050.0\n"
     ]
    }
   ],
   "source": [
    "#pg 365\n",
    "print('Example 12.4');\n",
    "from math import sqrt\n",
    "# aim : To determine the \n",
    "#  (a) throat and exit velocities\n",
    "#  (b) throat and exit areas\n",
    "\n",
    "# Given values\n",
    "P1 = 2.2;# inlet pressure, [MN/m^2]\n",
    "T1 = 273+260;# inlet temperature, [K]\n",
    "P2 = .4;# exit pressure,[MN/m^2]\n",
    "eff = .85;# efficiency of the nozzle after throat\n",
    "m_dot = 11;# steam flow rate in the nozzle, [kg/s]\n",
    "\n",
    "# solution\n",
    "# (a)\n",
    "# assuming steam is following same law as previous question 12.3\n",
    "Pt = .546*P1;# critical pressure,[MN/m^2]\n",
    "# from Fig. 12.6\n",
    "h1 = 2940;# [kJ/kg]\n",
    "ht = 2790;# [kJ/kg]\n",
    "\n",
    "Ct = sqrt(2*(h1-ht)*10**3);# [m/s]\n",
    "\n",
    "#  again from Fig. 12.6\n",
    "h2_prime = 2590;# [kJ/kg]\n",
    "# using eff = (ht-h2)/(ht-h2_prime)\n",
    "\n",
    "h2 = ht-eff*(ht-h2_prime); # [kJ/kg]\n",
    "\n",
    "C2 = sqrt(2*(h1-h2)*10**3);# [m/s]\n",
    "\n",
    "# (b)\n",
    "# from chart\n",
    "vt = .16;# [m^3/kg]\n",
    "v2 = .44;# [m^3/kg]\n",
    "#  using m_dot*v=A*C\n",
    "At = m_dot*vt/Ct*10**6;# throat area, [mm^2]\n",
    "\n",
    "A2 = m_dot*v2/C2*10**6;# throat area, [mm^2]\n",
    "#results\n",
    "print ' (a) The throat velocity is (m/s) = ',round(Ct)\n",
    "print '      The exit velocity is  (m/s) = ',C2\n",
    "print ' (b) The throat area is (mm^2) = ',round(At)\n",
    "print '      The throat area is (mm^2) = ',A2\n",
    "\n",
    "#  End\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.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}