summaryrefslogtreecommitdiff
path: root/Basic_Principles_And_Calculations_In_Chemical_Engineering/ch27.ipynb
blob: 0515e5c2583b7a84b02cdb92756fa4539e7a2825 (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
{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 27 : Ideal Processes Efficiency and the Mechanical Energy Balance"
     ]
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 27.1 page no. 838\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#  Calculation of the Work done during Evaporation of a Liquid\n",
      "# Solution E27.1\n",
      "\n",
      "# Variables\n",
      "V_w = 1. ;\t\t\t#  Volume of given water -[L]\n",
      "P_atm = 100. ;\t\t\t# Atmospheric pressure - [kPa]\n",
      "\n",
      "#W = -p*del_V\n",
      "V_H2O = 0.001043 ;\t\t\t# Specific volume of water from steam table according to book- [cubic metre] \n",
      "V_vap = 1.694 ;\t\t\t# Specific volume of vapour from steam table according to book- [cubic metre] \n",
      "V1 = 0 ;\t\t\t# Initial volume of H2O in bag-[cubic metre]\n",
      "\n",
      "# Calculations\n",
      "V2 = (V_w*V_vap)/(1000*V_H2O) ;\t\t\t# Final volume of water vapour -[cubic metre] \n",
      "W = -P_atm*(V2 -V1)* 1000 ;\t\t\t# Work done by saturated liquid water -[J]\n",
      " \n",
      "# Results \n",
      "print ' Work done by saturated liquid water is %.3e J.'%W\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Work done by saturated liquid water is -1.624e+05 J.\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      " Example 27.2  page no. 840\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Calculation of Work in a Batch Process\n",
      "# Solution E27.2\n",
      "\n",
      "# Variables\n",
      "m_N2 = 1. ;\t\t\t# Moles of N2 taken -[kg mol]\n",
      "p = 1000.;\t\t\t# Pressure of cylinder-[kPa]\n",
      "T = 20. + 273. ;\t\t\t# Temperature of cylinder -[K]\n",
      "a_pis = 6. ;\t\t\t# Area of piston - [square centimetre]\n",
      "m_pis = 2. ;\t\t\t# Mass of pston - [kg]\n",
      "R = 8.31 ;\t\t\t# Ideal gas constant - [(kPa*cubic metre)/(K * kgmol)]\n",
      "\n",
      "# Calculations\n",
      "V = (R*T)/p ;\t\t\t# Specific volue of gas at initial stage -[cubic metre/kg mol]\n",
      "V1 = V * m_N2 ;\t\t\t# Initial volume of gas - [cubic metre]\n",
      "V2 = 2.*V1 ;\t\t\t# Final volume of gas according to given condition -[cubic metre]\n",
      "\n",
      "# Assumed surrounding pressure constant = 1 atm\n",
      "p_atm = 101.3 ;\t\t\t# Atmospheric pressure-[kPa]\n",
      "del_Vsys = V2 -V1 ;\t\t\t# Change in volume of system -[cubic metre]\n",
      "del_Vsurr = - del_Vsys ;\t\t\t# Change in volume of surrounding -[cubic metre]\n",
      "W_surr = -p_atm*del_Vsurr ;\t\t\t# Work done by surrounding - [kJ]\n",
      "W_sys = -W_surr ;\t\t\t# Work done by system - [kJ]\n",
      "\n",
      "# Results\n",
      "print ' Work done by gas(actually gas + piston system) is %.0f kJ.'%W_sys\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Work done by gas(actually gas + piston system) is -247 kJ.\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      " Example 27.3  page no. 845\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Efficiency of Power Generation by a Hydroelectric Plant\n",
      "# Solution \n",
      "\n",
      "# Variables\n",
      "p_plant = 20. ;\t\t\t# Power generated by plant-[MW]\n",
      "h = 25. ;\t\t\t# Height of water level - [m]\n",
      "V = 100. ;\t\t\t# Flow rate of water -[cubic metre/s]\n",
      "d_water = 1000. ;\t\t\t# Density of water - [ 1000 kg / cubic metre]\n",
      "g = 9.807 ;\t\t\t# Acceleration due to gravity-[m/square second]\n",
      "\n",
      "# Calculations\n",
      "M_flow = V*d_water ;\t\t\t# Mass flow rate of water -[kg/s]\n",
      "del_PE = M_flow*g*h ;\t\t\t# Potential energy change of water per second -[W]\n",
      "eff = (p_plant*10**6) /(del_PE) ;\t\t\t# Efficiency of plant \n",
      "\n",
      "# Results\n",
      "print ' Efficiency of plant is %.2f .'%eff\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Efficiency of plant is 0.82 .\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      " Example 27.4  page no. 845\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Calculation of Plant Efficiency\n",
      "# Solution Fig.E27.4\n",
      "\n",
      "# Variables\n",
      "LHV = 36654. ;\t\t\t# LHV value of fuel - [kJ/ cubic metre]\n",
      "Q1 = 16. ;\t\t\t#- [kJ/ cubic metre]\n",
      "Q2 = 0 ;\t\t\t#- [kJ/ cubic metre]\n",
      "Q3 = 2432. ;\t\t\t#- [kJ/ cubic metre]\n",
      "Q4 = 32114. ;\t\t\t#- [kJ/ cubic metre]\n",
      "Q41 = 6988. ;\t\t\t#- [kJ/ cubic metre]\n",
      "Q8 = 1948. ;\t\t\t#- [kJ/ cubic metre]\n",
      "Q9 = 2643. ;\t\t\t#- [kJ/ cubic metre]\n",
      "Q81 = 2352. - Q8 ;\t\t\t# - [kJ/ cubic metre]\n",
      "Q567 = 9092. ;\t\t\t# Sum of Q5, Q6 and Q7- [kJ/ cubic metre]\n",
      "\n",
      "# Calculations and Results\n",
      "#(a)\n",
      "G_ef = (LHV+ Q1 +Q2 + Q3 - Q9)/(LHV) ;\t\t\t# Gross efficiency\n",
      "print '(a) Gross efficiency is %.3f .'%G_ef\n",
      "\n",
      "#(b)\n",
      "T_ef = (Q567+Q8)/(LHV+ Q1 +Q2 + Q3) ;\t\t\t#Thermal efficiency \n",
      "print ' (b) Thermal efficiency is %.3f .'%T_ef\n",
      "\n",
      "#(c)\n",
      "C_ef = Q4/(Q4 + Q41) ;\t\t\t# Combustion efficiency\n",
      "print ' (c) Combustion efficiency is %.3f .'%C_ef\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a) Gross efficiency is 0.995 .\n",
        " (b) Thermal efficiency is 0.282 .\n",
        " (c) Combustion efficiency is 0.821 .\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 27.5 page no. 850"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [
      "# Comparison of the reversible work for a batch process with that of a flow process operating under the same conditions.\n",
      "\n",
      "from scipy.integrate import quad\n",
      "\n",
      "# Variables\n",
      "V1 = 5. ;\t\t\t# Volume of gas initially - [cubic feet]\n",
      "P1 = 1. ;\t\t\t# Initial pressure - [atm]\n",
      "P2 = 10. ;\t\t\t# Final pressure - [atm]\n",
      "T1 = 100. + 460 ;\t\t\t# initial temperature - [degree Rankine]\n",
      "R = 0.7302 ;\t\t\t# Ideal gas constant -[(cubic feet*atm)/(lb mol)*(R)]\n",
      "\t\t\t#Equation of state pV**1.4 = constant\n",
      "\n",
      "\n",
      "# Calculations and Results\n",
      "V2 = V1*(P1/P2)**(1/1.4) ;\t\t\t# Final volume - [cubic feet]    \n",
      "\n",
      "def f(V):\n",
      "    return -(P1)*(V1/V)**(1.4)\n",
      "    \n",
      "W1_rev = quad(f,V1,V2)[0] ;\t\t\t# Reversible work done in compresion in a horizontal cylinder with piston -[cubic feet *atm]\n",
      "W1 = W1_rev *1.987/.7302 ;\t\t\t# Conversion to Btu -[Btu]\n",
      "print '(a)Reversible work done in compression in a horizontal cylinder with piston is %.1f Btu . '%W1\n",
      "\n",
      "#(b)\n",
      "n1 = (P1*V1)/(R*T1) ;\t\t\t# Number of moles of gas\n",
      "\n",
      "def f1(P):\n",
      "    return (V1)*(P1/P)**(1/1.4)\n",
      "W2_rev = quad(f1,P1,P2)[0]\t\t# Reversible work done in compresion in a rotary compressor -[cubic feet *atm]\n",
      "W2 = W2_rev *1.987/.7302 ;\t\t\t# Conversion to Btu -[Btu]\n",
      "\n",
      "print '(b)Reversible work done in a rotary compressor is %.1f Btu . '%W2\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)Reversible work done in compression in a horizontal cylinder with piston is 31.7 Btu . \n",
        "(b)Reversible work done in a rotary compressor is 44.3 Btu . \n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 27.6 page no. 853"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Application of the mechanical energy balance to the pumping water\n",
      "\n",
      "from scipy.integrate import quad\n",
      "# Variables\n",
      "m_water = 1. ;\t\t\t# Mass flow rate of water -[lb/min]\n",
      "P1 = 100. ;\t\t\t# Initial pressure - [psia]\n",
      "P2 = 1000. ;\t\t\t# Final pressure - [psia]\n",
      "T1 = 80. + 460 ;\t\t\t# initial temperature - [degree Rankine]\n",
      "T2 = 100. + 460 ;\t\t\t# final temperature - [degree Rankine]\n",
      "h = 10. ;\t\t\t# Difference in water level between entry and exit of stream-[ft]\n",
      "g = 32.2 ;\t\t\t# Accleration due to gravity - [ft/ square second]\n",
      "gc = 32.2 ;\t\t\t#[(ft*lbm)/(lbf*square second)]\n",
      "\n",
      "v1 = .01607 ;\t\t\t# specific volume of liquid water at 80 degree F -[cubic feet/lbm]\n",
      "v2 = .01613 ;\t\t\t# specific volume of liquid water at 100 degree F -[cubic feet/lbm] \n",
      "v= 0.0161 ;\t\t\t# -[cubic feet/lbm]\n",
      "\n",
      "# Calculations\n",
      "del_PE = (h*g)/(gc*778) ;\t\t\t# Change in potential energy - [Btu/lbm]\n",
      "\n",
      "def f(P):\n",
      "    return (v)*(12**2/778.)\n",
      "    \n",
      "PV_work = quad(f,P1,P2)[0]\t\t\t# PV work done  -[Btu/lbm]\n",
      "#From eqn. (A)\n",
      "W = PV_work + del_PE ;\t\t\t# Work per minute required to pump 1 lb water per minute - [Btu/lbm]\n",
      "\n",
      "# Results\n",
      "print ' Work per minute required to pump 1 lb water per minute is %.2f Btu/lbm . '%W\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Work per minute required to pump 1 lb water per minute is 2.69 Btu/lbm . \n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 2
    }
   ],
   "metadata": {}
  }
 ]
}