% Example 15-3: Reducing Nitrous Oxides in a Plant's Effluent
%

De=1.82;
vis=1.53;
Sa=530;
vo=10;
k1doubleprime=4.42;
rhoc=2.8*10^6;
DAB=2*10^-8;
Ac=2.03*10^-3;
phi=0.5;
k1prime=k1doubleprime*(10^-10)*Sa;
R1=0.003;
R=linspace(0.0,0.005,200);
W=linspace(0.0,1000,200);
phi11=R1*sqrt(k1prime*rhoc/(De*10^-8));
eff1=(3/phi11^2)*(phi11*coth(phi11)-1);
U=vo*10^-7/Ac;
Re1=U*2*R1/((1-phi)*vis*10^-8);
Sc=vis*10^-8/DAB;
Sh1=(Re1^0.5)*(Sc^(1/3));
kc1=(1-phi)*DAB*Sh1/(phi*2*R1);
ac1=6*(1-phi)/(2*R1);
rhob=rhoc*(1-phi);
effoverall1=eff1/(1+(eff1*k1doubleprime*(10^-10)*Sa*rhob)/(kc1*ac1));
for i=1:200
    phi1(i)=R(i)*sqrt(k1prime*rhoc/(De*10^-8));
    eff(i)=(3./phi1(i).^2).*(phi1(i).*coth(phi1(i))-1) ;
    CWP(i)=eff(i).*phi1(i).*phi1(i);
    dp(i)=2*R(i);
    Re(i)=U*dp(i)./((1-phi)*vis*10^-8);
    Sh(i)=(Re(i).^0.5).*(Sc^(1/3));
    kc(i)=(1-phi)*DAB*Sh(i)./(phi*2*R(i));
    ac(i)=6*(1-phi)./dp(i);
    effoverall(i)=eff(i)./(1+(eff(i)*k1doubleprime*(10^-10)*Sa*rhob)./(kc(i)*ac(i)));
    MR(i)=effoverall(i)*k1prime*rhob.*R(i)./kc(i);
    CAB0 = 2;
    CAB(i) = CAB0*exp(-effoverall1*k1prime*W(i)/(vo*10^-7));
    X(i) = (CAB0 - CAB(i))/CAB0;
end
tiledlayout(3,2)
nexttile
plot(W,X(1:200),'LineWidth',2)
ylabel('Conversion')
xlabel('Catalyst weight (gm)')
leg=legend('X');
leg.ItemTokenSize=[10,10];
axis([0 1000 0 1])
title('Conversion Profile')
grid on
nexttile
plot(W,CAB(1:200),'LineWidth',2)
ylabel('Concentration (mol/dm^3)')
xlabel('Catalyst weight (gm)')
axis([0 1000 0 2])
title('Concentration Profile')
grid on
nexttile
plot(R,eff(1:200),'LineWidth',2)
ylabel('\eta')
xlabel('Pellet radius, R(m)')
axis([0 0.005 0 1])
title('Internal eff factor')
grid on
nexttile
plot(R,effoverall(1:200),'LineWidth',2)
ylabel('\Omega')
xlabel('Pellet radius, R(m)')
axis([0 0.005 0 1])
title('Overall eff factor')
grid on
nexttile
plot(R,CWP(1:200),'LineWidth',2)
ylabel('WP')
xlabel('Pellet radius, R(m)')
axis([0 0.005 0 100])
title('WP')
grid on
nexttile
plot(R,MR(1:200),'LineWidth',2)
ylabel('MR')
xlabel('Pellet radius, R(m)')
axis([0 0.005 0 3])
title('MR')
grid on