function y = klcalc(T,index,mw,cnms,lrho)
gamma=1;
found=0;
kappa=1.3807E-23; %J/K

Nn=6.023e23; %1/gmol
if cnms(index,[1:5])=='water'
A=.00015;
B=-.1512;
C=58.912;
D=-6001.7;
a=0;
b=-.0239;
c=62.405;
rho=(a*(T)^2+b*(T)+c)*mw(index);
vs=A.*(T)^3 +B.*(T)^2+C.*(T)+D;
found=1;
Vn=mw(index)/rho/1000; % if rho in kg/m^3 in m^3/gmol
y=2.8*(Nn/Vn)^(2/3)*kappa*vs; %in units kg m /s^3/K
break
end

if cnms(index,[1:6])=='nitrog'
A=0;
B=0;
C=-10.145;
D=-1134.8;
a=-.0158;
b=-8.528;
c=-1122.8;
rho=(a*(T+273.15)^2+b*(T+273.15)+c)*mw(index);
found=1;
end

if cnms(index,[1:6])=='oxygen'
A=.0037;
B=2.1299;
C=403.26;
D=25887;
a=-.0003;
b=-.2517;
c=-1.4332;
rho=(a*(T+273.15)^2+b*(T+273.15)+c)*mw(index);
found=1;
end

if cnms(index,[1:6])=='fluori'
A=-1e-7;
B=-5e-5;
C=-.0079;
D=-.4171;
a=-.0003;
b=-.3049;
c=-6.0883;
rho=(a*(T+273.15)^2+b*(T+273.15)+c)*mw(index);
found=1;
end

if cnms(index,[1:6])=='methan'
A=0;
B=0;
C=-9.7087;
D=-228.79;
a=-.0002;
b=-.1596;
c=6.0081;
rho=(a*(T-273.15)^2+b*(T-273.15)+c)*mw(index);
found=1;
end

if cnms(index,[1:6])=='ethane'
A=0;
B=0;
C=-7.371;
D=664.62;
a=-3e-5;
b=-.0461;
c=14.254;
rho=(a*(T+273.15)^2+b*(T+273.15)+c)*mw(index);
found=1;
end

if cnms(index,[1:6])=='pentan'%not in 301 database
A=-2e-5;
B=.0012;
C=-4.8315;
D=1132;
found=1;
end

if cnms(index,[1:6])=='ethene'%not in 301 database
A=0;
B=0;
C=-7.0581;
D=579.4;
found=1;
end

if cnms(index,[1:6])=='butane'%not in 301 database
A=2e-7;
B=.0021;
C=-5.3588;
D=1028.5;
found=1;
end

if cnms(index,[1:6])=='isobut'
A=-9e-6;
B=-.0006;
C=-5.4483;
D=933.76;
a=-1e-5;
b=-0.0188;
c=10.009;
rho=(a*(T+273.15)^2+b*(T+273.15)+c)*mw(index);
found=1;
end

if cnms(index,[1:6])=='heptan'%not in 301 database
A=0;
B=0;
C=-4.3199;
D=1244.1;
found=1;
end

if cnms(index,[1:6])=='hexane'%not in 301 database
A=0;
B=.0045;
C=-4.4999;
D=1164;
found=1;
end

if cnms(index,[1:6])=='ammoni'
A=0;
B=0;
C=-7.7709;
D=1503.4;
a=-.0001;
b=-.0812;
c=37.473;
rho=(a*(T+273.15)^2+b*(T+273.15)+c)*mw(index);
found=1;
end

if cnms(index,[1:6])=='propan'
A=0;
B=0;
C=-6.714;
D=860.28;
a=-8e-6;
b=-.0253;
c=12.156;
rho=(a*(T+273.15)^2+b*(T+273.15)+c)*mw(index);
found=1;
end

if cnms(index,[1:7])=='propene' %not in 301 database
A=0;
B=0;
C=-6.6531;
D=836.7;
found=1;
end

vs=A.*(T-273.15)^3 +B.*(T-273.15)^2+C.*(T-273.15)+D
if vs<0
ans='This is not in the liquid range'
end
if found==0
cnms(1,:)
'Is not in the database for liquids'
end
rho
Vn=mw(index)/rho/1000; % if rho in kg/m^3 in m^3/gmol
y=2.8*(Nn/Vn)^(2/3)*kappa*vs; %in units kg m /s^3/K

%Mollie Finley and Ryan Dunnavant 4/2004



HomeGasesLiquidsSolidsSources
© 2003 Finley and Dunnavant