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
|
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Chapter 2: Thermodynamics"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 2.1: Calculation_on_a_Diffuser.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"// scilab Code Exa 2.1 Calculation on a Diffuser \n",
"\n",
"p1=800; // Initial Pressure in kPa\n",
"T1=540; // Initial Temperature in K\n",
"p2=580; // Final Pressure in kPa\n",
"gamma=1.4; // Specific Heat Ratio\n",
"cp=1005; // Specific Heat at Constant Pressure in J/(kgK)\n",
"R=0.287; // Universal Gas Constant in kJ/kgK\n",
"g=9.81; // Gravitational acceleration in m/s^2\n",
"sg=13.6; // Specific Gravity of mercury\n",
"n=0.95; // Efficiency in %\n",
"AR=4; // Area Ratio of Diffuser\n",
"delp=(367)*(1e-3)*(g)*(sg); // Total Pressure Loss Across the Diffuser in kPa\n",
"pr=p1/p2; // Pressure Ratio\n",
"T2s=T1/(pr^((gamma-1)/gamma));\n",
"T2=T1-(n*(T1-T2s));\n",
"c2=sqrt(2*cp*(T1-T2));\n",
"ro2=p2/(R*T2);\n",
"c3=c2/AR;\n",
"m=0.5*1e-3*ro2*((c2^2)-(c3^2));\n",
"n_D=1-(delp/m);\n",
"disp ('%',n_D*1e2,' Efficiency of the diffuser is')\n",
"p3=(p2+n_D*m)*1e-2;\n",
"disp('m/s',c2,'the velocity of air at diffuser entry is')\n",
"disp('m/s',c3,'the velocity of air at diffuser exit is')\n",
"disp('bar',p3,'static pressure at the diffuser exit is')"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 2.2: Determining_the_infinitesimal_stage_efficiencies.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"// Exa 2.2 Determining the infinitesimal stage efficiencies\n",
"p1=1.02; // Initial Pressure in bar\n",
"T1=300; // Initial Temperature in K\n",
"\n",
"// part(a)\n",
"T2=315; // Final Temperature in K\n",
"gamma=1.4; // Specific Heat Ratio\n",
"g=9.81; // Gravitational acceleration in m/s^2\n",
"sg=1; // Specific Gravity of air\n",
"delp=(1500)*(0.001)*(g)*(sg); // Total Pressure Loss Across the Diffuser in kPa\n",
"p2=p1+(0.01*delp);\n",
"pr=p2/p1; // Pressure Ratio\n",
"T2s=T1*(pr^((gamma-1)/gamma));\n",
"n_c=(T2s-T1)/(T2-T1); // Efficiency in %\n",
"n_p=((gamma-1)/gamma)*((log(p2/p1))/(log(T2/T1)));\n",
"disp ('%',n_c*100,'(a)Efficiency of the compressor is')\n",
"disp ('%',n_p*100,'and infinitesimal stage Efficiency or polytropic efficiency of the compressor is')\n",
"\n",
"// part(b) Determining the infinitesimal stage efficiency\n",
"\n",
"p2_b=2.5; // Final pressure in bar\n",
"n_b=0.75; // Efficiency\n",
"pr_b=p2_b/p1; // Pressure Ratio\n",
"T2s_b=T1*(pr_b^((gamma-1)/gamma));\n",
"T2_b=T1+((T2s_b-T1)/n_b);\n",
"n_p_b=((gamma-1)/gamma)*((log(p2_b/p1))/(log(T2_b/T1)));\n",
"disp ('%' ,n_p_b*100,'(b)infinitesimal stage Efficiency or polytropic efficiency of the compressor is')"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 2.3: Calculations_on_air_compressor.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"// scilab Code Exa 2.3 Calculation on a compressor\n",
"p1=1.0; // Initial Pressure in bar\n",
"t1=40; // Initial Temperature in degree C\n",
"T1=t1+273; // in Kelvin\n",
"s=8; // number of stages\n",
"m=50; // mass flow rate through the compressor in kg/s\n",
"pr=1.35; // equal Pressure Ratio in each stage\n",
"opr=pr^s; // Overall Pressure Ratio\n",
"gamma=1.4; // Specific Heat Ratio\n",
"cp=1.005; // Specific Heat at Constant Pressure in kJ/(kgK)\n",
"n=0.82; // Overall Efficiency\n",
"\n",
"// part(a) Determining state of air at the compressor exit\n",
"p9=opr*p1;\n",
"delTc=T1*(opr^((gamma-1)/gamma)-1)/n;\n",
"T9=T1+delTc;\n",
"disp('bar',p9,'(a)Exit Pressure is')\n",
"disp('K',T9,'and Exit Temperature is')\n",
"\n",
"// part(b) Determining the polytropic or small stage efficiency\n",
"n_p=((gamma-1)/gamma)*((log(p9/p1))/(log(T9/T1)));\n",
"disp('%',n_p*100,'(b)small stage Efficiency or polytropic efficiency of the compressor is')\n",
"\n",
"// part(c) Determining efficiency of each stage\n",
"n_st=(pr^((gamma-1)/gamma)-1)/(pr^(((gamma-1)/gamma)/n_p)-1);\n",
"disp ('%',n_st*100,'(c)Efficiency of each stage is')\n",
"\n",
"// part(d) Determining power required to drive the compressor\n",
"n_d=0.9; // Overall efficiency of the drive\n",
"P=m*cp*delTc/n_d;\n",
"disp ('MW' ,P/1e3,'(d)Power required to drive the compressor is')"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 2.4: compressor_with_same_temperature_rise.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"// Exa 2.4 compressor with same temperature rise\n",
"\n",
"p1=1.0; // Initial Pressure in bar\n",
"t1=40; // Initial Temperature in degree C\n",
"T1=t1+273; // in Kelvin\n",
"s=8; // number of stages\n",
"pr=1.35;\n",
"opr=pr^s; // Overall Pressure Ratio\n",
"n=0.82; // Overall Efficiency \n",
"p9=opr*p1;\n",
"gamma=1.4;\n",
"delTc=(T1*(opr^((gamma-1)/gamma)-1)/n);\n",
"delTi=delTc/s;\n",
"T9=T1+delTc;\n",
"n_p=((gamma-1)/gamma)*((log(p9/p1))/(log(T9/T1))); // small stage Efficiency or polytropic efficiency\n",
"m=8;\n",
"T(1)=T1;\n",
"for i=1:m\n",
" T(i+1)=T(i)+delTi;\n",
" pr(i)=(1+(delTi/T(i)))^(n_p/((gamma-1)/gamma));\n",
" n_st(i)=(pr(i)^((gamma-1)/gamma)-1)/(pr(i)^(((gamma-1)/gamma)/n_p)-1);\n",
"disp(T(i),'T is');\n",
"disp(pr(i),'pressure ratio is')\n",
"disp(n_st(i),'efficiency is' )\n",
"end"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 2.5: Calculations_on_three_stage_gas_turbine.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"// scilab Code Exa 2.5 Calculation on three stage gas turbine\n",
"\n",
"p1=1.0; // Initial Pressure in bar\n",
"gamma=1.4;\n",
"T1=1500; // Initial Temperature in K\n",
"s=3; // number of stages\n",
"opr=11; // Overall Pressure Ratio\n",
"\n",
"// part(a)Determining pressure ratio of each stage\n",
"pr=opr^(1/s); // equal Pressure Ratio in each stage\n",
"disp (pr,'(a)Pressure ratio of each stage is')\n",
"\n",
"// part(b)Determining the polytropic or small stage efficiency\n",
"n_o=0.88; // Overall Efficiency \n",
"delT=T1*(1-opr^(-((gamma-1)/gamma)))*n_o;\n",
"T2=T1-delT;\n",
"n_p=(log(T1/T2))/(((gamma-1)/gamma)*(log(opr)));\n",
"disp ('%',n_p*100,'(b)small stage Efficiency or polytropic efficiency of the turbine is')\n",
"\n",
"// part(c) Determining mass flow rate\n",
"P=30000; // Power output of the Turbine in kW\n",
"n_d=0.91; // Overall efficiency of the drive\n",
"cp=1.005; // Specific Heat at Constant Pressure in kJ/(kgK)\n",
"m=P/(cp*delT*n_d);\n",
"disp ('kg/s',m,'(c)mass flow rate is')\n",
"\n",
"// part(d) Determining efficiency of each stage\n",
"n_st=(1-pr^(n_p*(-((gamma-1)/gamma))))/(1-pr^(-((gamma-1)/gamma)));\n",
"disp ('%',n_st*100,'(d)Efficiency of each stage is')\n",
"d=3;\n",
"T(1)=T1;\n",
"for i=1:d\n",
" delT(i)=T(i)*(1-pr^(n_p*(-((gamma-1)/gamma))));\n",
" T(i+1)=T(i)-delT(i);\n",
" P(i)=m*cp*delT(i);\n",
"printf('\n P(%d)=%f MW',i,P(i)*1e-3)\n",
"end"
]
}
,
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Example 2.6: Calculations_on_a_Gas_Turbine.sce"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"// scilab Code Exa 2.6 calculation on a gas turbine\n",
"\n",
"funcprot(0);\n",
"p1=5; // Inlet Pressure in bar\n",
"p2=1.2; // Exit Pressure in bar\n",
"T1=500; // Initial Temperature in K\n",
"gamma=1.4;\n",
"m=20; // mass flow rate of the gas in kg/s\n",
"cp=1.005; // Specific Heat at Constant Pressure in kJ/(kgK)\n",
"n_T=0.9; // Overall Efficiency \n",
"pr=p1/p2; // Pressure Ratio\n",
"// part(a)\n",
"T2s=T1/(pr^((gamma-1)/gamma));\n",
"T2=T1-(n_T*(T1-T2s));\n",
"n_p=(log(T1/T2))/(log(T1/T2s));\n",
"disp('%',n_p*100,'(a)small stage Efficiency or polytropic efficiency of the expansion is')\n",
"P=m*cp*(T1-T2);\n",
"disp('kW',P,'and Power developed is')\n",
"\n",
"// part(b)\n",
"AR=2.5; // Area Ratio of Diffuser\n",
"R=0.287; // Universal Gas Constant in kJ/kgK\n",
"p3=1.2; // Exit Pressure for diffuser in bar\n",
"c2=75; // Velocity of gas at turbine exit in m/s\n",
"c3=c2/AR;\n",
"n_d=0.7; // Efficiency of the diffuser\n",
"ro2=p2/(R*T2);\n",
"delp=n_d*(0.5*0.001*ro2*((c2^2)-(c3^2))); // delp=p3-p2d\n",
"disp('mm W.G.',delp*100000/9.81,'(b)static pressure across the diffuser is')\n",
"p2d=p3-delp;\n",
"prd=p1/p2d;\n",
"T2sd=T1/(prd^((gamma-1)/gamma));\n",
"T2d=T1-(n_T*(T1-T2sd));\n",
"Pd=m*cp*(T1-T2d);\n",
"disp('kW',Pd-P,'and Increase in the power output of the turbine is')\n",
"\n",
"disp('Comment: Error in Textbook, Answers vary due to Round-off Errors')"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Scilab",
"language": "scilab",
"name": "scilab"
},
"language_info": {
"file_extension": ".sce",
"help_links": [
{
"text": "MetaKernel Magics",
"url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
}
],
"mimetype": "text/x-octave",
"name": "scilab",
"version": "0.7.1"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
|