---
title: "How to check whether a numerical wave is a shock"
description: "Replay actual finite-volume refinement, then inspect jump consistency, branch association and entropy floors."
canonical_url: "https://sandboxphysics.com/stories/agn-feedback/reading-wave-and-shock-evidence/"
language: "en"
page_type: "story"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/stories/agn-feedback/reading-wave-and-shock-evidence/"
last_modified: "2026-11-12"
---

[How black holes move energy through cluster gas](https://sandboxphysics.com/stories/agn-feedback/)

L3 · Bubbles, waves and cluster heating

# How to check whether a numerical wave is a shock

Sandbox Physics · 2026-11-12

Open gentle-wave-convergence.json in the download. It records spatial and timestep comparisons for one fixed gentle source, followed by four shock assessments. Recompute the field errors first; then inspect why a useful pressure-wave solution still fails the shock criteria.

## Before you begin

Use the preceding entropy, shell-volume and matching-cooling concepts. Independent replay needs Python 3.12 and NumPy 2.3.5, with no evolution solver or interactive Lab Engine.

## Identify the two physical problems being compared

One spherical gas calculation cools under gravity and receives a central thermal pulse during eighteen to nineteen million years. The other starts from the same atmosphere and only cools. The thermal energy is five percent of the eighteen-million-year total input; power, schedule and spatial kernel stay fixed.

Spatial comparison uses 2048 and 4096 radial cells. The timestep comparison halves the CFL coefficient from 0.35 to 0.175 on the same 4096 grid. This coefficient limits how far the fastest signal travels across the grid in one step. Every case runs from its initial state to sixty million years.

Each spherical record retains twelve predeclared complete fields, 334 integral rows and 81 candidate-diagnostic frames. Complete fields are retained at the twelve declared times. Conservation and physical-domain checks cover every accepted step.

Reading: Sandbox Physics

## A cell mean is not a centre-point sample

A finite-volume cell represents a shell average. Combining two fine cells requires their actual shell volumes. A simple arithmetic mean gives the larger outer shell too little weight.

Reconstruct density, radial velocity and pressure in each physical calculation, then subtract matching cooling. Project the fine-grid difference onto coarse volumes before comparing it. The independent reader script streams through the shells to check the same volume integrals.

$$
\overline f_C=\frac{1}{V_C}\sum_{j\subset C}V_j\overline f_j,\qquad V_j=\frac{4\pi}{3}\left(r_{j+1}^3-r_j^3\right)
$$

Density, velocity and pressure are tested separately, preserving their distinct units.

## Read the denominator before the percentage

The error divides the volume integral of the absolute discrepancy by the actual pulse-minus-cooling signal. Each variable and saved time is tested separately. Before heat release, the first three signals are exactly zero; those cases use an absolute-error check.

$$
e_f(t)=\frac{\sum_C V_C\left|\delta f_C^{\rm coarse}-\mathcal P\delta f^{\rm fine}_C\right|}{\sum_C V_C\left|\mathcal P\delta f^{\rm fine}_C\right|}
$$

Projection uses shell volumes. The original spatial limit is five percent and the half-timestep limit one percent.

| Actual comparison | Largest relative field error | Result |
| --- | --- | --- |
| 512 to 1024 | 0.178 | Spatial fail |
| 1024 to 2048 | 0.0794 | Spatial fail |
| 2048 to 4096 | 0.0332 | Spatial pass |
| Half timestep, original coarse projection | $4.68727\times10^{-6}$ | Time pass |
| Half timestep, additional native 4096 comparison | $4.85967\times10^{-6}$ | Time pass |

Reading: Sandbox Physics

## Associate the same propagation branch

Several compression bands may coexist. Selecting the strongest feature independently in every frame can jump from a fading pulse to a growing one. Differencing those positions invents a speed that no single front travelled.

The diagnostic retains all bracketed negative-gradient minima in its window. Adjacent quarter-million-year frames require unique bidirectional links using actual upstream flow, sound speed and the predeclared weak-shock Mach interval. Ambiguous links, a selected-branch switch or a stronger truncated boundary shoulder make the candidate speed unavailable.

This establishes local kinematic consistency only. It neither classifies a minimum as a shock nor forces distant assessment times into one trajectory.

Reading: Sandbox Physics

## Compare excess entropy with its matching floor

Heating and cooling themselves change entropy. An advected source-corrected label separates their declared contributions from the excess diagnostic. Candidate entropy is then compared with the largest acoustic-control, matching-cooling, spatial or timestep floor.

Matching cooling dominates all four final floors. At thirty million years, excess entropy is about 1.21 times ten to the minus ninth, versus a floor about 5.67 times ten to the minus eighth. Their ratio is 0.02134; the required ratio is greater than ten. The small negative value at twenty-six million years lies below the floor and is retained as unresolved numerical excess.

| Time / million years | Excess entropy / original floor | Original RH jump relative error |
| --- | --- | --- |
| 26 | −0.126 | 0.709 |
| 30 | 0.0213 | 0.367 |
| 34 | 0.0247 | 0.458 |
| 38 | 0.0277 | 0.304 |

Reading: Sandbox Physics

## Admit the gentle wave and retain the shock failure

A shock must satisfy all the original conditions: a location beyond the source and stencil, compression, a Mach number above one and at most 1.3, consistent density/pressure jumps, separation from sonic numerical uncertainty, and entropy clearly above the matching floor. At least two consecutive assessment times must pass.

All four times fail jump, sonic-separation and entropy conditions. Refined pulse-gradient half-height widths are about 0.38 to 0.61 kiloparsecs, spanning about 19 to 65 local cells. These describe a finite waveform; they are not fitted discontinuity thicknesses.

A separate uniform ideal-gas RH reference passed its own tests. It supplies evidence for its own prescribed uniform-gas problem. The AGN pulse keeps its separate shock assessment.

Reading: Sandbox Physics · Forman et al. (2007)

## Replay the two field norms locally

Download the full packet, native refinement ZIP, manifest, convergence record and independent script. ZIP members preserve the original NPZ bytes. The packet keeps all 4096 radii and twelve actual timestamps without downsampling or interpolation.

The replay gives spatial maximum 0.03321494 and original coarse-projected timestep maximum about 4.687 parts per million. Both maxima occur in the final-frame velocity column, and early zero-signal errors are zero. This recomputes field norms; the separate saved results describe per-step conservation, benchmarks and shock identification.

```
            python3.12 -m venv .venv
. .venv/bin/activate
python -m pip install numpy==2.3.5
python reproduce-wave-refinement.py --materials . --output local-wave-check.json
          
```

Reading: Sandbox Physics

## Download the independent scientific materials

The full packet and native refinement archive retain every saved radial cell and timestamp. The independent script checks data identities and recomputes the actual field norms.

[Exact byte, SHA256 and license manifest](https://sandboxphysics.com/stories/agn-feedback/public-reproduction.json)

- [LICENSE-code.txt](https://sandboxphysics.com/stories/agn-feedback/materials/LICENSE-code.txt)

  1,362 bytes · Original calculation/documentation with attribution; see license notices

  `96630e05864696f836e37b8b3c5abf777a90485dbd8737d21eadd44ce0235613`

- [LICENSE-data.txt](https://sandboxphysics.com/stories/agn-feedback/materials/LICENSE-data.txt)

  1,054 bytes · Original calculation/documentation with attribution; see license notices

  `67ae54be72c18d72a70cb63400f912e5e31d43c36938aef6504bd89543e20223`

- [gentle-wave-convergence.json](https://sandboxphysics.com/stories/agn-feedback/materials/gentle-wave-convergence.json)

  47,943 bytes · Original simulated numerical outputs; attribution grant LICENSE-data.txt

  `3b55a6e37a37c5debe3b56843d9f7b7fd8c713b210a5483199fdea1305748e1e`

- [reproduce-wave-refinement.py](https://sandboxphysics.com/stories/agn-feedback/materials/reproduce-wave-refinement.py)

  6,633 bytes · MIT; LICENSE-code.txt

  `4ee1c692c5c1243cca1eeb7422d996b64eb0ae26e5233108f5084611e9319d2b`

- [validate-records.py](https://sandboxphysics.com/stories/agn-feedback/materials/validate-records.py)

  3,382 bytes · MIT; LICENSE-code.txt

  `f89262e63c4f4352ef1ff3f9a19f396045acfddd9e7bee4a921c558a633a1dd6`

- [wave-refinement-expected.json](https://sandboxphysics.com/stories/agn-feedback/materials/wave-refinement-expected.json)

  4,574 bytes · Original simulated numerical outputs; attribution grant LICENSE-data.txt

  `15e692ba0b761d78eac6e59bab4f25689b82a6b4edad42652b1a287617d0148e`

- [wave-refinement-inputs.zip](https://sandboxphysics.com/stories/agn-feedback/materials/wave-refinement-inputs.zip)

  4,542,941 bytes · Original simulated numerical outputs; attribution grant LICENSE-data.txt

  `cea357cad48784dcd8e0ce1283c2ce69e5cba6cc34023e7f519433859e9d30a2`

- [wave-refinement-manifest.json](https://sandboxphysics.com/stories/agn-feedback/materials/wave-refinement-manifest.json)

  3,753 bytes · Original simulated numerical outputs; attribution grant LICENSE-data.txt

  `bdce85295190991805578c19b26cc772b381439b40587c6c43320fd28abeee4a`

- [accepted-records.json.gz](https://sandboxphysics.com/stories/agn-feedback/materials/accepted-records.json.gz)

  2,869,078 bytes · Original full-precision simulated output; attribution grant LICENSE-data.txt

  `2a81501bed03e97dbf5ed6df9ef96b6e452669eed7bb628d98e530c35dc8c236`

## Try the observation

### [Read the complete waveform](https://sandboxphysics.com/labs/agn-cavity-transport/)

1. At thirty million years, move a probe through several compression and rarefaction regions.
2. Follow complete profiles through time and check that a proposed front keeps its identity.
3. Distinguish visibility of a compression wave from the shock conditions in the explanation.

### [Compare a different shock problem](https://sandboxphysics.com/labs/supernova-remnant-shocks/)

1. Read that Lab’s own initial conditions and assumptions.
2. Compare its jump relations without combining its source energy with this gentle pulse.

## Exercises and explained answers

Why refine space if the half-timestep error is already small?

The two errors arise from different discretizations. Earlier timestep errors were small while spatial waveform errors exceeded ten percent. Finite spatial resolution still affects the waveform after the timestep is reduced.

Why can connecting the steepest gradient in every frame invent a supersonic speed?

The selected maximum can switch between different pulses. The difference includes the separation between two branches; the inferred trajectory changes identity.

[Previous: Replay a Perseus cavity pair against cooling losses](https://sandboxphysics.com/stories/agn-feedback/perseus-cavity-replay/) [Next: Follow heating through condensation, cosmic rays and XRISM](https://sandboxphysics.com/stories/agn-feedback/condensation-feedback-and-nonthermal-pressure/)

## Primary sources and calculation notes

1. [Forman et al. (2007), Filaments, bubbles, and weak shocks in the gaseous atmosphere of M87](https://arxiv.org/abs/astro-ph/0604583v2)

   Density and temperature jumps support the weak-shock interpretation in a different system, M87. Used as an observational contrast, not a calibration of the gentle pulse.

2. [Sandbox Physics, frozen gentle-source numerical evidence (2026)](https://sandboxphysics.com/stories/agn-feedback/materials/wave-refinement-manifest.json)

   Actual 512/1024/2048/4096 refinement history, original shock criteria and matching controls. The source power and scientific gates were kept fixed; the final scope remains no resolved AGN shock.
