Appearance
The n = 1 polytrope: equilibrium and collapse
| ID | Group | Milestone | Backends | Figure | Regression |
|---|---|---|---|---|---|
| SV-7, SV-8, SV-14 | Self-gravity | M8 (#81), P4; #87, P3, P4 | CPU, FNL | yes | selfgravity-star, selfgravity-star-amr |
Case and scope
An n = 1 polytrope star under the isolated self-gravity of SV-6, centred in a closed box. The n = 1 polytrope is the Lane–Emden equilibrium
What the case catches:
- SV-7, the equilibrium: a potential or a force inconsistent with the pressure gradient. The spurious motion of the discrete scheme around the continuum equilibrium (the drift of the central density, the Mach number inside the star) must shrink with the grid;
- SV-8, the collapse: a leak in the exact exchange of
and through the isolated solver. Its symmetry (an even kernel) must give the same exactness as the periodic solver: drifts only at the Runge–Kutta order while and exchange, and the momentum stays at round-off; - SV-14, the star on AMR (#87 P3): isolated self-gravity by the multigrid's symmetric James step (SV-13) coupled to the scheme. The equilibrium on a grid with the star refined must have less spurious motion than on the uniform base; the collapse must keep the exact exchange (the per-stage reflux carries the seam gravity work); a regrid that refines a boundary block must stop the run (D-87-4).
Models and numerics
| Item | Choice | Code |
|---|---|---|
| Equations | compressible Euler, | models |
| Poisson solver | FFT with isolated boundaries (poisson_bc = isolated): zero padding and the lattice Green's function; on AMR (SV-14) the multigrid's James step, its coarsest level on the same FFT solver | adam_poisson_mg_object.F90, adam_poisson_fft_object.F90, adam_fnl_poisson_fft_object.F90 |
| Coupling | one solve per Runge–Kutta stage, the potential path | solve_potential, adam_flume_common_object.F90; add_potential_sources, adam_flume_cpu_object.F90 |
| Space | WENO5 (weno-u-5) flux splitting on characteristic variables (weno) | numerics |
| Time | SSP Runge–Kutta, 3 stages, CFL 0.4 (SV-8: 0.4, 0.2, 0.1) | adam_rk_object.F90 |
| Positivity limiter | SV-7: cell (its gravity energy correction, M7-G1 option B); SV-8: none | limit_positivity, adam_flume_cpu_object.F90; numerics |
| Boundaries | wall-inviscid on every face: a closed box, no mass or energy crosses it, so | boundary conditions; adam_flume_bc_object.F90 |
| Initial condition | polytrope: the star and its atmosphere | set_initial_conditions, adam_flume_ic_object.F90 |
Initial and boundary conditions
| Item | Value |
|---|---|
| Star | polytrope: n = 1, radius |
| Atmosphere | isothermal at the central temperature ( |
| Box | wall-inviscid on every face |
| Ranks | 2 |
SV-7, equilibrium (star) | star_pressure_factor 1, atmosphere cell; |
SV-8, collapse (starc) | star_pressure_factor 0.5, atmosphere |
| SV-14, the star on AMR | a smaller star, radius --box: 120 blocks, the star at the |
| SV-14, equilibrium | as SV-7 (atmosphere cell, to |
| SV-14, collapse | as SV-8 (atmosphere reflux_cadence = stage |
| SV-14, refusal | starc --regrid 2 --boundary-box: a runtime marker on |
Regression selfgravity-star | star --levels 1: |
Regression selfgravity-star-amr | starc --radius 0.3 --box --reflux-cadence stage: SV-14's collapse, 120 blocks of |
Input files
| File | Role |
|---|---|
src/tests/flume/verification/selfgravity/make_polytrope.py | writes star and starc (--cells, --levels, --cfl, --time-max, --it-save, --atmosphere, --limiter; on AMR --radius, --box, --regrid, --boundary-box, --reflux-cadence) |
src/tests/flume/verification/selfgravity/star.sh | runs the legs sv7, sv8, sv14 (--np N, --legs LIST, --keep; FLUME_EXE selects the backend) |
src/tests/flume/verification/selfgravity/star_oracle.py | convergence (SV-7): the drifts on two grids and their reduction |
src/tests/flume/verification/selfgravity/jeans_oracle.py | conservation (SV-8): |
src/tests/flume/regression/selfgravity-star/input.ini | the frozen equilibrium at |
src/tests/flume/regression/selfgravity-star-amr/input.ini | the frozen SV-14 collapse on AMR, 20 steps (#87 P4) |
src/tests/flume/verification/make_doc_runs.sh, group isolated | sv7-l{2,3}, sv8-collapse-{0.4,0.2,0.1} (a checkpoint every 10 steps); needs exe/adam_flume_cpu_fft and exe/test_poisson_fft |
src/tests/flume/verification/make_doc_runs.sh, group isolated | also sv14-{uniform,box}, sv14-collapse-{0.4,0.2,0.1} |
src/tests/flume/verification/make_doc_figures.py, fig_selfgravity_star, fig_selfgravity_star_amr | draws the figures (--only selfgravity-star selfgravity-star-amr) |
bash
cd src/tests/flume/verification/selfgravity && ./star.sh # CPU (exe/adam_flume_cpu_fft)
FLUME_EXE=$PWD/../../../../../exe/adam_flume_fnl_fft ./star.sh # FNLResults

Top: at
The central density is the mean over the cells within one cell of the centre; the Mach numbers are taken inside
| Leg | Asserted | Bound | CPU | FNL |
|---|---|---|---|---|
| SV-7 | the largest central-density drift to | 1.74 | 1.73 | |
| SV-7 | the largest Mach number inside | 2.05 | 2.06 | |
| SV-7 | the largest Mach number in the whole star (set at its surface): 0.43, 0.29; reduction | reported | 1.50 | 1.49 |
| SV-8 | drift of | 2.85, 3.09 | 2.85, 3.09 (the same drifts) | |
| SV-8 | the largest |
SV-14, the star on AMR (#87 P3):

Top: the star of radius 0.3 on the uniform
| Leg | Asserted | Bound | CPU | FNL |
|---|---|---|---|---|
| SV-14 | the largest central-density drift to | 2.00 | 2.00 | |
| SV-14 | the largest Mach number inside | 2.19 | 2.19 | |
| SV-14 | the largest Mach number in the whole star: 15.2 (uniform: the surface spans 5 cells), 0.36; reduction | reported | 42 | 42 |
| SV-14 | collapse on AMR, drift of | 2.97, 2.97 | 2.97, 2.97 (the same drifts) | |
| SV-14 | the largest | |||
| SV-14 | a regrid that refines a boundary block | refused, exit 1 | refused | refused |
Related cases: the periodic analogue of the collapse is SV-4; the solver is SV-6, on AMR SV-13; the limiter's gravity energy correction comes from the force (M7-G1).
Findings
- Only the time integration drifts. In the collapse
and each change by 74 % of , while drifts by at CFL 0.4 and falls as : the isolated solver conserves as exactly as the periodic one (SV-4), through its symmetry. - The positivity limiter breaks the exchange where it acts. Its gravity energy correction (M7-G1, option B) is not part of the flux form. A star in a
atmosphere needs it at its surface (without it the gas there reaches in ten steps and its pressure goes negative), and with it drifts by by at , against without it in a atmosphere. SV-8 therefore runs in the heavier atmosphere, without the limiter. - A heavy atmosphere is not an equilibrium test. The
atmosphere holds 22 % of the star's mass, and the star then pulsates with 13 % of its central density at ; SV-7 uses the light one. - The equilibrium converges at about first order, set by the star's surface. The n = 1 surface has a kink in the density (
, ), the light atmosphere needs the limiter there (first order where it acts), and the surface is where the largest Mach number sits ( , ): it shrinks only 1.5-fold from to . The pulsation it drives sets the core's drift, which shrinks 1.7-fold, and the interior motion 2.1-fold. A star of radius 8 cells pulsates by 10 % of its central density, of 16 cells by 6 %. - The bound asserts convergence, not an order. P0 asked for 100 free-fall times; the runs reach 2 (
took 37 min on the WSL CPU, 20 min on the A30). - The regression case
selfgravity-starfreezes the equilibrium atin the atmosphere without the limiter, not SV-7's light-atmosphere setup. - Isolated self-gravity on AMR holds the star and keeps the exchange exact (SV-14). Refining the star halves its spurious motion against the uniform base, as a uniform grid of the fine spacing would; the collapse drifts at third order in
with the momentum at round-off, as on the uniform grid (SV-8): the James step is symmetric and the per-stage reflux carries the seam gravity work. - Keep refinement boundaries off the stellar surface. With the SV-7 star (
) the box's faces lie on the surface; in the light atmosphere the end-of-step reflux run goes non-finite at , the per-stage one reaches (#88). Production codes keep coarse–fine boundaries out of dense gas for the same reason (Castro refines everything far below the stellar density, Katz et al. 2016; Berger and Colella 1989 on the spurious waves of a resolution jump at a steep gradient). - No runtime-AMR star with a changing grid. One level above the
base can only refine the 8 inner blocks (0.5 wide), two levels carry the 2:1 balance to the boundary blocks (refused, D-87-4), and 4-cell blocks are below ; the regrid path is covered by the refusal and, periodic, by SV-11. A coarse star prolonged at its first regrid also drained one cell's internal energy to negative in the collapse (#88).