Fundamentals / Numerical mathematics / Numerical partial differential equations

Fronts and diffusive modes

Track conservation on a periodic mesh, distinguish shocks from expanding fans and choose a time step for an explicit diffusion solver.

Advect a marked volume

On a periodic ring of four cells take means \((1,0,0,0)\), positive speed and Courant number \(C=1/4\). Compute two first-order upwind updates, verify inventory and compare the maximum with that from an exact translation of a square pulse by half a cell.

Worked solution

The first update is \((3/4,1/4,0,0)\). Applying the same convex average gives \((9/16,6/16,1/16,0)\). Both arrays sum to one, so the total conserved amount is one cell width times this sum.

After an exact shift of half a cell, the two overlapping cell averages are \(1/2,1/2\) and the other two vanish, although the pointwise pulse height is still one. The numerical maximum of \(9/16\) is larger than the exact cell-average peak at this instant, even as the numerical support is more spread out. A peak comparison must specify whether it uses point values or cell means.

Explore the related calculation with adjustable inputs. Change the parameters in the corresponding calculation and compare its independently recomputed values with the equation derived in this solution.

Identify a shock and a fan

For \(f(u)=u^2/2\), consider left and right states 3 and 1. Compute the discontinuity speed, compare it with the two characteristic speeds and locate its position after 0.4 s from the origin. Reverse the states and identify the edges of the entropy-admissible solution.

Worked solution

Fluxes are 4.5 and 0.5, giving \(s=(0.5-4.5)/(1-3)=2\). Since the characteristic speeds \(f'(u)\) are 3 on the left and 1 on the right, both enter the discontinuity in its moving frame. Its position is \(0.4(2)=0.8\).

With left 1 and right 3 the characteristics move apart and an expansion fan fills the region between \(x=0.4\) and \(x=1.2\). A single jump satisfying the algebraic jump balance would have the wrong entropy behaviour for these data.

Explore the related calculation with adjustable inputs. Change the parameters in the corresponding calculation and compare its independently recomputed values with the equation derived in this solution.

Allocate a time budget on a refined grid

On a periodic rod \(D=2\times10^{-5}\) m²/s and \(h=1\) mm. Find the explicit diffusion step limit. To reach 1 s with \(r=0.4\), how many steps are needed? Repeat after halving spatial spacing and compare the total number of nodal updates on a fixed length.

Worked solution

The stability limit is

\[h^2/(2D)=0.025\,\mathrm{s}.\]

For \(r=0.4\), use \(0.4h^2/D=0.020\) s, or 50 steps. Halving \(h\) quarters the step to 0.005 s, giving 200 steps.

There are about twice as many spatial nodes on the refined line. The combination of twice as many nodes and four times as many steps requires about eight times as many local updates, neglecting boundary and setup costs.

Explore the related calculation with adjustable inputs. Change the parameters in the corresponding calculation and compare its independently recomputed values with the equation derived in this solution.