Skip to content

Self-gravity ​

Self-gravity in FLUME solves ∇2Φ=4πG(ρ−ρ¯) every Runge–Kutta stage and applies gravity through the cell potential. It uses the spatial discretisation of Mullen et al. (2021), with the 7-point Laplacian Lh:

  • face gravity: gd,i+1/2=−(Φi+1−Φi)/Δxd;
  • cell gravity: the mean of the cell's two faces;
  • momentum: ρ times the cell gravity;
  • energy: 12∑d(gd,i+1/2Fd,i+1/2ρ+gd,i−1/2Fd,i−1/2ρ), from the mass fluxes the continuity equation uses.

Summed over the cells, the energy source is ∑iΦi(Fi+1/2−Fi−1/2)/Δx. So E+ρΦ is conserved exactly with a static potential, and E+12ρΦ with a self-consistent one: in the semi-discrete form, given a Poisson solve that is linear and symmetric, Φ=4πGKρ with K=KT; a round-off residual of the Poisson equation is not required (models). The scheme is second order.

The cases verify the potential path against the constant-g oracles of external gravity, the Poisson solvers (FFT, isolated by the lattice Green's function, multigrid on AMR grids) against the discrete Laplacian Lh and the free-space potential, the coupling on Jeans modes against the dispersion relation with an exact E+W exchange, and the n=1 polytrope in equilibrium and in collapse, on uniform, static AMR and runtime AMR grids.

CaseTypeWhat it verifies
Gravity from a cell potentialPthe potential path reproduces the constant-g oracles of external gravity
The FFT Poisson solverPthe periodic solver is exact for Lh, second order against the continuum
Jeans modesP+Cthe coupling: dispersion relation, growth rate, symmetry, exact E+W exchange, scaling covariance
The isolated solverPzero padding with the lattice Green's function: free-space potential of the mass on the grid
The n = 1 polytropePa star in equilibrium and a collapsing one under isolated self-gravity, uniform grid
The multigrid solver on AMR gridsPthe mimetic 2:1 coupling (symmetric and consistent), the FCG solver, Dirichlet faces, isolated boundaries by the symmetric James step
Jeans modes on a static AMR gridPthe multigrid coupling, the seam gravity work, the per-stage reflux
Self-gravity under runtime AMRCthe solver and Φ follow every regrid; E+W exact between regrids
The polytrope on AMRP+Cthe star on a static AMR box; its collapse under runtime AMR with the conservative-state prolongation, a Jeans marker and dual energy; the Jeans-marker contract

Sink particles build on self-gravity and have their own group.

The figures are regenerated with make_doc_runs.sh <dir> <group> and make_doc_figures.py --only <figure> (src/tests/flume/verification/):

make_doc_runs.sh groupExecutables it needsmake_doc_figures.py --only
selfgravityexe/adam_flume_cpu, exe/test_poisson_fft (mode test-poisson-fft-gnu)selfgravity-potential selfgravity-poisson
jeansexe/adam_flume_cpu_fft (mode flume-cpu-gnu-fft)selfgravity-jeans
isolatedexe/test_poisson_fft, exe/adam_flume_cpu_fftselfgravity-isolated selfgravity-star selfgravity-star-amr
collapse-regridexe/adam_flume_cpu_fftselfgravity-star-regrid
amrexe/test_poisson_mg (mode test-poisson-mg-gnu), exe/adam_flume_cpu_fftselfgravity-amr selfgravity-amr-jeans selfgravity-amr-regrid

How it was built ​

Self-gravity is milestone M8 (#81); isolated self-gravity on AMR is #87, the star under runtime AMR #88 and #91 (M9); sink particles are M12 (#94). The phases of #81 and the cases that verify them:

PhaseWhat it addsCases
P1the potential path ([gravity] potential = linear)SV-1
P2the FFT Poisson solver, periodicSV-2
P3the coupling, one solve per Runge–Kutta stage ([gravity] self_gravity)SV-3, SV-4, SV-5
P4isolated boundaries (poisson_bc = isolated)SV-6, SV-7, SV-8
P5athe multigrid Poisson solver on AMR gridsSV-9
P5bself-gravity on static AMR grids, the seam gravity work in the refluxSV-10
P5cthe per-stage reflux, self-gravity under runtime AMRSV-10 (reflux_cadence = stage), SV-11
P6the regression cases selfgravity-jeans, selfgravity-amr-stage, selfgravity-star—
#87 P1Dirichlet faces in the multigrid solver, a DST-I coarsest levelSV-12
#87 P2isolated boundaries on AMR, the symmetric James stepSV-13
#87 P3isolated self-gravity on AMR in FLUME: the refusals lifted, a regrid that refines a boundary block fatalSV-14
#88, #91the star under runtime AMR: the conservative-state prolongation, the Jeans marker, dual energySV-15, SV-16, SV-17, rg7
CaseIDPhase
Gravity from a cell potentialSV-1P1
The FFT Poisson solverSV-2P2
Jeans modesSV-3 to SV-5P3
The isolated solverSV-6P4
The n = 1 polytropeSV-7, SV-8P4
The multigrid solver on AMR gridsSV-9, SV-12, SV-13P5a; #87 P1, P2
Jeans modes on a static AMR gridSV-10P5b, P5c
Self-gravity under runtime AMRSV-11P5c
The polytrope on AMRSV-14 to SV-17, rg7#87 P3, P4; #88; M9

The verification catalog places the star on AMR after M8, with #87 and #88.