Hi,
i'm trying to solve a simple diffusion problem: the diffusion of a stagnant gas into a stagnant liquid. A code for it with the pdepe solver is listed below. My problem is that i don't know exactly how to define the boundary conditions. As a result the solution is quite disappointing.
i expect that there should be a saturated liquid after some time of diffusion at the interface.
i appreciate any help. Thanks
function [Loes,x]=Diffkoeff()
t_V=480*3600;
D_12=5E-9;
x = linspace(0.0,0.2,50);
t = linspace(0,t_V,10);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Loes = pdepe(0,@pdedgl,@pdean,@pdera,x,t,[],D_12);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [c,f,s] = pdedgl(x,t,u,DuDx,D_12)
c = 1;
f = D_12*DuDx;
s = 0;
function u0 = pdean(x,D_12)
u0 = 0;
function [pl,ql,pr,qr] = pdera(xl, ul, xr, ur, t,D_12)
c_0=1;
pl = 0;
ql = 1;
pr = (ur-c_0);
qr = 1;
|