Uploaded by Spry Cylinder

CH127 MLAB EXER9.m

advertisement
%{
Exercise 9
Fugacity of a Component in a Multicomponent Gaseous Mixture using PREOS
Determine the fugacities of ethane and n-butane in an equimolar mixture at
323.15 K ata pressure from 1 to 25 bar total pressure using PREOS.
%}
% 1: ethane
% 2: n-butane
y1=0.5;
y2=0.5;
% binary interaction parameter
k12=0.003;
% Using PREOS to determine the pure specie fugacity
T=323.15;
P=[1:0.1:25];
n=(25-1)/0.1;
R=83.14;
sig=1+2^0.5;
eps=1-2^0.5;
% K
% bar
% cm^3-bar/gmol-k
% For Ethane
Tc1=305.3;
% K
Pc1=48.72;
% bar
Tr1=T/Tc1;
omega1=0.1;
kappa1=0.37469+1.54226*omega1-0.26992*omega1^2;
alpha1=(1+kappa1*(1-Tr1^0.5))^2;
a11=(0.45724*R^2*Tc1^2*alpha1)/Pc1;
b1=(0.07780*R*Tc1)/Pc1;
% For butane
Tc2=425.2;
% K
Pc2=37.9;
% bar
Tr2=T/Tc2;
omega2=0.1;
kappa2=0.37469+1.54226*omega2-0.26992*omega2^2;
alpha2=(1+kappa2*(1-Tr2^0.5))^2;
a22=(0.45724*R^2*Tc2^2*alpha2)/Pc2;
b2=(0.07780*R*Tc2)/Pc2;
a12=((a11*a22)^0.5)*(1-k12);
a=y1^2*a11 + 2*y1*y2*a12 + y2^2*a22;
b=y1*b1+y2*b2;
for i=1:(n+1)
A=(a*P(i))/(R*T)^2;
B=(P(i)*b)/(R*T);
AE(i)=1;
% abs error
VA(i)=R*T/P(i);
% VA is assumed molar volume
while (AE(i)>0.001)
% VC is computed molar volume
This study source was downloaded by 100000869784087 from CourseHero.com on 10-22-2023 07:08:50 GMT -05:00
https://www.coursehero.com/file/96169286/CH127-MLAB-EXER9m/
VC(i)=(R*T/P(i))+b-(a/P(i))*((VA(i)-b)/((VA(i)+eps*b)*(VA(i)+sig*b)));
AE(i)=abs(VC(i)-VA(i));
VA(i)=VC(i);
end
z(i)=(P(i)*VC(i))/(R*T);
%for Ethane
temp1E=(b1/b)*(z(i)-1)-log(z(i)-((b*P(i))/(R*T)));
temp2E=-a/(2*2^0.5*b*R*T);
temp3E=y1*a11+y2*a12;
temp4E=(2*temp3E/a)-(b1/b);
temp5E=z(i)+((sig*b*P(i))/(R*T));
temp6E=z(i)+((eps*b*P(i))/(R*T));
temp7E=log(temp5E/temp6E);
f1_bar(i)=y1*P(i)*exp(temp1E+temp2E*temp4E*temp7E);
end
% for Butance
temp1B=(b2/b)*(z(i)-1)-log(z(i)-((b*P(i))/(R*T)));
temp2B=-a/(2*2^0.5*b*R*T);
temp3B=y1*a12+y2*a22;
temp4B=(2*temp3B/a)-(b2/b);
temp5B=z(i)+((sig*b*P(i))/(R*T));
temp6B=z(i)+((eps*b*P(i))/(R*T));
temp7B=log(temp5B/temp6B );
f2_bar(i)=y2*P(i)*exp(temp1B+temp2B*temp4B*temp7B);
subplot(2,1,1)
plot(P, f1_bar, 'rx-')
title('fugacity of ethane in gas mixture vs pressure at 323.15K using PREOS')
xlabel(' P (bar)')
ylabel('f_{ethane} in GMix (bar)')
subplot(2,1,2)
plot(P, f2_bar, 'bx-')
title('fugacity of n-butane in gas mixture vs pressure at 323.15K using PREOS')
xlabel(' P (bar)')
ylabel('f_{butane} in GMix (bar)')
This study source was downloaded by 100000869784087 from CourseHero.com on 10-22-2023 07:08:50 GMT -05:00
https://www.coursehero.com/file/96169286/CH127-MLAB-EXER9m/
Powered by TCPDF (www.tcpdf.org)
Download