Problem solving coupled PDE / Adsorption
17 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hello, I'm trying to model a packed bed to adsorps H2O on Activated Alumina. I've worked a lot researching but I'm not getting proper results.
I've watched many papers and codes, but they doesn't use mole fraction as unit of concentration.
The result should be around 2.59 mol/kg adsorbed
Thank you in advance.

The code that I'm working at is this:
L=0.4 %Large m
R=8.314; %J/molK
P0=493000; %Pascal
T0=298; %K
yWater=0.3/100; % mole fraction, air composed by 0.3% of Water
pco2=0.1972 %To use on function, alumina doesnt adsorb co2 on this layer
psWater=3.169 %kPa
%% Activated Alumina Isotherm temperature dependent from Zhang 2013
nh2o=40548*exp(-2987/T0);
bco2=5.762*10^-2 *exp(191.57/T0); %1/kPa
bh2o=7.504*exp(490.85/T0); %1/kPa
qsat=0.0934*exp(1030.8/T0) %qsaturation mol/kg
epss=0.26
rhos=820 %Kg/m3
%% Velocity
rof=1.184; %kg/m3 %density at 298K
m=10; %inlet mass flowrate kg/s Qdot=V*A ROF=m/Qdot
A=pi/4 *1.5^2; %area m^2
Q=m/rof; %flow m^3
v=Q/A; %superficial velocity m/s
u=v/epss; %intersticial velocity m/s
%% Mass transfer
LDF1=1E-3; %1/s
%% Main code
Nz=101;
z=linspace(0,L,Nz);
dz=z(2)-z(1);
% Time step
t=0:14400;
% Initial condition
ICA=zeros(1,Nz); %Inlet gas concentration
ICB=zeros(1,Nz); %Initial bed concentration
IC=[ICA,ICB]; %Vector
% Solver
[t y]=ode15s(@f,t,IC,[],Nz,yWater,P0,qsat,bh2o,bco2,pco2,LDF1,u,rhos,R,T0,epss,dz,nh2o,psWater);
% Extract value
c1=y(:,1:Nz);
q1=y(:,Nz+1:2*Nz);
% Re BC
c1(:,1)=yWater;
c1(:,end)=(4*c1(:,end-1)-c1(:,end-2))./3;
q1(:,end)=(4*q1(:,end-1)-q1(:,end-2))./3;
function dydt=f(t,y,Nz,yWater,P0,qsat,bh2o,bco2,pco2,LDF1,u,rhos,R,T0,epss,dz,nh2o,psWater);
dydt=zeros(length(y),1);
dc1dt=zeros(Nz,1);
dq1dt=zeros(Nz,1);
%Assign values
c1=y(1:Nz);
q1=y(Nz+1:2*Nz);
%BC
c1(1)=yWater;
c1(end)=(4*c1(end-1)-c1(end-2))./3;
q1(end)=(4*q1(end-1)-q1(end-2))./3;
%interior
for i=2:Nz-1
dc1dz(i)=(c1(i+1)-c1(i-1)) ./2./dz; %Centered
ph2o(i)=c1(i)*P0/1000; %Mole fraction to kPa
q1star(i)=qsat*bh2o.*ph2o(i)*exp(nh2o*ph2o(i)/psWater)/(1+bh2o.*ph2o(i)+bco2*pco2); %Extended Langmuir
dq1dt(i)=LDF1.*(q1star(i)-q1(i)); %LDF
dc1dt(i)=-u.*dc1dz(i)-((rhos*R*T0./P0).*((1-epss)./epss).*dq1dt(i));
end
dydt=[dc1dt;dq1dt];
end
2 Commenti
Torsten
il 22 Feb 2023
Are you sure about the velocity u ? Never seen an adsorption with a flow velocity for the adsorbent of 18.4 m/s .
Risposte (2)
Torsten
il 22 Feb 2023
Spostato: Torsten
il 22 Feb 2023
Your code works if you change the centered scheme for the first derivatives to the usual upwind scheme:
dc1dz(i)=(c1(i)-c1(i-1))/dz; %Upwind
instead of
dc1dz(i)=(c1(i+1)-c1(i-1)) ./2./dz; %Centered
9 Commenti
Torsten
il 15 Mar 2023
Modificato: Torsten
il 15 Mar 2023
Try a linear increase of velocity over the length of the reactor that reflects this decrease in mass. I don't think you will get an effect on the results. Maybe if temperature changes drastically because of the adsorption, the effect on fluid velocity might become more important.
Jose Adones
il 11 Giu 2023
Modificato: Torsten
il 11 Giu 2023
10 Commenti
Torsten
il 22 Ago 2023
Modificato: Torsten
il 22 Ago 2023
As you can see in the last plot from your code, the water vapor concentration decreases in the reactor right from the beginning whereas in Fig. 5 of the article, it rises to about 1.5 mol/m^3 for ~1500 s.
I don't have access to the article, but you should check the design variables of the desorption again (volume flow and temperature of flushing gas (why do you compute ps with Tfeed and not with T ?), your adsorption isotherm, the factor 1000 in the expression "((1 - epsilon) / epsilon) * rho * 1000*DqDt(2:n)",...)
cFeed = 1E-6; % Concentration at the inlet node in mol/m3
Taire = 423;
L = 0.3; % Column length in m
t0 = 0; % Initial time in s
tf = 10000; % Final time in s
dt = 1; % Time step
z = [0:0.001:L].'; % Mesh generation
t = [t0:dt:tf]; % Time vector
n = numel(z); % Mesh size
% Initial conditions and boundary conditions
c0 = 0.523*ones(n,1); % c = 0 at t = 0 for all z
c0(1) = cFeed; % c = cFeed at z = 0 and t > 0
q0 = 0.0123*ones(n,1); % t = 0, q = 0 for all z
T0 = 293*ones(n,1);
T0(1) = 423;
Tw0 = 298*ones(n,1);
y0 = [c0 ; q0 ; T0 ; Tw0];
% Solving using the ODE15S solver
[Time, Y] = ode15s(@(t,y) MyFun(t,y,z), t, y0);
c = Y(:,1:n);
q = Y(:,n+1:2*n);
T = Y(:,2*n+1:3*n);
Tw = Y(:,3*n+1:4*n);
figure(1)
% Subplot of the first graph
subplot(2, 1, 1);
plot(Time, c(:,end))
hold on
title('Outlet concentration')
xlabel('Time in seconds')
ylabel('Concentration')
xlim([0 8000])
% Subplot of the second graph
subplot(2, 1, 2);
plot(Time, T(:,end), 'r')
hold on
title('Temperature during the Process')
xlabel('Time in seconds')
ylabel('Temperature in Kelvin')
xlim([0 8000])
%figure(2)
%plot(z,[q(1,:);q(50,:);q(end,:)])
figure(3)
plot(z,[c(1,:);c(50,:);c(end,:)])
toc
function DyDt = MyFun(t, y, z)
n=numel(z);
epsilon = 0.37; % Bed porosity
volflow = 4.3e-4; % Flow rate in m^3/s
bedarea = pi/4 * 0.033^2; % Bed area in m^2
v = volflow / bedarea; % Superficial velocity in m/s
rho = 1100; % Particle density in kg/m^3
Dl = 3.995e-3; % Axial dispersion coefficient in m^2/s
k = 5e-3; % Mass transfer coefficient
Tfeed = 423; % Temperature in K
R = 8.314; % J/mol K
% Langmuir isotherm parameters
k1 = 0.002082; % mol/g
k2 = 3.851e-5; % 1/K
k3 = 0.083; % 1/(mol/m3)
k4 = 1659; % K
k5 = 1.073;
k6 = 1.049; % K
qm = k1 + k2 * Tfeed;
b = k3 * exp(k4 / Tfeed);
n1 = k5 + k6 / Tfeed;
%% Heat Transfer Calculation
Tatm = 293;
Kl = 3.374; % W/m K
alfa = 0.52; % Dimensionless
rog = 1.159; % kg/m3
rob = 690; % kg/m3
dh = 62700; % J/mol
hi = 1.5; % W/m2 s K
ho = 4.2; % W/m2 s K
Rbi = 0.033; % m
Rbo = 0.03323; % m
cps = 920; % J/kg K
cpa = 2392.6; % J/kg K
Ma = 18/1000; % kg/mol
row = 7700;
cpw = 500;
cpg = 1047;
%%
% Creating vectors for variables
c = zeros(n,1);
q = zeros(n,1);
T = zeros(n,1);
Tw = zeros(n,1);
DcDt = zeros(n,1);
DqDt = zeros(n,1);
DTDt = zeros(n,1);
DTwDt = zeros(n,1);
zhalf = zeros(n-1,1);
DcDz = zeros(n,1);
D2cDz2 = zeros(n,1);
DTDz = zeros(n,1);
D2TDz2 = zeros(n,1);
DyDt = zeros(4*n,1);
c = y(1:n);
q = y(n+1:2*n);
T = y(2*n+1:3*n);
Tw = y(3*n+1:4*n);
% Interior mesh points
zhalf(1:n-1) = (z(1:n-1) + z(2:n)) / 2;
% Calculation of spatial derivatives
DcDz(2:n) = (c(2:n) - c(1:n-1)) ./ (z(2:n) - z(1:n-1));
D2cDz2(2:n-1) = ((c(3:n) - c(2:n-1)) ./ (z(3:n) - z(2:n-1)) - (c(2:n-1) - c(1:n-2)) ./ (z(2:n-1) - z(1:n-2))) ./ (zhalf(2:n-1) - zhalf(1:n-2));
DTDz(2:n) = (T(2:n) - T(1:n-1)) ./ (z(2:n) - z(1:n-1));
D2TDz2(2:n-1) = ((T(3:n) - T(2:n-1)) ./ (z(3:n) - z(2:n-1)) - (T(2:n-1) - T(1:n-2)) ./ (z(2:n-1) - z(1:n-2))) ./ (zhalf(2:n-1) - zhalf(1:n-2));
% Calculation of D2cDz2 at z=L for the boundary condition dc/dz = 0
D2cDz2(n) = -1.0 / (z(n) - zhalf(n-1)) * DcDz(n);
D2TDz2(n) = -1.0 / (z(n) - zhalf(n-1)) * DTDz(n);
% Calculation of qstar (adsorption capacity)
ps=(0.61094*exp(17.625*(Tatm-273.15)./(Tatm-30.11)).*1000./(R*T(1:n))); % mol/m3
qstar = (qm * b * (c(1:n)).^n1) ./ (1 + b * ((c(1:n)).^n1).*(1-(c(1:n)./ps)).^0.03);
DqDt = (k * (qstar - q));
DcDt(1) = 0.0;
DcDt(2:n) = (Dl * D2cDz2(2:n) - v/epsilon * DcDz(2:n)) - ((1 - epsilon) / epsilon) * rho * 1000*DqDt(2:n);
% Temperature calculation
DTDt(1)=0.0;
DTDt(2:n) = (Kl*D2TDz2(2:n) - rog*cpg*v/epsilon *DTDz(2:n) + ((1-epsilon)/epsilon)*dh*rho*1000*DqDt(2:n)- 2*hi/Rbi *(T(2:n)-Tw(2:n)))...
./ (alfa*rog*cpg + ((1-epsilon)/epsilon)*rob*cps); % Luberti 2015
DTwDt(1)=0;
DTwDt(2:n) = (2*pi*Rbi*hi*(T(2:n)-Tw(2:n)) -2*pi*Rbo*ho*(Tw(2:n)-Tatm))./ (row*cpw*(pi*(Rbo^2 - Rbi^2)));
% Concatenation of temporal derivatives vectors
DyDt = [DcDt; DqDt; DTDt; DTwDt];
end
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!














