summaryrefslogtreecommitdiff
path: root/32/CH7/EX7.14/7_14.sce
blob: 66c910907f40d45b5f1ba7ff5154455aecffb8d6 (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
//pathname=get_absolute_file_path('7.14.sce')
//filename=pathname+filesep()+'7.14-data.sci'
//exec(filename)
//Volume of compartment A(in m^3):
Va=6
//Volume of compartment B(in m^3):
Vb=4
//Pressure in compartment A(in bar):
p1=6
//Temperature in compartment A(in K):
T1=600
//Atmosheric pressure(in bar):
p0=1
//Atmosheric temperature(in K):
T0=300
//Adiabatic index of compression:
r=1.4
//Gas constant(in J/kg.K):
R=0.287
//Value of Cv(in kJ/kg.K):
Cv=0.718
//Final volume(in m^3):
V2=Va+Vb
//Final temperature(in K):
T2=T1*(Va/V2)^(r-1)
//Mass of air(in kg):
m=p1*10^5*Va/(R*10^3*T1)
//Change in entropy of control system(in kJ/kg.K):
dSs=m*(Cv*log(T2/T1)+R*log(V2/Va))
//Loss of available energy or irreversibilty(in kJ):
I=T0*dSs
printf("\nRESULT")
printf("\nLoss of available energy = %f kJ",-I)