Skip to content
Snippets Groups Projects
Commit 25d1f39a authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Merge branch '836-sphm1rt-doesn-t-compile-with-2-or-3-photon-groups' into 'master'

Resolve "SPHM1RT doesn't compile with 2 or 3 photon groups"

Closes #836

See merge request !1689
parents 3e2f88b3 7e92d79a
No related branches found
No related tags found
3 merge requests!1715Update planetary strength after planetary plus's master rebase,!1693More threapool plotting tweaks,!1689Resolve "SPHM1RT doesn't compile with 2 or 3 photon groups"
......@@ -2836,6 +2836,9 @@ case "$with_rt" in
if test "$number_group" -eq "0"; then
AC_MSG_ERROR([SPHM1RT: Cannot work with zero photon groups])
fi
if test $number_group -lt 4; then
AC_MSG_ERROR([SPHM1RT: Cannot work with < four photon groups for now])
fi
if ! test $number_group -eq $number_group; then
# abuse -eq to check whether $number_group is an integer. -eq
# only works with those.
......
......@@ -20,7 +20,8 @@ Compiling for SPHM1-RT
- To compile swift to be able to run with SPHM1-RT, you need to configure with
``--with-rt=SPHM1RT_N`` where ``N`` is the integer number of photon groups that
you intend to use in your simulation.
you intend to use in your simulation. The number of photon groups for SPHM1RT has
to be four for now (since it is hard-coded in thermo-chemistry solver).
- SPHM1-RT is compatible with any SPH scheme. You'll
need to compile using ``--with-hydro=sphenix`` or other SPH schemes, e.g. we have tested gadget2, minimal, and sphenix.
......
......@@ -32,7 +32,7 @@ GEAR_RT:
--with-riemann-solver=hllc --with-stars=GEAR --with-feedback=none --with-grackle=$GRACKLE_ROOT
SPHM1RT:
--with-rt=SPHM1RT_3 --with-hydro-dimension=1 --with-stars=basic --with-sundials=$SUNDIALS_ROOT
--with-rt=SPHM1RT_4 --with-hydro-dimension=1 --with-stars=basic --with-sundials=$SUNDIALS_ROOT
IMPORTANT: Need SUNDIALS version = 5 .
SUNDIALS_ROOT is the root directory that contains the lib and include directories, e.g. on cosma:
......
......@@ -19,7 +19,7 @@ GEAR_RT:
--with-riemann-solver=hllc --with-stars=GEAR --with-feedback=none --with-grackle=$GRACKLE_ROOT
SPHM1RT:
--with-rt=SPHM1RT_3 --with-hydro-dimension=1 --with-stars=basic --with-sundials=$SUNDIALS_ROOT
--with-rt=SPHM1RT_4 --with-hydro-dimension=1 --with-stars=basic --with-sundials=$SUNDIALS_ROOT
IMPORTANT: Need SUNDIALS version = 5 .
SUNDIALS_ROOT is the root directory that contains the lib and include directories, e.g. on cosma:
......
......@@ -115,6 +115,11 @@ def plot_photons(filename, energy_boundaries=None, flux_boundaries=None):
boxsize = meta.boxsize[0]
ngroups = int(meta.subgrid_scheme["PhotonGroupNumber"])
# Currently, SPHM1RT only works for frequency group = 4 in the code
# However, we only plot 3 frequency groups here, so
# we set ngroups = 3:
if scheme.startswith("SPH M1closure"):
ngroups = 3
for g in range(ngroups):
# workaround to access named columns data with swiftsimio visualisaiton
......
......@@ -63,9 +63,9 @@ GEARRT:
SPHM1RT:
cred: 2.99792458e10 # reduce the speed of light in the code unit
CFL_condition: 0.1 # CFL condition for RT, independent of hydro
photon_groups_Hz: [1., 2.] # Photon frequency group bin edges in Hz. Needs to be 1 less than the number of groups (N) requested during the configuration (--with-RT=SPHM1RT_N).
photon_groups_Hz: [0., 1., 2.] # Photon frequency group bin edges in Hz. Needs to be 1 less than the number of groups (N) requested during the configuration (--with-RT=SPHM1RT_N).
use_const_emission_rates: 1 # (Optional) use constant emission rates for stars as defined with star_emission_rates parameter
star_emission_rates: [1e-32, 1e-32, 1e-32] # (Optional) constant star emission rates for each photon frequency group to use if use_constant_emission_rates is set.
star_emission_rates: [1e-32,1e-32, 1e-32, 1e-32] # (Optional) constant star emission rates for each photon frequency group to use if use_constant_emission_rates is set.
stellar_spectrum_type: 0 # Which radiation spectrum to use. 0: constant from 0 until some max frequency set by stellar_spectrum_const_max_frequency_Hz. 1: blackbody spectrum.
stellar_spectrum_const_max_frequency_Hz: 1.e17 # (Conditional) if stellar_spectrum_type=0, use this maximal frequency for the constant spectrum.
skip_thermochemistry: 1 # (Optional) skip the thermochemistry. This is intended only for debugging and testing the radiation transport, as it breaks the purpose of RT.
......
......@@ -25,7 +25,7 @@ To use the GEAR RT model, compile with :
--with-rt=GEAR_1 --with-rt-riemann-solver=GLF --with-hydro-dimension=2 --with-hydro=gizmo-mfv --with-riemann-solver=hllc --with-stars=GEAR --with-feedback=none --with-grackle=$GRACKLE_ROOT
To use the SPHM1 RT model, compile with :
--with-rt=SPHM1RT_1 --with-hydro-dimension=2 --with-stars=basic --with-feedback=none --with-sundials=$SUNDIALS_ROOT
--with-rt=SPHM1RT_4 --with-hydro-dimension=2 --with-stars=basic --with-feedback=none --with-sundials=$SUNDIALS_ROOT
IMPORTANT: Need SUNDIALS version = 5 .
SUNDIALS_ROOT is the root directory that contains the lib and include directories, e.g. on cosma:
......
......@@ -61,7 +61,7 @@ https://github.com/SWIFTSIM/swiftsim-rt-tools/blob/main/additionalTests/instruct
To use the SPHM1 RT model, compile with :
for propagation test:
--with-rt=SPHM1RT_1 --with-stars=basic --with-feedback=none --with-sundials=$SUNDIALS_ROOT
--with-rt=SPHM1RT_4 --with-stars=basic --with-feedback=none --with-sundials=$SUNDIALS_ROOT
for Stromgren3D test:
--with-rt=SPHM1RT_4 --with-stars=basic --with-feedback=none --with-sundials=$SUNDIALS_ROOT
......
......@@ -61,9 +61,9 @@ GEARRT:
SPHM1RT:
cred: 2.99792458e10 # reduce the speed of light in the code unit
CFL_condition: 0.1 # CFL condition for RT, independent of hydro
photon_groups_Hz: [] # Photon frequency group bin edges in Hz. Needs to be 1 less than the number of groups (N) requested during the configuration (--with-RT=SPHM1RT_N).
photon_groups_Hz: [0.,1.,2.] # Photon frequency group bin edges in Hz. Needs to be 1 less than the number of groups (N) requested during the configuration (--with-RT=SPHM1RT_N).
use_const_emission_rates: 1 # (Optional) use constant emission rates for stars as defined with star_emission_rates_erg_LSol parameter
star_emission_rates: [382600.0] # (Optional) constant star emission rates (1e-28 Lsun) for each photon frequency group to use if use_constant_emission_rates is set.
star_emission_rates: [382600.0, 1e-32, 1e-32, 1e-32] # (Optional) constant star emission rates (1e-28 Lsun) for each photon frequency group to use if use_constant_emission_rates is set.
stellar_spectrum_type: 0 # Which radiation spectrum to use. 0: constant from 0 until some max frequency set by stellar_spectrum_const_max_frequency_Hz. 1: blackbody spectrum.
stellar_spectrum_const_max_frequency_Hz: 1.e17 # (Conditional) if stellar_spectrum_type=0, use this maximal frequency for the constant spectrum.
stars_max_timestep: 1.953125e-06 # update stars every step!
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment