Hi,
I was trying to solve PDEs system about diffusion on catalyst (modeled by deactivation model), which yields:
Error using pdepe (line 293)Spatial discretization has failed. Discretization supports only parabolicand elliptic equations, with flux term involving spatial derivative.Error in Resolution (line 30)sol = pdepe(m,@eqn2,@initial2,@bc2,x,t);
After read model in attchament, please see the code below:
global Def T Dp R cAO k kd kO cW alphaO gamma%Parameters
T = 333; %[=]K
Dp = 2; %[=]m
Def = 10^-5; %
cAO = 0.0001; %[=]kmol/m^3 intial valure of concentration
cW = 0.0001;%[=]kmol/m^3
R = Dp/2;k = (1.191*10^5)*exp(-7.544/(0.001607460438947*T));kd = (4.299*10^3)*(exp(-6.86/(0.002102114315754*T)));kO =k*cW;gamma = 1;alphaO = 1; %intial value of catalyst activity
%PDE2: MATLAB script M-file that solves the PDE
%stored in eqn2.m, bc2.m, and initial2.m
m = 2; %spheric
x = linspace(0,R,10);t = linspace(0,1,10);sol = pdepe(m,@eqn2,@initial2,@bc2,x,t);u1 = sol(:,:,1);u2 = sol(:,:,2);%--------------------------------------------------------
%EQN2: MATLAB M-file that contains the coefficents for
%a system of two PDE in time and one space dimension.
function [c,b,s] = eqn2(x,t,u,DuDx)global Def kO kd gammac = [1; 1];b = [Def; 0] .* DuDx;s = [- kO*u(1)*(u(2));-kd*u(1)*((u(2)).^(gamma+1))];% --------------------------------------------------------
%INITIAL2: MATLAB function M-file that defines initial conditions
%for a system of two PDE in time and one space variable.
function value = initial2(x);global cAO alphaOvalue = [cAO; alphaO];% --------------------------------------------------------%BC2: MATLAB function M-file that defines boundary conditions
%for a system of two PDE in time and one space dimension.
function [pl,ql,pr,qr] = bc2(xl,ul,xr,ur,t)global cAO Rpl = [0; 0];ql = [1; 0];pr = [ur(R)-cAO; 0];qr = [0; 0];
Best Answer