Commit ebc096a6 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Moved the compiled-time parameters of the EAGLE black hole model to a separate file for clarity.

parent 756d2fe4
......@@ -235,7 +235,7 @@ nobase_noinst_HEADERS = align.h approx_math.h atomic.h barrier.h cycle.h error.h
black_holes/Default/black_holes_struct.h \
black_holes/EAGLE/black_holes.h black_holes/EAGLE/black_holes_io.h \
black_holes/EAGLE/black_holes_part.h black_holes/EAGLE/black_holes_iact.h \
black_holes/EAGLE/black_holes_properties.h \
black_holes/EAGLE/black_holes_properties.h black_holes/EAGLE/black_holes_parameters.h \
black_holes/EAGLE/black_holes_struct.h \
pressure_floor/GEAR/pressure_floor.h pressure_floor/none/pressure_floor.h \
pressure_floor/GEAR/pressure_floor_iact.h pressure_floor/none/pressure_floor_iact.h \
......
......@@ -20,6 +20,7 @@
#define SWIFT_EAGLE_BH_IACT_H
/* Local includes */
#include "black_holes_parameters.h"
#include "gravity.h"
#include "hydro.h"
#include "random.h"
......@@ -146,11 +147,13 @@ runner_iact_nonsym_bh_gas_swallow(const float r2, const float *dx,
/* Start by checking the repositioning criteria */
/* Note the factor 9 is taken from EAGLE. Will be turned into a parameter */
/* (Square of) Max repositioning distance allowed based on the softening */
const float max_dist_repos2 =
kernel_gravity_softening_plummer_equivalent_inv *
kernel_gravity_softening_plummer_equivalent_inv * 9.f *
grav_props->epsilon_baryon_cur * grav_props->epsilon_baryon_cur;
kernel_gravity_softening_plummer_equivalent_inv *
const_max_repositioning_distance_ratio *
const_max_repositioning_distance_ratio * grav_props->epsilon_baryon_cur *
grav_props->epsilon_baryon_cur;
/* This gas neighbour is close enough that we can consider it's potential
for repositioning */
......@@ -250,11 +253,13 @@ runner_iact_nonsym_bh_bh_swallow(const float r2, const float *dx,
const float v2_pec = v2 * cosmo->a2_inv;
/* Note the factor 9 is taken from EAGLE. Will be turned into a parameter */
/* (Square of) Max repositioning distance allowed based on the softening */
const float max_dist_repos2 =
kernel_gravity_softening_plummer_equivalent_inv *
kernel_gravity_softening_plummer_equivalent_inv * 9.f *
grav_props->epsilon_baryon_cur * grav_props->epsilon_baryon_cur;
kernel_gravity_softening_plummer_equivalent_inv *
const_max_repositioning_distance_ratio *
const_max_repositioning_distance_ratio * grav_props->epsilon_baryon_cur *
grav_props->epsilon_baryon_cur;
/* This gas neighbour is close enough that we can consider it's potential
for repositioning */
......@@ -285,10 +290,11 @@ runner_iact_nonsym_bh_bh_swallow(const float r2, const float *dx,
h = hj;
}
/* Note the factor 9 is taken from EAGLE. Will be turned into a parameter */
/* (Square of) Max swallowing distance allowed based on the softening */
const float max_dist_merge2 =
kernel_gravity_softening_plummer_equivalent_inv *
kernel_gravity_softening_plummer_equivalent_inv * 9.f *
kernel_gravity_softening_plummer_equivalent_inv *
const_max_merging_distance_ratio * const_max_merging_distance_ratio *
grav_props->epsilon_baryon_cur * grav_props->epsilon_baryon_cur;
const float G_Newton = grav_props->G_Newton;
......
/*******************************************************************************
* This file is part of SWIFT.
* Coypright (c) 2019 Matthieu Schaller (schaller@strw.leidenuniv.nl)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser 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
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#ifndef SWIFT_EAGLE_BLACK_HOLES_PARAMETERS_H
#define SWIFT_EAGLE_BLACK_HOLES_PARAMETERS_H
/* Configuration file */
#include "config.h"
/**
* @file EAGLE/black_holes_parameters.h
* @brief Parameters of the EAGLE black holes
* model that need to be defined at compile time.
*/
/*! Maximal distance for merging particles in units of the (spline not Plummer)
* softening length. */
#define const_max_merging_distance_ratio 3.f
/*! Maximal distance for repositioning particles in units of the (spline not
* Plummer) softening length. */
#define const_max_repositioning_distance_ratio 3.f
#endif /* SWIFT_EAGLE_BLACK_HOLES_PARAMETERS_H */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment