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
|
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter 16 - Gas Cycles"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 1a - Pg 279"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#calculate the efficiency and work done per pound of fluid\n",
"#initialization of varaibles\n",
"import math\n",
"Pb=75. #psia\n",
"Pc=15. #psia\n",
"k=1.4\n",
"Td=550. #R\n",
"Tb=1700. #R\n",
"cp=0.24\n",
"#calculations\n",
"print '%s' %(\"Gas law solution\")\n",
"Pratio=Pb/Pc\n",
"Ta=Td*math.pow((Pratio),((k-1)/k))\n",
"Tc=Tb/math.pow((Pratio),((k-1)/k))\n",
"Q1=cp*(Tb-Ta)\n",
"Q2=cp*(Tc-Td)\n",
"Wnet=Q1-Q2\n",
"eta=Wnet/Q1\n",
"eta2=1-Td/Ta\n",
"#results\n",
"print '%s %.3f' %(\"Efficiency in 1= \",eta)\n",
"print '%s %.2f' %(\"\\n Efficiency in 2 = \",eta2)\n",
"print '%s %d %s' %(\"\\n Work per pound of fluid =\",Wnet,\"B/lb\")\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Gas law solution\n",
"Efficiency in 1= 0.369\n",
"\n",
" Efficiency in 2 = 0.37\n",
"\n",
" Work per pound of fluid = 73 B/lb\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 1b - Pg 280"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#calculate the efficiency and work done per pound of fluid\n",
"#initialization of variables\n",
"import math\n",
"Pb=75. #psia\n",
"Pc=15. #psia\n",
"k=1.4\n",
"Td=550. #R\n",
"Tb=1700. #R\n",
"cp=0.24\n",
"#calculations\n",
"Prd=1.4779\n",
"hd=131.46 #B/lb\n",
"Prb=90.95\n",
"hb=422.59 #B/lb\n",
"Pratio=Pb/Pc\n",
"Pra=Pratio*(Prd)\n",
"Ta=868 #R\n",
"ha=208.41\n",
"Prc=Prb/Pratio\n",
"Tc=1113 #R\n",
"hc=269.27\n",
"Q1=hb-ha\n",
"Q2=hc-hd\n",
"Wnet=Q1-Q2\n",
"eta=Wnet/Q1\n",
"#results\n",
"print '%s %.3f' %(\"Efficiency = \",eta)\n",
"print '%s %.2f %s' %(\"\\n Work per pound of fluid =\",Wnet,\"B/lb\")\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Efficiency = 0.357\n",
"\n",
" Work per pound of fluid = 76.37 B/lb\n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 2 - Pg 282"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Calculate the work done and efficiency of the process\n",
"#initialization of varaibles\n",
"e=0.75\n",
"Ta=870. #R\n",
"Tc=1075. #R\n",
"cp=0.24\n",
"Td=550. #R\n",
"Tb=1700. #R\n",
"#calculations\n",
"Tadash=e*(Tc-Ta) +Ta\n",
"Tcdash=Tc+Ta-Tadash\n",
"Q1=cp*(Tb-Tadash)\n",
"Q2=cp*(Tcdash-Td)\n",
"Wnet=Q1-Q2\n",
"eta=Wnet/Q1\n",
"#results\n",
"print '%s %d %s' %(\"Net work done =\",Wnet,\"B/lb\")\n",
"print '%s %.2f' %(\"\\n efficiency = \",eta)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Net work done = 73 B/lb\n",
"\n",
" efficiency = 0.45\n"
]
}
],
"prompt_number": 3
}
],
"metadata": {}
}
]
}
|