summaryrefslogtreecommitdiff
path: root/Thermodynamics_by_C_P_Arora/Chapter3.ipynb
blob: f35af800b4253bc7101682f73eb237df62d1b930 (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
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
{
 "metadata": {
  "name": "",
  "signature": "sha256:2adb5810f77a16f36c057b0df75843c0d900b3354a62e4e4e5a6c4e231a86e5c"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 3:PROPERTIES OF A PURE SUBSTANCE"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.1, Page No:77"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "\n",
      "V=0.01;                               # Volume of water in a rigid vessel in m^3\n",
      "m=4.5;                                # Mass of water+ steam in a rigid vessel in kg\n",
      "T=35;                                 # Temperature of water in a rigid vessel in degree celcius\n",
      "#Calculation\n",
      "\n",
      "# (a)      \n",
      "v=V/m;                                # specific volume of water\n",
      "# From steam table\n",
      "vf=0.001006; vg=25.22;                # specific volume in m^3/kg\n",
      "x=(v-vf)/(vg-vf);                     # Quality of steam\n",
      "x1=1-x;                               # Quality of water\n",
      "mg=x*m;                               # Mass of steam\n",
      "mf=x1*m;                              # Mass of water\n",
      "#Result for (a)\n",
      "\n",
      "print \"(a).\\n\",\"Quality of steam in a rigid vessel = \",x,\"\\nQuality of water in a rigid vessel = \",x1\n",
      "print \"Mass of steam in a rigid vessel = \",round(mg,8),\"kg\\n\",\"Mass of water in a rigid vessel = \",round(mf,9),\"kg\\n\"\n",
      "# (b)\n",
      "#Result for (b)\n",
      "\n",
      "vc=0.003155;                          #  Crictical volume for water in m^3/kg\n",
      "print \"(b).\\n\",\"The level of liquid water will rise in the vessel. Since v < vc and refer figure 3.21\\n\"\n",
      "# (c)  \n",
      "#Result for (c)\n",
      "\n",
      "print \"(c)\\n\",\"The final temperature after heating is 370.04 oC.  Because it is constant volume process and refer figure 3.21\\n\"\n",
      "#  (d)   \n",
      "#Calculation for (d)\n",
      "\n",
      "m1=0.45;                             # Mass of water in kg\n",
      "v1=V/m;                              # specific volume of water\n",
      "#Result for (d)\n",
      "\n",
      "print\"(d).\\n\", \"Level of liquid drops to bottom (v1 > vc).  Temperature on reaching saturation state is 298.5 oC and refer figure 3.21\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a).\n",
        "Quality of steam in a rigid vessel =  4.82264368762e-05 \n",
        "Quality of water in a rigid vessel =  0.999951773563\n",
        "Mass of steam in a rigid vessel =  0.00021702 kg\n",
        "Mass of water in a rigid vessel =  4.499782981 kg\n",
        "\n",
        "(b).\n",
        "The level of liquid water will rise in the vessel. Since v < vc and refer figure 3.21\n",
        "\n",
        "(c)\n",
        "The final temperature after heating is 370.04 oC.  Because it is constant volume process and refer figure 3.21\n",
        "\n",
        "(d).\n",
        "Level of liquid drops to bottom (v1 > vc).  Temperature on reaching saturation state is 298.5 oC and refer figure 3.21\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.2, Page No:79 "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration for (a)\n",
      "# (a) Ammonia 26 oC and 0.074 m^3/kg\n",
      "# From saturation table of ammonia at 26 oC\n",
      "v=0.074;                      # specific volume of ammonia in m^3/kg\n",
      "vf=0.001663; vg=0.1245;       # specific volume  of ammonia in m^3/kg\n",
      "\n",
      "#Calculation for (a)\n",
      "x=(v-vf)/(vg-vf);             # Quality of vapour  since v<vg\n",
      "\n",
      "#Result for (a)\n",
      "print \"(a) Ammonia 26 oC and 0.074 m^3/kg\\n\",\"The Quality of ammonia = \",round(x,3)\n",
      "\n",
      "#Variable declaration for (b)\n",
      "# (b).Ammonia 550kPa and 0.31m^3/kg\n",
      "# From saturation table of ammonia at 550 kPa\n",
      "v=0.31;                      # specific volume of ammonia in m^3/kg\n",
      "vg=0.23;                     # specific volume  of ammonia in m^3/kg\n",
      "\n",
      "#Calculation for (b)\n",
      "# v > vg . Since from superheated table by interpolation for 550kPa and v\n",
      "T=82.1;                      # Temperature of ammonia in degree celcius\n",
      "\n",
      "#Result for (b)\n",
      "print \"\\n(b).Ammonia 550kPa and 0.31m^3/kg\\n\",\"Temperature of ammonia = \",T,\"oC\\n\"\n",
      "\n",
      "#Variable declaration for (c)\n",
      "# (c).Freon 12, 0.35MPa and 0.036 m^3/kg\n",
      "# From saturation table of Freon 12 at 0.35MPa\n",
      "v=0.036;                     # specific volume of Freon 12 in m^3/kg\n",
      "vf=0.000722; vg=0.049329;    # specific volume  of Freon 12 in m^3/kg\n",
      "\n",
      "#Calculation for (c)\n",
      "x=(v-vf)/(vg-vf);            # Quality of vapour since v<vg\n",
      "\n",
      "#Result for (c)\n",
      "print \"(c).Freon 12, 0.35MPa and 0.036 m^3/kg\\n\",\"The Quality of Freon 12  = \",round(x,2)\n",
      "\n",
      "#Variable declaration for (d)\n",
      "# (d).Methane 0.5MPa and 1.0 m^3/kmol\n",
      "v=1;                         # specific volume of Methane in m^3/kmol\n",
      "# From table at 0.5 MPa molar values are\n",
      "vf=0.04153; vg=2.007;        # specific volume  of Methane in m^3/kmol\n",
      "\n",
      "#Calculation for (d)\n",
      "x=(v-vf)/(vg-vf);            # Quality of vapour since v<vg\n",
      "\n",
      "#Result for (d)\n",
      "print \"\\n(d).Methane 0.5MPa and 1.0 m^3/kmol\",\"\\nThe Quality of Methane  = \",round(x,4)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a) Ammonia 26 oC and 0.074 m^3/kg\n",
        "The Quality of ammonia =  0.589\n",
        "\n",
        "(b).Ammonia 550kPa and 0.31m^3/kg\n",
        "Temperature of ammonia =  82.1 oC\n",
        "\n",
        "(c).Freon 12, 0.35MPa and 0.036 m^3/kg\n",
        "The Quality of Freon 12  =  0.73\n",
        "\n",
        "(d).Methane 0.5MPa and 1.0 m^3/kmol \n",
        "The Quality of Methane  =  0.4877\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.3, Page No:83"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "V=300;        # Volume of air in the room in m^3\n",
      "p=1;          # Atmospheric pressure in bar\n",
      "T=25;         # Temperature of air in Degree Celcius\n",
      "R=287;        # Characteristic constant of Air in J/kg k\n",
      "\n",
      "#Calculation\n",
      "m=(p*10**5*V)/(R*(T+273)); # Ideal gas equation\n",
      "\n",
      "#Result\n",
      "print \"Mass of air in room = \",round(m,2),\"kg\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Mass of air in room =  350.0 kg\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.4, Page No:84"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "D=20;                      # Diameter of the sphere in cm\n",
      "m=2.54;                    # Mass of gas filled in sphere in gram\n",
      "p=10;                      # Pressure of gas in bar\n",
      "T=25;                      # Temperature of gas in Degree Celcius\n",
      "R=8.3144*10**3;            # Universal gas constant in J/kmol K\n",
      "\n",
      "#Calculation\n",
      "V=(3.14*(D*10**-2)**3)/16; # Volume of das in sphere in m^3\n",
      "M=(m*10**-3*R*(T+273))/(p*10**5*V); # Molecular weight of the gas\n",
      "\n",
      "#Result\n",
      "print \"Molecular weight of the gas = \",round(M,3),\"\\nTherefore gas in sphere is Helium (unless mixture of two or more gases)\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Molecular weight of the gas =  4.008 \n",
        "Therefore gas in sphere is Helium (unless mixture of two or more gases)\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.5, Page No:85"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "p2=2.5;                        # Pressure of air in the cylinder in bar\n",
      "T1=430;                        # Temperature of air in cylinder in Degree Celcius\n",
      "V1=1.2;                        # Volume of cylinder in m^3\n",
      "V2=0.6;                        # Volume of cylinder upto end stops in m^3\n",
      "\n",
      "#Calculation for (a)\n",
      "# (a) Temperature of air when the piston reaches the stops\n",
      "T2=(T1+273)*(V2/V1);           # constant pressure process\n",
      "\n",
      "#Result for (a)\n",
      "print \"(a).Temperature of air when the piston reaches the stops = \",round(T2,1),\"K\"\n",
      "\n",
      "#Calculation for (b)\n",
      "# (b) The pressure of air when its temperature equals to 25 oC\n",
      "T3=25;                        #Room temperature in Degree Celcius\n",
      "p3=p2*((T3+273)/T2);          # constant volume process\n",
      "\n",
      "#Result for (b)\n",
      "print \"\\n(b).The pressure of air when its temperature equals to 25 oC = \",round(p3,2),\"bar\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a).Temperature of air when the piston reaches the stops =  351.5 K\n",
        "\n",
        "(b).The pressure of air when its temperature equals to 25 oC =  2.12 bar\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.7, Page No:92"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "p=6000;                   # Pressure of nitrogen gas in kPa\n",
      "T=150;                    # Temperature of nitrogen gas in kelvin\n",
      "V=250;                    # Volume of tank in litres\n",
      "R_1=8.3143;               # Universal gas constant in kJ/kmol K\n",
      "M=28.1013;                # Molecular mass\n",
      "\n",
      "#Calculation for (a)\n",
      "# (a).Beattie - Bridgeman equation of state\n",
      "# Constants for nitrogen gas\n",
      "c=4.2*10**4; Ao=136.2315; a=0.02617; Bo=0.05046; b=-0.00691;\n",
      "# By substituting these values in the following equation \n",
      "# p=(R_1*T/v^2)*(1-(c/(vT^3)))*(v+Bo*(1-(b/v)))-(Ao/v^2*(1-(a/v)))\n",
      "# By trial and error we get\n",
      "v=0.1222;                # specific volume in m^3/kmol\n",
      "m=(M*V/1000)/v;          # Mass of nitrogen gas\n",
      "\n",
      "#Result for (a)\n",
      "print \"(a).Beattie - Bridgeman equation of state\",\"\\nMass of nitrogen gas = \",round(m,2),\"kg\"\n",
      "print \"specific volume of nitrogen gas = \",round(v,4),\"m^3/kmol\"\n",
      "\n",
      "#Calculation for (b)\n",
      "# (b).Nitrogen tables\n",
      "# From property table of nitrogen fas\n",
      "v=0.004413;            # specific volume in m^3/kg\n",
      "m=(V/1000)/v;          #  Mass of nitrogen gas\n",
      "\n",
      "#Result for (b)\n",
      "print \"\\n\\n(b).Nitrogen tables\",\"\\nMass of nitrogen gas = \",round(m,2),\"kg\",\"\\nspecific volume of nitrogen gas = \",round(v,6),\"m^3/kg\"\n",
      "\n",
      "#Calculation for (c)\n",
      "# (c).Ideal gas equation of state\n",
      "m=(p*V/1000)/(R_1*T/M);  #Mass of nitrogen gas\n",
      "\n",
      "#Result for (c)\n",
      "print \"\\n\\n(c).Ideal gas equation of state\",\"\\nMass of nitrogen gas = \",round(m,2),\"kg\"\n",
      "\n",
      "#Calculation for (d)\n",
      "# (d).Generalized compressibility chart\n",
      "# The crictical properties for nitrogen gas \n",
      "Tc=126.2;              # Temperature in kelvin\n",
      "Pc=3.349;              # Pressure in MPa\n",
      "# Reduced properties are\n",
      "Pr=p/Pc; Tr=T/Tc;\n",
      "z=0.6;                 # From chart\n",
      "m=(p*V/1000)/(z*R_1*T/M); #Mass of nitrogen gas\n",
      "\n",
      "#Result for (d)\n",
      "print \"\\n\\n(d).Generalized compressibility chart\",\"\\nMass of nitrogen gas = \",round(m,2),\"kg\"\n",
      "\n",
      "#Result for (e)\n",
      "#(e).Arrangement the methods in order of percentage error\n",
      "print \" \\n\\n(e).Arrangement the methods in order of percentage error : \"\n",
      "print \"Nitrogen tables\",\"\\nBeattie - Bridgeman equation of state\",\"\\nGeneralized compressibility chart\",\"\\nIdeal gas equation of state\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a).Beattie - Bridgeman equation of state \n",
        "Mass of nitrogen gas =  57.49 kg\n",
        "specific volume of nitrogen gas =  0.1222 m^3/kmol\n",
        "\n",
        "\n",
        "(b).Nitrogen tables \n",
        "Mass of nitrogen gas =  56.65 kg \n",
        "specific volume of nitrogen gas =  0.004413 m^3/kg\n",
        "\n",
        "\n",
        "(c).Ideal gas equation of state \n",
        "Mass of nitrogen gas =  33.8 kg\n",
        "\n",
        "\n",
        "(d).Generalized compressibility chart \n",
        "Mass of nitrogen gas =  56.33 kg\n",
        " \n",
        "\n",
        "(e).Arrangement the methods in order of percentage error : \n",
        "Nitrogen tables \n",
        "Beattie - Bridgeman equation of state \n",
        "Generalized compressibility chart \n",
        "Ideal gas equation of state\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.8, Page No:97"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "T=-58.7;              #Normal boling point of CF3Br in Degree Celcius\n",
      "Tc=340.9;             # Crictical temperature of CF3Br in K\n",
      "pc=4.05;              # Crictical pressure of CF3Br in MPa\n",
      "M=148.9;              # Moleclar mass of CF3Br\n",
      "p=1.01325*10**5;      # Atmospheric pressure in N/m^2\n",
      "R1=8314.4;            # Universal gas constant in J/kmol K\n",
      "R=R1/M;               # Gas constant of CF3Br\n",
      "\n",
      "#Calculation\n",
      "a=(0.42748*R**2*Tc**2.5)/(pc*10**6); # Constant of Redlich-Kwong equation of state\n",
      "b=(0.08664*R*Tc)/(pc*10**6); # Constant of Redlich-Kwong equation of state\n",
      "vi=(R*(T+273))/p; # Ideal gas volume for assigning initial value\n",
      "# By substituting these values in the Redlich-Kwong equation of state \n",
      "vi_1=(R*(T+273)/p)+b-((a/(p*(273+T)**0.5*vi))*((vi-b)/(vi+b))); #and solving it by trial and error method we get\n",
      "\n",
      "#Result\n",
      "print \"Saturated vapour volume = \",round(vi_1,5),\"m^3/kg   (roundoff error)\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Saturated vapour volume =  0.1145 m^3/kg   (roundoff error)\n"
       ]
      }
     ],
     "prompt_number": 7
    }
   ],
   "metadata": {}
  }
 ]
}