Post

Convection-Diffusion-Reaction PDE

Convection-Diffusion-Reaction PDE

Most of the partial differential equations you’ll meet in physics, engineering, and biology are variations on the same idea: something spreads, something flows, and something grows or decays. This post builds up that idea from scratch, and lets you play with it directly.

The operator

A differential operator takes a function and returns a new function built from its derivatives. The one that shows up almost everywhere in physical modeling is the general linear second-order operator:

\[B_\mu u(x) = \underbrace{\nabla \cdot \big(\boldsymbol{\alpha}_\mu(x)\, \nabla u(x)\big)}_{\text{diffusion}} \;+\; \underbrace{\boldsymbol{\beta}_\mu(x) \cdot \nabla u(x)}_{\text{advection}} \;+\; \underbrace{\gamma_\mu(x)\, u(x)}_{\text{reaction}}\]

Three ingredients, three physical behaviors:

  • Diffusion — $\boldsymbol{\alpha}_\mu$ controls how fast $u$ spreads out from regions of high concentration to low concentration, in every direction.
  • Advection — $\boldsymbol{\beta}_\mu$ is a velocity field that carries $u$ along bodily, like a current pushing something downstream.
  • Reaction — $\gamma_\mu$ makes $u$ grow or decay locally, proportional to how much of it is already there.

The subscript $\mu$ marks these as parameter-dependent: for every choice of parameter $\mu$, you get a slightly different operator, and therefore a different solution $u_\mu$. This is the setting of parametric PDEs, where the goal is usually to solve $B_\mu u_\mu = f_\mu$ efficiently for many different values of $\mu$, rather than treating each one as an unrelated problem from scratch.

Each term, in isolation

Before watching all three terms act together, it helps to see what each one does on its own. Below, the same drop starts in each panel — only one term is switched on at a time.

α∇²u  only

Spreads outward evenly. Never moves, never fades.

β·∇u  only

Carried along rigidly. Never spreads, never fades.

γu  only

Fades in place. Never moves, never spreads.

Notice the very different personalities:

  • Diffusion alone spreads the drop into a symmetric, ever-widening, ever-flattening blur. It never moves and never fades — it just relaxes.
  • Advection alone carries the drop rigidly to the side, keeping its shape almost entirely intact. It never spreads and never fades — it just translates.
  • Reaction alone shrinks the drop in place, exactly where it started. It never spreads and never moves — it just fades (or, with a positive rate, blooms).

A real system is almost always a mixture of all three, running on the same field at the same time.

Watching them work together

A concrete way to picture $B_\mu u$ is a spill of ink in a flowing river. The ink concentration $u(x,t)$ diffuses on its own, gets carried by the current, and can chemically decay or bloom over time. Drag the sliders below and click the water to see how the three terms combine.

∂u/∂t = α∇²u β·∇u + γu

Click or tap the water to add a drop of ink

0.40

How fast the ink spreads on its own, in every direction.

0.80

Speed and direction of the flow carrying the ink downstream.

-0.05

Negative fades the ink away over time, positive lets it bloom.

u(x,t) is the ink concentration in the tank. The diffusion term spreads it evenly outward, the advection term carries it along with the current, and the reaction term lets it decay or grow locally. All three run at once, on the same field, every frame — exactly the operator Bμu described above.

This is the advection-diffusion-reaction equation,

\[\partial_t u = \alpha \nabla^2 u - \boldsymbol{\beta}\cdot\nabla u + \gamma u,\]

one of the most widely used PDE models around — it also describes heat spreading in a moving fluid, or a population that disperses locally, drifts with an environmental flow, and reproduces or dies off.

Five examples, one operator

The same template $B_\mu u$ underlies a whole family of classic PDEs, just with different terms switched on or off, and sometimes extended into time.

  Time derivative Spatial operator Active terms Conditions
1. Thermal block none (stationary) $-\sum_p \mu_p \nabla\cdot(\chi_{\Omega_p}\nabla u)$ diffusion only, piecewise constant u = 0 on ∂Ω
2. Heat equation $\dot u$ (1st order) $A_\mu$, affine elliptic, e.g. $-\mu\Delta$ diffusion only, general affine coefficient u(0) = 0, u = 0 on ∂Ω
3. Linear transport $\dot u$ (1st order) $\boldsymbol b_\mu\cdot\nabla u + c_\mu u$ advection and reaction, no diffusion u = g on the inflow boundary Γ−
4. Wave equation $\ddot u$ (2nd order) $A_\mu = -\mu^2\Delta$, affine elliptic diffusion-type term only, two time derivatives u(0) = u₀, ̇u(0) = u₁, u = 0 on ∂Ω
5. Schrödinger equation $i\dot\psi$ (1st order, complex) $-\tfrac12\Delta_x\psi + \Phi_\mu\psi$ kinetic (diffusion-type) and potential (reaction-type), complex-valued ψ(0) = ψ₀, ψ = 0 on ∂Ω

The thermal block (example 1) is the simplest case: pure diffusion, no time dependence, and a coefficient that is constant on each of $P$ disjoint pieces of the domain rather than varying smoothly.

∂Ω  (boundary, u = 0) Ω₁ μ₁ Ω₂ μ₂ Ω₃ μ₃ Ω₄ μ₄ Ω₅ μ₅ Ω₆ μ₆ lighter block = lower diffusivity  ·  darker block = higher diffusivity

Ω is split into P = 6 disjoint blocks Ωp. Inside each block the diffusivity is a single constant μp, so αμ(x) = ∑p μp χΩp(x) — no smooth variation, just a jump at every block boundary.

Every one of these examples is built so that its parameter dependence is affine:

\[A_\mu = \sum_{q=1}^{Q} \vartheta_q(\mu)\, A_q,\]

a sum of fixed, $\mu$-independent operators $A_q$, each scaled by a scalar function $\vartheta_q(\mu)$. That structure isn’t a coincidence — it’s what makes it possible to precompute the expensive parts once and reuse them cheaply for every new $\mu$, which is the whole point of reduced-order modeling.

This post is licensed under CC BY 4.0 by the author.