summaryrefslogtreecommitdiff
path: root/Fundamentals_Of_Thermodynamics/Chapter3.ipynb
blob: 7447d700edcf2a4ea82f1cbe6baf2d76d6f7d528 (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
{
 "metadata": {
  "name": "",
  "signature": "sha256:6916c81bc8c1ac256991650a35c94801d5197d3ce593f7738220895278cf5f8b"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter3:PROPERTIES OF A PURE SUBSTANCE"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex3.3:pg-59"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#example 3\n",
      "#determining the quality and specific volume\n",
      "\n",
      "v1=0.5 #given specific volume in m^3/kg\n",
      "vf=0.001073 #specific volume when only liquid phase is present in m^3/kg\n",
      "vfg=0.60475 #in m^3/kg\n",
      "x=(v1-vf)/vfg #quality\n",
      "print\"For water at a pressure of 300 kPa,the state at which v1 is 0.5 m^3/kg is seen to be in the liquid-vapor two-phase region,at which T=133.6 C and the quality is\",round(x,3)\n",
      "\n",
      "v2=1 #given specific volume in m^3/kg\n",
      "\n",
      " # using the method of interplotation\n",
      "T=((400-300)*(1.0-0.8753))/(1.0315-0.8753)+300 #temperature of the water\n",
      "print\"For water at a pressure of 300 kPa,the state at which v2 is 1 m^3/kg is seen to be in the liquid-vapor two-phase region,the temperature is\",round(T,1)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "For water at a pressure of 300 kPa,the state at which v1 is 0.5 m^3/kg is seen to be in the liquid-vapor two-phase region,at which T=133.6 C and the quality is 0.825\n",
        "For water at a pressure of 300 kPa,the state at which v2 is 1 m^3/kg is seen to be in the liquid-vapor two-phase region,the temperature is 379.8\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex3.4:pg-60"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      " #example 4\n",
      "#percentage of vapor \n",
      "\n",
      "vliq=0.1 #volume of saturated liquid in m^3\n",
      "vf=0.000843 #in m^3/kg\n",
      "vvap=0.9 #volume of saturated vapor R-134a in equilbrium\n",
      "vg=0.02671 #in m^3/kg\n",
      "mliq=vliq/vf #mass of liquid in kg \n",
      "mvap=vvap/vg #mass of vapor in kg\n",
      "m=mliq+mvap #total mass in kg\n",
      "x=mvap*100/m #percentage of vapor on mass basis\n",
      "print\"hence,% vapor on mass basis is\",round(x,1),\"%\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "hence,% vapor on mass basis is 22.1 %\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex3.6:pg-61"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#example 6\n",
      "#Determinig the missing property\n",
      "\n",
      "T1=273-53.2 #given temperature in K\n",
      "P1=600 #given pressure in kPa\n",
      "print\"This temperature is higher than the critical temperature (critical temp. at P=600 kPa) is 96.37 K.Hence,v=0.10788 m^3/kg\"\n",
      "T2=100 #given temp. in K\n",
      "v2=0.008 #given specific volume in m^3/kg\n",
      "vf=0.001452 #in m^3/kg\n",
      "vg=0.0312 #in m^3/kg\n",
      "Psat=779.2 #saturation pressure in kPa\n",
      "vfg=vg-vf #in m^3/kg\n",
      "x=(v2-vf)/vfg #quality\n",
      "print\"\\n hence, the pressure is\",round(Psat,1),\"kPa\"\n",
      "print\"\\n and quality is\",round(x,4),\"%\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "This temperature is higher than the critical temperature (critical temp. at P=600 kPa) is 96.37 K.Hence,v=0.10788 m^3/kg\n",
        "\n",
        " hence, the pressure is 779.2 kPa\n",
        "\n",
        " and quality is 0.2201 %\n"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex3.7:pg-62"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#example 7\n",
      "#determining the pressure of water\n",
      "\n",
      "vg=0.12736 #specific volume in m^3/kg for water at 200C\n",
      "v=0.4 #specific volume in m^3/kg\n",
      "P1=500 #in kPa\n",
      "v1=0.42492 #specific volume at P1 in m^3/kg\n",
      "P2=600 #in kPa\n",
      "v2=0.35202 #specific volume at P2 in m^3/kg\n",
      "P=P1+(P2-P1)*(v-v1)/(v2-v1) #calculating pressure by interplotation\n",
      "print \"hence,the pressure of water is\",round(P,1),\" kPa\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " hence,the pressure of water is 534.2  kPa\n"
       ]
      }
     ],
     "prompt_number": 21
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex3.8:pg-66"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#example 8\n",
      "#calculating mass of air\n",
      "\n",
      "P=100 #pressure in kPa\n",
      "V=6*10*4 #volume of room in m^3\n",
      "R=0.287 #in kN-m/kg-K\n",
      "T=25 #temperature in Celsius\n",
      "m=P*V/(R*(T+273.1)) #mass of air contained in room\n",
      "print\"\\n hence, mass of air contained in room is\",round(m,1),\"kg\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " hence, mass of air contained in room is 280.5 kg\n"
       ]
      }
     ],
     "prompt_number": 27
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex3.9:pg-67"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#example 9\n",
      "#calculating pressure inside tank\n",
      "\n",
      "V=0.5 #volumr of tank in m^3\n",
      "m=10 #mass of ideal gas in kg\n",
      "T=25 #temperature of tank in Celsius\n",
      "M=24 #molecular mass of gas in kg/kmol\n",
      "Ru=8.3145 #universal gas constant in kN-m/kmol-K\n",
      "R=Ru/M #gas constant for given ideal gas in kN-m/kg-K\n",
      "P=m*R*(T+273.2)/V #pressure inside tank\n",
      "print\"\\n hence,pressure inside tank is\",round(P),\"kpa\" "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " hence,pressure inside tank is 2066.0 kpa\n"
       ]
      }
     ],
     "prompt_number": 30
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex3.10:pg-67"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#example 10\n",
      "#mass  flow rate\n",
      "\n",
      "dt=185 #time period in seconds over which there is incrrease in volume \n",
      "dV=0.75 #increase in volume in 0.75 in m^3\n",
      "V=dV/dt #volume flow rate in m^3/s\n",
      "P=105 #pressure inside gas bell kPa\n",
      "T=21 #temperature in celsius\n",
      "R=0.1889 #ideal gas constant in kJ/kg-K\n",
      "m=P*V/(R*(T+273.15)) #mass flow rate of the flow in kg/s\n",
      "print\"\\n hence,mass flow rate is\",round(m,5),\"kg/s\"\n",
      "print\"\\n and volume flow rate is\",round(V,5),\"m^3/s\"\n",
      "#The answer of volume flow rate in the book is wrong."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " hence,mass flow rate is 0.00766 kg/s\n",
        "\n",
        " and volume flow rate is 0.00405 m^3/s\n"
       ]
      }
     ],
     "prompt_number": 40
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex3.12:pg-71"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#example 12\n",
      "#determining specific using diffenet laws\n",
      "\n",
      "T=100.0 #given temp.in 100 celsius\n",
      "P=3.0 #given pressure in MPa\n",
      "v1=0.0065 #specific volume in m^3/kg using table\n",
      "print\"\\n hence,the specific volume for R-134a using R-134a tables is\",round(v1,3),\"m^3/kg\"\n",
      "M=102.3 #molecular mass in kg\n",
      "R=8.3145 #in kJ/K\n",
      "Ru=R/M #in kJ/K-kg\n",
      "v2=Ru*(T+273)/(P*1000) #specific volume assuming R-134a to be ideal gas in m^3/kg\n",
      "print\"\\n hence,the specific volume for R-134a using R-134a the ideal gas laws is\",round(v2,5),\"m^3/kg\"\n",
      "Tr=373.2/374.2 #reduced temperature using generalized chart\n",
      "Pr=3.0/4.06 #reduced pressure using generalized chart\n",
      "Z=0.67 #compressibility factor \n",
      "v3=Z*v2 # specific volume using generalized chart in m^3/kg\n",
      "print\"\\n hence,the specific volume for R-134a using the generalized chart is\",round(v3,5),\"m^3/kg\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " hence,the specific volume for R-134a using R-134a tables is 0.006 m^3/kg\n",
        "\n",
        " hence,the specific volume for R-134a using R-134a the ideal gas laws is 0.01011 m^3/kg\n",
        "\n",
        " hence,the specific volume for R-134a using the generalized chart is 0.00677 m^3/kg\n"
       ]
      }
     ],
     "prompt_number": 51
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex3.13:pg-71"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#example 13\n",
      "#calculating mass of gas\n",
      "\n",
      "Pc=4250 #critical pressure of propane in kPa\n",
      "Tc=369.8 #critical temperature in K\n",
      "T=15 #temperature of propane in celsius\n",
      "Tr=T/Tc #reduced temperature\n",
      "Prsat=0.2 # reduced pressure \n",
      "P=Prsat*Pc #pressure in kPa\n",
      "x=0.1 #given quality\n",
      "Zf=0.035 #from graph\n",
      "Zg=0.83 #from graph\n",
      "Z=(1-x)*Zf+x*Zg #overall compressibility factor\n",
      "V=0.1 #volume of steel bottle in m^3\n",
      "R=0.1887 #in kPa-m^3/kg-K\n",
      "m=P*V/(Z*R*(T+273)) #total propane mass in kg\n",
      "print\"\\n hence,the total propane mass is\",round(m,2),\"kg\"\n",
      "print\"\\n and pressure is\",round(P,2),\"kPa\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " hence,the total propane mass is 13.66 kg\n",
        "\n",
        " and pressure is 850.0 kPa\n"
       ]
      }
     ],
     "prompt_number": 44
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}