# Diffusion

**Diffusion** is the process by which concentration differences even out over time due to random movements.
Qualitatively different from other motions in nature, diffusion gives us a baseline expectation for how quickly particles spread out.
If we see particles transported much faster than diffusion would allow, it's a clear signal that some energy is being spent to facilitate it.

Many physical processes like spreading leaks, chemical signaling in gene expression, and the flow of current in a transistor have a physical diffusive mechanism. Other processes like the formation of rivers, the spreading of genes through a population, or the popularity of a given opinion throughout a population have an effective diffusive mechanism.

Beyond basic diffusion, there are various modifications like injection (where new particles are injected), absorption (where existing particles are removed), and drift (where diffusion happens alongside driven motion due to, e.g., an electric field). Below we'll explore these various scenarios.

## The Basic Diffusive Mechanism

The basic assumption underlying diffusion is that molecules pick up random, thermal motion due to ambient heat in the environment. For example, when a drop of ink is placed in water, its molecules quickly reach the temperature of the water and have some characteristic energy $($on the order of $k_BT$, though the precise speed is unimportant$),$ and therefore a velocity of $v_\textrm{thermal}.$

If we watch an ink molecule over a short period of time, $\tau_\textrm{corr},$ it will move in the same direction as its initial kick from the water during this period, but over longer periods of time, $t\gg\tau_\textrm{corr},$ it will receive new kicks that make it move in another direction that has no correlation with the first. In practice, $\tau_\textrm{corr}$ is on the order of $\sim\SI{e-6}{\second},$ so that for the macroscopic observer, the ink's motion is a random sequence of uncorrelated movements of length $\ell_\textrm{corr} = v_\textrm{thermal}\tau_\textrm{corr}.$

This suggests a simple basis upon which to build our models:

At any moment in time, an ink molecule is equally likely to be moving to the left and right, to the top and bottom, or in and out.

## Model Assumptions

Diffusion can occur along a line (a wire), in a plane (a particle diffusing on the surface of a liquid), in three dimensions (a gas) or higher in more abstract systems, and the magnitude of a diffusing particle's velocity can vary with time. As it turns out, neither of these details change the conclusions very much. For simplicity, we'll consider an ink molecule diffusing in a 1-dimensional liquid (at the end, it will be clear how our result generalizes).

To get started, let's write down our list of assumptions:

- The liquid is in thermal equilibrium, so the temperature $T$ is uniform.
- In any moment of duration comparable to $\tau_\textrm{corr},$ a molecule is equally likely to move to the left or right.

For further simplicity, we'll assume that the liquid is a lattice made up of $N$ sites. Later we'll take the continuous limit.

## Deriving the Diffusion Equation

We'll focus on the concentration of ink molecules in a neighborhood of $\Delta x$ around the point $x.$

To get started, let's find the flow of molecules according to our assumptions above. The concentration in the neighborhood of a point $x$ can change in two ways:

- Molecules flow into the neighborhood, raising the local concentration.
- Molecules flow out from the neighborhood, lowering the local concentration.

**Flux**

First, let's focus on the left wall. Since any given particle has an equal chance of moving to the left or right, we expect $\frac12$ of the molecules within $v\tau_\textrm{corr}$ of the wall to exit the neighborhood via the left-hand side. Likewise, we expect half of the particles around $c(x-\Delta x)$ to flow in via the left wall.

The flux through the left wall is therefore given by

$\begin{aligned} J(x) &= \frac{(\textrm{flux of molecules through left wall})}{\tau_\textrm{corr}} \\ &=\frac12\frac{1}{\tau_\textrm{corr}} \times(\textrm{volume of neighborhoods})\times(\textrm{concentration}) \\ &=\frac{Av_\textrm{thermal}\tau_\textrm{corr}}{2\tau_\textrm{corr}} \big[c(x-\Delta x, t) - c(x,t)\big] \\ &= \frac{Av_\textrm{thermal}\Delta x}{2} \frac{c(x-\Delta x, t) - c(x,t)}{\Delta x}. \end{aligned}$

Recognizing that $\Delta x = v_\textrm{thermal}\tau_\textrm{corr},$ this becomes

$J(x) = -\frac{Av^2_\textrm{thermal}\tau_\textrm{corr}}{2}\frac{\partial c(x,t)}{\partial x}$

or

$\boxed{J(x) = - \frac12 AD \dfrac{\partial c(x,t)}{\partial x}\Bigg\rvert_{x}},$

where $D = v_\textrm{thermal}^2\tau_\textrm{corr}.$

Following the same calculation, the flux through the right-hand wall is given by

$\boxed{J(x + \Delta x) = -\frac12 AD \dfrac{\partial c(x,t)}{\partial x}\Bigg\rvert_{x + \Delta x}}.$

Now, the number of ink molecules in the neighborhood at any given time is given by $c(x,t) \Delta x,$ so the rate of change in the number of molecules in this neighborhood is given by

$\dot{N}(x,t) = \dot{c}(x,t)\cdot\overbrace{A\Delta x}^\textrm{"volume"}.$

Now, we can also express the change in the number of molecules in terms of the particles that flow across the neighborhoods left and right boundaries.

We can write down an accounting equation with phenomenological random movement to obtain the diffusion current $J_d = -D\nabla c(x).$

- From conservation of particle number, we have $\partial_t c(x) = -\nabla J_d(x) = \nabla^2 c(x).$

## Solutions

- Solve it for a few situations (no injection, injection).