summaryrefslogtreecommitdiff
path: root/32/CH3/EX3.21/3_21.sce
blob: 29d8b510c384f4d439eaa9bf4656f3b0437e78c7 (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
//pathname=get_absolute_file_path('3.21.sce')
//filename=pathname+filesep()+'3.21-data.sci'
//exec(filename)
//Volume of bottle(in m^3):
v1=0.3
//Pressure in the bottle(in bar):
p1=35
//Temperature in the bottle(in K):
T1=40+273
//Turbo generator's actual output(in kJ/s):
w1=5
//Final prssure(in bar):
p2=1
//Final volume(in m^3):
v2=v1
//Gas constant for air(in kJ/kg.K):
Ra=0.287
//Compression ratio:
r=1.4
//% of output which is consumed= 60%
//Specific heat at const volume(in kJ/kg):
Cv=0.718
//Specific heat at const pressure(in kJ/kg):
Cp=1.005
//Final temperature(in K):
T2=T1*(p2/p1)^((r-1)/r)
//Initial mass in the bottle(in kg):
m1=p1*10^2*v1/(Ra*T1)
//Final mass in the bottle(in kg):
m2=p2*10^2*v2/(Ra*T2)
//Maximum work that can be obtained(in kJ):
W=(m1*Cv*T1-m2*Cv*T2)-(m1-m2)*Cp*T2
//Input to the turbo generator(in kJ/s):
i=w1/0.6
//Time duration(in s):
t=W/i
printf("\nRESULT\n")
printf("\nDuration = %f seconds",t)