summaryrefslogtreecommitdiff
path: root/647/CH2/EX2.16/Example2_16.sce
blob: 55e48cfd50b68ac7bd9fce610949cfdbc0c0bfbf (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
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
clear;
clc;

// Example: 2.16
// Page: 62

printf("Example: 2.16 - Page: 62\n\n");

// Solution

//*****Data*****//
P1 = 1;// [bar]
T1 = 300;//[K]
V1 = 24.92;// [cubic m/kmol]
P2 = 10;// [bar]
T2 = 300;// [K]
Cp = 29.10;// [kJ/kmol K]
Cv = 20.78;// [kJ/kmol K]
R = 8.314;// [J/mol K]
//**************//

// Basis: 1 kmol of ideal gas:
n = 1;
V2 = P1*V1/P2;// [cubic m]

// First Process:
printf("First Process\n");
// In the first step of the first process, the cooling of ga takes place at constant pressure.
// Here the volume is reduced appreciably and consequently the temperature decreases.
T_prime = T1*V2/V1;// [K]
// Heat Requirement:
Q1 = n*Cp*(T_prime - T1);// [kJ]
deltaH1 = Q1;// [kJ]
deltaU1 = deltaH1 - P1*(V2 - V1);// [kJ]
// In the second step, the gas is heated at constant Volume:
// V = constant
Q2 = n*Cv*(T2 - T_prime);// [kJ]
deltaU2 = Q2;// [kJ]
deltaH2 = n*R*(T2 - T_prime);// [kJ]
deltaU = deltaU1 + deltaU2;// [kJ]
deltaH = deltaH1 + deltaH2;// [kJ]
Q = Q1 + Q2;// [kJ]
printf("Change in Internal Energy is %.2f kJ\n",deltaU);
printf("Change in Enthalpy is %.2f kJ\n",deltaH);
printf("Heat Requirement is %.2f kJ\n",Q);
printf("\n");

// Second Process:
printf("Second Process\n");
// In the first step of the second process, the gas is heated at constant volume.
T_prime = T1*P2/P1;// [K]
// Heat Requirement:
Q1 = n*Cv*(T_prime - T1);// [kJ]
deltaU1 = Q1;// [kJ]
deltaH1 = n*R*(T_prime - T1);// [kJ]
// In the second step, the gas is cooled at constant presure:
// V = constant
Q2 = n*Cp*(T2 - T_prime);// [kJ]
deltaH2 = Q2;// [kJ]
deltaU2 = deltaH2 - P1*(V2 - V1);// [kJ]
deltaU = deltaU1 + deltaU2;// [kJ]
deltaH = deltaH1 + deltaH2;// [kJ]
Q = Q1 + Q2;// [kJ]
printf("Change in Internal Energy is %.2f kJ\n",deltaU);
printf("Change in Enthalpy is %.2f kJ\n",deltaH);
printf("Heat Requirement is %.2f kJ\n",Q);