Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

8. The Burgers equation, the Cole–Hopf solution and shock speeds

School of Engineering, Nazarbayev University

In linear advection (qt+u0qx=0q_t + u_0 q_x = 0), every point on a wave travels at the same speed u0u_0, so smooth waves stay smooth forever. In real compressible gas dynamics, traffic waves, and nonlinear acoustics, higher-velocity fluid overtakes slower fluid ahead of it (ut+uux=νuxxu_t + u u_x = \nu u_{xx}), relentlessly steepening smooth compressions into viscous shock layers of thickness δ∼ν/Δu\delta \sim \nu / \Delta u. Even more remarkably, although uuxu u_x and ∂x(12u2)\partial_x(\frac{1}{2}u^2) are algebraically identical for smooth functions, discretizing the non-conservative form ut+uux=0u_t + u u_x = 0 across a shock predicts a physically wrong shock propagation speed (the Hou–LeFloch theorem). In this lecture we verify exact nonlinear solutions via the Cole–Hopf transformation (burgers_riemann.cole_hopf_viscous_burgers_exact), compare conservative Godunov and Rusanov solvers (solve_viscous_burgers_1d), and show the Rankine–Hugoniot jump condition s=12(uL+uR)s = \frac{1}{2}(u_L + u_R).

Learning objectives

  1. Derive the Cole–Hopf nonlinear-to-linear transformation u=−2ν ∂xln⁡ϕu = -2\nu\,\partial_x \ln \phi mapping the 1-D viscous Burgers equation onto the linear heat equation (burgers_riemann.cole_hopf_viscous_burgers_exact).

  2. Analyze nonlinear wave steepening and verify viscous shock thickness scaling δ=Δu/max⁡∣∂xu∣=8ν/Δu\delta = \Delta u / \max|\partial_x u| = 8\nu / \Delta u against Taylor’s exact tanh⁡\tanh traveling shock profile.

  3. Prove the Rankine–Hugoniot shock speed s=[f(u)][u]=12(uL+uR)s = \frac{[f(u)]}{[u]} = \frac{1}{2}(u_L + u_R) and execute the Hou–LeFloch failure-mode audit comparing conservative godunov/rusanov vs. nonconservative discretizations (solve_viscous_burgers_1d).

  4. Verify Osher’s exact entropy-satisfying Godunov flux identity, audit Roe sonic expansion shocks, and implement a 2nd-order MUSCL–Godunov viscous Burgers solver.

Time: about 60 min

1. Nonlinear Steepening & the Exact Cole–Hopf Transformation

The 1-D viscous Burgers equation is the canonical prototype uniting nonlinear convective steepening with Newtonian viscous dissipation (ν>0\nu > 0):

∂u∂t+∂∂x(12u2)=ν∂2u∂x2⟺ut+u ux=ν uxx(for C2 smooth u)(1.1)\frac{\partial u}{\partial t} + \frac{\partial}{\partial x}\left(\frac{1}{2}u^2\right) = \nu \frac{\partial^2 u}{\partial x^2} \quad\Longleftrightarrow\quad u_t + u\,u_x = \nu\,u_{xx} \quad (\text{for } C^2 \text{ smooth } u) \tag{1.1}

Independently discovered by Hopf (1950) and Cole (1951), the nonlinear substitution

u(x,t)=−2ν ∂ln⁡ϕ(x,t)∂x=−2ν ϕx(x,t)ϕ(x,t)(ϕ>0)(1.2)u(x, t) = -2\nu\,\frac{\partial \ln \phi(x, t)}{\partial x} = -2\nu\,\frac{\phi_x(x, t)}{\phi(x, t)} \quad (\phi > 0) \tag{1.2}

cancels the quadratic nonlinearity uuxu u_x identically whenever ϕ(x,t)\phi(x, t) satisfies the linear heat equation ϕt=νϕxx\phi_t = \nu \phi_{xx}. Specifically, choosing the strictly positive single-mode heat solution ϕ(x,t)=a0+cos⁡(kx)e−νk2t\phi(x, t) = a_0 + \cos(kx)e^{-\nu k^2 t} (a0>1a_0 > 1, k=2π/Lk = 2\pi / L) yields the exact closed-form periodic benchmark in burgers_riemann.cole_hopf_viscous_burgers_exact:

u(x,t)=2νksin⁡(kx) e−νk2ta0+cos⁡(kx) e−νk2t(1.3)u(x, t) = \frac{2\nu k \sin(kx)\,e^{-\nu k^2 t}}{a_0 + \cos(kx)\,e^{-\nu k^2 t}} \tag{1.3}

When a0a_0 is close to 1 (e.g. a0=1.12a_0 = 1.12), the denominator a0+cos⁡(kx)e−νk2ta_0 + \cos(kx)e^{-\nu k^2 t} becomes very small near x=L/2x = L/2, producing a steep asymmetric sawtooth shock wave that subsequently relaxes via viscous decay.


Demonstration 1: Exact Cole-Hopf Solution & Conservative Godunov FVM Verification
=================================================================================
Cole-Hopf exact PDE residual max |u_t + u*u_x - nu*u_xx| = 1.552e-10
Godunov L2 error = 1.2917e-03, Rusanov L2 error = 1.3563e-03, Impulse drift = 3.49e-16
<Figure size 814x451 with 1 Axes>

Figure 8.1. Decay of a sine wave under the viscous Burgers equation: the Cole–Hopf solution at three times and the finite-volume Godunov solution at the last time.

What Demonstration 1 shows. Near x=πx = \pi, positive velocity on the left (u>0u > 0) collides with negative velocity on the right (u<0u < 0), creating an intense stationary viscous shock layer whose thickness gradually broadens as momentum diffuses across x=πx = \pi while conserving total periodic impulse ∫0Lu dx=0\int_0^L u\,dx = 0 to <10−15< 10^{-15}.


2. Taylor’s Traveling Viscous Shock Profile & Shock Thickness Scaling δ∝ν/Δu\delta \propto \nu / \Delta u

For a non-periodic step connecting upstream velocity uLu_L to slower downstream velocity uR<uLu_R < u_L, Equation (1.1) admits G. I. Taylor’s (1910) exact steady-profile traveling viscous shock wave moving at speed s=12(uL+uR)s = \frac{1}{2}(u_L + u_R):

uTaylor(x,t)=uL+uR2−Δu2 tanh⁡ ⁣(Δu (x−x0−st)4ν),Δu≡uL−uR>0(2.1)u_{\mathrm{Taylor}}(x, t) = \frac{u_L + u_R}{2} - \frac{\Delta u}{2}\,\tanh\!\left(\frac{\Delta u\,(x - x_0 - s t)}{4\nu}\right), \qquad \Delta u \equiv u_L - u_R > 0 \tag{2.1}

Differentiating Equation (2.1) at the shock center gives the Prandtl–Taylor maximum-slope shock thickness:

δshock≡Δumax⁡x∣∂xu∣=8νΔu(2.2)\delta_{\mathrm{shock}} \equiv \frac{\Delta u}{\max_x |\partial_x u|} = \frac{8\nu}{\Delta u} \tag{2.2}

As ν→0+\nu \to 0^+, δshock→0\delta_{\mathrm{shock}} \to 0 linearly with ν\nu, while the propagation speed s=12(uL+uR)s = \frac{1}{2}(u_L + u_R) is independent of viscosity ν\nu.


Demonstration 2: Viscous Shock Layer Thickness delta = 8*nu / Delta_u
=====================================================================
 nu [m^2/s] |  Exact 8*nu/du |   FVM delta | Profile L2 Err
------------------------------------------------------------
      0.030 |         0.2000 |      0.2413 |      1.015e-02
      0.060 |         0.4000 |      0.4365 |      6.540e-03
      0.120 |         0.8000 |      0.8284 |      3.608e-03
      0.240 |         1.6000 |      1.6195 |      2.633e-03
<Figure size 814x451 with 1 Axes>

Figure 8.2. Traveling viscous shocks for four viscosities. Solid lines: finite-volume solution; dotted lines: the exact tanh profile; the vertical line is the exact position of the shock center.

What Demonstration 2 shows. Every computed shock is centered at xs=x0+12(uL+uR)t=3.20 mx_s = x_0 + \frac{1}{2}(u_L + u_R)t = 3.20\ \mathrm{m} regardless of viscosity ν\nu, while doubling ν\nu doubles the shock transition thickness δ=8ν/Δu\delta = 8\nu / \Delta u.


3. Rankine–Hugoniot Jump Condition & the Hou–LeFloch Non-Conservative Failure Mode

In the inviscid limit ν→0+\nu \to 0^+, classical derivatives cease to exist across a shock jump [u]=uR−uL[u] = u_R - u_L, and only the integral conservation law remains valid:

ddt∫x1x2u(x,t) dx=f(u(x1,t))−f(u(x2,t)),f(u)=12u2(3.1)\frac{d}{dt}\int_{x_1}^{x_2} u(x, t)\,dx = f(u(x_1, t)) - f(u(x_2, t)), \qquad f(u) = \frac{1}{2}u^2 \tag{3.1}

For a shock moving at speed ss inside [x1,x2][x_1, x_2], Equation (3.1) yields the Rankine–Hugoniot jump relation:

s (uL−uR)=f(uL)−f(uR)=12uL2−12uR2⟹sRH=uL+uR2(3.2)s\,(u_L - u_R) = f(u_L) - f(u_R) = \frac{1}{2}u_L^2 - \frac{1}{2}u_R^2 \quad\Longrightarrow\quad s_{\mathrm{RH}} = \frac{u_L + u_R}{2} \tag{3.2}

What happens if a programmer discretizes the non-conservative advective form ut+u(ui−ui−1Δx)=0u_t + u\left(\frac{u_i - u_{i-1}}{\Delta x}\right) = 0 (flux="nonconservative" in solve_viscous_burgers_1d)? Because ui(ui−ui−1)u_i(u_i - u_{i-1}) does not telescope when summed across cells, momentum is silently destroyed at the shock front. For uL=2.0,uR=0.0u_L = 2.0, u_R = 0.0, let us watch nonconservative stall behind the true Rankine–Hugoniot shock.


Demonstration 3: Conservative vs Non-Conservative Shock Speed
=============================================================
Exact Rankine-Hugoniot: x_shock = 1.800 m | Impulse gain dI = 2.0000
Conservative Godunov : x_shock = 1.805 m | Impulse gain dI = 2.0000
Conservative Rusanov : x_shock = 1.805 m | Impulse gain dI = 2.0000
Non-conservative u*ux : x_shock = 0.005 m | Impulse gain dI = 0.0000 (the shock does not move)
<Figure size 814x451 with 1 Axes>

Figure 8.3. A shock moving into fluid at rest, at t=1t = 1 s. The two conservative schemes place the shock at the position given by the Rankine–Hugoniot condition; the non-conservative upwind scheme leaves it at its initial position.

What Demonstration 3 shows. When uR=0u_R = 0, the non-conservative upwind stencil ui(ui−ui−1)/Δxu_i(u_i - u_{i-1})/\Delta x evaluates 0⋅(0−2)/Δx=00 \cdot (0 - 2)/\Delta x = 0 in the first cell ahead of the jump, freezing the shock at x0=0.80 mx_0 = 0.80\ \mathrm{m} (snc=0s_{\mathrm{nc}} = 0 instead of sRH=1.0 m/ss_{\mathrm{RH}} = 1.0\ \mathrm{m/s}). Meanwhile, conservative Godunov and Rusanov telescope interior fluxes identically, matching both ΔI=2.0000\Delta I = 2.0000 and xs=1.80 mx_s = 1.80\ \mathrm{m}.


4. Transonic Rarefaction Fan uL<uRu_L < u_R

What happens if we flip the jump so fluid pulls apart (uL=−1.0<uR=+1.0u_L = -1.0 < u_R = +1.0)? Characteristics diverge, creating a continuous centered rarefaction fan u(x,t)=(x−x0)/tu(x, t) = (x - x_0)/t for uLt<x−x0<uRtu_L t < x - x_0 < u_R t passing smoothly through the sonic point u=0u = 0. We verify solve_viscous_burgers_1d(..., flux="godunov") on this transonic expansion.


Demonstration 4: Entropy-Satisfying Transonic Rarefaction Fan (u_L = -1, u_R = +1)
==================================================================================
Transonic rarefaction L1 error = 1.1354e-02 | Sonic-point velocity u(x0, t) = +0.000e+00

Inside the algorithm

Why does _burgers_godunov_flux handle compressions, supersonic ramps, and sonic points in one formula? For any convex flux f(u)=12u2f(u) = \frac{1}{2}u^2 with sonic minimum at u=0u = 0, Osher’s exact Riemann formula collapses all four wave cases into a single branch-free expression:

FGodunov(uL,uR)=max⁡ ⁣(12max⁡(uL,0)2,  12min⁡(uR,0)2)F_{\mathrm{Godunov}}(u_L, u_R) = \max\!\left(\frac{1}{2}\max(u_L, 0)^2,\; \frac{1}{2}\min(u_R, 0)^2\right)

Below we inspect burgers_riemann._burgers_godunov_flux and verify exact identity with Osher’s formula across 10,00010{,}000 state pairs (uL,uR)∈[−3,3]2(u_L, u_R) \in [-3, 3]^2.

Check against the library


Inside the Algorithm: burgers_riemann._burgers_godunov_flux vs Osher Convex Min-Max Formula
===========================================================================================
def _burgers_godunov_flux(ul: np.ndarray, ur: np.ndarray) -> np.ndarray:
    """Exact entropy-satisfying Godunov numerical flux for f(u) = 0.5 * u^2."""
    fl = 0.5 * (ul**2)
    fr = 0.5 * (ur**2)
    shock = np.where(0.5 * (ul + ur) >= 0.0, fl, fr)
    raref = np.where(ul >= 0.0, fl, np.where(ur <= 0.0, fr, 0.0))
    return np.where(ul > ur, shock, raref)

Max |f_lib(uL, uR) - f_osher(uL, uR)| over 101x101 state grid = 0.000e+00

Exercises

Worked solutions are in 08_solutions.ipynb. The cell below the list is a short self-check to start from.

  1. Verify a result. Perform a grid-refinement study (N∈{64,128,256,512}N \in \{64, 128, 256, 512\}) for solve_viscous_burgers_1d(..., flux='godunov', periodic=True) against cole_hopf_viscous_burgers_exact (ν=0.20,a0=1.25,t=0.6\nu = 0.20, a_0 = 1.25, t = 0.6), asserting first-order O(Δx)O(\Delta x) convergence and exact impulse conservation.

  2. Find how it fails. Verify cole_hopf_viscous_burgers_exact input guards (ν≤0\nu \leq 0, a0≤1.0a_0 \leq 1.0) and demonstrate that unfixed Roe flux FRoe(uL,uR)=14(uL2+uR2)−12∣uL+uR2∣(uR−uL)F_{\mathrm{Roe}}(u_L, u_R) = \frac{1}{4}(u_L^2 + u_R^2) - \frac{1}{2}|\frac{u_L+u_R}{2}|(u_R - u_L) produces an unphysical stationary expansion shock on uL=−1,uR=+1u_L = -1, u_R = +1 while _burgers_godunov_flux resolves the exact rarefaction fan.

  3. Implement it yourself. Implement solve_muscl_viscous_burgers_1d(u_init, L, nu, dt, n_steps) using periodic minmod slope reconstruction, _burgers_godunov_flux, centered viscous diffusion, and SSP-RK2. Verify O(Δx2)O(\Delta x^2) convergence on cole_hopf_viscous_burgers_exact (ν=0.12,a0=1.20,t=0.5\nu = 0.12, a_0 = 1.20, t = 0.5) and assert >8×> 8\times lower L2L_2 error than 1st-order solve_viscous_burgers_1d at N=256N = 256.


Self-check for the exercises
============================
Cole-Hopf zero-mean antisymmetry and Godunov sonic-point flux verified
All checks passed.