Appearance
The n = 1 polytrope: equilibrium and collapse
| ID | Group | Milestone | Backends | Figure | Regression |
|---|---|---|---|---|---|
| SV-7, SV-8, SV-14 to SV-17 | Self-gravity | M8 (#81), P4; #87, P3, P4; #88; #91 | 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 |
| SV-15, runtime-AMR collapse | starc --radius 0.3 --reflux-cadence stage --regrid 5: the SV-14 star on the uniform regrid_prolongation = conservative-state, and the default conservative reported |
| SV-17, dual energy | the SV-15 case (starc --radius 0.3 --reflux-cadence stage --regrid 5, the default prolongation, no Jeans marker) with --physical-model euler-de, the dual-energy switch at its default 0.05 (DE) |
| SV-16, Jeans refinement | starc --radius 0.22 --reflux-cadence stage --regrid 5 --jeans 8: a smaller star (3.5 cells per radius on the base; its Jeans length is amr_iterations = 1); the default prolongation; the same star without the Jeans marker reported |
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, sv15, sv16, sv17 (--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_runs.sh, group collapse-regrid | sv15-{conservative-state,conservative}, sv16-{jeans,control} and sv17-de, a checkpoint every 2 steps (the conservative and control runs stop by design) |
src/tests/flume/verification/make_doc_figures.py, fig_selfgravity_star, fig_selfgravity_star_amr, fig_selfgravity_star_regrid | draws the figures (--only selfgravity-star selfgravity-star-amr selfgravity-star-regrid) |
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 |
SV-15 to SV-17, the runtime-AMR collapse (#88, #91):

Top row, SV-15: the SV-14 star collapsing on the uniform conservative the coldest cells then keep cooling while an infall reaches Mach 10: conservative-state the smallest conservative and conservative-state, and drifts at the time integration's error between regrids. Bottom row, SV-16: the smaller star refined only by the Löhner marker at step 5 cools to non-finite at step 27; with the Jeans marker the initial AMR refines it before the collapse (120 blocks, 64 on the base), no regrid changes the grid, the coldest cell recovers and the run reaches euler (the red curve of the top row) and with euler-de: the floor lifts the coldest cells to their adiabat in 6 steps, adding
| Leg | Asserted | Bound | CPU | FNL |
|---|---|---|---|---|
| SV-15 | conservative-state: reaches | completes | ||
| SV-15 | conservative-state: mass and momentum drifts | mass | mass | |
| SV-15 | conservative, the default | reported | non-finite at step 64 | non-finite at step 65 |
| SV-16 | Jeans marker: the initial grid refined (blocks at step 0 above the 64 of the base); reaches | completes | 120 blocks at step 0; | 120 blocks at step 0; |
| SV-16 | Jeans marker: mass and momentum drifts | mass | mass | |
| SV-17 | euler-de: reaches | completes | ||
| SV-17 | euler-de: mass and momentum drifts | mass | mass | |
| SV-17 | the energy the entropy floor added | reported | ||
| SV-16 | without the Jeans marker | reported | non-finite at step 27 | non-finite at step 33 |
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). - A runtime-AMR star changes its grid once, and needs
conservative-state(SV-15). One level above thebase 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 collapse's first regrid refines the 8 inner blocks and later regrids keep that grid. With the default prolongation the collapse then drains a cell's internal energy to negative; conservative-state, one range limit for the whole state, runs it to the end (#88). In a sweep on WSL (CPU) it also ran the star of radius 0.25 regridded every 5 steps and of radius 0.3 every 8, on which the default goes non-finite (steps 53 and 48), and of radius 0.3 every 3, which the default survives; it fails on the radius-0.22 star regridded every 5 steps and the radius-0.25 star every 8 (3.5 and 4.0 cells per radius on the base), which the non-conservativelinearprolongation runs to the end. - Refine before the collapse: the Jeans criterion (SV-16). A runtime-AMR star prolonged mid-collapse is the fragile case; a Jeans marker refines it at the start instead, and the collapse never regrids. With 8 cells per Jeans length the radius-0.22 star regridded every 5 steps, which no conservative prolongation survives, reaches
with the default one; on WSL so did the radius-0.25 star regridded every 8 and the SV-15 star. For this polytrope the Jeans length does not shrink in the collapse ( at ), so one refinement at the start holds; in an adiabatic collapse , so for any it shortens as the density rises, and the runtime regrids then follow it. - Or carry the entropy: dual energy (SV-17). The coldest cells of the SV-15 collapse sit at
two steps before the default run goes non-finite; euler-delifts them to their adiabat when they drop below it, and the run ends with the default prolongation. On WSL it also ran the radius-0.25 star regridded every 5 and every 8 steps; the radius-0.22 star (3.5 cells per radius) still needs the Jeans marker. Three remedies, one per cause:conservative-statekeeps a mid-collapse regrid from building cold fast cells, the Jeans marker avoids the mid-collapse regrid, dual energy keeps the cold infall from draining.