Gas-Solid Reaction Modeling with Random Pore Model. Pdepe: Spatial discretization has failed. Discretization supports only parabolic and elliptic equations, with flux term involving spatial derivative.

조회 수: 3 (최근 30일)
Hello everyone,
I am studying the reaction's kinetics of calcium oxide with carbon dioxide through the Random Pore Model of Bhatia and Perlmutter. You can find the equations and code attached that I am trying to solve with the pdepe but it appears the error "Error using pdepe (line 293) Spatial discretization has failed. Discretization supports only parabolic and elliptic equations, with flux term involving spatial derivative".
Is there anyone who could tell me why I have this kind of error in the code and how to fix it?
Thanks in advance for your help.
clc,clear
%% RPM
% Properties
global phi zeta beta psi eps0 cb ceq s0 ks Sh
R=41e-6; %[m]
cb=1.95e-5; %[kmol m^-3]
ks=0.559e-5; %[m^4 kmol^-1 s^-1]
ceq=1.93e-3; %[kmol m^-3]
s0=42e6; %[m^-1]
psi=1.52; %[-]
zeta=2.10; %[-]
eps0=0.47; %[-]
beta=8120; %[-]
phi=45.46; %[-]
Sh=4.48; %[-]
%Axes
rmesh=linspace(0,R,100);
etamesh=rmesh/R; %eta
tspan=linspace(-1523,0,100);%tetac
%% Solver
m=2;
sol=pdepe(m,@pdefun,@icfun,@bcfun,etamesh,tspan);
cstar=sol(:,:,1);
xcao=sol(:,:,2);
%% Plots
surf(etamesh,tspan,sol,'edgecolor','none')
xlabel('xcao [-]')
ylabel('deltatetac [-]')
zlabel('c* [-]')
% Pdefun
function [c,f,s] = pdefun(x,t,u,dudx)
global phi zeta beta psi eps0 cb ceq s0 ks Sh
cs=u(1);
xcao=u(2);
c=[-phi^2 1]';
f=[1-((zeta-1)*(1-eps0)/eps0)*xcao 0]'.*dudx;
s=[0 -(cs*(1-xcao)*(1-psi*log(1-xcao)^(0.5)))/(1+((beta*zeta)/(psi)*(1-psi*log(1-xcao))^(0.5)-1))]';
end
% Bcfun
function [pl,ql,pr,qr] = bcfun(xl,ul,xr,ur,t)
global phi zeta beta psi eps0 cb ceq s0 ks Sh
pl = [0 0]';
ql = [1 1]';
pr=[0 0]';
qr =[0 0]' ;
end
% Icfun
function u0 = icfun(x)
global phi zeta beta psi eps0 cb ceq s0 ks Sh
u0 =[-ceq/(cb-ceq) 0]';
end

채택된 답변

Bill Greene
Bill Greene 2020년 9월 15일
Your right-end boundary conditions are invalid.
Possibly you want:
pr=[ur(1)-1 0]';
qr =[0 1]' ;
  댓글 수: 3
Bill Greene
Bill Greene 2020년 9월 30일
I reproduced an example from the Bhatia and Perlmutter 1981 paper using pdepe.
My MATLAB code is here.
VINCENZO MAIELLO
VINCENZO MAIELLO 2020년 10월 8일
편집: VINCENZO MAIELLO 2020년 10월 8일
Good evening,
I used your example to solve the system and the next step is to perform a parameter estimation using lsqnonlin (PDE system,datas and code are attached) and I have the error "Unable to perform assignment because the size of the left side is 2-by-1 and the size of the right side is 2-by-10''
Do you have an idea of how I can fix the problem?
Thanks in advance for your kind help.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Eigenvalue Problems에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by