Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

12. Diffuse interfaces and the linear theory of spinodal decomposition

School of Engineering, Nazarbayev University

Classical Gibbs thermodynamics treats phase boundaries as infinitely sharp mathematical surfaces of zero thickness, yet inside the chemical spinodal (f′′(c0)<0f''(c_0) < 0), a quenched solid solution decomposes spontaneously without any nucleation barrier, forming nanoscale composition waves whose diffuse interfaces are several atomic planes wide. If we wrote Fick’s law with a negative diffusivity Deff=Mf′′(c0)<0D_{\mathrm{eff}} = M f''(c_0) < 0, the shortest grid-scale wavelengths (k→∞k \to \infty) would grow at an unbounded rate (ω(k)=−Deffk2→+∞\omega(k) = -D_{\mathrm{eff}} k^2 \to +\infty), rendering the PDE mathematically ill-posed. In 1958, John W. Cahn and John E. Hilliard removed this divergence by adding the gradient energy penalty κ2∣∇c∣2\frac{\kappa}{2}|\nabla c|^2 to the free-energy functional. In this lecture we derive and verify the exact planar tanh⁡\tanh diffuse interface, interfacial tension σ=κW/18\sigma = \sqrt{\kappa W / 18}, the Cahn–Hilliard dispersion relation ω(k)\omega(k), and the severe Δx4\Delta x^4 biharmonic stiffness of explicit finite differences versus semi-implicit spectral integration.

Learning objectives

  1. Evaluate the symmetric Landau double-well free-energy density f(c)=Wc2(1−c)2f(c) = W c^2(1-c)^2, chemical potential f′(c)f'(c), and spinodal curvature f′′(c)f''(c) via phase_field.double_well_potential.

  2. Verify the exact 1-D equilibrium planar interface c(x)=12[1+tanh⁡((x−x0)/ℓw)]c(x) = \frac{1}{2}[1 + \tanh((x-x_0)/\ell_w)] with diffuse width ℓw=2κ/W\ell_w = \sqrt{2\kappa / W}, energy equipartition, and surface tension σ=κW/18\sigma = \sqrt{\kappa W / 18} via phase_field.equilibrium_interface_profile_1d.

  3. Analyze linear spinodal amplification ω(k)=−Mk2[f′′(c0)+κk2]\omega(k) = -M k^2 [f''(c_0) + \kappa k^2], critical wavenumber kck_c, and fastest-growing wavelength λmax⁡=2π2/kc\lambda_{\max} = 2\pi\sqrt{2}/k_c using phase_field.cahn_hilliard_dispersion.

  4. Contrast the fourth-order Δtmax⁡∝Δx4/(Mκ)\Delta t_{\max} \propto \Delta x^4 / (M\kappa) explicit stability bottleneck of phase_field.cahn_hilliard_1d_fd against semi-implicit Fourier integration in phase_field.cahn_hilliard_1d_spectral.

Time: about 60 min

1. Principles and governing equations

Consider an inhomogeneous binary alloy with local conserved solute mole fraction c(r,t)∈[0,1]c(\mathbf{r}, t) \in [0, 1]. In Cahn–Hilliard continuum thermodynamics (Cahn & Hilliard, J. Chem. Phys. 28, 258, 1958), the total Ginzburg–Landau free energy F[c]\mathcal{F}[c] sums a homogeneous bulk Landau free-energy density f(c)f(c) and a non-local gradient penalty resisting sharp composition jumps:

F[c]=∫Ω[f(c)+κ2∣∇c∣2]dr,f(c)=Wc2(1−c)2(1.1)\mathcal{F}[c] = \int_{\Omega} \left[ f(c) + \frac{\kappa}{2}|\nabla c|^2 \right] d\mathbf{r}, \qquad f(c) = W c^2 (1 - c)^2 \tag{1.1}

where W>0W > 0 sets the double-well barrier height f(0.5)=W/16f(0.5) = W / 16 between equilibrium phases cα=0c_\alpha = 0 and cβ=1c_\beta = 1, and κ>0\kappa > 0 is the gradient energy coefficient. Differentiating f(c)f(c) (phase_field.double_well_potential) gives:

f′(c)=2Wc(1−c)(1−2c),f′′(c)=2W(1−6c+6c2)(1.2)f'(c) = 2 W c (1 - c)(1 - 2c), \qquad f''(c) = 2 W (1 - 6c + 6c^2) \tag{1.2}

Setting f′′(cs)=0f''(c_s) = 0 locates the chemical spinodal inflection points cs,±=12(1±13)≈(0.2113,0.7887)c_{s,\pm} = \frac{1}{2}\left(1 \pm \frac{1}{\sqrt{3}}\right) \approx (0.2113, 0.7887), inside which f′′(c)<0f''(c) < 0 triggers barrierless uphill diffusion.

1.1 Variational Chemical Potential & Exact Planar Diffuse Interface

Taking the variational derivative μ≡δFδc=f′(c)−κ∇2c\mu \equiv \frac{\delta \mathcal{F}}{\delta c} = f'(c) - \kappa \nabla^2 c, a 1-D planar equilibrium interface connecting c(−∞)=0c(-\infty) = 0 to c(+∞)=1c(+\infty) = 1 satisfies μ=0  ⟹  f′(c)=κd2cdx2\mu = 0 \implies f'(c) = \kappa \frac{d^2 c}{dx^2}. Multiplying by dc/dxdc/dx and integrating from −∞-\infty yields exact pointwise energy equipartition κ2(dcdx)2=f(c)\frac{\kappa}{2}\left(\frac{dc}{dx}\right)^2 = f(c), with closed-form solution (phase_field.equilibrium_interface_profile_1d):

ceq(x)=12[1+tanh⁡ ⁣(x−x0ℓw)],ℓw=2κW,σ=∫−∞+∞[f(ceq)+κ2(dceqdx)2]dx=κW18(1.3)c_{\mathrm{eq}}(x) = \frac{1}{2}\left[1 + \tanh\!\left(\frac{x - x_0}{\ell_w}\right)\right], \qquad \ell_w = \sqrt{\frac{2\kappa}{W}}, \qquad \sigma = \int_{-\infty}^{+\infty} \left[f(c_{\mathrm{eq}}) + \frac{\kappa}{2}\left(\frac{dc_{\mathrm{eq}}}{dx}\right)^2\right] dx = \sqrt{\frac{\kappa W}{18}} \tag{1.3}

Demonstration 1: Landau Double-Well Spinodal Region & Exact Planar tanh Interface
=================================================================================
Spinodal interval where f''(c) < 0 : [0.211325, 0.788675]
Diffuse interface width l_w        : 0.707107 (exact sqrt(2*kappa/W) = 0.707107)
Pointwise equipartition max |f - 0.5*kappa*(dc/dx)^2| : 1.39e-16
Surface tension sigma: quadrature = 0.23570226 vs exact sqrt(kappa*W/18) = 0.23570226
<Figure size 1210x440 with 2 Axes>

Figure 12.1. (a) Double-well free-energy density and its second derivative (scaled by 0.1); the shaded band is the spinodal. (b) Equilibrium interface profile and the normalized energy density across it.

What Demonstration 1 shows. κ\kappa and WW act in opposite directions on the width: increasing the gradient penalty κ\kappa widens the interface (ℓw=2κ/W↑\ell_w = \sqrt{2\kappa/W} \uparrow), whereas increasing the chemical barrier WW sharpens it (ℓw↓\ell_w \downarrow), while both raise the excess interfacial energy σ=κW/18\sigma = \sqrt{\kappa W / 18}. Pointwise equipartition f(ceq(x))=κ2(dceq/dx)2f(c_{\mathrm{eq}}(x)) = \frac{\kappa}{2}(dc_{\mathrm{eq}}/dx)^2 holds to 10-15, and numerical quadrature matches κW/18=0.23570226\sqrt{\kappa W / 18} = 0.23570226 to 8 significant digits (here W=2W = 2, κ=0.5\kappa = 0.5).


2. Linear Spinodal Dispersion & Wavelength Selection

Because solute atoms are conserved, the flux J=−M∇μ\mathbf{J} = -M \nabla \mu obeys the continuity equation ∂c∂t=−∇⋅J\frac{\partial c}{\partial t} = -\nabla \cdot \mathbf{J}, giving the fourth-order nonlinear Cahn–Hilliard PDE:

∂c∂t=∇⋅[M∇(f′(c)−κ∇2c)](2.1)\frac{\partial c}{\partial t} = \nabla \cdot \left[ M \nabla \left( f'(c) - \kappa \nabla^2 c \right) \right] \tag{2.1}

Substituting an infinitesimal Fourier composition wave c(r,t)=c0+A^ eik⋅r+ω(k)tc(\mathbf{r}, t) = c_0 + \hat{A}\,e^{i\mathbf{k}\cdot\mathbf{r} + \omega(k) t} around a uniform alloy c0c_0 and retaining linear terms in A^\hat{A} yields the Cahn–Hilliard dispersion relation (phase_field.cahn_hilliard_dispersion):

ω(k)=−Mk2[f′′(c0)+κk2](2.2)\omega(k) = -M k^2 \left[ f''(c_0) + \kappa k^2 \right] \tag{2.2}

When f′′(c0)<0f''(c_0) < 0, long-wavelength perturbations with 0<k<kc0 < k < k_c grow exponentially (ω(k)>0\omega(k) > 0), while short-wavelength modes k>kck > k_c are damped (ω(k)<0\omega(k) < 0) by the −κMk4-\kappa M k^4 capillary penalty:

kc=−f′′(c0)κ,kmax⁡=kc2,λmax⁡=2πkmax⁡=2π2kc,ωmax⁡=M [f′′(c0)]24κ(2.3)k_c = \sqrt{\frac{-f''(c_0)}{\kappa}}, \qquad k_{\max} = \frac{k_c}{\sqrt{2}}, \qquad \lambda_{\max} = \frac{2\pi}{k_{\max}} = \frac{2\pi\sqrt{2}}{k_c}, \qquad \omega_{\max} = \frac{M\,[f''(c_0)]^2}{4\kappa} \tag{2.3}

Demonstration 2: Cahn-Hilliard Linear Dispersion Curve omega(k) Inside vs Outside Spinodal
==========================================================================================
Alloy c0 |    d2f/dc2 |  Unstable? |       k_c |     k_max |  lambda_max |  omega_max
----------------------------------------------------------------------------------
    0.50 |    -2.0000 |       True |    2.0000 |    1.4142 |      4.4429 |     2.0000
    0.35 |    -1.4600 |       True |    1.7088 |    1.2083 |      5.2000 |     1.0658
    0.25 |    -0.5000 |       True |    1.0000 |    0.7071 |      8.8858 |     0.1250
    0.12 |     1.4656 |      False |    0.0000 |    0.0000 |         inf |     0.0000
<Figure size 825x462 with 1 Axes>

Figure 12.2. Growth rate ω(k)\omega(k) of a small composition wave for four mean compositions; the point marks the fastest-growing wavenumber at c0=0.5c_0 = 0.5.

What Demonstration 2 shows. Without gradient energy (κ→0\kappa \to 0), ω(k)=−Mf′′(c0)k2\omega(k) = -M f''(c_0) k^2 diverges parabolically as k→∞k \to \infty. The −κMk4-\kappa M k^4 fourth-order term bends ω(k)\omega(k) back below zero beyond kck_c, which selects the wavelength λmax⁡=2π/kmax⁡=2π2/kc=4.443\lambda_{\max} = 2\pi / k_{\max} = 2\pi\sqrt{2}/k_c = 4.443 at c0=0.50c_0 = 0.50. As c0c_0 moves from the spinodal center (0.50) toward the spinodal boundary (0.2113), ∣f′′(c0)∣|f''(c_0)| weakens, shifting λmax⁡\lambda_{\max} to longer wavelengths (8.886 at c0=0.25c_0 = 0.25) and lowering ωmax⁡\omega_{\max} by a factor of 16. Outside the spinodal (c0=0.12c_0 = 0.12, metastable binodal region), ω(k)≤0\omega(k) \leq 0 for all k>0k > 0: small composition fluctuations decay, so phase separation requires finite-amplitude nucleation.


3. Biharmonic Δx4\Delta x^4 Stiffness: Explicit FD vs. Semi-Implicit Spectral

Discretizing Eq. (2.1) on an NN-point periodic grid of spacing Δx=L/N\Delta x = L/N via conservative second-order finite differences (phase_field.cahn_hilliard_1d_fd) approximates the fourth derivative ∂x4c\partial_x^4 c, whose highest Nyquist mode (kNyq=π/Δxk_{\mathrm{Nyq}} = \pi/\Delta x) has discrete eigenvalue (4/Δx2)2=16/Δx4(4/\Delta x^2)^2 = 16/\Delta x^4. Forward Euler time stepping therefore suffers a punitive fourth-order stability restriction:

ΔtFD,crit≈Δx48Mκ(3.1)\Delta t_{\mathrm{FD,crit}} \approx \frac{\Delta x^4}{8 M \kappa} \tag{3.1}

Halving Δx\Delta x shrinks the maximum stable time step by 16×16\times. By contrast, phase_field.cahn_hilliard_1d_spectral treats the stiff linear −κM∂x4c-\kappa M \partial_x^4 c term implicitly in Fourier space while keeping the nonlinear chemical term explicit:

c^kn+1=c^kn−Δt Mk2f′(cn)^k1+Δt Mκk4(3.2)\hat{c}_k^{n+1} = \frac{\hat{c}_k^n - \Delta t\,M k^2 \widehat{f'(c^n)}_k}{1 + \Delta t\,M\kappa k^4} \tag{3.2}

We verify both solvers at a stable fine step Δt=0.005\Delta t = 0.005 against analytical linear growth A(t)=A0eω(k)tA(t) = A_0 e^{\omega(k) t}, and then test Δt=0.10\Delta t = 0.10 (6.4×6.4\times above ΔtFD,crit\Delta t_{\mathrm{FD,crit}}).


Demonstration 3: 1-D Explicit FD vs Semi-Implicit Spectral Solver & Early-Time Mode Growth
==========================================================================================
Grid dx = 0.500 -> Explicit biharmonic limit dx^4/(8*M*kappa) = 0.01562
At t = 2.0 (dt=0.005): Spectral amp = 0.018326 vs Linear Theory A0*exp(omega*t) = 0.018659
Max |c_FD - c_Spectral| at dt = 0.005 : 5.9729e-04
At dt = 0.10 (> dt_crit): Explicit FD blew up = True | Spectral bounded in [0.0224, 0.9776]
Spectral free energy F(0) = 4.0000 -> F(25) = 2.3536 (monotone decay)

What Demonstration 3 shows. At Δt=0.005<ΔtFD,crit=0.0156\Delta t = 0.005 < \Delta t_{\mathrm{FD,crit}} = 0.0156, explicit finite differences and Fourier spectral integration agree closely (largest difference 6.0×10−46.0\times 10^{-4}), and the amplitude at t=2t = 2 is within 2%2\% of the linear growth law A0eω(k)tA_0 e^{\omega(k) t}. Increasing the step to Δt=0.10\Delta t = 0.10 makes cahn_hilliard_1d_fd diverge, whereas cahn_hilliard_1d_spectral carries the perturbation into plateaus near c=0c = 0 and c=1c = 1 separated by tanh⁡\tanh interfaces, conserves the mean composition to <10−14< 10^{-14} and lowers F[c]\mathcal{F}[c] from 4.000 to 2.354. Five domains have ten interfaces, and 10σ=2.35710\sigma = 2.357.


4. Sensitivity to the parameters

What happens to the emergent spinodal microstructure if we vary the gradient energy coefficient κ∈{0.125,0.25,0.50,1.00,2.00}\kappa \in \{0.125, 0.25, 0.50, 1.00, 2.00\} at fixed W=2.0W = 2.0? We verify the simultaneous scaling of interface width ℓw∝κ1/2\ell_w \propto \kappa^{1/2}, interfacial tension σ∝κ1/2\sigma \propto \kappa^{1/2}, fastest spinodal wavelength λmax⁡∝κ1/2\lambda_{\max} \propto \kappa^{1/2}, and peak amplification rate ωmax⁡∝κ−1\omega_{\max} \propto \kappa^{-1}.


Demonstration 4: Gradient-Energy Sensitivity Sweep kappa -> l_w, sigma, lambda_max, omega_max
=============================================================================================
   kappa |   Width l_w |  Tension sigma |   lambda_max |  lambda_max / l_w |   omega_max
----------------------------------------------------------------------------------------
   0.125 |      0.3536 |        0.11785 |       2.2214 |          6.283185 |      8.0000
   0.250 |      0.5000 |        0.16667 |       3.1416 |          6.283185 |      4.0000
   0.500 |      0.7071 |        0.23570 |       4.4429 |          6.283185 |      2.0000
   1.000 |      1.0000 |        0.33333 |       6.2832 |          6.283185 |      1.0000
   2.000 |      1.4142 |        0.47140 |       8.8858 |          6.283185 |      0.5000

Inside the algorithm

What Demonstration 4 shows. At the critical composition c0=0.50c_0 = 0.50 (f′′(0.5)=−Wf''(0.5) = -W), kmax⁡=−f′′(0.5)/(2κ)=W/(2κ)=1ℓwk_{\max} = \sqrt{-f''(0.5)/(2\kappa)} = \sqrt{W/(2\kappa)} = \frac{1}{\ell_w}, which yields a universal dimensionless ratio λmax⁡/ℓw=2π≈6.283185\lambda_{\max} / \ell_w = 2\pi \approx 6.283185 independent of both κ\kappa and WW. Every nascent spinodal wave is 2π2\pi diffuse interface widths across.

Below we inspect phase_field.equilibrium_interface_profile_1d and phase_field.cahn_hilliard_dispersion, and verify a NumPy implementation side by side to rounding error.

Check against the library


Inside the Algorithm: phase_field.equilibrium_interface_profile_1d & cahn_hilliard_dispersion
=============================================================================================
def equilibrium_interface_profile_1d(
    x: np.ndarray,
    W: float = 1.0,
    kappa: float = 1.0,
    x0: float = 0.0,
) -> dict:
    """Compute exact 1-D diffuse interface c(x) = 0.5*[1 + tanh((x-x0)/w)] and surface tension sqrt(kappa*W/18)."""
    if W <= 0.0 or kappa <= 0.0:
        raise ValueError("W and kappa must be strictly positive.")
    xg = np.asarray(x, dtype=float)
    width = float(np.sqrt(2.0 * kappa / W))
    c_prof = 0.5 * (1.0 + np.tanh((xg - x0) / width))
    dc_dx = (0.5 / width) / (np.cosh((xg - x0) / width) ** 2)
    sigma_exact = float(np.sqrt(kappa * W / 18.0))
    return {
        "c": c_prof,
        "dc_dx": dc_dx,
        "interface_width": width,
        "interfacial_energy_exact": sigma_exact,
    }

def cahn_hilliard_dispersion(
    k: float | np.ndarray,
    c0: float = 0.5,
    W: float = 1.0,
    kappa: float = 1.0,
    M: float = 1.0,
) -> dict:
    """Evaluate Cahn-Hilliard dispersion omega(k) = -M*k^2*[f''(c0) + kappa*k^2] and fastest spinodal mode k_max."""
    k_arr = np.asarray(k, dtype=float)
    f2 = double_well_potential(float(c0), W=W)["d2f_dc2"]
    omega = -M * (k_arr**2) * (f2 + kappa * (k_arr**2))
    if f2 < 0.0:
        kc = float(np.sqrt(-f2 / kappa))
        k_max = float(kc / np.sqrt(2.0))
        lam_max = float(2.0 * np.pi / k_max)
        omega_max = float(M * (f2**2) / (4.0 * kappa))
        unstable = True
    else:
        kc = 0.0
        k_max = 0.0
        lam_max = float(np.inf)
        omega_max = 0.0
        unstable = False
    return {
        "omega": float(omega) if np.ndim(k) == 0 else omega,
        "d2f_dc2": float(f2),
        "spinodal_unstable": unstable,
        "k_c": kc,
        "k_max": k_max,
        "lambda_max": lam_max,
        "omega_max": omega_max,
    }

Max |omega_hand - omega_lib|: 0.0

Exercises

Worked solutions are in 12_solutions.ipynb. The cell below the list is a short self-check to start from.

  1. Verify a result. On a periodic domain L=40.0L = 40.0 (N=256N = 256), construct a smooth two-interface slab c(x)=12[tanh⁡((x−10)/ℓw)−tanh⁡((x−30)/ℓw)]c(x) = \frac{1}{2}[\tanh((x - 10)/\ell_w) - \tanh((x - 30)/\ell_w)] for W=4.0,κ=0.5W = 4.0, \kappa = 0.5, evaluate phase_field.ginzburg_landau_free_energy_1d, and verify across three (W,κ)(W, \kappa) pairs that F[c]=2σ=2κW/18\mathcal{F}[c] = 2\sigma = 2\sqrt{\kappa W / 18} to within 10-5.

  2. Find how it fails. Verify that equilibrium_interface_profile_1d raises ValueError when W <= 0 or kappa <= 0, and check numerically on cahn_hilliard_1d_fd (L=32,M=1,W=2,κ=0.5L = 32, M = 1, W = 2, \kappa = 0.5) that Δt=0.05\Delta t = 0.05 is stable at N=32N = 32 (Δx=1.0\Delta x = 1.0) yet blows up at N=64N = 64 (Δx=0.5\Delta x = 0.5) due to the Δx4\Delta x^4 biharmonic CFL penalty.

  3. Implement it yourself. Implement my_cahn_hilliard_1d_spectral(c_init, L, dt, n_steps, M=1.0, W=1.0, kappa=1.0) in pure NumPy using np.fft.fft and np.fft.ifft, verify its final composition profile matches phase_field.cahn_hilliard_1d_spectral to < 1e-13, and verify ∣cˉ(T)−cˉ(0)∣<10−14|\bar{c}(T) - \bar{c}(0)| < 10^{-14}.


Self-check for the exercises
============================
Periodic two-interface F[c] = 0.66666667 vs exact 2*sigma = 0.66666667
All checks passed.