This is a set of routines to compute the spectral energy distributions (SEDs) of radiatively inefficient accretion flows (RIAFs) around black holes. This should be useful for researchers interested in modeling the electromagnetic radiation from e.g. low-luminosity active galactic nuclei, X-ray binaries and other astrophysical applications. A RIAF consists of a geometrically thick, optically thin accretion flow filled with a very hot, two-temperature gas with the ion temperatures reaching
These routines use a semi-analytical approach to treat the radiation from the RIAF (also called sometimes advection-dominated accretion flows, ADAFs) in which the accretion flow is considered stationary assuming an α-viscosity and a pseudo-Newtonian gravity, and the radiative transfer is treated in considerable detail, taking into account synchrotron, inverse Compton scattering and bremsstrahlung processes as appropriate for hot plasmas (e.g. Yuan et al. 2005; Nemmen et al. 2006; Nemmen et al. 2014).
The bottleneck of the calculations is in solving the dynamical structure of the flow and computing the inverse Compton radiation. The radiative transfer calculations take advantage of parallel architectures with OpenMP.
Figure: The dashed line corresponds to the SED calculated for the RIAF around the black hole at the center of galaxy M87, taken from Wong et al. (2017).
- Fortran compiler (e.g., gfortran) with OpenMP support
- Perl with modules
Math::Derivative,Chart::Gnuplot - Python 3 with Matplotlib for the smoke/regression comparison checks and diagnostic plots
To install the required Perl modules use the commands:
cpan App::cpanminus
sudo cpan Math::Derivative
sudo cpan Chart::GnuplotTo compile the routines, please clone this repository in your machine and then issue these commands inside the repo folder:
make build
The compiled Fortran binaries will be placed in the bin/ directory at the repository root. The Perl wrappers are in the perl/ dir.
Convenience targets at the repository root:
make build # compile the Fortran executables via `fortran/Makefile`
make clean # remove the compiled Fortran binaries
make smoke # run the tests These routines use a semi-analytical approach to treat the radiation from the RIAF (also called sometimes advection-dominated accretion flows, ADAFs) in which the accretion flow is considered stationary assuming an α-viscosity and a pseudo-Newtonian gravity, and the radiative transfer is treated in considerable detail, taking into account synchrotron, inverse Compton scattering and bremsstrahlung processes as appropriate for hot plasmas (e.g. Nemmen et al. 2006; Nemmen et al. 2014).
Our model for the RIAF emission is described in Nemmen et al. (2014). RIAFs are usually characterized by the presence of outflows or winds, which prevent a considerable fraction of the gas that is available at large radii from being accreted onto the black hole (see Yuan & Narayan 2014 for a review). In order to take this mass-loss into account, the radial variation of the accretion rate is parameterized as $\dot{M}(R) = \dot{M}{\rm o} \left( R/R{\rm o} \right)^{s}$
(or
The parameters of the model are:
| Parameter | Description |
|---|---|
s |
power-law index for accretion rate (or density) radial variation |
| mass accretion rate at the outer radius | |
R_o |
outer radius |
M |
black hole mass |
alpha |
Shakura-Sunyaev viscosity parameter |
beta |
ratio between the gas and total pressures |
delta |
fraction of energy dissipated via turbulence that directly heats electrons |
gamma |
adiabatic index |
The units of the parameters are described in the input parameter files included in the examples folder.
- Build the Fortran binaries with
make build cdto the directory that will contain the SED- Prepare the parameter file
model.dat(you can start from the one inexamples/largeR.dat) - Run the Perl wrappers directly from this repository;
perl/run_model.pl(orperl/dyn.pl,perl/spectrum.plandperl/ssd.pl)
For the usual workflow, use the one-command runner:
cd /path/model-run
/path/perl/run_model.pl model.datThis will compute the dynamics, checks that the solution is physical, compute the spectrum, and write a SED plot named after the parameter file basename, such as model.png, in the current working directory.
- run
perl/dyn.plto compute ADAF dynamics to find physical global solution, adjusting range of eigenvaluessl0i,sl0fif required - once you get a good (physical) global solution in step 1, run
perl/spectrum.plto generate ADAF SED - optional: run
perl/ssd.plto compute truncated thin disk SED
You can pass a parameter file explicitly:
cd /path/model-run
perl /path/perl/dyn.pl model.dat
perl /path/perl/spectrum.pl model.dat
perl /path/perl/ssd.pl model.datWith no parameter-file argument, the scripts read in.dat from the working directory.
The scripts above are meant to be invoked from the working directory that contains the selected parameter file and, for spectrum.pl, the matching x.dat produced by dyn.pl.
Two examples of input parameter files are included in the examples folder:
largeR.dat: ADAF with R_out=1E4 RssmallR.dat: R_out=500 Rs
In order to compute the corresponding models, either copy one to in.dat or pass the file explicitly, for example perl perl/run_model.pl examples/largeR.dat.
For more information and useful references, refer to this document.
Test suite can be run with:
make smoke
This command rebuilds the Fortran binaries, checks representative "nice" and "bad" dynamical solutions from tests/testcases_for_code/, verifies the bundled tests/n1097/ and tests/m81/ example outputs are still parseable and physically plausible, and runs the examples/largeR.dat dynamics and spectrum workflow. It compares all 15 radial-profile columns against tests/reference/largeR_dyn.out, compares the generated spectrum against tests/reference/largeR_spectrum.out, and writes diagnostic plots to tests/artifacts/largeR_dynamics.png and tests/artifacts/largeR_spectrum.png.
You are morally obligated to cite the following papers in any scientific literature that results from use of any part of this code:
- Yuan, F.; Cui, W. & Narayan, R. An Accretion-Jet Model for Black Hole Binaries: Interpreting the Spectral and Timing Features of XTE J1118+480. ApJ, 2005 , 620 , 905
- Nemmen, R. S.; Storchi-Bergmann, T. & Eracleous, M. Spectral models for low-luminosity active galactic nuclei in LINERs: the role of advection-dominated accretion and jets MNRAS, 2014 , 438 , 2804
- Yuan, F.; Zdziarski, A. A.; Xue, Y.; Wu, X. Modeling the Hard States of XTE J1550-564 during Its 2000 Outburst. ApJ, 2007, 659, 541
- include general-purpose user scripts for plotting SEDs
- add nonthermal emission
- improve parallelization, radiative transfer