How can i implemente this PDE boundary conditions?

1 view (last 30 days)
I wrote this code using pdepe to implement this system (I wrote the constant terms like a, b, c, d, and for simplicity)
function[c,f,s]=heatsempccl(z,t,u,dudz)
global rhoc cp kc h eps q sigma Tinf volf volm rhom Hu mc n
c=[1;1];
f=[(kc/(rhoc*cp));0].*dudz;
A1=75000; %[1/s]
E1=74690; %[J/mol]
A2=21666.667; %[1/s]
E2=58370; %[J/mol]
R=8.314462; %[J/(mol*K)]
k1=A1*exp(-E1/(R*u(1)));
k2=A2*exp(-E2/(R*u(1)));
dalfadt=(k1+k2*u(2)^mc)*(1+u(2))^n;
s=[((volm*rhom*Hu)/rhoc*cp)*dalfadt;dalfadt];
end
How can i write the boundary conditions d(alpha)/dz=0 at both ends?
  9 Comments
Torsten
Torsten on 27 Mar 2020
Edited: Torsten on 27 Mar 2020
Why do you use c(2)=1/dalphadt and s(2)=1 instead of c(2)=1 and s(2)=dalphadt ?
And in the definition of dalphadt, you use (1+u(2))^n instead of (1-u(2))^n.
Taking larger tolerances may also improve convergence.
Claudio D'Amato
Claudio D'Amato on 27 Mar 2020
perfect, all solved. thank you so much for your availability and patience!!!

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!