模拟心得 MATERIAL STUDIO 中SORPTION 第一个课题是模拟金属有机框架和共价有机框架吸附CO2 以及分离CO2/CH4,使用的软件是Material studio,使用的是Sorption 模块,输入的是逸度。 单组份求逸度的MATLAB程序,只需要在主程序窗 口输入function [rho,f] =PengRobinson(P1,T,N)(P1,T,N是具体的数值)就可以得到不同的压力和温度下的逸度。 function [rho,f] =PengRobinson(P1,T,N) %+++++++++++++++++++++++++++++++++++++++++++++ %PengRobinson is used to calculate the density and fugacity of single %component gas at given pressure with Peng-Robinson equation. %PengRobinson v1.00 beta include the parameter of n-alkanes(1-5), CO2(6) %and CO(7). %Where P1 means input pressure(kPa), T is temperature(K), N means the serial number of gas. rho %is density, f is fugacity. %e.g. If you wanna calculate density and fugacity of methane at 300kPa, 298k,you %need input [rho,f] =PengRobinson(300,298,1). %+++++++++++++++++++++++++++++++++++++++++++++ %set physical parameters %+++++++++++++++++++++++++++++++++++++++++++++ P=P1./100; t_M=[16.043 30.070 44.097 58.123 72.150 44.01 28.01]; t_omiga=[0.012 0.100 0.152 0.2 0.252 0.224 0.048]; t_Tc=[190.6 305.3 369.8 425.1 469.7 304.2 132.9 ]; t_Pc=[45.99 48.72 42.48 37.96 33.70 73.83 34.99]; %+++++++++++++++++++++++++++++++++++++++++++++ Tc=t_Tc(N); Pc=t_Pc(N); omiga=t_omiga(N); M=t_M(N); %+++++++++++++++++++++++++++++++++++++++++++++ R=83.14; epsilon=1-2.^(0.5); sigma=1+2.^(0.5); %+++++++++++++++++++++++++++++++++++++++++++++ %calculate the Z of PR equation %+++++++++++++++++++++++++++++++++++++++++++++ alpha=(1+(0.37464+1.54226*omiga-0.26992*omiga.^2)*(1-(T/Tc)^(0.5))).^2; a=((0.45724*R^2*Tc^2)/Pc)*alpha; b=0.07779.*R.*Tc./Pc; beta=b.*P./(R.*T); q=a./(b.*R.*T); Z0=zeros(length(P),1); Z1=ones(length(P),1); for k=1:length(P) while abs(Z1(k)-Z0(k))>1e-6 Z0(k)=Z1(k); Z1(k)=1+beta(k)-q.*beta(k).*(Z0(k)-beta(k))./((Z0(k)+epsilo...