I am using the 2015 version of the PDE toolbox for diffusion modeling. I am modeling a layer that is only a few microns thick which I converted to cm on the y-axis, and the x-axis is the width in cm.
The solve parameters I am using are:
Time: linspace(0,72000,72000)
u(t0): 1e-12
Relative Tolerance: 0.01
Absolute Tolerance: 0.001
and the PDE coefficients are:
C=8e-17
A=0
F=0
D=1
I have also made the geometry in the x and y directions equal so that the problem is square but I still see negative values for the concentration (u) data around the side boundaries of the model where I have specified a Neumann=0 (no flux) as well as a few places within the meshing where the diffused substance doesn't reach by the end of the simulation (after 20 hours, 72000 seconds). For diffusion into the geometry I would expect my values to be between 0.1 and 1E-12 with no values being negative.
What would be the easiest way to ensure all output values were only positive or zero?
Best Answer