1D Nonlinear Diffusion Equation with NDSolve Graphs

I am trying to model/solve a specific instance of a 1D diffusion equation in which I have a nonlinear Neumann boundary condition at x=1 (length of unit 1). My equations that I have are:

D[u[x,t],t] == D[u[x,t], x, x] for the general diffusion equation;

D[u[1,t],x] == 10 - Log[u[1, t]+1] for a flux at boundary x=1 that begins at 10 and decreases as a function of Log of concentration at the boundary;

D[u[0,t],x] == 0 for a no flux boundary at x=0;

u[x,0] == 0 for an initial concentration of 0 everywhere in the rod.

What I am trying to see occur is a function where the heat spreads across the rod and smoothes out across the rod to a steady-state/equilibrium; additionally, the goal is to have the flux approach zero and remain at zero (which represents the difference in chemical potentials between the domain and an external source approaching zero).

Upon further reconsideration, I was able to use NDSolve to find a plot that looks somewhat like what my goal is. However, I want the diffusion to continue across the domain until it smoothes out. Here is my code:

NDSolve[{D[c[x,t],t]==D[c[x,t],x,x],D[c[1,t],x]==10-Log[c[1,t]+1],c[x,0]==0},c,{t,0,10},{x,0,1}]


This gives a decent solution as said but results in two errors.

NDSolve: Warning: boundary and initial conditions are inconsistent.
NDSolve: Warning: an insufficient number of boundary conditions have been specified for the direction of independent variable x. Artificial boundary effects may be present in the solution.


My three questions are as follows:

1. Should I address this warnings if it still gives a close enough solution?
2. How do I get a curve where the concentration smoothes out over the domain (and as time moves forward)?
3. Is there a way to get a 2D list line plot that shows the curves as lines where each line represents a different time?

Sorry if that is too much to ask. If you can help tackle any of these questions, that will be greatly appreciated. Thank you!

• Note : your code call (automatically) the TensorProductGrid method, as opposed to the FiniteElement method. I have unsuccessfully tried the finite element method (NDSolve[{D[c[x, t], t] == D[c[x, t], x, x],D[c[1, t], x] == 10 - Log[c[1, t] + 1], c[x, 0] == 0}, c, {t, 0, 10}, {x, 0, 1}, Method -> "FiniteElement"] ) which doesn' t work in this case . The error message is explicit : "The dependent variable in the boundary condition needs to be linear." Jul 4, 2021 at 20:26
• @andre314 How would one go about fixing this? I want the dependent variable in the boundary to be non-linear purposely for my model. Is there anything that I can do to fix it to work with the Log? Jul 4, 2021 at 20:41
• I don't know. The aim of my comment was only to avoid that you spend much time to try the finite element method in this case. Concerning the TensorProductGrid method, I can't say if it can work. Jul 4, 2021 at 21:14
• 1. D[c[1,t],x] is wrong. One possible correction is D[c[x, t], x]/. x->1. 2. The bcart warning is a serious problem. See this post for more info: mathematica.stackexchange.com/q/73961/1871 Notice you've forgotten the b.c. D[u[x,t],x]==0/.x->0. 3. The ibcinc warning is a serious problem in this case, you need Method->{"MethodOfLines","DifferentiateBoundaryConditions"->{True,"ScaleFactor"->100}}, check this post for more info: mathematica.stackexchange.com/a/127411/1871 Jul 5, 2021 at 2:04

We can solve this problem by introducing damping factor to make bc and ic are consistent as follows
 sol = NDSolve[{D[c[x, t], t] == D[c[x, t], x, x],