Diffusion (source code)

= Diffusion
{title2=$\mathbf j=-D\nabla C$}

Diffusion is net transport associated with random microscopic motion. A localized patch of a dilute <solute> can spread through a stationary <solvent>: individual <molecules> move in both directions, but more cross from the crowded side of an imaginary surface than from the less crowded side. This imbalance gives a net <diffusive flux> down the <concentration> <gradient>; the <molecules> do not need to sense which direction has lower <concentration>. At uniform <concentration>, microscopic exchanges continue even though the net <diffusive flux> vanishes. https://ocw.mit.edu/courses/1-061-transport-processes-in-the-environment-fall-2008/8260e3e1577cd739ce85143510d9c165_lec_01.pdf[Heidi Nepf, MIT: random motion and Fick's law]{ref}

The distinction from <advection> is easiest to see in a dye patch. Uniform bulk motion carries its centre downstream; <diffusion> broadens it relative to that centre. Both can happen together. A moving or spreading patch by itself does not identify the mechanism: a nonuniform <velocity field> can also stretch a patch. https://ocw.mit.edu/courses/1-061-transport-processes-in-the-environment-fall-2008/c96f9a75576238ac2c4e0e73b84e8072_lec_05.pdf[Nepf, MIT: advection and diffusion of a release]{ref}

\Image[/molecular-diffusion-profiles.png]
{title=<Diffusion> broadens a patch; uniform <advection> translates it}
{description=Original model curves, not measured data. Each panel starts with the same <Gaussian distribution> of dye, with <standard deviation> $\sigma_0=0.50\,\mathrm{mm}$. The chosen <diffusion coefficient> is $D=0.20\,\mathrm{mm^2\,h^{-1}}$ where enabled; the chosen bulk speed is $u=0.60\,\mathrm{mm\,h^{-1}}$ where enabled. The vertical axis is <concentration> divided by its spatial integral, so every curve has area one. Pure uniform <advection> preserves width and peak height; <diffusion> lowers the peak while preserving the total dye.}

For a dilute nonreacting <solute> in a uniform medium at fixed <temperature>, <Fick's first law> models the relative <diffusive flux> as $\mathbf j=-D\nabla C$, with scalar <diffusion coefficient> $D>0$ of units $\mathrm{m^2\,s^{-1}}$. Here $C$ is the <amount of substance> per unit <volume (thermodynamics)>, so $\mathbf j$ has units $\mathrm{mol\,m^{-2}\,s^{-1}}$. With carrier <velocity field> $\mathbf u$, the total <flux> is $C\mathbf u+\mathbf j$. The <continuity equation>, with no sources or <chemical reactions>, gives
$$
\frac{\partial C}{\partial t}+\nabla\cdot(C\mathbf u)=\nabla\cdot(D\nabla C).
$$
For constant $D$ and <incompressible flow>, this reduces to $C_t+\mathbf u\cdot\nabla C=D\nabla^2C$, where $\nabla^2$ is the <Laplacian>. In a stationary carrier it is the <diffusion equation>. These assumptions matter: variable $D$ must remain inside the <divergence>, and changing sources require extra terms. https://ocw.mit.edu/courses/1-061-transport-processes-in-the-environment-fall-2008/5536a0bf7f3bd0b21fde2169b93a4b5a_lec_02.pdf[Nepf, MIT: conservation with advective and diffusive fluxes]{ref}

The useful surprise is the common mathematics: <thermal conduction> smooths <temperature> through the analogous <heat equation>, while <molecular diffusion> smooths composition. This analogy already motivated the original formulation of <Fick's laws>. https://doi.org/10.1080/14786445508641925[Fick (1855), On liquid diffusion: the analogy with heat conduction]{ref} However, the <thermal diffusivity> and the <solutal diffusivity> need not be equal. A <diffusive time scale> $t_D\sim L^2/D$ means that crossing ten times the distance requires roughly one hundred times the time. This is why <molecular diffusion> is especially effective across thin layers, and why <chaotic advection> can assist mixing by making those layers thinner. Physical <diffusion> is a transport mechanism, distinct from the broader probabilistic class of <Markov diffusion>.