Skip to content

Latest commit

 

History

History
106 lines (78 loc) · 3.86 KB

File metadata and controls

106 lines (78 loc) · 3.86 KB

GRMONTY: A relativistic Monte Carlo code

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

GRMONTY is parallelized using OpenMP. This version is configured to use input from harm2d.


NEWS
There is now a GPU-accelerated version of grmonty: GPUmonty. Compatible with NVIDIA GPUs. Over 10x faster than grmonty.


Directory Structure

grmonty/
├── src/
│   ├── main.c              # Entry point
│   ├── physics/            # Radiation physics (compton, synchrotron)
│   ├── geometry/           # Geodesics, tetrads
│   └── model/              # HARM model implementation
├── include/                # Header files (decs.h, constants.h, harm_model.h)
├── data/                   # Input data files (dump019, hotcross.dat)
├── test/                   # Test reference files
├── scripts/                # Utility scripts (plspec.m, speclab.m)
├── build/                  # Build artifacts (generated)
└── makefile

Quick Start

make                                    # Build (requires OpenMP-enabled gcc)
export OMP_NUM_THREADS=8                # Set threads (bash)
./grmonty 5000000 data/dump019 4.e19    # Run

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 grmonty.spec which should be identical to test/grmonty_spec_verify.

Verification

diff grmonty.spec test/grmonty_spec_verify

Plotting

Use python and the nmmn module:

import nmmn.sed
s=nmmn.sed.SED()
s.grmonty('grmonty.spec')
plot(s.lognu, s.ll)

Old-fashioned way: Use the SM scripts in scripts/ to plot up broad-band spectral energy distribution.

Calculate spectra from other sources

Replace src/model/harm_model.c with your own source model. 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

TODO

  • make it work with HARMPI
  • GPU support: CUDA (see GPUmonty)
  • parallelize with MPI
  • add bremsstrahlung
  • nonthermal electron distribution
  • dynamic metrics as input
  • add LICENSE

References

Code and methods: Dolence et al. 2009 ApJ

Applications:

LICENSE

grmonty is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the LICENSE file or the GNU General Public License for more details.