Heat Transfer · Learn

2D Steady-State Conduction

Where the heat goes, and why — the theory behind the playground. From an energy balance to Laplace's equation, the boundary conditions that make a problem solvable (or not), and the relaxation method the computer actually uses.

▶ Play the lab 📖 Learn the theory 🍬 Collect cards · soon

1The governing equation

Picture a thin flat plate. Heat flows through it according to Fourier's law — heat travels down the temperature gradient, faster through a more conductive material:

$$ \vec{q} = -k\,\nabla T $$

Here $\vec{q}$ is the heat flux (W/m²), $k$ is the thermal conductivity (W/m·K), and the minus sign says heat flows from hot to cold. Now write an energy balance on a tiny control volume. At steady state nothing is storing energy, so whatever flows in must flow out, plus anything generated inside:

$$ -\nabla\cdot\vec{q} + \dot q = 0 $$

where $\dot q$ is the internal heat generation per unit volume (W/m³) — think resistive heating or a chemical reaction. Substitute Fourier's law, and for constant $k$ this becomes the steady-state heat equation (a Poisson equation):

$$ \nabla^2 T + \frac{\dot q}{k} = 0 \qquad\Longleftrightarrow\qquad \frac{\partial^2 T}{\partial x^2} + \frac{\partial^2 T}{\partial y^2} + \frac{\dot q}{k} = 0 $$

With no internal generation ($\dot q = 0$) the source term vanishes and we are left with the most famous equation in all of mathematical physics — Laplace's equation:

$$ \nabla^2 T = 0 $$

2What Laplace's equation means

Laplace's equation has a beautiful interpretation: at every interior point, the temperature equals the average of the temperatures around it. This is the mean-value property of harmonic functions. A direct consequence is the maximum principle: a steady temperature field can have no interior hot spot or cold spot — the hottest and coldest points always live on the boundary. (Add generation and that's no longer true: the source can create an interior peak, which is exactly why a current-carrying wire is hottest at its core.)

▶ In the lab

Set all four edges to fixed temperatures with no generation, solve, and notice the interior never exceeds the hottest wall. Then add heat generation and watch an interior peak appear — the maximum principle breaking, on cue. Open the lab →

3Boundary conditions

The equation alone doesn't determine the temperature — you also need to say what happens at the edges. Two kinds cover most problems:

An insulated wall forces the isotherms to meet it at a right angle, because the temperature can't change in the direction across a zero-flux boundary.

When does a problem have no answer?

Steady state demands global energy balance: everything generated inside must escape through the boundary. If you insulate all four edges while generating heat, that's impossible — the heat has nowhere to go, so the temperature rises without bound and no steady state exists. Formally, the Neumann problem only has a solution when the compatibility condition holds:

$$ \oint_{\partial\Omega} k\,\frac{\partial T}{\partial n}\,ds + \int_\Omega \dot q \,dA = 0 $$

If every edge is insulated the boundary integral is zero, so a solution requires $\int \dot q\,dA = 0$. And even when a pure-insulated problem is consistent (no generation), its solution is only defined up to an additive constant — any uniform shift of the whole field is equally valid. You need at least one fixed-temperature edge to pin it down.

⚠ In the lab

The "Break it" preset insulates all four edges with generation on — press Solve and watch it diverge, with the lab telling you no steady state exists. That's this compatibility condition failing. Try Break it →

4Solving it numerically

Laplace's equation rarely has a tidy closed-form solution on a real shape, so we go discrete. Lay a uniform grid of spacing $h$ and approximate each second derivative with a central difference:

$$ \frac{\partial^2 T}{\partial x^2}\bigg|_{i,j} \approx \frac{T_{i+1,j} - 2T_{i,j} + T_{i-1,j}}{h^2} $$

Adding the $x$ and $y$ versions and including the source, the PDE collapses to one wonderfully simple algebraic rule per node — the five-point stencil:

$$ T_{i,j} = \tfrac{1}{4}\Big( T_{i+1,j} + T_{i-1,j} + T_{i,j+1} + T_{i,j-1} + \tfrac{\dot q\,h^2}{k} \Big) $$

There it is again: every node is the average of its four neighbours (plus a generation nudge). But each node depends on its neighbours, which depend on it — so we can't solve it in one shot. Instead we relax: sweep the grid over and over, updating each node from the latest surrounding values, until nothing changes.

MethodUpdate ruleSpeed
Jacobiaverage of neighbours from the previous sweepslowest
Gauss–Seideluses the newest values as it sweeps~2× faster
SORGauss–Seidel, then over-shoot by a factor $\omega$fastest

The playground uses successive over-relaxation (SOR), nudging each update a bit past the Gauss–Seidel value with a relaxation factor $\omega$ (here near $1.85$; the optimum is roughly $\omega \approx 2/(1+\sin(\pi h/L))$). The residual — the largest change on the last sweep — measures how far we still are from a true solution; when it falls below a tiny threshold, the discrete equation is satisfied.

Insulated edges are handled with a ghost node: reflect the interior across the boundary so the gradient there is zero, which amounts to setting each edge node equal to its inward neighbour after every sweep.

▶ In the lab

The animation is these sweeps. Watch the field relax from a flat guess and the residual fall as it converges — press Step ×20 to advance the relaxation by hand. Open the lab →

5The conductivity surprise

Here's the one that catches everyone. In Laplace's equation with fixed-temperature walls and no generation, $k$ appears nowhere — it has divided clean out. So the temperature field doesn't depend on conductivity at all: copper and firebrick with the same wall temperatures have identical temperature maps. What $k$ does control is the heat flux, $\vec q = -k\nabla T$ — the same temperatures, but wildly different watts flowing through. Turn on generation and $k$ matters again, because now the interior temperature depends on the ratio $\dot q/k$.

▶ In the lab

The "Does k matter?" preset proves it: solve, then drag conductivity from 1 to 400 and the field doesn't move a pixel — until you add generation. See it →

Key takeaways

  • Steady 2-D conduction obeys $\nabla^2 T + \dot q/k = 0$ — Laplace's equation when there's no internal heat.
  • Harmonic temperature = average of the surroundings; no interior extrema without a source.
  • Dirichlet fixes temperature; Neumann fixes flux (insulated = zero flux).
  • All-insulated + generation = no steady state; all-insulated + no source = solution only up to a constant.
  • Discretize → five-point averaging stencil → solve by relaxation (Jacobi → Gauss–Seidel → SOR).
  • With fixed walls and no generation the field is independent of $k$; only the flux scales with $k$.

EngineeringCandy · Learn · the theory behind the playground