The exponential & error function solutions in diffusion

Non-steady-state diffusion, H. K. D. H. Bhadeshia

In solving the equations governing non-steady-state diffusion, a change of independent variables helps:

η =
z 2√(Dt)
or η =
z √t
.

In 1894, Ludwig Boltzmann (Ann. Phys. 53, 960) introduced this variable substitution to integrate the nonlinear diffusion equation (Fick’s second law):

∂c ∂t
=
∂ ∂z
[ D
∂c ∂z
]

When applying Fick's first law, we consider diffusion through a membrane of finite thickness; similarly, there is a finite time required to reach steady-state diffusion through the foil. Boltzmann recognised that with Fick's second law, given the boundary conditions c{z, 0} = c0 and c{0, t} = cs, the physical system possesses no characteristic length scale or time scale. As a consequence, the concentration cannot depend independently on space z and time t, but rather, on the ratio η = z / √t.

With the transformation of variables, the partial differential equation with two independent variables becomes a single, solvable ordinary differential equation:

-
η 2
dc dη
=
d dη
[ D
dc dη
]

Exponential and error function solutions

For a concentration-independent diffusion coefficient (D = const), substituting η = z / (2√[Dt]) into Fick’s second law proceeds by the multivariate chain rule. Differentiating c{η} with respect to time:

∂c ∂t
=
dc dη
∂η ∂t
=
dc dη
[ -
z 4t √(Dt)
] = -
η 2t
dc dη

Differentiating with respect to space:

∂c ∂z
=
dc dη
∂η ∂z
=
1 2√(Dt)
dc dη

Evaluating the second spatial derivative:

∂2c ∂z2
=
∂ ∂z
[
1 2√(Dt)
dc dη
] =
1 4Dt
d2c dη2

Equating the temporal and spatial derivatives via Fick’s second law (∂c/∂t = D ∂2c/∂z2):

-
η 2t
dc dη
= D [
1 4Dt
d2c dη2
]

On multiplying by 4t this becomes :

d2c dη2
+ 2η
dc dη
= 0

Exponential solution

Defining a gradient variable p{η} = dc/dη separates the first-order differential equation directly:

dp p
= -2η dη ⟹ p{η} = A exp{-η2}
exponential solution to diffusion equation
Exponential solution, thin plate on semi-infinite bar.

Error function solution

Integrating p{η} from 0 to η yields the integral:

c{η} = A ∫0η exp{-ξ2} dξ + B

Applying the standard semi-infinite boundary conditions (c = cs at η = 0, and c → c0 as η → ∞), and the definition of the error function erf{η} = (2/√π} ∫0η exp{-ξ2} dξ:

c{z, t} - c0 cs - c0
= 1 - erf {
z 2√(Dt}
} = erfc {
z 2√(Dt)
}
error function solution to diffusion equation
Error function solution, diffusion couple of two semi-infinite bars.
Collapse onto the universal similarity master curve
Compare space-time concentration profiles against the invariant Boltzmann similarity coordinate
Diffusion coefficient (D) 1.0 × 10⁻¹¹ m²/s
Display representation