The code is configured to use the specified equation with the setting
$BHAC_DIR/setup.pl -p=EQUATIONwhere EQUATION is one of the implemented physics modules (rmhd,...), see below.
$BHAC_DIR/setup.pl -p=rmhdSets up the following system of equations
with the vector of conserved variables and the sources
The parameters for this physics module are
eqpar(gamma_), eqpar(m_), eqpar(a_)
which signify the adiabatic index, the mass-scale (defaulted to 1) and the spin-parameter of the metric (defaulted to 0) respectively.
A detailed discussion of the terms in the conservation law and implementation details can be found in Porth et al. (2017).
The metric can be selected via
$BHAC_DIR/setup.pl -coord=METRICand we currently support the following spacetimes (where Identifier=METRIC in the line above)
coordpar(...)arrays. We refer to the respective implementations found in
Creating a new spacetime is very easy. In principle all BHAC needs are implementations of the subroutines
get_alpha, get_beta, get_g_component in a corresponding module
src/geometry/mod_coord_METRIC.t. For convenience, several coordinate transformations should however also be implemented in the module. See e.g. the minimal example of spherical coordinates in
src/geometry/mod_coord_sp.t for details.
A new AMRVACPHYS module may be created gradually. The first step is to create a new folder src/NEWEQ with the files amrvacphys.t and amrvacpar.t. You best copy and edit an existing AMRVACPHYS module similar to the new one. The idea is that some functionality (like any solver which requires more info than a maximal physical propagation speed, i.e. anything beyond TVDLF) should only be added at a later stage. In principle, the needed subroutines are at the minimum
subroutine conserve (define the primitive to conservative transformation) subroutine primitive (define the conservative to primitive transformation) subroutine getv (define the advection speed, to be seen in combination with getflux) subroutine getcmax (return the (minimal and) maximal physical propagation speed) subroutine getflux (define the physical fluxes for all variables) subroutine addgeometry (in case other than cartesian cases are needed: geometrical source additions)
If your equations contain more restrictions on the time step than the CFL condition, the getdt subroutine could be implemented. For geometric sources, the subroutine addgeometry should provide the geometrical source terms, while other source terms may be given in addsource.
At this point you can use the TVDLF and HLL schemes.
If you think that your new AMRVACPHYS module is of general interest, please send it to the developers, so we may actually make it part of the future release.