summaryrefslogtreecommitdiff
path: root/Basic_Engineering_Thermodynamics_by_A._Venkatesh/ch11.ipynb
blob: b963376706552832447f66d74063b9652f3fa136 (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
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
{
 "metadata": {
  "name": "",
  "signature": "sha256:1a66a7b358047512cb72cb60b5347f9bd68c40105b1c8a4914776231ef293db4"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 11 : Real Gas"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.1 Page No : 394"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\t\t\t\n",
      "# Variables\n",
      "P = 70.e5 \t\t\t#Pa\n",
      "T = 150. + 273 \t\t\t#K\n",
      "Z = 0.55 \t\t\t#Compressibility factor\n",
      "R = 8314.3/44 \t\t\t#J/kgK\n",
      "\t\t\t\n",
      "# Calculations and Results\n",
      "#For propane\n",
      "v = Z*R*T/P \t\t\t#m**3/kg\n",
      "print \"Specific volume for propane = %.2e m**3/kg\"%(v)\n",
      "\t\t\t#ideal gas\n",
      "v = R*T/P \t\t\t#m**3/kg\n",
      "print \"Specific volume for ideal gas = %2.3e m**3/kg\"%(v)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Specific volume for propane = 6.28e-03 m**3/kg\n",
        "Specific volume for ideal gas = 1.142e-02 m**3/kg\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.2 Page No : 396"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\t\t\t\n",
      "# Variables\n",
      "Z = 1.04 \t\t\t#Compressiblity factor\n",
      "pc = 3.77e6 \t\t\t#Pa \t\t\t#crticial pressure\n",
      "Tc = 132.5 \t\t\t#K\n",
      "vc = 0.0883 \t\t\t#m**3/kmol\n",
      "p = 10.e5 \t\t\t#Pa\n",
      "T = 300. \t\t\t#K\n",
      "\t\t\t\n",
      "# Calculations and Results\n",
      "R = 287. \t\t\t#J/kgK\n",
      "pR = p/pc \t\t\t#reduced pressure\n",
      "TR = T/Tc \t\t\t#reduced temperature\n",
      "v = Z*R*T/p \t\t\t#m**3/kg\n",
      "vR = v/vc \t\t\t#reduced volume\n",
      "\n",
      "print \"Reduced pressure = %.5f \"%(pR)\n",
      "print \"Reduced temperature = %.5f \"%(TR)\n",
      "print \"Reduced volume = %.3f \"%(vR)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Reduced pressure = 0.26525 \n",
        "Reduced temperature = 2.26415 \n",
        "Reduced volume = 1.014 \n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.3 Page No : 397"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\t\t\t\n",
      "# Variables\n",
      "pR = 0.26525 \t\t\t#reduced pressure\n",
      "TR = 2.26415 \t\t\t#reduced temperature\n",
      "pc = 22.09 \t\t\t#bar \t\t\t#critical pressure of water\n",
      "Tc = 647.3 \t\t\t#K \t\t\t#critical temperature of water\n",
      "\t\t\t\n",
      "# Calculations and Results\n",
      "p = pR*pc \t\t\t#bar\n",
      "T = TR*Tc \t\t\t#K\n",
      "print \"Temperature at which steam would beahve similar to air at 10 bar and 27\u00b0C = %.1f K\"%(T)\n",
      "\n",
      "print \"Pressure at which steam would beahve similar to air at 10 bar and 27\u00b0C = %.2f bar\"%(p)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Temperature at which steam would beahve similar to air at 10 bar and 27\u00b0C = 1465.6 K\n",
        "Pressure at which steam would beahve similar to air at 10 bar and 27\u00b0C = 5.86 bar\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.4 Page No : 399"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\t\t\t\n",
      "# Variables\n",
      "pc = 3.77e6 \t\t\t#Pa \t\t\t#critical pressure\n",
      "p = 5.65e6 \t\t\t#Pa\n",
      "Tc = 132.5 \t\t\t#K \t\t\t#critical temperature\n",
      "T = 300 \t\t\t#K\n",
      "\n",
      "\t\t\t\n",
      "# Calculations and Results\n",
      "pR = p/pc \t\t\t#reduced pressure\n",
      "TR = T/Tc \t\t\t#reduced temperature\n",
      "\t\t\t#from generalized compressibilty chart\n",
      "Z =0.97\n",
      "print \"From the generalized compressiblity chart,\\\n",
      " at reduced pressure of %.1f and reduced temperature of %.2f, Z = %.2f\"%(pR,TR,Z)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "From the generalized compressiblity chart, at reduced pressure of 1.5 and reduced temperature of 2.26, Z = 0.97\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.5 Page No : 299"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "T =150.+273 \t\t\t#K\n",
      "p = 7e6 \t\t\t#Pa\n",
      "\n",
      "#Part (i)\n",
      "print \"Parti\"\n",
      "v = (8314.3/44)*T/p \t\t\t#m**3/kg\n",
      "print \"Specific volume for gaseous propane using ideal gas equation = %.4f m**3/kg\"%(v)\n",
      "\n",
      "#Part(ii)\n",
      "print \"Partii\"\n",
      "pc = 4.26e6 \t\t\t#Pa \t\t\t#critical pressure\n",
      "Tc = 370. \t\t\t#K \t\t\t#critical temperature\n",
      "\n",
      "pR = p/pc \t\t\t#reduced pressure\n",
      "TR = T/Tc \t\t\t#reduced temperature\n",
      "Z = 0.56 \t\t\t#compressibility factor\n",
      "print \"From the generalized compressiblity chart,\\\n",
      " at reduced pressure of %.1f and reduced temperature of %.2f, Z = %.2f\"%(pR,TR,Z)\n",
      "v = Z*v\n",
      "print \"Specific volume for gaseous propane using generalized compressiblity chart = %.5f m**3/kg\"%(v)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Parti\n",
        "Specific volume for gaseous propane using ideal gas equation = 0.0114 m**3/kg\n",
        "Partii\n",
        "From the generalized compressiblity chart, at reduced pressure of 1.6 and reduced temperature of 1.14, Z = 0.56\n",
        "Specific volume for gaseous propane using generalized compressiblity chart = 0.00639 m**3/kg\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.6 Page No : 404"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\t\t\t\n",
      "# Variables\n",
      "m = 5.\t\t\t#kg \t\t\t#mass of CO2\n",
      "T = 300. \t\t\t#K\n",
      "R = 8314.3/44 \t\t\t#J/kgK\n",
      "V = 1.5 \t\t\t#m**3\n",
      "\n",
      "#Part(i)\n",
      "print \"Parti\"\n",
      "p = m*R*T/V\n",
      "print \"Pressure exerted by CO2using ideal gas equation) = %.2f kPa\"%(p*.001)\n",
      "\n",
      "#Part(ii)\n",
      "print \"Partii\"\n",
      "R = 8.3143 \t\t\t#J/kmolK\n",
      "a = 0.3658e3 \t\t\t#kPam**6/kmol**2\n",
      "b = 0.0428 \t\t\t#m**3.kmol\n",
      "v = 44*V/m \t\t\t#m**3/kmol\n",
      "p = T*R/(v-b) - a/v**2\n",
      "print \"Pressure exerted by CO2using van der Waals equation) = %.1f kPa\"%(p)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Parti\n",
        "Pressure exerted by CO2using ideal gas equation) = 188.96 kPa\n",
        "Partii\n",
        "Pressure exerted by CO2using van der Waals equation) = 187.5 kPa\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.7 Page No : 406"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\t\t\t\n",
      "# Variables\n",
      "M = 28. \t\t\t#g/mol\n",
      "m = 3.5\t\t\t#kg\n",
      "V = 0.015 \t\t\t#m**3\n",
      "v = V/m \t\t\t#m**3/kg\n",
      "T = 473. \t\t\t#K\n",
      "R = 8314.3/M \t\t\t#J/kgK\n",
      "\t\t\t\n",
      "# Calculations and Results\n",
      "\n",
      "#Part(i)\n",
      "print \"Parti\"\n",
      "p = m*R*T/V \t\t\t#Pa\n",
      "print \"Pressure using ideal gas equation of state) = %.2f MPa\"%(p*1e-6)\n",
      "\n",
      "#Part(ii)\n",
      "print \"Partii\"\n",
      "pc = 3.39e6 \t\t\t#Pa \t\t\t#critical pressure\n",
      "Tc = 126.2 \t\t\t#K \t\t\t#critical temperature\n",
      "vc = 0.0899 \t\t\t#m**3/kmol \t\t\t#critical volume\n",
      "\n",
      "TR = T/Tc \t\t\t#reduced temperature\n",
      "vR = v/(R*Tc/pc) \t\t\t#reduced volume\n",
      "Z = 1.1 \t\t\t#Compressibility factor\n",
      "print \"From the generalized compressiblity chart, \\\n",
      " at reduced volume of %.4f and reduced temperature of %.2f, Z = %.2f\"%(vR,TR,Z)\n",
      "p = Z*R*T/v \t\t\t#Pa\n",
      "print \"Pressure using generalised compressibility chart) = %.3f MPa\"%(p*1e-6)\n",
      "\n",
      "#Part(iii)\n",
      "print \"Partiii\"\n",
      "a = 0.1366e6 \t\t\t#Pam**5/kmol**2\n",
      "b = 0.0386 \t\t\t#m**3/kmol\n",
      "p = (8314.3*T/(v*M - b)) - a/(v*M)**2\n",
      "print \"Pressure using van der Waals equation) = %.2f MPa\"%(p*1e-6)\n",
      "\n",
      "#Part(iv)\n",
      "print \"Partiv\"\n",
      "a = (0.427*(R*M)**2*Tc**2.5/pc)\n",
      "b = 0.0866*(R*M*Tc/pc)\n",
      "\n",
      "p = (R*M*T/(v*M-b))-(a/(((v*M)**2 + v*M*b)*(T**0.5)))\n",
      "print \"Pressure using Redlich-Kwong equation of state) = %.2f MPa\"%(p*1e-6)\n",
      "\n",
      "\n",
      "#Part(v)\n",
      "print \"Partv\"\n",
      "A0 = 136.2315\n",
      "a = 0.02617\n",
      "B0 = 0.05046\n",
      "b = -0.00691\n",
      "c = 42000\n",
      "\n",
      "A = A0*(1 - a/(v*M))\n",
      "B = B0*(1 - b/(v*M))\n",
      "eps = c/(T**3 * v*M)\n",
      "p = ((8314.3)*T*(1-eps)*(v*M+B))/(v*M)**2 - 1e3*A/(v*M)**2\n",
      "print \"Pressure using ideal gas equation of state) = %.2f MPa\"%(p*1e-6)\n",
      "\n",
      "\t\t\t#---Note--- \t\t\t\n",
      "# Calculations and Results to Part(iv) in the textbook is 40.58 MPa which is wrong. \n",
      "#  The correct solution (38.13 MPa) is computed here.\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Parti\n",
        "Pressure using ideal gas equation of state) = 32.77 MPa\n",
        "Partii\n",
        "From the generalized compressiblity chart,  at reduced volume of 0.3877 and reduced temperature of 3.75, Z = 1.10\n",
        "Pressure using generalised compressibility chart) = 36.049 MPa\n",
        "Partiii\n",
        "Pressure using van der Waals equation) = 38.83 MPa\n",
        "Partiv\n",
        "Pressure using Redlich-Kwong equation of state) = 38.13 MPa\n",
        "Partv\n",
        "Pressure using ideal gas equation of state) = 39.79 MPa\n"
       ]
      }
     ],
     "prompt_number": 1
    }
   ],
   "metadata": {}
  }
 ]
}