Skip to content

Barotropic gases under gravity ​

IDGroupMilestoneBackendsFigureRegression
EO (eg1 to eg10)EulerM13 (#100), P4CPU, FNLyesbaro-jeans-box, iso-sinks-shu

Case and scope ​

The isothermal and barotropic gases have no energy equation: their energy slot is inert (D-M13-1). P4 couples them to gravity, self-gravity, the Jeans refinement marker and the sink particles (numerics, input). Gravity must then move the momentum only, and every quantity the ideal gas reads from its internal energy (the sound speed of the Jeans length, the sinks' threshold density, the thermal energy of their Jeans test) must come from the equation of state, cs2=dP/dρ (D-M13-4).

What the legs catch:

  • gravity writing into the energy slot: the free fall and the AMR collapse keep rE and its integral at exactly 0;
  • a sound speed taken as P/ρ: the Jeans wave and the Jeans marker on a barotropic background where dP/dρ and P/ρ differ by the factor Γ;
  • a broken self-gravity coupling: the order of the stable Jeans wave, the growth rate of the unstable mode, the mirror symmetry, the conservation across the 2:1 seams;
  • sinks reading the energy slot: with cs2=0 every cell would pass the threshold, with Eth=0 every candidate the Jeans test;
  • the isothermal sphere: its accretion rate against Shu's similarity solution, now with an exactly isothermal gas;
  • the stability of a Bonnor–Ebert sphere on either side of its critical radius;
  • a limiter that extrapolates the velocity: the Boss–Bodenheimer cloud's envelope crossing the corners of the refined cube, where seam ghosts and cells reach the density floor;
  • a backend that disagrees.

Models and numerics ​

ItemChoiceCode
Modeleuler with [eos] type = isothermal or barotropic (MODEL_EULER_ISO, MODEL_EULER_BARO)adam_flume_physics_object.F90 (eos_pressure, eos_sound_speed2)
Gravitythe momentum sources of the ideal gas, the energy residual cleared (clear_inert_energy), no fourth-order energy correction, no seam gravity workadam_flume_cpu_object.F90, adam_flume_fnl_object.F90, adam_flume_fnl_kernels.F90
Self-gravityFFT (periodic, isolated) and multigrid (AMR) Poisson solvers, the potential pathself-gravity
Sinksthreshold πcs2/(4Gracc2) with cs2=dP/dρ; Jeans test with Eth=32∫PdVadam_flume_common_object.F90 (accrete_cells, create_sinks)
Positivitythe cell limiter on the density, plus a kinetic chord (internal_energy = ρ and kinetic_sound_speed2 in the models' kernels; the reflux limiter's cs2_inert); the seam fill clamps the density and the velocity of a fine ghost to an MP bound of the coarse cells (#101)adam_flume_cpu_euler_{iso,baro}_kernels.F90, adam_flume_common_object.F90 (reflux_positivity_theta), adam_seam_interpolation_library.F90 (seam_mp_bound), adam_field_object.F90 (interp_seam_ghost)
Space, timeWENO5 characteristic flux splitting, SSP-RK(3,3), CFL 0.4—

Initial and boundary conditions ​

The barotropic cases use POLY of eos_oracle.py (c0=1, breaks ρ=2,8, exponents 1,1.4,5/3).

LegSetup
eg1a uniform periodic box at rest (2 blocks of 24 cells), gx=0.5, t=0.4; isothermal ρ=1, barotropic ρ=5
eg2the stable Jeans wave of make_jeans.py (4×4 blocks, k=2π(1,1), amplitude 10−6), 4πGρ0=c2k2/4, one period, 32², 64², 128²; isothermal c0=1, ρ0=1; barotropic ρ0=5: c2=P′(5)=2.0198, while P/ρ=1.4427
eg3the unstable mode, 4πGρ0=94c2k2 (σ=5/4ck), 64², t=0.5/c, both gases
eg4eg2 (isothermal) with the central box refined 2:1, the multigrid solver; the barotropic collapse (amplitude 10−2, 64² base, t=0.4/c) on the same grid
eg5a static periodic box [−1,1]3, 32³, a Jeans marker of 5.4 cells per Jeans length, a regrid at step 4: isothermal at 5 cells per λJ; barotropic ρ0=10 (the Γ=5/3 segment) at 6 cells by dP/dρ, 4.65 by P/ρ
eg6the sinks' box (32³, G=1): a Jeans-stable periodic box at 1.2 times the threshold (c02=0.0259, creation on, 20 steps); accretion by a sink of mass 0.1 from ρ=1, c02=2⋅10−3; the singular isothermal sphere A=29.3, c0=0.5, a seed sink, t=0.25; a supercritical Bonnor–Ebert sphere (ξ=10 at the walls, c0=0.2, density doubled), creation on, t=3
eg7the closed cube [−1,1]3, 32³, isolated self-gravity, c0=1, G=1, the Bonnor–Ebert profile with ξ=3,6 (sub-critical) and 9 (super-critical) at the walls, t=4
eg8bonnor-ebert with the barotropic gas or without self-gravity, boss-bodenheimer with the ideal gas, singular-isothermal-sphere with the barotropic gas
eg9the eg1, eg2 (64²) and eg4 runs and the eg6 sphere and Bonnor–Ebert runs of CPU and FNL
eg10the Boss–Bodenheimer cloud of the figure (32 cells per block, the Jeans marker to 2 levels more, sinks), 300 steps (iteration-driven), still advancing at the end

The Bonnor–Ebert sphere in a cube. The Lane–Emden profile is the equilibrium of an isolated sphere; in a closed cube the gas in the corners, outside the inscribed sphere, carries 46 % of the sphere's mass at ξ=3, and its cubic multipoles pull on the sphere by 3 % of its gravity at r=0.6 and 10 % at r=0.9 (outward along the axes, inward along the diagonals; direct summation over the 48³ profile). The profile is therefore not a discrete equilibrium, and refining does not change that (16³ and 32³ drift alike); an isothermal gas offers no confining medium either (P(ρ) is single-valued). The leg tests what survives: a sub-critical sphere rings about its initial state, a super-critical one runs away.

Input files ​

FileRole
src/tests/flume/verification/eos/make_eos_gravity.pywrites the cases from the gamma-law Jeans and sinks inputs, the gas of [eos] in place of γ
src/tests/flume/verification/eos/gravity.shruns the legs (--legs eg1,...,eg10, default all but eg9; FLUME_EXE, EG_NP ranks)
eos_oracle.py (freefall, refined, inert-history, advancing), selfgravity/jeans_oracle.py, selfgravity/star_oracle.py (unstable), sinks/si_oracle.pythe checks; the Jeans oracle reads c2 from [eos]
src/tests/flume/regression/baro-jeans-box/input.ini, iso-sinks-shu/input.inithe frozen eg4 collapse (20 steps) and eg6 sphere (16³, 30 steps)
make_doc_runs.sh <runs> eosgrav, make_doc_figures.py --only barotropic-gravitythe figure
bash
cd src/tests/flume/verification/eos && ./gravity.sh                                              # CPU
FLUME_EXE=$PWD/../../../../../exe/adam_flume_fnl_fft EG_NP=2 ./gravity.sh                        # FNL
./gravity.sh --legs eg9                                                                          # CPU against FNL

Results ​

Barotropic gases under gravity: the Jeans wave and mode, Bonnor-Ebert stability, the singular isothermal sphere and the Boss-Bodenheimer cloud

Top left: the stable Jeans wave, the L1 error of ρ after one period, isothermal, barotropic and across the 2:1 seams (slope 2 dashed). Top centre: the unstable mode against eσt. Top right: the central density of the Bonnor–Ebert spheres, sub-critical ξ=3,6 ringing, super-critical ξ=9 departing. Bottom left: the sink of the singular isothermal sphere against Shu's rate. Bottom centre and right: the Boss–Bodenheimer cloud, the column density along z, with the sinks.

LegAssertedBoundCPUFNL
eg1ρ uniform, ρu−ρgt; rE10−12; 00, 8.9⋅10−17; 00, 4.4⋅10−17; 0
eg2the L1 order of the finest pair, isothermal; barotropic≥1.82.00; 2.002.00; 2.00
eg3the growth rate; the mirror symmetry10−2; 10−107.2⋅10−4 both; 7.3⋅10−11, 4.2⋅10−117.2⋅10−4 both; 1.4⋅10−11, 1.5⋅10−11
eg4the order across the seams; the momentum, the mass; the energy integral≥1.8; 10−14, 10−13; 01.98; 5.6⋅10−17, 1.8⋅10−16; 01.98; 2.8⋅10−17, 1.8⋅10−16; 0
eg5isothermal refined, barotropic not—8 → 64 blocks; 8 → 88 → 64 blocks; 8 → 8
eg6no sink; accreted mass, momentum; Shu's rate; one central sink0; 10−13, 5 %; 6 %; 1 cell0; 0, 2.6 %; 4.1 %; 8.9⋅10−150; 2.2⋅10−16, 2.8 %; 4.1 %; 3.8⋅10−15
eg7sub-critical drift and Mach; super-critical departure0.25, 0.25; ≥0.50.147, 0.084 (ξ=3), 0.136, 0.147 (ξ=6); 0.695the same to the printed digits
eg8the 4 invalid inputsrefusedrefusedrefused
eg9FNL against CPU10−10, 10−6 of the amplitude, 10−8(the same comparison)free fall 6.7⋅10−17; Jeans 2.0⋅10−9, 1.4⋅10−9, collapse 2.9⋅10−13; sinks 8⋅10−11, 4⋅10−16
eg10the time advanced over the last 50 steps, over 50 mean steps; sinks formed≥0.1; ≥10.372 (t=1.649); 10.372 (t=1.649); 1
eg10the edge cells of the shell against the rest: largest speed; smallest density (#101)≤2; ≥0.51.42; 1.00 (8 ranks)1.42; 1.00 (2 ranks)

Related cases: the Jeans modes and the sink particles of the ideal gas.

Findings ​

  • The sound speed decides the Jeans physics, not the pressure. On the barotropic background ρ0=5 the wave is checked against ω2=P′(ρ0)k2−4πGρ0; with P/ρ in place of P′ its phase after one period would be off by 1.3 rad, and the marker of eg5 would refine a box it leaves alone.
  • The sinks need the virial thermal energy. The ideal gas's internal energy ∫P/(γ−1)dV diverges as γ→1; 32∫PdV is the virial term, equal at γ=5/3. With it the Jeans-stable box forms no sink, the supercritical sphere one at its centre, and the singular isothermal sphere, now exactly isothermal, accretes at 0.959 of Shu's rate (95.9 %), on both backends.
  • Accretion needs the density-only limiter. A sink draining a cold background to its threshold density leaves a jump the scheme undershoots: without the limiter the run fails (the ideal-gas control at the same sound speed fails too). With it, mass is conserved to round-off and the momentum to 2.6 % of the exchange (FNL 2.8 %). The limiter makes the cold accretion run differ between backends: equal to round-off for five steps, apart by 10−6 at step 15, as the other limited cases (so eg9 leaves it out).
  • A limiter must not extrapolate the velocity of an inert gas. When the cloud's envelope, expanding into an ambient 100 times thinner, reaches the corners of the refined cube (step 130), the tricubic seam ghosts of the fine-block corner cells come out with ρ≤0. Two limiters then take states to the density floor along a segment whose far end has negative density, the seam ghost blend (to κρin) and the cell limiter (to κρb): the velocity ρu/ρ of the result is extrapolated, up to 1/κ=10 times the anchor's. For the ideal gas the internal-energy chord rejects that state; for the inert gases nothing did, the corner cells' velocity grew by a factor per step, and dt→0. The ghost blend alone stalled the run at t=1.3721 (2940 steps, 1.24tff); with the ghosts taking their interior cell, the cell limiter stalled it at 1.4637, the ambient beside the corners drained to 10−5 at |u| up to 365. The cell and reflux limiters now add a kinetic chord on ρW−|m|2/(2ρ), W=(4|ub|2+c2)/2 of the backbone (numerics): the cloud runs 400 steps to t=1.83 (1.65tff), still advancing (eg10): the ambient dips once to 1.4⋅10−4 and ends above 6.6⋅10−4, and the fastest gas at the end, |u|=4.4, falls into the sink. The chord's factor 4 matters for cold gas: with W=(|ub|2+c2)/2 the cold accretion of eg6 drifted its momentum by 13 % of the exchange.
  • The seam fill must bound the velocity at the corners of a refined region (#101). The chord keeps the run going, it does not keep the corner ghosts sound. eg10 compares, every 20 steps, the cells of the shell 1.55<r<1.85 near the edges of the refined cube (3680 cells) with the rest of the shell (42216): their largest speed (bound: twice the rest's) and their smallest density (bound: half the rest's). With the tricubic ghosts unbounded the edge cells reach |u|=22.7c0, 14.8 times the rest (step 200), and their density falls to 0.04 times the rest's (step 240). Three fills were measured before the one adopted (400 steps, 8 ranks): a density guard (a ghost below 0.1 times its anchor's density takes the anchor's state) holds the density (0.90) but not the speed (2.95); clamping the density and the momenta to a monotonicity-preserving bound holds the density (1.00) but not the speed either (2.93): the velocity, their ratio, stays free; injection everywhere passes (1.07, 1.00) at first order. The fill adopted clamps the density and the velocity to the MP bound of the coarse cells around the ghost (numerics): 1.42 and 1.00, the same on CPU (400 steps) and FNL (eg10, 300 steps, 2 GPUs), while the order across a 2:1 corner on smooth data is unchanged (AO euler-l6: L1 8.548e-8 at N=256, orders 5.33 and 5.53, CPU and FNL to every printed digit).

Corner cells against the rest of the shell, five seam fills

  • A Bonnor–Ebert sphere in a cube is no equilibrium, but its stability is testable. See above; sub-critical spheres ring within 15 % of their central density (0.147 at ξ=3, 0.136 at ξ=6) below Mach 0.15, the super-critical one departs by 70 % (0.695; −0.67 at t=4).