Git Product home page Git Product logo

ebhlight's Introduction

EBHLIGHT: GENERAL RELATIVISTIC RADIATION MAGNETOHYDRODYNAMICS WITH MONTE CARLO
                                   TRANSPORT

This software is based on

  Ryan, B. R., Dolence, J. C., & Gammie, C. F. 2015, ApJ, 807:31

As described in the LICENSE, all academic work derived from this software should
reference this publication.

Subsequent major contributors:
  Sean Ressler
  Jonah Miller

Questions, comments, and bug reports should be sent by email to Ben Ryan at
[email protected].

------------------------------- NUMERICAL SCHEME -------------------------------

BHLIGHT solves the equations of general relativistic radiation
magnetohydrodynamics in stationary spacetimes. Fluid integration is performed
with a second order shock-capturing scheme (HARM; Gammie, McKinney & Toth 2003).
Frequency-dependent radiation transport is performed with a second order Monte
Carlo scheme (GRMONTY; Dolence et al. 2009). Fluid and radiation exchange four-
momentum in an explicit first-order operator-split fashion.

The algorithm in this version of the code contains alterations from the scheme
originally published in Ryan et al. 2015:
  - 3D: The fluid sector no longer assumes symmetry in the X^3 coordinate.
  - Hamiltonian geodesic transport: Originally, the geodesic equation was solved
      in the form
        d X^{\mu} / d \lambda = K^{\mu}
        d K^{\mu} / d \lambda = \Gamma^{\mu}_{\nu \lambda} K^{\nu} K^{\lambda}.
      This ignores the conservation of K_{\mu} when the metric is symmetric in 
      X^{\mu}. To take advantage of this fact, and to avoid inconsistencies 
      between \lambda and the simulation coordinate time t, we solve the 
      geodesic equation in an alternative form:
        d X^{\mu} / d t = K^{\mu} / K^{0}
        d K_{\mu} / d t = -1/(2 g^{0 \nu} k_{\nu}) k_b k_c (d g^{bc} / dx^{\mu})
  - Variable superphoton timesteps: Originally, all superphoton geodesics were
      updated according to the shortest light crossing time for all simulation
      zones, times a Courant factor. Now, superphoton geodesic updates are
      performed only when required by the light crossing time for the zone each
      superphoton is currently in. An interpolation between current and previous
      X^{\mu} and K^{\mu} to the current fluid time t is performed to process
      interactions for all superphotons each fluid timestep to second order
      spatial accuracy.

--------------------------------- DEPENDENCIES ---------------------------------

BHLIGHT is written in C99. It requires the following libraries:
  - GSL
  - MPI
  - Parallel HDF5

Configuration and analysis scripts are written in Python 3.6, and use
matplotlib, numpy, and h5py.

If using gcc, version 4.9 or later is recommended. 

--------------------------------- CONFIGURATION --------------------------------

A custom build script is used for each problem to:
  - Set compile-time code parameters
  - Set machine-specific dependency locations
  - Collect copies of all required source files
  - Write a problem-specific makefile
  - Call make to compile the source and create an executable
  - Clean up temporary files

To run, for example, the Sod shocktube problem:
 $ cd bhlight/prob/sod
 $ python build.py
 $ ./bhlight

------------------------------------- I/O --------------------------------------

File input and output are performed with HDF5. In the active output directory,
dumps/ and restarts/ folders are created, holding dump and restart output,
respectively. Output directories may be specified at runtime by passing the flag

  -o /path/to/output/directory/

to the executable.

------------------------------- AUTOMATIC TESTING ------------------------------

Scripts are provided for automatically running and analyzing certain test
problems.

To run, for example, the Sod shocktube test:
 $ cd bhlight/test
 $ python sod.py
which will produce 'sod.png' in the current directory, showing the numerical and
analytic solutions.

------------------------------ RUNTIME PARAMETERS ------------------------------

Runtime parameters are read in from a (required) parameters file passed to the 
executable as '-p path/to/parameter/file'. A default param.dat file is generated
alongside the executable by the build routine. Note that this build routine 
overwrites param.dat each time it is called -- if you wish to preserve your 
runtime parameters, change the filename from param.dat. 

Problem-specific runtime parameters are also available. Each problem.c file 
contains a routine void set_problem_params(). To include a problem parameter
"test" (here a double, but 'int' and 'string' are also allowed) accessible from 
the parameter file, there are three steps:

1) Define your variable in problem.c in file scope (internal linkage 
recommended)

2) Call the parameter read function inside set_problem_params()

After these steps you should have

  static double test;
  void set_problem_params()
  {
    set_param("test", &test);
  }

3) Use the problem's build.py script to request your new variable as a runtime
parameter, with the line

  bhl.config.set_rparm('test', 'double', default = 100)

The 'default' parameter is optional.

ebhlight's People

Contributors

brryan avatar gnwong avatar jonahm-lanl avatar yurlungur avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.