Description

A slab 0 < x < L has a field u(t,x) (temperature or concentration) that diffuses with a diffusivity that depends on u itself:​ du/dt = d/dx ( D(u) du/dx ), u(0,x) = uR, u(t,L) = uR, u(t,0) = uR + (uL - uR)(1 - exp(-t/epsilon)), epsilon = 10^-4.​The left boundary is raised from uR to uL over a very short time instead of with a discontinuous step, which keeps the initial and boundary data consistent at the corner. For t >> epsilon it is the same as u(t,0) = uL.​Three laws are studied: (1) linear D = D0 (1 + beta u), (2) power law D = D0 u^m, (3) exponential D = D0 exp(beta u).​Define the Kirchhoff potential θ(u) =
u
∫
0
D(s)ds
. Since D > 0, theta is strictly increasing and can be inverted. The flux is q = -D du/dx = -dθ/dx, so the nonlinearity disappears from the flux. At steady state
2
d
θ/d
2
x
= 0, so theta is a straight line in x. The steady profile is therefore found without solving any PDE: transform the boundary values, draw a straight line, transform back.​​References:​[1] Kirchhoff, G. (1894). Vorlesungen über die Theorie der Wärme (Vorlesungen über mathematische Physik, Vol. 4). Edited by M. Planck. Leipzig: B. G. Teubner. X + 210 pp.[2] Carslaw, H. S. and Jaeger, J. C., Conduction of Heat in Solids, 2nd ed., Oxford University Press, 1959.[3] Crank, J., The Mathematics of Diffusion, 2nd ed., Oxford University Press, 1975, which covers concentration-dependent diffusion.​

Workflow

1
.
Set the parameters (slab thickness, boundary values, D0, beta, m, end time).
2
.
For each D(u): write down D(u), the potential θ(u) =
u
∫
0
D(s)ds
3
.
Solution of the full transient PDE with NDSolve. The boundary condition u(t,0) =uR+(uL-uR)(1-Exp[-t/ε]) keeps the initial and boundary data consistent at the corner, so NDSolve gives no ibcinc warning. Plot snapshots at the chosen times.
4
.
Steady state by Kirchhoff: compute θ(uL) and θ(uR), form the straight line θ(x) = θ(uL) + (θ(uR) - θ(uL)) x/L, and invert it to get u(x).
5
.
Steady flux: q = (θ(uL) - θ(uR))/L. It is the same at every x.
6
.
Effective diffusivity: Deff = the mean of D over [uR, uL]. It is computed by direct NIntegrate of D.
7
.
Validation: overlay the dashed steady profile on the transient curves
In[]:=
(*Parameters*)​​L=1;(*slabthickness*)​​uL=1;uR=0.1;(*boundaryvalues*)​​D0=1;β=2;m=1.25;​​tEnd=5;
In[]:=
times={0.02,0.03,0.05,0.1,tEnd};
In[]:=
θ[x_]:=(θR-θL)x/L+θL

Case 1 - linear diffusivity D = D0 (1 + beta u)

In[]:=
ε=0.0001;
SOL=NDSolveValue[{D[u[t,x],t]==D[D0(1+βu[t,x])D[u[t,x],x],x],u[0,x]==uR,u[t,0]==uR+(uL-uR)(1-Exp[-t/ε]),u[t,L]==uR},u,{t,0,tEnd},{x,0,L}]
Out[]=
InterpolatingFunction
Domain: {{0.,5.},{0.,1.}}
Output: scalar

In[]:=
p1=Plot[Evaluate[Table[SOL[tt,x],{tt,times}]],{x,0,L},PlotLegends->(StringForm["t = ``",#]&/@times),PlotStyle->Table[{Hue[(i+2)/5]},{i,6}],PlotRange->All,AspectRatio->1,Frame->True,GridLines->Automatic,FrameLabel->{Style["position",14],Style["concentration",14]}];
In[]:=
θR=First[x/.NSolve[(-1+Sqrt[1+2βx/D0])/β==uR,x]]
Out[]=
0.11
In[]:=
θL=First[x/.NSolve[(-1+Sqrt[1+2βx/D0])/β==uL,x]]
Out[]=
2.
In[]:=
c[x_]:=(-1+Sqrt[1+2βθ[x]/D0])/β
In[]:=
Show[p1,Plot[c[x],{x,0,1},PlotStyle->{Black,Dashed}],PlotRange->All]
Out[]=
t = 0.02
t = 0.03
t = 0.05
t = 0.1
t = 5
In[]:=
θ[x]
Out[]=
2.-1.89x
In[]:=
(*Steadyflux:q=-Ddu/dx=-dθ/du=-(θ(uL)-θ(uR))/(ul-uR)*)​​steadyFlux=-D[θ[x],x]
Out[]=
1.89
In[]:=
(*Effective(mean)diffusivitybetweentheboundaryvalues*)​​Deff=NIntegrate[D0(1+βu),{u,uL,uR}]/(uR-uL)
Out[]=
2.1
In[]:=
steadyFluxL/(uL-uR)(*check*)
Out[]=
2.1

Case 2 - power law D = D0 u^m

In[]:=
SOL=NDSolveValue[{D[u[t,x],t]==D[D0u[t,x]^mD[u[t,x],x],x],u[0,x]==uR,u[t,0]==uR+(uL-uR)(1-Exp[-t/ε]),u[t,L]==uR},u,{t,0,tEnd},{x,0,L},AccuracyGoal->5];
In[]:=
p2=Plot[Evaluate[Table[SOL[tt,x],{tt,times}]],{x,0,L},PlotLegends->(StringForm["t = ``",#]&/@times),PlotStyle->Table[{Hue[(i+2)/5]},{i,6}],PlotRange->All,AspectRatio->1,Frame->True,GridLines->Automatic,FrameLabel->{Style["position",14],Style["concentration",14]}];
In[]:=
θR=First[x/.NSolve[((m+1)x/D0)^(1/(m+1))==uR,x]]
Out[]=
0.00249929
In[]:=
θL=First[x/.NSolve[((m+1)x/D0)^(1/(m+1))==uL,x]]
Out[]=
0.444444
In[]:=
c[x_]:=((m+1)θ[x]/D0)^(1/(m+1))
In[]:=
Show[p2,Plot[c[x],{x,0,1},PlotStyle->{Black,Dashed}]]
Out[]=
t = 0.02
t = 0.03
t = 0.05
t = 0.1
t = 5
In[]:=
θ[x]
Out[]=
0.444444-0.441945x
In[]:=
(*Steadyflux:q=-Ddu/dx=-dθ/du=-(θ(uL)-θ(uR))/(ul-uR)*)​​steadyFlux=-D[θ[x],x]
Out[]=
0.441945
In[]:=
(*Effective(mean)diffusivitybetweentheboundaryvalues*)​​Deff=NIntegrate[D0u^m,{u,uL,uR}]/(uR-uL)
Out[]=
0.49105

Case 3 - exponential diffusivity D = D0 exp(beta u)

Discussion

Results: with (uL = 1, uR = 0.1, D0 = 1, beta = 2, m = 1.25, L = 1), the Kirchhoff calculation gives Deff = 2.1 and q = 1.89 for the linear law, Deff = 0.4911 and q = 0.4419 for the power law, and Deff = 3.4265 and q = 3.0838 for the exponential law. In each case q L/(uL - uR) reproduces the direct NIntegrate value of Deff.
Shape of the steady profiles: Since the flux is constant, du/dx = -q/D(u): the profile is steep where D is small and flat where D is large. All three laws have D increasing with u, so the profiles are steep near the low-concentration face x = L and flat near x = 0, and they are concave and lie above the straight line that a constant D would give. The effect grows with the contrast in D. Across the slab D varies by a factor of 2.5 for the linear law (1.2 to 3), 6.0 for the exponential law (1.22 to 7.39) and 17.8 for the power law (0.056 to 1), so the departure from a straight line is strongest for the power law.
Transient behaviour: The left boundary is raised from uR to uL within a time of order epsilon = 10^-4, so for all plotted times (t >= 0.02) u(t,0) = uL and the curves start at uL. Heat or mass enters at x = 0 and penetrates faster where D is large. Ahead of the advancing front u is close to uR, so D is small there. This effect is strongest for the power law (D(uR) = 0.056, compared with 1.2 and 1.22 for the other two laws), so its front is the sharpest.
Effective diffusivity: Deff is the mean of D(u) over [uR, uL], so the steady flux equals the flux of a linear problem with constant diffusivity Deff: q = Deff (uL - uR)/L. It describes the steady state only. It is not the relaxation rate of the transient, which is controlled mainly by the smaller diffusivities.
Accuracy: The Kirchhoff steady state is exact, so any difference between the NDSolve curve at tEnd and the dashed line comes either from numerical error or from incomplete relaxation of the transient. Check which one by increasing tEnd or refining the grid. The power law is the most demanding case because D is smallest (0.056 at u = 0.1) near x = L, where the profile is steepest.
Limitations: The transform removes the nonlinearity from the flux but does not linearize the transient problem. It needs a scalar D(u), constant rho*Cp (for heat), and Dirichlet or prescribed-flux boundaries. Convective or radiative boundaries need an iterative solve.