Duke711 |
Verfasst am: 28. Feb 2017 17:50 Titel: |
|
Diese empirische Gl. kann man nicht so einfach nach T auflösen. So könnte man es z.B. mit Peng Robinson in Matlab machen: Code ---------------------------------- % function result = PengRobinson(T,P,Tc,Pc,w,MW,Liquido) % Parameters: T,P,w,Tc,Pc,w,MW,Liquido % T: Temperature [=] K % P: Presure [=] Pa % Tc: critical temperature [=] K % Pc: critical presure [=] Pa % w: accentic factor % MW: molar weigth [=] kg/mol % Liquido: if Liquido == 1, then calculates liquid fugacity; % if Liquido == 0 then calculates vapor fugacity % Example: % [Z fhi density] = PengRobinson(273,2*1.013*1e5,304.21,7.382*1e6,0.225,0.044,1) function [Z,fhi,density] = PengRobinson(T,P,Tc,Pc,w,MW,Liquido) R = 8.314; % gas constant [=] J/(mol K) % Reduced variables Tr = T/Tc ; Pr = P/Pc ; % Parameters of the EOS for a pure component m = 0.37464 + 1.54226*w - 0.26992*w^2; alfa = (1 + m*(1 - sqrt(Tr)))^2; a = 0.45724*(R*Tc)^2/Pc*alfa; b = 0.0778*R*Tc/Pc; A = a*P/(R*T)^2; B = b*P/(R*T); % Compressibility factor Z = roots([1 -(1-B) (A-3*B^2-2*B) -(A*B-B^2-B^3)]); ZR = []; for i = 1:3 if isreal(Z(i)) ZR = [ZR Z(i)]; end end if Liquido == 1 Z = min(ZR); else Z = max(ZR); end % Fugacity coefficient fhi = exp(Z - 1 - log(Z-B) - A/(2*B*sqrt(2))*log((Z+(1+sqrt(2))*B)/(Z+(1-sqrt(2))*B))); if isreal(fhi) density=P*MW/(Z*R*T); result = [Z fhi density]; else 'No real solution for "fhi" is available in this phase' result=['N/A' 'N/A' 'N/A']; end -------------- Wenn man es über die Wagner-Gleichung machen möchte dann ganz einfach über die Temperatur als zu definierende Variable bzw. als Tabellenwerk. code ----------------- function SVP = svp(T) % T = temperature on Kelvin scale % SVP = saturation vapor pressure according to Goff & Gratch Equation (1946) % SVP in Pascal Ts = 373.15; % standard temperature at steam point on Kelvin scale (Goff, 1965) Ps = 101324.6; % standard atmospheric pressure at steam point (Pascal) log10SVP = -7.90298*(Ts./T - 1) + 5.02808*log10(Ts./T) -1.3816e-7*(10.^(11.344*(1 - T./Ts)) - 1) + 8.1328e-3*(10.^(3.49149*(1 - Ts./T)) - 1) + log10(Ps); SVP = 10.^(log10SVP); ------------------------------------ Einen einfachen Weg gibt es: Coolpack oder Refprop |
|