Solution to piecewise heat equation

We have piecewise diffusion equation

$u_{t}(x,t)=\left\{\begin{matrix} D_{1}u_{xx}(x,t) &x\in(0,1) \\ D_{2}u_{xx}(x,t) & x\in (1,2)\end{matrix}\right.$,

with IC:

$u(x,0)=2x+1$

and BC :

$u(0,t)=1$ and $u(2,t)=5$, $\lim_{x\uparrow 1}u=\lim_{x\downarrow 1}u$ and $\lim_{x\uparrow 1}D_{1}u_{x}=\lim_{x\downarrow 1}D_{2}u_{x}$.

Attempt

By splitting $u=v(x)+w(x,t)$, steady state and transient solutions, we can find each one. The first is easy

$$v(x)=\left\{\begin{matrix}\frac{D_{2}}{D_{1}}\frac{u_{R}-u_{L}}{\frac{D_{2}}{D_{1}}+1}x+u_{L} & x\in(0,1)\\ \frac{u_{R}-u_{L}}{\frac{D_{2}}{D_{1}}+1} x+\frac{(\frac{D_{2}}{D_{1}}-1)u_{R}+2u_{L}}{\frac{D_{2}}{D_{1}}+1} & x\in (1,2). \\ \end{matrix}\right.$$

The w(x,t) satisfies the Dirichlet BC heat equation because $w(0,t)=u(0,t)-v(0)=0$ and similarly $w(2,t)=0$.

Assuming separable solution $w=T(t)X(x)$ we get $X''=k_{1}X$ and $X''=k_{2}X$ for $(0,1),(1,2)$ respectively for some constants $k_{1},k_{2}$. If they are both zero, we get $X$ linear. If positive we get $Acosh(\sqrt{k_{1}}x)+Bsinh(\sqrt{k_{1}}x)$, $Ccosh(\sqrt{k_{2}}x)+Dsinh(\sqrt{k_{2}}x)$ for each interval respectively. If negative we get $Acos(\sqrt{-k_{1}}x)+Bsin(\sqrt{-k_{1}}x)$, $Ccos(\sqrt{-k_{2}}x)+Dsin(\sqrt{-k_{2}}x)$

The $w(0,t)=0$ gives A=0. But the other conditions give

$$Bsinh(\sqrt{k_{1}})=Ccosh(\sqrt{k_{2}})+Dsinh(\sqrt{k_{2}})$$

$$B\sqrt{k_{1}}cosh(\sqrt{k_{1}})=C\sqrt{k_{2}}sinh(\sqrt{k_{2}})+D\sqrt{k_{2}}cosh(\sqrt{k_{2}})$$

$$Ccosh(2\sqrt{k_{2}})+D\sqrt{k_{2}}sinh(2\sqrt{k_{2}})=0$$

Any suggestions?

You may be interested by the numerical solution of the problem.
Here it is, assuming D1=10 and D2=1 :

It is important to verify that $\lim_{x\uparrow 1}D_{1}u_{x}=\lim_{x\downarrow 1}D_{2}u_{x}$.
Here are the curves :

$d(x)$ = If x<1 then 10 else 1.

The continuity of $d(x) u(x)$ is respected, except at t=0, because your IC condition is not compatible with that.

Here is the whole code, in Wolfram Langage (= Mathematica) :

d1 = 10;
d2 = 1;
d12[x_] = If[x < 1, d1, d2];
eq = D[uu[x, t], t] ==  d12[x] D[uu[x, t], x, x];
opts = Method -> {"MethodOfLines",
"SpatialDiscretization" -> {"FiniteElement",
"MeshOptions" -> {"MaxCellMeasure" -> 0.01}}};
u = NDSolveValue[{eq, uu[x, 0] == 2 x + 1, uu[0, t] == 1,
uu[2, t] == 5}, uu, {x, 0, 2}, {t, 0, 5}, opts];

Plot[Evaluate[Table[
Callout[u[x, t[[1]]], With[{t0 = t[[1]]}, HoldForm[u[x, t0]]],
t[[2]]], {t, {
{0, {.95, Above}}, {0.001, {1.3, 1}}, {0.05, {.5,
Above}}, {0.2, {1.5, Below}}, {1, {1.7, Below}}}}]],
{x, 0, 2}, PlotRange -> {Automatic, {0, 5}},
PlotTheme -> {"Web", "LargeLabels"}]

Plot[Evaluate[
Table[Callout[d12[x] D[u[x, t[[1]]], x],
With[{t0 = t[[1]]}, d[x] D["u"[x, t0], x]], t[[2]]], {t, {
{0, {.95, Above}}, {0.001, {1.3, 10}}, {0.05, {.5,
Above}}, {0.2, {0.3, Below}}, {1, {0.8, Below}}}}]] , {x, 0, 2},     PlotRange -> {Automatic, {0, 25}},
PlotTheme -> {"Web", "LargeLabels"}]

• I don't think there is a closed form for the solution. I would be happy to be wrong Dec 18, 2016 at 19:03

HINT:

Consider

\begin{align*} m(x,t) = \begin{cases} w\left(\frac{x+1}{\sqrt{D_1}},t\right), \mbox{if} \ x\in(-1, 0)\\ w\left(\frac{x+1}{\sqrt{D_2}},t\right), \mbox{if} \ x\in(0, 1) \end{cases} \end{align*}

What PDE does m satisfy?