NDsolve Boundary Condition is a Function of the Solution

I am trying to solve something like Fick's Law using NDSolve: $$\frac{\partial \varphi}{\partial t}=\frac{\partial^2 \varphi}{\partial r^2}+F(r,t)$$ Subject to a boundary condition which looks something like: $$\varphi (R,t)=\varphi_0-\int_0^R \varphi(r,t)dr$$ Which is an attempt to simulate the case where whatever is diffusing into the medium of interest is limited in quantity. I assume simply plugging a recursive boundary condition is going to go poorly (Edit: it did go poorly), is there any option here other than writing my own solver?

In specific one particular case could look like: $$\frac{\partial \varphi}{\partial t}=\frac{\partial^2 \varphi}{\partial r^2}+\frac{1}{r^2}\frac{\partial\varphi}{\partial r}(2r+r^3/3-\int\varphi r^2dr)-\varphi$$ In this case $$\varphi_0=1$$ and the initial condition is $$\varphi(0\leq r, where $$R=1$$. The problem should have spherical symmetry so a bound at $$r=0$$ may result in trouble.

• Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour and check the faqs! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign Sep 22, 2020 at 3:32
• The method here may be helpful. Sep 22, 2020 at 17:00
• Readers are more likely to respond, if you provide all the necessary information to obtain a numerical solution, including the definitions of F, the values of R and phi0, and the initial condition and other boundary condition. Sep 22, 2020 at 18:44
• As it turns out the method of lines was a nudge in the right direction, I found a few more posts on the topic of integro-differential equations and their boundary conditions at it looks like there are a few other avenues to try (possibly replacing $\varphi$ with its x-partial-derivative to eliminate the integral terms?). Sep 23, 2020 at 14:07
• @UranylTrioxide What was the outcome of your effort? Nov 16, 2020 at 4:16