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.

6 次查看(过去 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 个评论
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 中查找有关 1-D Partial Differential Equations 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by