clearvars
close all
clc
global eta eps rext rint delta rhoc cpi PinSweep
global DH0 Trif mui ki MW S R Ac Dp p ls Tw
R = 8314.45;
rhoc = 2400;
delta = 5e-6;
eta = 0.28;
rext = 0.08;
rint = 0.045;
Ac = pi*rint^2;
L = 10;
eps = 0.6;
nu = [-1 -1 1 1 0 0 0];
nup = [0 0 0 -1 0 -1 0];
cpi = 1e-3*[2.9108e+04 3.3363e+04 2.9370e+04 2.7617e+04 2.9105e+04 2.7617e+04 3.3363e+04
8.7730e+03 2.6790e+04 3.4540e+04 9.5600e+04 8.6149e+03 9.5600e+04 2.6790e+04
3.0851e+03 2.6105e+03 1.4280e+03 2.4660e+03 1.7016e+03 2.4660e+03 2.6105e+03
8.4553e+03 8.8960e+03 2.6400e+04 3.7600e+03 1.0347e+02 3.7600e+03 8.8960e+03
1.5382e+03 1.1690e+03 5.8800e+02 5.6760e+02 9.0979e+02 5.6760e+02 1.1690e+03];
mui = [ 1.1127e-06 1.7096e-08 2.148e-06 1.797e-07 6.5592e-07 1.797e-07 1.7096e-08
0.5338 1.1146 0.46 0.685 0.6081 0.685 1.1146
94.7 0 290 -0.59 54.714 -0.59 0
0 0 0 140 0 140 0 ];
ki = [ 5.9882e-04 6.2041e-06 3.69 2.653e-03 3.3143e-04 2.653e-03 6.2041e-06
0.6863 1.3973 -0.3838 0.7452 0.7722 0.745 1.3973
57.13 0 964 12 16.323 12 0
501.92 0 1.86e+06 0 373.72 0 0 ];
DH0 = 1e-3*[-1.1053e+08 -2.41814e+08 -3.9351e+08 0 0 0 -2.41814e+08 ];
Trif = 298.15;
Tw = 628.15;
TinSweep = 628.15;
Tin = 628;
PinSweep = 101;
Pin = 2376.53;
FinSweep = 8;
Ftot0 = 14;
F0Perm = 0;
x0 = [0.0521 0.4453 0.0272 0.4649 0.0105];
MW = [ 28.010 18.015 44.010 2.016 28.013 2.016 18.015 ];
Tb = [81.15 373.15 194.65 79 77.35 79 373.15 ];
S = 1.5.*Tb;
Um = 8.64;
Dp = 0.0053;
ls = 1.256;
p = 0.8;
In = [Ftot0*x0, F0Perm, FinSweep, Pin, Tin, TinSweep - 100];
zspan = [0 L];
options = odeset('Reltol',1e-11,'Abstol',1e-12);
[Z,X] = ode15s(@Tronky,zspan,In,options);
function f = Tronky(z,x)
global eta eps rext rint delta rhoc cpi PinSweep
global DH0 Trif mui ki MW S R Ac Dp p ls Tw
Fi = x(1:5);
FiPS = x(6:7);
P = x(8);
T = x(9);
Tperm = x(10);
Ftot = sum(Fi);
xi = Fi./Ftot;
Pi = P*xi;
FtotPS = sum(FiPS);
xiPS = FiPS./FtotPS;
PiPS = PinSweep*xiPS;
Tmem = (T + Tperm)/2;
k = exp(-29364/(1.987*T) + 40.32/1.987);
Kco = exp(3064/(1.987*T) - 6.74/1.987)*1/(101325);
Kh2o = exp(-6216/(1.987*T) + 12.77/1.987);
Kco2 = exp(12542/(1.987*T) - 18.45/1.987);
Keq = exp(4400/T - 4.063);
rco = k*Kco*Kh2o*(Pi(1)*Pi(2) - Pi(3)*Pi(4)/Keq)*(1 + Kco*Pi(1) + Kh2o*Pi(2) + Kco2*Pi(4))^-2*rhoc;
Rco = rco*eta*(1 - eps)*pi*(rext^2 - rint^2);
Bh = 2.95*1e-4*3600/1e3*exp(-5833.5/Tmem);
Jh2perm = Bh/delta*(Pi(4)^0.5 - PiPS(2)^0.5);
Rh2 = Jh2perm*2*pi*rint;
for i = 1:5
cp(i) = cpi(1,i) + cpi(2,i)*((cpi(3,i)/T)/sinh(cpi(3,i)/T))^2 +...
cpi(4,i)*((cpi(5,i)/T)/cosh(cpi(5,i)/T))^2;
DHi(i) = DH0(i) + (2*cpi(2,i)*cpi(3,i))*((1/(exp(2*cpi(3,i)/T) - 1) - 1/(exp(2*cpi(3,i)/Trif) - 1)) + ...
(1/(exp(2*cpi(3,i)/T) + 1) - 1/(exp(2*cpi(3,i)/Trif) + 1)));
cpmixi(i) = cp(i)*xi(i);
MWi(i) = MW(i)*xi(i);
end
MWm = sum(MWi);
rhom = P/(R*T)*MWm;
cpm = sum(cpmixi(i));
DHr = -DHi(1) - DHi(2) + DHi(3) + DHi(4);
for i = 1:5
mu = mui(1,i)*(T^(mui(2,i)))/(1 + mui(3,i)/T + mui(4,i)/(T^2));
k = 3600/1e3*(ki(1,i)*(T^(ki(2,i)))/(1 + ki(3,i)/T + ki(4,i)/(T^2)));
end
for i = 1:5
for j= 1:5
phi(i,j) = (1 + ((mu(i)./mu(j))^(1/2)).*((MW(j)./MW(i))^(1/4))).^2./...
(8.*(1 + MW(i)./MW(j))).^(1/2);
Ss(i,j) = 0.735*sqrt(S(i)*S(j));
Ai(i,j) = 0.25*(1 + (mu(i)/mu(j)*(MW(j)/MW(i))^(3/4)*((T + S(i))/(T + S(j))))^(1/2))^2*...
((T + Ss(i,j))/(T + S(i)));
DENm(i) = phi(i,j)*xi(j);
DENk(i) = Ai(i,j)*xi(j);
end
DENmt(i) = sum(DENm);
DENkt(i) = sum(DENk);
NOMm(i) = mu(i)*xi(i);
NOMk(i) = k(i)*xi(i);
end
mum = sum(NOMm)/sum(DENmt);
km = sum(NOMk)/sum(DENkt);
v = Ftot*MWm*1/(rhom*Ac*3600);
Re = rhom*v*Dp/mum;
Pr = mum*cpm/km;
alpharu = (0.8171*(T/100)^3)/(1 + eps/(2*(1 - eps))*((1 - p)/p));
alphars = 0.8171*(p/(2 - p))*(T/100)^3;
ler0 = eps*(km + 0.95*alpharu*Dp) + ((0.95*(1 - eps))/(2/(3*ls) + 1/(10*km + alphars*Dp)));
ler = ler0 + 0.111*km*(Re*Pr^(1/3))/(1 + 46*(Dp/(2*rext))^2);
alphaw = 8.694*(ler0/(2*rext)^(4/3)) + 0.512*km*2*rext*Re*Pr^(1/3)/Dp;
Bi = alphaw*rext/ler;
U = (1/alphaw + rext/(3*ler)*(Bi + 3)/(Bi + 4))^(-1);
for i = 6:7
cp(i) = cpi(1,i) + cpi(2,i)*((cpi(3,i)/T)/sinh(cpi(3,i)/T))^2 +...
cpi(4,i)*((cpi(5,i)/T)/cosh(cpi(5,i)/T))^2;
DHi(i) = DH0(i) + (2*cpi(2,i)*cpi(3,i))*((1/(exp(2*cpi(3,i)/T) - 1) - 1/(exp(2*cpi(3,i)/Trif) - 1)) + ...
(1/(exp(2*cpi(3,i)/T) + 1) - 1/(exp(2*cpi(3,i)/Trif) + 1)));
DHTpermi(i) = DH0(i) + (2*cpi(2,i)*cpi(3,i))*((1/(exp(2*cpi(3,i)/Tperm) - 1) - 1/(exp(2*cpi(3,i)/Trif) - 1)) + ...
(1/(exp(2*cpi(3,i)/Tperm) + 1) - 1/(exp(2*cpi(3,i)/Trif) + 1)));
end
fv = 150 + 1.75*Re/(1 - eps);
Pressure = fv*v*mum/Dp^2*((1 - eps)^2/eps^3);
f(1) = -Rco;
f(2) = -Rco;
f(3) = Rco;
f(4) = Rco - Rh2;
f(5) = 0;
f(6) = -Rh2;
f(7) = 0;
f(8) = Pressure;
f(9) = 1/(Ftot*cpm)*(Rco*DHr + U*2*pi*rext*(Tw - T) - Um*2*pi*rint*(T - Tperm));
f(10) = 1/(FiPS(1)*cp(6) + FiSweep*cp(7))*(Um*2*pi*rint*(T - Tperm) + Rh2*(DHTpermi(6) - DHi(6)));
f = f(:);
end