Skip to content

Commit

Permalink
Merge pull request #87 from EwanBJones98/rates_refactor
Browse files Browse the repository at this point in the history
Calc_rates_g refactor
  • Loading branch information
brittonsmith committed Jul 13, 2021
2 parents 973c061 + 9f8d734 commit 8087b4d
Show file tree
Hide file tree
Showing 22 changed files with 2,873 additions and 1,827 deletions.
51 changes: 51 additions & 0 deletions doc/source/Parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,57 @@ For all on/off integer flags, 0 is off and 1 is on.
H\ :sub:`2`\ self-shielding computed using the ``H2_self_shielding``
flag.

.. c:var:: int h2_charge_exchange_rate
Flag which selects the formula used for calculating the ``k11`` rate
coefficient. Default: 1.

- 1: Equation 4 from `Savin et. al., 2004 <https://arxiv.org/abs/astro-ph/0404288>`_.
- 2: Table 3, Equation 11 from `Abel et. al., 1996 <https://arxiv.org/abs/astro-ph/9608040>`_.

.. c:var:: int h2_dust_rate
Flag which selects the formula used for calculating the ``h2dust`` rate
coefficient. Default: 1.

- 1: Table 1, Equation 23 from `Omukai, 2000 <https://arxiv.org/abs/astro-ph/0003212>`_.
- 2: Equation 3.8 from `Hollenbach & McKee, 1979 <https://ui.adsabs.harvard.edu/abs/1979ApJS...41..555H/abstract>`_.

.. c:var:: int h2_h_cooling_rate
Flag which selects the formula for calculating the ``GAHI`` rate coefficient.
Default: 1.

- 1: Equation based on `Lique, 2015 <https://academic.oup.com/mnras/article/453/1/810/1752438>`_.
- 2: Equation 40 with fitting coefficients found in Table 8, from `Glover & Abel, 2008 <https://arxiv.org/abs/0803.1768>`_.

Notes on setting 1:
This fit is accurate to within ~5% over the temperature range 100 < T < 5000 K. Lique (2015)
doesn't present data above 5000 K, so at higher temperatures the rate has been calculated
assuming that the de-excitation rate coefficients have the same values that they have at 5000 K.
Lique also doesn't give rates for T < 100 K, but since we don't expect H2 cooling to be important
there, it should be OK to just set the rate to zero.

.. c:var:: int collisional_excitation_rates
On/off flag to toggle calculation of rate coefficients corresponding to collisional excitations
(``ceHI``, ``ceHeI`` and ``ceHeII``). Default: 1

.. c:var:: int collisional_ionisation_rates
On/off flag to toggle calculation of rate coefficients corresponding to collisional ionisations
(``ciHeIS``, ``ciHI``, ``ciHeI`` and ``ciHeII``). Default: 1

.. c:var:: int recombination_cooling_rates
On/off flag to toggle calculation of rate coefficients corresponding to recombination cooling
(``reHII``, ``reHeII1``, ``reHeII2`` and ``reHeIII``). Default: 1

.. c:var:: int bremsstrahlung_cooling_rates
On/off flag to toggle calculation of rate coefficients corresponding to bremsstrahlung cooling
(``brem``). Default: 1

.. c:var:: int omp_nthreads
Sets the number of OpenMP threads. If not set, this will be set to
Expand Down
8 changes: 3 additions & 5 deletions src/clib/Make.config.objects
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,8 @@ OBJS_CONFIG_LIB = \
calculate_temperature.lo \
calc_temp1d_cloudy_g.lo \
calc_temp_cloudy_g.lo \
calc_rates_g.lo \
calc_tdust_1d_g.lo \
calc_tdust_3d_g.lo \
cie_thin_cooling_rate_g.lo \
colh2diss_g.lo \
coll_rates_g.lo \
cool1d_cloudy_g.lo \
cool1d_cloudy_old_tables_g.lo \
cool1d_multi_g.lo \
Expand All @@ -39,4 +35,6 @@ OBJS_CONFIG_LIB = \
set_default_chemistry_parameters.lo \
solve_chemistry.lo \
solve_rate_cool_g.lo \
update_UVbackground_rates.lo
update_UVbackground_rates.lo \
rate_functions.lo \
initialize_rates.lo
2 changes: 1 addition & 1 deletion src/clib/Make.mach.darwin
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,4 @@ MACH_LIBS = $(LOCAL_LIBS_HDF5) $(LOCAL_LIBS_MACH)

MACH_INSTALL_PREFIX = $(HOME)/grackle_install
MACH_INSTALL_LIB_DIR =
MACH_INSTALL_INCLUDE_DIR =
MACH_INSTALL_INCLUDE_DIR =
2 changes: 1 addition & 1 deletion src/clib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ install:
@(if [ ! -d $(INSTALL_INCLUDE_DIR) ]; then \
mkdir $(INSTALL_INCLUDE_DIR); \
fi)
@cp grackle.h grackle_macros.h grackle_types.h grackle_chemistry_data.h grackle.def grackle_fortran_types.def grackle_fortran_interface.def $(INSTALL_INCLUDE_DIR)
@cp grackle.h grackle_macros.h grackle_types.h grackle_chemistry_data.h grackle_rate_functions.h grackle.def grackle_fortran_types.def grackle_fortran_interface.def $(INSTALL_INCLUDE_DIR)
@(if [ ! -d $(INSTALL_LIB_DIR) ]; then \
mkdir $(INSTALL_LIB_DIR); \
fi)
Expand Down

0 comments on commit 8087b4d

Please sign in to comment.