• 大小: 2KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-29
  • 语言: 其他
  • 标签: .m  

资源简介

热力学模型的编码实现,主要是利用PR和SRK方程,以及闪蒸计算。

资源截图

代码片段和文件信息

function [ABZAiBim1m2Aij]=Compressity(TriPriBIPciwioption)
if option==1
    Qbi=0.077796074;
    Qai=0.457235529;
    m1=1+sqrt(2);
    m2=1-sqrt(2);
    for i=1:1:6
        if (wi(i)<0.49||wi(i)==0.49)
            mi(i)=0.37464+1.54226*wi(i)-0.26992*(wi(i))^2;
        end
        if (wi(i)>0.49)
            mi(i)=0.379642+1.48503*wi(i)-0.164423*(wi(i))^2+0.016666*(wi(i))^3;
        end
    end
    mi=mi‘;
elseif option==2
    mi=0.48+1.574*wi-0.176*wi.^2;
    Qbi=0.08664035;
    Qai=0.4274802;
    m1=0;
    m2=1;
end

alpha=(1+mi.*(1-Tri.^0.5)).^2;
Ai=Qai*alpha.*Pri./Tri.^2;
Bi=Qbi*Pri./Tri;
AiAj=Ai*Ai‘;
Aij=sqrt(AiAj).*(1-BIP);
cicj=ci*ci‘;
Ami=cicj.*Aij;
A=sum(sum(Ami));
B=ci‘*Bi;

if option==1
    a=B-1;
    b=A-2*B-3*B^2;
    c=B^3+B^2-A*B;
elseif option==2
    a=-1;
    b=A-B-B^2;
    c=-A*B;
end

% X=eval(solve(‘z^3+a*z^2+b*z+c=0‘));   another method to solve cubic equation

Qi=(a^2-3*b)/9;
Ri=(2*a^3-9*a*b+27*c)/54;
M=Ri^2-Qi^3;
if (M<0||M==0)
    theta=acos(Ri/sqrt(Qi^3));
    x1=-(2*sqrt(Qi)*cos(theta/3))-a/3;
    x2=-(2*sqrt(Qi)*cos((theta+2*pi)/3))-a/3;
    x3=-(2*sqrt(Qi)*cos((theta-2*pi)/3))-a/3;
    X=[x1x2x3];
    xmin=min(X);
    xmax=max(X);
    dG=xmax-xmin+log((xmin-B)/(xmax-B))+A/((m1-m2)*B)*log((xmin+m1*B)*(xmax+m2*B)/(xmin+m2*B)/(xmax+m1*B));
    if (dG>0)
        Z=xmin;
    else
        Z=xmax;
    end
end
if M>0
    S=-sign(Ri)*(abs(Ri)+sqrt(M))^(1/3);
    if S==0
        T1=0;
    else
        T1=Qi/S;
    end
    Z=S+T1-a/3;
end
end


 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       1573  2018-10-02 14:25  thermodynamics model\Compressity.m

     文件        158  2018-07-26 19:37  thermodynamics model\Fugucity.m

     文件       1582  2018-10-02 13:17  thermodynamics model\mainbase.m

     文件        934  2018-09-09 14:25  thermodynamics model\Phase_Fraction.m

     目录          0  2018-12-10 14:29  thermodynamics model

----------- ---------  ---------- -----  ----

                 4247                    5


评论

共有 条评论