summaryrefslogtreecommitdiff
path: root/2339/CH4/EX4.7.1/Ex4_7.sce
blob: c06cd192cd9510d706173d938e84771bd3b96587 (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
clc
clear

//Conditions at 10 bar
P1=10;              //in bars
Hg=2778.1;          //in kJ/kg
Tsat=179.9+273;     //Temperature in K
Vg=0.194;           //in m^3/kg

//Conditions at 10 bar and 300 Celcius
Cps=2.1;
Tsup=300+273;
H1=Hg+(Cps*(Tsup-Tsat));
V1=Vg*(Tsup/Tsat);
U1=H1-(P1*100*V1);
printf('The Internal energy: %3.1f kJ/kg',U1);
printf('\n');

//At 1.4 bar and other conditions
P2=1.4;             //in bars
x=0.8;              //Dryness Fraction
Hf=458.4;           //in kJ/kg
Hfg=2232.0;         //in kJ/kg
Vg=1.237;           //in m^3/kg
H2=Hf+(x*Hfg);
V2=x*Vg;
U2=H2-(P2*100*V2);
U=U2-U1;
printf('The change in internal energy: %3.1f kJ/kg',U);
printf('\n');