I am trying to solve the diffusion equation in polar coordinates:
$\frac{\partial u}{\partial t} = D \left( \frac{\partial^2 u}{\partial r^2} + \frac{1}{r} \frac{\partial u}{\partial r}\right)$
subject to there being a Dirichlet boundary condition at $r=10$, and there being no-flux (Neumann) at $r=0$. I am starting with $u(0,r)=e^{-10r}$, although would eventually like to move to a delta function at the origin.
I have tried the following (where I have set $D=0.01$):
d = 0.01;
op2Diff = -d*(Derivative[0, 1][u][t, r]/r + Derivative[0, 2][u][t, r]) +
Derivative[1, 0][u][t, r];
uSoln2Diff =
NDSolveValue[{op2Diff == 0 + NeumannValue[0, r == 0],
DirichletCondition[u[t, r] == 0, r == 10], u[0, r] == Exp[-10 r]},
u, {t, 0, 1000}, {r, 0, 10}];
I get the following error:
NDSolveValue::femcnmd: "The PDE coefficient {{1.,-(0.01/r)}} does not evaluate to a numeric matrix of dimensions {1,2}."
Does anyone know what this means, and how to rectify the issue?
Also, following my point above - does anyone know how to specify a delta function at the origin as an initial condition? I have tried to specify $u(0,r)=DiracDelta[r]$, but this results in an error saying that there isn't a numeric derivative at this time point (even for simpler PDE examples than the one here, which work with other initial conditions).
Sorry for the poor formatting of the Mathematica code above - I don't know how to make it look neat (please let me know if you do).
Best,
Ben