Time-dependent point source for diffusion with pdepe

7 次查看(过去 30 天)
Hi Everyone,
I was hoping someone could give me a hand with this diffusion problem. In brief, I'm trying to simulate two-dimensional diffusion which includes a time-dependent source function to reproduce some experimental results, however I've encountered challenges...
I have no problem simulating diffusion alone, however the problem arises in introducing the source for t>0 at x = 0. Currently I've been trying to do the following:
function [c,f,s] = pdex4pde(x,t,u,DuDx, xSpan, tSpan)
c = [1; 1];
f = [D1; D2] .* DuDx; % diffusion term
k1 = 0.02; % degradation rate for species 1
k2 = k1/4; % degradation rate for species 2
sourcePosition = 0; %micrometers
releaseTime = 1; %seconds
initialConc = 0.001
if x == sourcePosition & t <= releaseTime ;
n = (0.221 * releaseTime ) + 1.662; % source function parameter
k = 0.138 * releaseTime ^ 1.53); % source function parameter
releaseFunction = (initialConc .* (tSpan.^n) ./ ((k.^n) + (tSpan.^n))); % sourcefunction
releaseRates = diff(releaseFunction); % source function differential
if t == 0 % at t = 0, there is nothing in the system
Source=0;
else % for t>0, diffusing species is introduced into the system
Source = interp1(tSpan(2:end), releaseRates, t, 'linear', 'extrap');
end
else
Source= 0;
end
F1 = -k1*u(1) + Source;
F2 = k1*u(1)-k2*u(2);
s = [F1; F2];
end
Any suggestions would be immensely appreciated, I've been struggling with this for a while now. I'm do not have a strong math background, so the simpler the better if possible. If there's any other information what is needed, please let me know.
Thanks in advance!
  7 个评论
Torsten
Torsten 2018-1-30
I don't understand the physical background - so I can't give you further advice. But your solution with
pl = -pdexSource;
ql = 1.0;
can't be correct because D1*du1/dx has unit mol/(m^2*s) wheras pdexSource has unit mol/(m^3*s), I guess.
Best wishes
Torsten.
Nicholas Mikolajewicz
Hi Torsten,
what other information would help understand the problem?
Here are all the details I can provide: the source is positioned at x=0, at the center of a cylinder. The radius of the cylinder is 500, such that x=0:500. There is no reflection at the boundaries of the cylinder. As time t tends to infinity, the concentration c tends to 0. The amount of diffusing species introduced at x=0 is time dependent, and decreases exponentially with time.
my biggest problems are that (i) I don't know how to introduce the source properly and (ii) I need to compare the solution concentrations to those I've measured experimentally, however the time and distance steps influence the outcome concentrations. (iii) the concentrations I introduce are in terms of moles per volume...I'm not sure how this affects interpretation of the solution if it assumes only radial diffusion?
With respect to my first problem, I think I found a work around where I introduce the source as an initial condition, simulate the problem for one time step and use the corresponding solution after one time step as the initial condition in a subsequent simulation. In each subsequent simulation, in addition to the solution from the previous simulation I also add the time-dependent source to obtain a new initial condition, and so on. This approach has given me the the diffusion profiles that I've expected, however the absolute concentrations are way off and I have no idea how to correct this.
If I'm asking for too much, please let me know so I stop bothering you, however help would be greatly appreciated as I'm completely lost on this right now.
Thank you,
Nick

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Equation Solving 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by