summaryrefslogtreecommitdiff
path: root/Chemical_Engineering_Thermodynamics/ch6.ipynb
blob: cf3f1f12705fcb61eba287077c986d647a9cc601 (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
{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 6 :  Thermodynamic potentials"
     ]
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 6.6  Page No : 218"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "m = 0.1;\t\t\t #mass of superheated steam in the piston cylinder assembly in kg\n",
      "P1 = 1.\t    \t\t #initial pressure of superheated steam in MPa\n",
      "T1 = 300.\t\t\t #initial temperature of superheated steam in degree celsius\n",
      "P2 = 0.1\t\t\t #pressure of steam after expansion in MPa\n",
      "T2 = 200.\t\t\t #temperature of steam after expansion in degree celsius\n",
      "\n",
      "# Calculations\n",
      "#For steam at P1 and T1:\n",
      "h1 = 3052.1\n",
      "v1 = 0.2580\n",
      "\n",
      "#For steam at P2 and T2:\n",
      "h2 = 2875.4\n",
      "v2 = 2.1720\n",
      "\n",
      "del_u = (((h1*10**3)-(P1*10**6*v1))-((h2*10**3)-(P2*10**6*v2)))*10**-3\n",
      "W = m*(del_u)\n",
      "\n",
      "# Results\n",
      "print \" The work done by steam = %0.2f kJ\"%(W);\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The work done by steam = 13.59 kJ\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 6.8  Page No : 220"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "P = 3.\t    \t\t #pressure of superheated steam in MPa\n",
      "Ti = 300.\t\t\t #temperature at which the steam enters the turbine in degree celsius\n",
      "m = 1.\t\t    \t #mass flow rate of steam in kg/s\n",
      "Te = 60.\t\t\t #temperature of dry saturated steam when it leaves the turbine in degree celsius\n",
      "\n",
      "# Calculations\n",
      "#For steam at P and Ti:\n",
      "h1 = 2995.1\t\t\t #specific entahlpy of steam in kJ/kg\n",
      "\n",
      "#For saturated steam at Te:\n",
      "h2 = 2609.7\t\t\t #specific enthalpy of saturated vapour in kJ/kg\n",
      "\n",
      "Ws = m*(h1-h2)\t\t # Calculations of the power  Results of the turbine using Eq.(6.83) in kW\n",
      "\n",
      "# Results\n",
      "print \" The power  Results of the turbine = %0.1f kW\"%(Ws);\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The power  Results of the turbine = 385.4 kW\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 6.10  Page No : 223"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "m = 0.1 \t\t\t #mass of superheated steam in the piston cylinder assembly in kg\n",
      "P1 = 3.\t    \t\t #initial pressure of superheated steam in MPa\n",
      "T1 = 300.\t\t\t #initial temperature of superheated steam in degree celsius\n",
      "T0 = 300.\t\t\t #temperature of the reservoir which is placed in thermal contact with the piston-cylinder assembly in degree celsius\n",
      "P2 = 0.1\t\t\t #pressure of steam after expansion in MPa\n",
      "\n",
      "#For steam at P1 and T1:\n",
      "h1 = 2995.1\n",
      "v1 = 0.08116\n",
      "s1 = 6.5422\n",
      "\n",
      "#For steam at P2 and T2:\n",
      "h2 = 3074.5\n",
      "v2 = 2.6390\n",
      "s2 = 8.2166\n",
      "\n",
      "# Calculations\n",
      "T0 = T0+273.15\n",
      "\n",
      "W = m*(h1-h2-(((P1*v1)-(P2*v2))*10**3)-(T0*(s1-s2)))\n",
      "\n",
      "# Results\n",
      "print \" The maximum work obtained from steam = %0.2f kJ\"%(W);\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The maximum work obtained from steam = 90.07 kJ\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 6.12  Page No : 226"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math\n",
      "\n",
      "# Variables\n",
      "P1 = 0.1\t\t\t #pressure at which air enters the compressor in MPa\n",
      "T1 = 300.\t\t\t #temperature at which air enters the compressor in K\n",
      "P2 = 1. \t\t\t #pressure at which air leaves the compressor in MPa\n",
      "T2 = 300.\t\t\t #temperature at which air leaves the compressor in K\n",
      "T0 = 300.\t\t\t #ambient temperature in K\n",
      "N = 1.  \t\t\t #molar flow rate of air in mol/s\n",
      "gaamma = 1.4\t\t #ratio of specific heat capacities (no unit)\n",
      "R = 8.314\t\t\t #universal gas constant in J/molK\n",
      "\n",
      "# Calculations\n",
      "\n",
      "Ws = (-N*T0*(-R*math.log (P2/P1)))*10**-3\n",
      "\n",
      "# Results\n",
      "print \" The minimum power required to compress one mole per second of air = %0.3f kW\"%(Ws);\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The minimum power required to compress one mole per second of air = 5.743 kW\n"
       ]
      }
     ],
     "prompt_number": 4
    }
   ],
   "metadata": {}
  }
 ]
}