Skip to content

The n = 1 polytrope: equilibrium and collapse ​

IDGroupMilestoneTypeBackendsFigureRegression
SV-7, SV-8Self-gravityM8 (#81) · P4PCPU, FNLyesselfgravity-star

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 p=Kρ2 with a closed-form density, so the discrete scheme holds it up to its truncation error, and halving its pressure makes it collapse, bounce and ring.

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 E and W through the isolated solver. Its symmetry (an even kernel) must give the same exactness as the periodic solver: E+W drifts only at the Runge–Kutta order while E and W exchange, and the momentum stays at round-off.

Models and numerics ​

ItemChoiceCode
Equationscompressible Euler, γ=2 (the adiabatic exponent of p=Kρ2), isolated self-gravity, G=1models
Poisson solverFFT with isolated boundaries (poisson_bc = isolated): zero padding and the lattice Green's functionadam_poisson_fft_object.F90, adam_fnl_poisson_fft_object.F90
Couplingone solve per Runge–Kutta stage, the potential pathsolve_potential, adam_flume_common_object.F90; add_potential_sources, adam_flume_cpu_object.F90
SpaceWENO5 (weno-u-5) flux splitting on characteristic variables (weno)numerics
TimeSSP Runge–Kutta, 3 stages, CFL 0.4 (SV-8: 0.4, 0.2, 0.1)adam_stepper_object.F90 (SELAH)
Positivity limiterSV-7: cell (its gravity energy correction, M7-G1); SV-8: nonelimit_positivity, adam_flume_cpu_object.F90; numerics
Boundarieswall-inviscid on every face: a closed box, no mass or energy crosses it, so E+W has no boundary termboundary conditions; adam_flume_bc_object.F90
Initial conditionpolytrope: the star and its atmosphereset_initial_conditions, adam_flume_ic_object.F90

Initial and boundary conditions ​

ItemValue
Starpolytrope: n = 1, radius a=1/2, ρc=1, G=1, p=Kρ2 with K=2Ga2/π (the Lane–Emden equilibrium), γ=2; mass 4ρca3/π, mean density 3ρc/π2, free-fall time of the mean density tff=3π/(32Gρ¯)=0.98
Atmosphereisothermal at the central temperature (p1=Kρcρ1) and hydrostatic in the star's field, ρ=ρ1eGM/T(1/r−1/a) outside; inside, ρ1 and p1 added to the star
Box[−1,1]3, an octree, uniform; 8 cells per block side, 4 ghosts; wall-inviscid on every face
Ranks2
SV-7, equilibrium (star)star_pressure_factor 1, atmosphere ρ1=10−4ρc, positivity limiter cell; 323 and 643 (levels 2 and 3) to t=2, CFL 0.4, a checkpoint every 10 steps
SV-8, collapse (starc)star_pressure_factor 0.5, atmosphere ρ1=10−2ρc, no limiter; 323 to t=1.5 at CFL 0.4, 0.2, 0.1
Regression selfgravity-starstar --levels 1: 163 (2×2×2 blocks of 83), atmosphere 10−2ρc, no limiter, 20 steps

Input files ​

FileRole
src/tests/flume/verification/selfgravity/make_polytrope.pywrites star and starc (--cells, --levels, --cfl, --time-max, --it-save, --atmosphere, --limiter; the AMR options are on the star on AMR)
src/tests/flume/verification/selfgravity/star.shruns the legs sv7, sv8 here and sv14 to sv17 of the star on AMR (--np N, --legs LIST, --keep; FLUME_EXE selects the backend)
src/tests/flume/verification/selfgravity/star_oracle.pyconvergence (SV-7): the drifts on two grids and their reduction
src/tests/flume/verification/selfgravity/jeans_oracle.pyconservation (SV-8): E+W against Δt, the momentum
src/tests/flume/regression/selfgravity-star/input.inithe frozen equilibrium at 163, 20 steps
src/tests/flume/verification/make_doc_runs.sh, group isolatedsv7-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_figures.py, fig_selfgravity_stardraws the figure (--only selfgravity-star)
bash
cd src/tests/flume/verification/selfgravity && ./star.sh --legs sv7,sv8      # CPU (exe/adam_flume_cpu_fft)
FLUME_EXE=$PWD/../../../../../exe/adam_flume_fnl_fft ./star.sh --legs sv7,sv8  # FNL

Results ​

SV-7 and SV-8: the equilibrium star's core and spurious motion at two resolutions; the collapse's energy drift and density

Top: at 323 and 643 the core first expands (the central density falls, by 10 % and 4.5 %) and then recompresses past its initial value within two time units; on the finer grid the swing is smaller and the interior Mach number about half. Bottom left: in the collapse E and W exchange 74 % of |E+W| (their curves coincide) while E+W drifts at the Runge–Kutta order, a factor 8 per halving of the CFL number. Bottom right: the collapsing star at its densest checkpoint, t=1.03, its central density four times the initial one.

The central density is the mean over the cells within one cell of the centre; the Mach numbers are taken inside 0.8a and over the whole star (the cells denser than a tenth of the central density).

LegAssertedBoundCPUFNL
SV-7the largest central-density drift to t=2: 9.91⋅10−2 (323), 5.71⋅10−2 (643); reduction≥1.51.731.74
SV-7the largest Mach number inside 0.8a: 0.154, 0.075; reduction≥1.52.06the same
SV-7the largest Mach number in the whole star (set at its surface): 0.43, 0.29; reductionreported1.491.50
SV-8drift of E+W at CFL 0.4, 0.2, 0.1: 5.97⋅10−7, 8.29⋅10−8, 9.71⋅10−9; order in Δt≥2.52.85, 3.092.85, 3.09 (the same drifts)
SV-8the largest |∫ρu|10−147.8⋅10−186.5⋅10−18

Measured: ADAM 0bcdf870 + the night-2026-11-22 tree (the paper commit, tag pending), CPU gfortran 16.2.0 + Open MPI 5.0.11 (iac_gnu) on medooza (gnode22), FNL nvfortran 26.9, CUDA 12.9 (iac_nvf) on NVIDIA A30, 2026-11-23 (selfgravity/star.sh --legs sv7,sv8, jobs 1369376 CPU, 1369378 FNL).

Related cases: the periodic analogue of the collapse is SV-4; the solver is SV-6; the star on AMR grids is SV-14 to SV-17; the limiter's gravity energy correction comes from the force (M7-G1).

Findings ​

  • Only the time integration drifts. In the collapse E and W each change by 74 % of |E+W|, while E+W drifts by 6⋅10−7 at CFL 0.4 and falls as Δt3: 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) is not part of the flux form. A star in a 10−4 atmosphere needs it at its surface (without it the gas there reaches |u|≈0.4 in ten steps and its pressure goes negative), and with it E+W drifts by 2.8⋅10−3 by t=4 at 323, against 3⋅10−9 without it in a 10−2 atmosphere. SV-8 therefore runs in the heavier atmosphere, without the limiter.
  • A heavy atmosphere is not an equilibrium test. The 10−2 atmosphere holds 22 % of the star's mass, and the star then pulsates with 13 % of its central density at 323; 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 (ρs∝a−r, p∝(a−r)2), the light atmosphere needs the limiter there (first order where it acts), and the surface is where the largest Mach number sits (r=0.454, a=0.5): it shrinks only 1.5-fold from 323 to 643. 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. The runs reach two free-fall times.
  • The regression case selfgravity-star freezes the equilibrium at 163 in the 10−2 atmosphere without the limiter, not SV-7's light-atmosphere setup.