I'm trying to solve the diffusion equation in polar coordinates:
$$c_t = \frac{D}{r^2}[2r\,c_r + r^2\,c_{rr}] = \frac{D}{r}[2\,c_r + r\,c_{rr}] \tag{1}$$
with the following BC:
$$c(0,t)=0, \quad c(R,t)=c_0, \quad c(r,0) = \begin{cases} 0 &\mbox{for } r<R \\ c_0 &\mbox{for } r=R \end{cases}$$
First I substituted $g=rc$ such that $g_r = c + rc_r$ and $g_{rr} = 2c_r + rc_{rr}$. Putting this into equation $(1)$ gives: $1/r\,g_t = D/r\,g_{rr}$ and the familiar equation
$$g_t = D\,g_{rr} \tag{2}$$ The new BC are: $$g(0,t) = 0 \cdot c(0,t) = 0 \quad g(R,t) = R \cdot c(R,t) = R\,c_0 \\ g(r,0) = r \cdot c(r,0) = \begin{cases} 0 &\mbox{for } r<R \\ R\,c_0 &\mbox{for } r=R \end{cases}$$
In the second step, I wanted to make the boundary conditions homogenous by defining $v = g-g^e$ where $g^e$ is the steady state solution obeying $g^e_{rr} = 0$. The most simple solution for that is $g^e = c_0\,r$.
With this I get $v_{rr} = g_{rr} - g^e_{rr} = g_{rr}$ and $v_t = g_t$ leading to the equation
$$v_t = D\,v_{rr} \tag{3}$$ but with homogenous BC: $$v(0,t) = g(0,t)-g^e(0,t) = 0 \quad v(R,t) = g(R,t)-g^e(R) = 0 \\ v(r,0) = g(r,0)-g^e(r) = \begin{cases} -g^e(r) &\mbox{for } r<R \\ 0 &\mbox{for } r=R \end{cases}$$
I found the solution for this in the form of a series:
$$v(r,t) = \sum^{\infty}_{n=1} B_n \sin\left(\frac{n \pi r}{R}\right)\,e^{-D\left(\frac{n \pi}{R}\right)^2 t} \tag{4}$$ with \begin{align} B_n &= \frac{2}{R}\int^R_0[-g^e(r)]\sin\left(\frac{n \pi r}{R}\right) dr \\ &= \frac{2 c_0 R(n \pi \cos(n \pi) - \sin(n \pi))}{n^2 \pi^2}\\ &= \frac{2c_0R}{\pi}\,\frac{(-1)^n}{n} \end{align}
I calculated $v,g$ and $c$. $v(r,t)$, $g(r,t)$ and $c(r,t)$ for various $t$
$v$ and $g$ look reasonable.
But when it comes to calculate $c = g/r = c_0 + v/r$ I have a problem with the BC at $r=0$.
I guess it comes from my first substitution since $r=0$ seems critical as in $c = g/r$ both, $g$ and $r$ tend towards zero.
Any help is much appreciated.