Solving advection diffusion pde
Mostrar comentarios más antiguos

I want to solve the above pde with the given boundary and initial conditions. I came across the pdepe function in MATLAB.
I had a chance to look at the example given here . I couldn't understand how pdex1pde function has to be defined for my case.
Could someone help?
1 comentario
Deepa Maheshvare
el 27 de Dic. de 2018
Respuestas (1)
Bill Greene
el 27 de Dic. de 2018
The only problem I see with your code is in the boundary conditions. I corrected your bcfun function and have attached my version of your code below.
function DiffusionConvection
m = 0;
x = linspace(0,62,10);
t = linspace(0,10,100);
D = 900;
sol = pdepe(m,@pdefun,@icfun,@bcfun,x,t);
function [g,f,s] = pdefun(x,t,c,DcDx)
v = 10;
g = 1;
f = D*DcDx;
s = -v*DcDx;
end
function c0 = icfun(x)
c0 = 80;
end
function [pl,ql,pr,qr] = bcfun(xl,cl,xr,cr,t)
pl = -10*D;
ql = 1;
pr = 0;
qr = 1;
end
end
5 comentarios
Deepa Maheshvare
el 28 de Dic. de 2018
Editada: Deepa Maheshvare
el 28 de Dic. de 2018
Bill Greene
el 29 de Dic. de 2018
Equation 3 on this page, pdepe, shows the boundary condition form required. I simply matched terms from the BCs you defined above.
Deepa Maheshvare
el 29 de Dic. de 2018
Deepa Maheshvare
el 2 de En. de 2019
Categorías
Más información sobre Mathematics and Optimization en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!