Skip to content
Snippets Groups Projects
Commit 7b9db40e authored by Folkert Nobels's avatar Folkert Nobels
Browse files

Add km/s/Mpc constant working to the code

parent 65707be6
Branches
Tags
1 merge request!681Add example of isolated galaxy and change hernquist potential configuration
...@@ -6,7 +6,7 @@ then ...@@ -6,7 +6,7 @@ then
./getIC.sh ./getIC.sh
fi fi
../swifthern -g -G -S -t 16 isolated_galaxy.yml 2>&1 | tee output.log ../swift -g -G -S -t 16 isolated_galaxy.yml 2>&1 | tee output.log
echo "Make plots of conservation of total angular momentum" echo "Make plots of conservation of total angular momentum"
......
...@@ -158,6 +158,7 @@ void phys_const_print(const struct phys_const *internal_const) { ...@@ -158,6 +158,7 @@ void phys_const_print(const struct phys_const *internal_const) {
internal_const->const_astronomical_unit); internal_const->const_astronomical_unit);
message("%25s = %e", "Parsec", internal_const->const_parsec); message("%25s = %e", "Parsec", internal_const->const_parsec);
message("%25s = %e", "Solar mass", internal_const->const_solar_mass); message("%25s = %e", "Solar mass", internal_const->const_solar_mass);
message("%25s = %e", "km/s/Mpc", internal_const->const_reduced_hubble);
} }
/** /**
......
...@@ -156,8 +156,6 @@ external_gravity_get_potential_energy( ...@@ -156,8 +156,6 @@ external_gravity_get_potential_energy(
return -phys_const->const_newton_G * potential->mass * r_plus_alinv; return -phys_const->const_newton_G * potential->mass * r_plus_alinv;
} }
/* Standard values for a few parameters in the Hernquist potential */
#define Mpc_to_cm 3.08567781E24
/** /**
* @brief Initialises the external potential properties in the internal system * @brief Initialises the external potential properties in the internal system
...@@ -211,7 +209,7 @@ static INLINE void potential_init_backend( ...@@ -211,7 +209,7 @@ static INLINE void potential_init_backend(
* First read in the mandatory parameters in this case */ * First read in the mandatory parameters in this case */
const float G_newton = phys_const->const_newton_G; const float G_newton = phys_const->const_newton_G;
/* const float kmoversovermpc = phys_const->*/ const float kmoversoverMpc = phys_const->const_reduced_hubble;
/* Initialize the variables */ /* Initialize the variables */
double M200 = parser_get_opt_param_double( double M200 = parser_get_opt_param_double(
...@@ -223,10 +221,9 @@ static INLINE void potential_init_backend( ...@@ -223,10 +221,9 @@ static INLINE void potential_init_backend(
const double h = const double h =
parser_get_param_double(parameter_file, "HernquistPotential:h"); parser_get_param_double(parameter_file, "HernquistPotential:h");
const double H0 = h * 100 * 1e5 / Mpc_to_cm * us->UnitTime_in_cgs; const double H0 = h * kmoversoverMpc;
message("H0 = %g", H0); message("H0 = %g", H0);
/* There are 3 legit runs possible with use disk, /* There are 3 legit runs possible with use disk,
* with a known M200, V200 or R200 */ * with a known M200, V200 or R200 */
if (M200 != 0.0) { if (M200 != 0.0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment