Skip to content
This repository was archived by the owner on May 11, 2021. It is now read-only.

Self Gravity with FFT

Chang-Goo Kim edited this page Jun 1, 2018 · 22 revisions

Self-Gravity with FFT

A new Gravity class is constructed as a member of MeshBlock. The Gravity class contains the gravitational potential array phi. For the FFT gravity solver, boundary function is also separately set for phi (which is unnecessary for the multigrid gravity solver; see Self-Gravity with MultiGrid).

A new FFTGravityDriver class is constructed and solves Poisson's equation using FFT assuming periodic BCs in all directions. FFTGravityDriver::Solve() function is called in the main loop at every substeps:

  • loading density from MeshBlocks to the FFT input array
  • execute forward FFT
  • multiply kernel (-1/k^2; SetNormFactor() takes the 4*pi*G factor into account)
  • execute backward FFT
  • retrieve the real part of the FFT output to phi
  • call gravity tasklist to send/recv boundary values

The momentum source term due to the gravitational force is included in the flux calculation by adding the gravitational tensor. See athena/src/hydro/gravity_fluxes.cpp

The energy source term due to the gravitational energy flux is separately added as a source term. See athena/src/hydro/gravity_fluxes.cpp

Regression Test (Jeans problem)

> cd tst/regression/
> ./run_tests.py grav

Example

> ./configure.py --prob=poisson -fft --grav=fft
> cd bin
> ./athena -i ../inputs/hydro/athinput.poisson 
Clone this wiki locally