Sunteți pe pagina 1din 3

MATLAB Code

%creating a symbolic expression for differentiation


syms theta;
%declaring constants of IAPWS expression for saturation
pressure calculation
a1 = -7.85951783; a4 = 22.6807411;
a2 = 1.84408259 ;a5 = -15.9618719;
a3 = -11.7866497 ;a6 = 1.80122502;
%calculating the tau values for three temperatures:
42,102,327
t1=0.513209786;
t2=0.420487841;
t3=0.0727805457;
Tc=647.096;
T1=315;
T2=375;
T3=600;
Pc=22.064;
%writing the expression for calculation of saturation
pressure from IAPWS
%expression
P=Pc*exp((1/theta)*(a1*(1-theta)+ (a2*((1-theta)^1.5)) +
(a3*((1-theta)^3)) + (a4*((1-theta)^3.5)) + (a5*((1-
theta)^4)) + (a6*((1-theta)^7.5))));
y=diff(P)/Tc;

P1=Pc*exp((Tc/T1)*(a1*t1+ (a2*(t1^1.5)) + (a3*(t1^3)) +


(a4*(t1^3.5)) + (a5*(t1^4)) + (a6*(t1^7.5))))
P2=Pc*exp((Tc/T2)*(a1*t2+ (a2*(t2^1.5)) + (a3*(t2^3)) +
(a4*(t2^3.5)) + (a5*(t2^4)) + (a6*(t2^7.5))))
P3=Pc*exp((Tc/T3)*(a1*t3+ (a2*(t3^1.5)) + (a3*(t3^3)) +
(a4*(t3^3.5)) + (a5*(t3^4)) + (a6*(t3^7.5))))

%declaring constants of IAPWS expression for saturated


liquid density calculation
b1 = 1.99274064 ;b4 = -1.75493479;
b2 = 1.09965342 ;b5 = -45.5170352;
b3 = -0.5100839303 ;b6 = -6.74694450*10^5;
P_c=322;

Pf_1=P_c*(1 + b1*t1^(1/3) + b2*t1^(2/3) + b3*t1^(5/3) +


b4*t1^(16/3) + b5*t1^(43/3) + b6*t1^(110/3))
Pf_2=P_c*(1 + b1*t2^(1/3) + b2*t2^(2/3) + b3*t2^(5/3) +
b4*t2^(16/3) + b5*t2^(43/3) + b6*t2^(110/3))
Pf_3=P_c*(1 + b1*t3^(1/3) + b2*t3^(2/3) + b3*t3^(5/3) +
b4*t3^(16/3) + b5*t3^(43/3) + b6*t3^(110/3))

%declaring constants of IAPWS expression for saturated


vapour density calculation
c1 = -2.03150240; c4 = -17.2991605;
c2 = -2.68302940; c5 = -44.7586581;
c3 = -5.38626492; c6 = -63.9201063;

Pg_1=P_c*exp(c1*t1^(2/6) + c2*t1^(4/6) + c3*t1^(8/6) +


c4*t1^(18/6) + c5 *t1^(37/6) + c6*t1^(71/6))
Pg_2=P_c*exp(c1*t2^(2/6) + c2*t2^(4/6)+ c3*t2^(8/6) +
c4*t2^(18/6) + c5 *t2^(37/6) + c6*t2^(71/6))
Pg_3=P_c*exp(c1*t3^(2/6) + c2*t3^(4/6) + c3*t3^(8/6) +
c4*t3^(18/6) + c5 *t3^(37/6) + c6*t3^(71/6))

%declaring constants of IAPWS expression for specific


enthalpy calculation
d1 = -5.65134998*(10^(-8)); d4 = -135.003439;
d2 = 2690.6631 ;d5 = 0.981825814;
d3 = 127.287297 ;d6 = -1135.905627715;
a0=1000;
a_1=a0*(d6 + d1*(1-t1)^(-19)+ d2*(1-t1) + d3*((1-t1)^4.5)+
d4*((1-t1)^5)+ d5*((1-t1)^54.5))
a_2=a0*(d6 + d1*(1-t2)^(-19)+ d2*(1-t2) + d3*((1-t2)^4.5)+
d4*((1-t2)^5)+ d5*((1-t2)^54.5))
a_3=a0*(d6 + d1*(1-t3)^(-19)+ d2*(1-t3) + d3*((1-t3)^4.5)+
d4*((1-t3)^5)+ d5*((1-t3)^54.5))

%calculation of enthalpies of saturated liquid(hf) and


saturated vapour(hg)
%by using specific enthalpy and values of pressure gradient
wrt temperature
hf1=((a_1*10^(-6))+(T1/Pf_1)*(vpa(subs(y,theta,(1-
t1)))))*1000;
hf2=((a_2*10^(-6))+(T2/Pf_2)*(vpa(subs(y,theta,(1-
t2)))))*1000;
hf3=((a_3*10^(-6))+(T3/Pf_3)*(vpa(subs(y,theta,(1-
t3)))))*1000;
hg1=((a_1*10^(-6))+(T1/Pg_1)*(vpa(subs(y,theta,(1-
t1)))))*1000;
hg2=((a_2*10^(-6))+(T2/Pg_2)*(vpa(subs(y,theta,(1-
t2)))))*1000;
hg3=((a_3*10^(-6))+(T3/Pg_3)*(vpa(subs(y,theta,(1-
t3)))))*1000;
disp(hf1);
disp(hf2);
disp(hf3);
disp(hg1);
disp(hg2);
disp(hg3);

S-ar putea să vă placă și