# How to achieve (approx) unit scaling of a non-linear diffusion (heat) equation with a wildly varying diffusion coefficient?

I have numerical issues with a poorly scaled one-dimensional non-linear diffusion equation in physical co-ordinates

$$\frac{\partial{u}}{\partial{t}}(x,t) = \frac{\partial}{\partial{x}}\left(D(u) \frac{\partial{u}(x,t)}{\partial{x}}\right)$$

$$x \in (0,L),\ t \in (0,t_\text{f})$$

with initial conditions $$u(x,0) = u_0(x)$$ and Double-Neumann Boundary Conditions $$D(u)\frac{\partial{u}}{\partial{x}}_{\Large\mid \normalsize{x=0}} = f(t); \quad D(u)\frac{\partial{u}}{\partial{x}}_{\Large\mid \normalsize{x=L}} = 0$$.

In numerically solving this PDE, I end up with convergence errors due to poor scaling of the problem with $$u \approx \mathcal{O}(10^3)$$, $$x \approx \mathcal{O}(10^-6)$$, and the most problematic of them all $$D(u) \approx \mathcal{O}(10^{-12})\text{ to }\mathcal{O}(10^{-16})$$.

By applying standard scaling techniques $$\bar{t} = \frac{t}{t_\text{c}}$$, $$\bar{x} = \frac{x}{x_\text{c}}$$, $$\bar{u} = \frac{u}{u_\text{c}}$$, $$\bar{D} = \frac{D}{D_\text{c}}$$, and setting $$x_\text{c} = L$$, $$D_\text{c} = D_{\max}$$, $$t_\text{c} = \frac{L^2}{D_{\max}}$$ and $$u_\text{c} = {u_{\max}}$$, I was able to arrive at a better-scaled non-dimensionalised version of the PDE as

$$\frac{\partial{\bar{u}}}{\partial{\bar{t}}}(\bar{x},\bar{t}) = \frac{\partial}{\partial{\bar{x}}}\left(\bar{D}(\bar{u}) \frac{\partial{\bar{u}}(\bar{x},\bar{t})}{\partial{\bar{x}}}\right)$$

in the unit interval $$\bar{x} \in (0,1)$$ with $$\bar{u} \in (0,1)$$. However, due to the 4 orders of magnitude variation in $$\bar{D}$$ as well as the poor resolution of its values, it doesn't look like the linear scaling $$\bar{D} = \frac{D}{D_\text{max}}$$ is the correct one to use.

• Did you try changing the equation to log scale? Take $\phi = \log{(u)}$, so your diffusion equation becomes: $$\frac{\partial \phi}{\partial t} = \exp{(\phi)} \frac{\partial}{\partial x} (\exp{(\phi)} D(\phi) \frac{\partial \phi}{\partial x})$$ The new diffusion coefficient would be: $$D^{'}(\phi) = \exp{(\phi)} D(\phi)$$ and it hopefully will balance the multiplication of very large numbers to very small numbers. – Alone Programmer Mar 12 '20 at 18:49
• This formulation just makes the non-linearities much stronger without much gain. – Dr Krishnakumar Gopalakrishnan Mar 12 '20 at 21:02
• How $f(t)$ behaves in time? Is it increasing or decreasing always or it oscillates somehow? – Alone Programmer Mar 12 '20 at 21:04
• For now, I am happy to assume $f(t) = 1$, and scale my PDE properly. How about choosing something along the lines of logarithmic scaling for both the diffusion coefficient as well as the spatial variable $x$? – Dr Krishnakumar Gopalakrishnan Mar 12 '20 at 21:05
• You can't assume $f(t) = 1$. Think about it physically. You are pumping mass into the system with the constant rate but on the other hand you blocked the other side of the domain by imposing zero flux boundary condition, it means at some point your system will be exploded cause you are pumping mass into the system and this mass keeps accumulating without any way to go out of your domain. – Alone Programmer Mar 12 '20 at 21:07