summaryrefslogtreecommitdiff
path: root/Fundamentals_Of_Thermodynamics/Chapter10.ipynb
blob: 59bbb80a33d1e336396f299a537e153c76c4a326 (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
{
 "metadata": {
  "name": "",
  "signature": "sha256:6310b6690e48041fd88dd8277353623ea538798dfeeeb9a3819409de065b2175"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter10:IRREVERSIBILITY AND AVAILABILITY"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex10.1:pg-386"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#example 1\n",
      "#Calculating reversible work\n",
      "\n",
      "#Form the Steam Tables,the inlet and the exit state properties are \n",
      "hi=171.95 #initial specific heat of enthalpy in kJ/kg\n",
      "si=0.5705 #initial specific entropy in kJ/kg-K\n",
      "se=2.1341 #final specific entropy in kJ/kg-K\n",
      "he=765.34 #final specific heat of enthalpy in kJ/kg-K\n",
      "m=5 #mass flow rate of feedwater in kg/s\n",
      "q1=900/m #heat added by one of the sources in kJ/kg\n",
      "q2=he-hi-q1 #second heat transfer in kJ/kg\n",
      "To=25+273.3 #Temp. of the surroundings in K\n",
      "T1=100+273.2 #temp. of reservoir of one of the source in K\n",
      "T2=200+273.2 #temp. of reservoir of second source in K\n",
      "wrev=To*(se-si)-(he-hi)+q1*(1-To/T1)+q2*(1-To/T2) #reversible work in kJ/kg\n",
      "print\"\\n Hence, the irreversibility is\",round(wrev,1),\"kJ/kg\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " Hence, the irreversibility is 62.0 kJ/kg\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex10.2:pg-387"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#example 2\n",
      "#Calculating reversible work\n",
      "import math\n",
      "#Form the Steam Tables,the inlet and the exit state properties are\n",
      "hi=298.6 #initial specific heat of enthalpy in kJ/kg\n",
      "si=6.8631 #initial specific entropy in kJ/kg-K\n",
      "se=7.4664 #final specific entropy in kJ/kg-K\n",
      "he=544.7 #final specific heat of enthalpy in kJ/kg-K\n",
      "q=-50 #heat lost to surroundings in kJ/kg\n",
      "w=hi-he+q #work in kJ/kg\n",
      "To=25+273.2 #Temp. of the surroundings in K\n",
      "P1=100 #Pressure of ambient air in kPa\n",
      "P2=1000 #Final pressure of air after compression in kPa\n",
      "R=0.287 #Universal gas constant in kJ/kg-K\n",
      "wrev=To*(se-si-R*math.log(P2/P1))-(he-hi)+q*(1-To/To)#reversible work for the given change of state in kJ/kg\n",
      "i=wrev-w #irreversibility in kJ/kg\n",
      "print\"\\n Hence, the irreversibility is\",round(i,1),\"kJ/kg\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " Hence, the irreversibility is 32.8 kJ/kg\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex10.3:pg-390"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#example 3\n",
      "#Calculating reversible work and irreversibility\n",
      "\n",
      "#Form the Steam Tables at state 1\n",
      "u1=1243.5 #initial specific internal energy in kJ/kg\n",
      "s1=4.4819 #initial specific entropy in kJ/kg-K\n",
      "v1=28.895 #initial specific volume in m^3/kg\n",
      "v2=2*v1 #final specific volume in kg/m^3\n",
      "u2=u1 #initial specific internal energy in kJ/kg\n",
      "#These two independent properties, v2 and u2 , fix state 2.The final temp. is calculated by interplotation using the data for T2=5C and v2,x=0/3928 and u=948.5 kJ/kg. For T2=10C and v2, x=0.5433 and u=1317 kJ/kg\n",
      "T2=9.1+273.2 #final temp. in K\n",
      "x2=0.513 #quality in final state\n",
      "s2=4.644 #final specific entropy in kJ/kg\n",
      "V1=1 #volume of part of A in m^3\n",
      "m=V1/v1  #mass flow rate in kg/s\n",
      "To=20+273.2 #Room temperature in K\n",
      "Wrev=To*m*(s2-s1) #reversible work in kJ\n",
      "I=Wrev #irreversibility of the process\n",
      "print\"\\n The irreversibility is \",round(I,3),\"kJ\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        " The irreversibility is  1.645 kJ\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}