Total flux through a boundary calculated over time, given the solution to the governing parabolic equation?

3 views (last 30 days)
I'm trying to simulate drug diffusion out of a sphere, governed by dimension-less equation:
dØ/dT = d2Ø/dX2 + d2Ø/dY2
Due to symmetry, a quadrant of a circle was drawn as the domain with following initial and boundary conditions:
Ø=1 at T=0
Ø=0 at X^2+X^2=1
dØ/dX=0 at X=0
dØ/dY=0 at Y=0
I developed the model in PDE toolbox GUI, solved it, and exported the solution along with all defining parameters (geometry,mesh,PDE coefficients,etc.) to MATLAB workspace. Next, I calculated flux on the surface of the sphere and took numerical integration of the product of flux and surface area over time in order to get total amount of drug that is being released during the time span that the equation was solved for:
% Diffusivity=9E-4 (um2/s), Radius=50(um)
% dimensionless time = T = D/R^2 * t
% at t=100 hours for example, T=9E-4*360000/2500=0.1296
>> time=linspace(0,0.1296,600); % same as what was used to solve the pde, time points every 10 min
>> for i=1:600
>> f=pdecgrad(p,t,c,u(:,i)) % to calculate flux at the elements’ centers
>> fn=pdeprtni(p,t,f) % to interpolate flux at nodal points
>> fr=tri2grid(p,t,fn,1,0) % to calculate flux at (1,0), considering that in this case flux is the same at any arbitrary point on the surface of the sphere
>> rate(i) = (4*pi*1^2)*abs(fr);
>> M(i) = trapz(0:1/600:1/600*(i-1),rate(1:i));
>> end
>> scatter(time,M)
The shape of the release curve looks fine but values on the Y-axis doesn't seem right (Shouldn't they all be between 0 and 1 since the equation and BCs were dimension-less?). One thing I noticed is that if I calculate flux at a different point on the surface, for example at (0,1) using the same method, I'll get a different value than the flux at (1,0), which doesn't seem right!. Any ideas on what I'm doing wrong? Or in general, is there a better/easier way to do this?
Thanks!

Answers (0)

Community Treasure Hunt

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

Start Hunting!