9.3 Solving the Heat Equation: Separation of Variables ended with a warning: everything in that lesson rested on superposition, and one innocent change breaks it. Put the speed of the wave equal to the solution itself and the equation is Burgers’ equation. It is the transport equation of 9.10 First-Order PDEs: Advection & Characteristics with , and the nonlinear core of the Navier-Stokes momentum equation (the term in 11.4 Viscosity & the Navier–Stokes Equations). 11.12 Compressible Flow & Shocks already used it to show why air forms shocks. This lesson takes Burgers as the subject: the life of a wave from smooth data to a shock, the shock with viscosity added, and the numerical lesson, because a shock is where a careless scheme gives a confident wrong answer.
Transcript
- Put the speed of a wave equal to the solution itself and you get Burgers' equation: u t plus u u x equals zero. Along a curve moving at speed u, the solution does not change, so every characteristic is a straight line: x equals x naught plus t times u zero of x naught. Tall parts run fast, low parts slowly. Take a sine wave: the lines lean right where it is positive, left where it is negative, all toward x equals pi.
- When do the lines meet? The map from x naught to x has slope one plus t u zero prime. While it stays positive, each point has one foot and the solution is smooth. It first reaches zero at t star, minus one over the smallest u zero prime. For the sine, the steepest slope is minus 1, so t star is 1, at x equals pi. The profile steepens and at time 1 stands vertical. A bump breaks at 1.5396, a Gaussian at 1.1658. Smooth data, and the wave still breaks: a linear equation never does that.
- After breaking, the solution gives up smoothness but not meaning: the integral form of the conservation law needs no derivative. Across a jump it demands the Rankine-Hugoniot condition: the shock speed is the average of the two states. The sine data are antisymmetric about pi, so the shock stays at pi, and lines from both sides run into it and end. Its height shrinks: 0.9477 at time 2, 0.7596 at time 3, 0.6186 at time 4, roughly pi over t plus 1. The shock dissipates the wave with no friction in the equation.
- Now a step. Start with u equal to 1 on the left and 0 on the right. Fast lines overtake slow ones, so there is one shock, moving at one half. Turn it around, 0 on the left and 1 on the right. The lines spread apart and leave an empty wedge, filled by a rarefaction fan. A jump at one half would also satisfy Rankine-Hugoniot, so the entropy condition decides: characteristics must run into a shock from both sides. Here they run away, so the jump is rejected and the fan wins.
- But which conservation law? Multiply the equation by 2u and you find that u squared is conserved too, with flux two thirds u cubed. For smooth solutions it is the same equation. For a jump from 1 down to 0, the first law gives a shock speed of one half, the second two thirds. They agree where the solution is smooth and disagree at shocks, so u t plus u u x alone is incomplete. Physics must choose the quantity really conserved, mass, momentum or energy. Here, it is u.
- Add viscosity, nu u x x, and the vertical front rounds off. In a travelling wave the two end states are roots of a quadratic, and their sum fixes the speed: the Rankine-Hugoniot speed, whatever nu is. The wave is a tanh that must fall, so there is no expansion shock, the entropy condition again. The thickness from 10 to 90 percent is 8.789 nu over the jump. For a drop from 1 to 0 and nu 0.02, that is 0.1758. Halve nu and the width halves. A real shock in air is far too thin to resolve, so a simulation has to capture it.
- Burgers hides a secret. Write u as psi x, let psi be minus 2 nu times the log of phi, and the nonlinear terms cancel, leaving phi t equals nu phi x x. That is the heat equation. Solve it with Fourier modes and transform back: u equals minus 2 nu phi x over phi. For the sine wave with nu 0.05, a direct finite difference solution stays within 0.0037 of this exact answer at time 1. At x equals pi over 2 the exact value is 0.7255 for nu 0.05, closing in on the inviscid 0.7391 as nu shrinks.
- Now the numerical lesson. Step from 1 to 0 at minus one half, 200 cells, run to time 1. The shock belongs at 0. Godunov puts it at 0.0002 with mass 1.0000. Rusanov, 0.0007. Roe, 0.0002. The non-conservative upwind scheme, which differences u u x directly, leaves the shock at minus 0.5000, and half the mass has vanished: cells ahead of the jump are zero and never change. Crisp, stable, wrong, and no warning. Entropy matters too: Roe with no entropy fix freezes a transonic fan into a jump, with error 0.8000.
- To recap. Characteristics are straight lines, and smooth data breaks at t star. Shocks move at the average of the two states, and entropy gives shocks for steps down and fans for steps up. Viscosity gives a tanh, and Cole-Hopf makes the whole thing linear. And a scheme must be in conservation form to get shocks right. That last fact was used but never derived: each cell changes only by the fluxes through its faces. Next, the finite volume method derives it from control volumes.
Characteristics that carry their own speed
Along a curve , the chain rule gives , exactly as in the transport lesson. The value is constant along the curve, so the curve has constant slope: a straight line,
Each line has its own slope, set by the value it carries: tall parts travel fast. The solution is implicit: where solves the equation above, the foot of the line through .
When does this recipe fail? The map has derivative . As long as that is positive the map is one-to-one and every has exactly one foot. If is negative somewhere, the derivative reaches zero at the first time
At neighbouring lines meet and the profile becomes vertical; afterwards the implicit equation has three roots, and no single-valued follows it: the wave has broken. Fast fluid has caught slow fluid.
Example: the sine wave. For , has minimum at , so . The breaking point is , where and the line stands still.
Example: a bump. For , . Setting its derivative to zero gives the steepest point at , where and . Hence , and the breaking point is . Only the front breaks.
Breaking needs a decreasing part of ; a profile that increases everywhere never breaks, its lines fan apart. Up to the solution is as smooth as , then the slope is infinite, from perfectly smooth data, with no viscosity involved. Linear equations never do that.
Weak solutions and the jump condition
After breaking we give up smoothness but not the solution. The PDE is the local form of a conservation law: with ,
The integral form needs no derivative of . A weak solution may have jumps but satisfies the integral form on every interval (2.10 Green, Stokes & the Divergence Theorem). For a jump at from to the Rankine-Hugoniot condition, derived in 11.12 Compressible Flow & Shocks, is
The shock moves at the average of the two states; it is the curve where lines from both sides end.
The sine wave after . The data are antisymmetric about , so the shock stays there, speed . Its left value comes from the line that started at and carries , so becomes
Solving numerically, the shock height is at , at and at . For large , write : gives ( at ). Shocks dissipate the wave, decaying like , though the equation has no friction.
Which conservation law? The PDE is also for smooth , because multiplying by gives the same equation. Both are conservation laws. For a jump from to the first gives and the second gives . They agree for smooth solutions and disagree at shocks. Physics must choose: the conserved quantity is the one the problem conserves (mass, momentum, energy). The non-conservative form is incomplete at a shock. Here we take as the conserved density.
Fans, shocks and the entropy condition
A Riemann problem has for and for . The data have no length scale, so the solution depends only on , with two outcomes.
Step down, . Take , . Fast lines on the left overtake slow ones on the right: one shock of speed . Starting at , the shock is at at .
Step up, . Take , . The lines spread apart and leave a wedge with none. The rarefaction fan fills it, constant along lines through the corner:
Check: and .
A problem. A jump moving at speed also satisfies Rankine-Hugoniot, so weak solutions are not unique. The entropy condition (the Lax condition, name from memory) removes the bad one: characteristics must run into a shock from both sides,
An expansion shock has lines leaving it on both sides, so any disturbance turns it into a fan. In gas dynamics this is the second law (11.12 Compressible Flow & Shocks). The sharper justification is next: add a little viscosity and let it go to zero; the viscous equation never selects an expansion shock.
Viscous Burgers and the shock thickness
With viscosity, Burgers becomes
It is parabolic, like the heat equation of 9.2 The Heat (Diffusion) Equation, so solutions stay smooth: the vertical front is rounded off. Look for a travelling wave joining on the left to on the right. Substituting, , which integrates once to
At both ends , so and must be the two roots of . The sum of the roots gives : the viscous wave moves at the Rankine-Hugoniot speed, whatever . With , the equation separates, and the solution is
Two facts follow. Between the roots is negative, so the wave must fall, : no expansion shock, the entropy condition again. And the thickness: the tanh goes from to of its jump over
Thickness is proportional to and inversely proportional to the jump. For , , it is ; halving halves it. By finite differences this tanh satisfies the PDE to a residual of ().
Cole-Hopf: Burgers is secretly the heat equation
The last lesson recalled, from memory, that Burgers turns back into the heat equation. Here is the check. Write and integrate the equation once in : . Let . Then , and . The terms cancel on both sides and what is left is
The Cole-Hopf transformation (the name and the formula I carried from memory; the algebra above is what I rely on) makes a nonlinear equation exactly linear. Solve the heat equation by the Fourier methods of 9.3 Solving the Heat Equation: Separation of Variables and transform back. For , : expand it in cosines, damp mode by , take .
Superposition holds for , not for : gives a weighted average of and , not their sum.
The lab compares this exact solution with a direct finite-difference solution of the viscous PDE (, cells): the maximum difference is at and at , a discretisation error. At , the exact value is for and for , closing in on the inviscid (from ).
Why the scheme must be conservative
On a grid with spacing , consider the update
where is a numerical flux from the neighbours of the face between cells and . This is the conservation form. Summed over all cells the fluxes cancel in pairs, so changes only by what crosses the ends: the discrete integral law. I recall (from memory, the Lax-Wendroff theorem) that if such a consistent scheme converges, the limit is a weak solution, with the right shock speed. The form , which differences directly, has no such guarantee.
The lab runs the step from to at on , cells, to , where the shock belongs at :
| scheme | shock position | mass (exact ) | width in cells |
|---|---|---|---|
| Godunov | |||
| Rusanov | |||
| Roe, no entropy fix | |||
| non-conservative upwind |
Godunov uses the exact Riemann solution at each face, Rusanov (local Lax-Friedrichs) adds viscosity proportional to the largest speed, Roe linearises with the speed . The non-conservative scheme is stuck: cells ahead of the jump have , so never changes them, and half the mass disappears. The profile is crisp, stable and plausible, with the wrong speed: no oscillation, no warning.
A caveat: on the sine wave the non-conservative scheme does well at (peak against Godunov , mass ), because the shock sits still and has no speed to get wrong. Test on a moving shock.
Rarefactions: the entropy fix. Roe is conservative, so it gets shocks right, but on a transonic fan with , the speed is zero at the jump and the flux is : the initial jump never moves, an expansion shock. At its error is , exactly (the area ), against for Godunov and for Rusanov. Godunov’s flux returns when , the sonic point. Conservation fixes the speed of shocks; entropy fixes which jumps may exist.
On the sine wave at Godunov’s peak is against the exact shock height (the shock is smeared over about two cells), mass stays at round-off (), and the error is at , at and at .
The lab
All runs: cells, CFL , forward Euler. Try, in order:
- Sine to with Godunov: peak against the exact , mass zero. Set the stop time to and the profile is nearly vertical; in the x-t plane the lines run into the red shock at .
- Shock, non-conservative: the shock does not move. Switch to Godunov: it arrives at .
- Step up with Godunov, Rusanov, and Roe: Godunov and Roe agree (, no sonic point), Rusanov is more rounded (). Then transonic fan, Roe shows the frozen jump ().
- Viscous shock, central flux with : measured widths , , against the tanh values , , (a error at cells across).
- Sine with : the dashed curve is the Cole-Hopf solution; the scheme follows it within at .
Computing it
With cells the Godunov shock sits at with mass , the non-conservative one at with mass , and the transonic fan at reads (the exact fan gives ).
Concept checks
Problems
For with , find the breaking time and the place where it happens.
Show worked solution
has derivative , zero at , where . So , and the breaking point is . The front breaks; the rising back does not.
A jump joins to . (a) Find its speed for . (b) Find it for the law . (c) Both come from when is smooth. Why do they differ?
Show worked solution
(a) .
(b) .
(c) Multiplying by is legitimate for smooth (chain rule) but changes what is called conserved. At a jump the chain rule fails, so the two integral laws give different jumps.
Solve with for and for . Give and the region where the fan is active at . Why is the jump of speed rejected?
Show worked solution
, so the solution is a fan: for , constant outside. At the fan spans and . The competing jump has speed , but : characteristics leave it on both sides, violating the entropy condition.
A shock from to is to be resolved by the viscous equation on a grid with , with a width of cells. (a) What viscosity does that need? (b) What is the cell Peclet number ? (c) What does air, with m/s, say about resolving real shocks at m?
Show worked solution
(a) Width , so .
(b) . Above a central difference of the advection term is no longer a weighted average of neighbours, so wiggles become possible (from memory, the usual cell-Peclet criterion); the lab’s case has cell Peclet and stays clean.
(c) The physical width is of order metres, far below a centimetre. The scheme’s numerical viscosity decides the width, so it must give the right speed (conservation) and direction (entropy).
What comes next
Everything numerical here rested on one fact that was used but not derived: each cell changes only by the fluxes through its faces, so what leaves one cell enters the next. The next lesson, 10.10 The Finite Volume Method (10.10), derives that from the integral law on a control volume, which carries to 2D and to the compressible equations. It also takes up what is left open: these schemes are first-order, so shocks smear over two or three cells; limiters raise the order without bringing back oscillations. Not proved here: the Lax-Wendroff theorem (from memory).
Key Takeaways
- For the characteristics are straight lines carrying ; the solution is smooth until ( for , for , for ), when smooth data goes vertical.
- Weak solutions obey the integral law across jumps: . The sine wave gets a stationary shock at of height at , decaying roughly like .
- Which law is conserved matters: and give different speeds ( against for ). Physics chooses.
- The entropy condition keeps compressive shocks and replaces expansion jumps by fans .
- Viscous Burgers has an exact tanh wave at the inviscid speed with thickness . Cole-Hopf, , turns it into (checked to against a direct solution).
- A scheme must be in conservation form: on the step conservative schemes put the shock at to with mass ; non-conservative upwind leaves it at with mass . Roe without an entropy fix freezes a transonic fan into a jump ( error against ).
- Next: 10.10 The Finite Volume Method derives the conservative flux form from control volumes.