Skip to content

Computes spectral energy distributions from radiatively inefficient accretion flows around black holes. GPU-accelerated, CUDA (alpha, unstable)

License

Notifications You must be signed in to change notification settings

black-hole-group/gpumonty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GRMONTY: A relativistic Monte Carlo code

Computes spectral energy distributions (SEDs) from numerical simulations of radiatively inefficient accretion flows around black holes. This version of GRMONTY is configured to use input files from the HARM code. It assumes that the source is a plasma near a black hole described by Kerr-Schild coordinates that radiates via thermal synchrotron and inverse compton scattering.

GRMONTY is parallelized using OpenMP. For the alpha GPU version gpumonty, check out the GPU documentation. This version is configured to use input from harm2d.

Pros:

  • Deals with whatever curved spacetime as long as you provide the metric data
  • Properly compute inverse Compton scattering in the Klein-Nishina regime

Cons:

  • Only supports HARM data
  • Only useful for post-processing radiative transfer (i.e. neglects momentum effect of photons on gas), thus only supports optically-thin flows
  • Currently only supports multi-core CPUs and is inefficiently parallelized (see GPU acceleration)
  • Only handles a thermal electron distribution

Based on Dolence et al. 2009 ApJ. Originally downloaded from Astrophysical Code Library @ UI.

Quick start

Compile (requires OpenMP enabled gcc):

make

Set number of threads (csh):

setenv OMP_NUM_THREADS 8

If using bash:

export OMP_NUM_THREADS=8

Run the code on the supplied harm output file:

./bin/grmonty 5000000 dump1000 4.e19

Arguments are:

  • estimate of photon number (actual number is probabilistic due to scattering)
  • harm dump file for model
  • mass unit (few x 10^19 is appropriate for Sgr A*)

This will output spectrum to spectrum.dat.

Plotting

Use python and the nmmn module:

from  nmmn import plots
plots.plot('grmonty.spec')

Running Tests

./test/tester.py

See ./test/README.md for test details.

Calculate spectra from other sources

Replace harm_model.c with your own source model. Begin by modifying harm_model.c. You must supply

init_model
make_super_photon
bias_func
get_fluid_params
report_spectrum
stop_criterion
record_criterion

gcon_func
gcov_func
get_connection

in the model file.

Branch structure

See branches.md.

References

Citation

You are morally obligated to cite the following paper in any scientific literature that results from use of any part of GRMONTY:

Dolence, J.C., Gammie, C.F., Mo'scibrodzka, M., & Leung, P.-K. 2009, Astrophysical Journal Supplement, 184, 387

If you use one of the alpha versions contained in this repo, for reproducibility purposes please cite this repo and the corresponding commit you use.

TODO

  • make it work with HARMPI
  • GPU support: CUDA, OpenACC (work in progress — broken but could be fun to fix)
  • add bremsstrahlung
  • nonthermal electron distribution
  • dynamic metrics as input
  • add LICENSE

About

Computes spectral energy distributions from radiatively inefficient accretion flows around black holes. GPU-accelerated, CUDA (alpha, unstable)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages