summaryrefslogtreecommitdiff
path: root/Fundamentals_Of_Thermodynamics/Chapter14.ipynb
blob: 6654362c7f4a60a7bf51da4d0754d564f39cc25d (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
{
 "metadata": {
  "name": "",
  "signature": "sha256:b6f84d510db3595ba71244d9d44f7e9987d44c62ba0d0520a72da2384551019e"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter14:THERMODYNAMIC RELATIONS"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex14.1:Pg-567"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#ques1\n",
      "#to determine the sublimation pressure of water\n",
      "import math\n",
      "#from table in appendix B.1.5\n",
      "T1=213.2;#K, Temperature at state 1\n",
      "P2=0.0129;#kPa, pressure at state 2\n",
      "T2=233.2;#K, Temperature at state 2\n",
      "hig=2838.9;#kJ/kg, enthalpy of sublimation \n",
      "R=.46152;#Gas constant \n",
      "#using relation log(P2/P1)=(hig/R)*(1/T1-1/T2) \n",
      "P1=P2*math.exp(-hig/R*(1/T1-1/T2));\n",
      "print\" Sublimation Pressure \",round(P1,5),\"kPa\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Sublimation Pressure  0.00109 kPa\n"
       ]
      }
     ],
     "prompt_number": 25
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex14.4:Pg-579"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#ques4\n",
      "#Volume expansivity, Isothermal and Adiabatic compressibility\n",
      "\n",
      "#known data\n",
      "ap=5*10**-5;#K^-1 Volume expansivity\n",
      "bt=8.6*10**-12;#m^2/N, Isothermal compressibility\n",
      "v=0.000114;#m^3/kg, specific volume\n",
      "P2=100*10**6;#pressure at state 2 in kPa\n",
      "P1=100;#pressure at state 1 in kPa\n",
      "w=-v*bt*(P2**2-P1**2)/2;#work done in J/kg\n",
      "#q=T*ds and ds=-v*ap*(P2-P1)\n",
      "#so q=-T*v*ap*(P2-P1)\n",
      "T=288.2;#Temperature in K\n",
      "q=-T*v*ap*(P2-P1);#heat in J/kg\n",
      "du=q-w;#change in internal energy in J/kg\n",
      "print\" Change in internal energy =\",round(du,3),\"J/kg\"\n",
      "\n",
      "#the answer is correct within given limts\n",
      " "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Change in internal energy = -159.372 J/kg\n"
       ]
      }
     ],
     "prompt_number": 22
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex14.5:Pg-586"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#ques5\n",
      "#adiabatic steady state processes\n",
      "\n",
      "#from table A.2\n",
      "P1=20;#pressure at state 1 in MPa\n",
      "P2=2;#pressure at state 2 in MPa\n",
      "T1=203.2;#Temperature at state 1 in K\n",
      "Pr1=P1/3.39;#Reduced pressure at state 1\n",
      "Pr2=P2/3.39;#Reduced pressure at state 2\n",
      "Tr1=T1/126.2;#Reduced temperature\n",
      "#from compressibility chart h1*-h1=2.1*R*Tc\n",
      "#from zero pressure specific heat data h1*-h2*=Cp*(T1a-T2a)\n",
      "#h2*-h2=0.5*R*Tc\n",
      "#this gives dh=h1-h2=-2.1*R*Tc+Cp*(T1a-T2a)+0.5*R*Tc\n",
      "R=0.2968;#gas constant for given substance\n",
      "Tc=126.2;#K, Constant temperature\n",
      "Cp=1.0416;#heat enthalpy at constant pressure in kJ/kg\n",
      "T2=146;#temperature at state 2\n",
      "dh=-1.6*R*Tc+Cp*(T1-T2);#\n",
      "print\" Enthalpy change =\",round(dh,3),\"kJ/kg \\n\"\n",
      "print\" Since Enthalpy change is nearly \",-round(dh),\"kJ/kg so Temperature =\",round(T2,3),\"K\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Enthalpy change = -0.35 kJ/kg \n",
        "\n",
        " Since Enthalpy change is nearly  0.0 kJ/kg so Temperature = 146.0 K\n"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex14.6:Pg-589"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#ques6\n",
      "#isothermal steady state processes\n",
      "import math\n",
      "#from table A.2\n",
      "P1=8;#pressure at state 1 in MPa\n",
      "P2=0.5;#pressure at state 2 in MPa\n",
      "T1=150.0;#Temperature at state 1 in K\n",
      "Pr1=P1/3.39;#Reduced pressure at state 1\n",
      "Pr2=P2/3.39;#Reduced pressure at state 2\n",
      "Tr1=T1/126.2;#Reduced temperature\n",
      "T2=125.0;#temperature at state 2\n",
      "#from compressibility chart h1*-h1=2.1*R*Tc\n",
      "#from zero pressure specific heat data h1*-h2*=Cp*(T1a-T2a)\n",
      "#h2*-h2=0.5*R*Tc\n",
      "#this gives dh=h1-h2=-2.1*R*Tc+Cp*(T1a-T2a)+0.15*R*Tc\n",
      "R=0.2968;#gas constant for given substance\n",
      "Tc=126.2;#K, Constant temperature\n",
      "Cp=1.0416;#heat enthalpy at constant pressure in kJ/kg\n",
      "dh=(2.35)*R*Tc+Cp*(T2-T1);#\n",
      "print\" Enthalpy change =\",round(dh),\"kJ/kg\"\n",
      "#change in entropy \n",
      "#ds= -(s2*-s2)+(s2*-s1*)+(s1*-s1)\n",
      "#s1*-s1=1.6*R\n",
      "#s2*-s2=0.1*R\n",
      "#s2*-s1*=Cp*log(T2/T1)-R*log(P2/P1)\n",
      "#so\n",
      "ds=1.6*R-0.1*R+Cp*math.log(T2/T1)-R*math.log(P2/P1);\n",
      "print\" Entropy Change =\",round(ds,3),\"kJ/kg.K \""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Enthalpy change = 62.0 kJ/kg\n",
        " Entropy Change = 1.078 kJ/kg.K \n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex14.7:Pg-596"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#ques7\n",
      "#percent deviation using specific volume calculated by kays rule and vander waals rule\n",
      "import math\n",
      "\n",
      "#a-denotes C02\n",
      "#b-denotes CH4\n",
      "T=310.94;#Temperature of mixture K\n",
      "P=86.19;#Pressure of mixture in MPa\n",
      "#Tc- critical Temperature\n",
      "#Pc-critical pressure\n",
      "Tca=304.1;#K\n",
      "Tcb=190.4;#K\n",
      "Pca=7.38;#MPa\n",
      "Pcb=4.60;#MPa\n",
      "Ra=0.1889;#gas constant for a in kJ/kg.K\n",
      "Rb=0.5183;#gas constant for b in kJ/kg.K\n",
      "xa=0.8;#fraction of CO2\n",
      "xb=0.2;#fraction of CH4\n",
      "Rm=xa*Ra+xb*Rb;#mean gas constant in kJ/kg.K\n",
      "Ma=44.01;#molecular mass of a\n",
      "Mb=16.043;#molecular mass of b\n",
      "#1.Kay's rule\n",
      "ya=xa/Ma/(xa/Ma+xb/Mb);#mole fraction of a\n",
      "yb=xb/Mb/(xa/Ma+xb/Mb);#mole fraction of b\n",
      "Tcm=ya*Tca+yb*Tcb;#mean critical temp in K\n",
      "Pcm=ya*Pca+yb*Tcb;#mean critical pressure n MPa\n",
      "#therefore pseudo reduced property of mixture\n",
      "Trm=T/Tcm;\n",
      "Prm=P/Pcm;\n",
      "Zm=0.7;#Compressiblity from generalised compressibility chart\n",
      "vc=Zm*Rm*T/P/1000;#specific volume calculated in m^3/kg\n",
      "ve=0.0006757;#experimental specific volume in m^3/kg\n",
      "pd1=(ve-vc)/ve*100;#percent deviation\n",
      "print\" Percentage deviation in specific volume using Kays rule =\",round(pd1,1),\"percent \\n\"\n",
      "\n",
      "#2. using vander waals equation\n",
      "#values of vander waals constant\n",
      "Aa=27*(Ra**2)*(Tca**2)/(64*Pca*1000);\n",
      "Ba=Ra*Tca/(8*Pca*1000);\n",
      "Ab=27*(Rb**2)*(Tcb**2)/(64*Pcb*1000);\n",
      "Bb=Rb*Tcb/(8*Pcb*1000);\n",
      "#mean vander waals constant\n",
      "Am=(xa*math.sqrt(Aa)+xb*math.sqrt(Ab))**2;\n",
      "Bm=(xa*Ba+xb*Bb);\n",
      "#using vander waals equation we get cubic equation \n",
      "#solving we get\n",
      "vc=0.0006326;#calculated specific volume in m^3/kg\n",
      "pd2=((ve-vc)/ve)*100;\n",
      "print\" Percentage deviation in specific volume using vander waals eqn =\",round(pd2,1),\"percent\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Percentage deviation in specific volume using Kays rule = 4.8 percent \n",
        "\n",
        " Percentage deviation in specific volume using vander waals eqn = 6.4 percent\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}