Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
708023e4
Commit
708023e4
authored
6 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Clarify the newly added reduced Hubble constant in CGS.
parent
1950ef68
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/physical_constants.c
+5
-5
5 additions, 5 deletions
src/physical_constants.c
src/physical_constants.h
+1
-1
1 addition, 1 deletion
src/physical_constants.h
src/physical_constants_cgs.h
+3
-2
3 additions, 2 deletions
src/physical_constants_cgs.h
with
9 additions
and
8 deletions
src/physical_constants.c
+
5
−
5
View file @
708023e4
...
@@ -106,11 +106,6 @@ void phys_const_init(const struct unit_system *us, struct swift_params *params,
...
@@ -106,11 +106,6 @@ void phys_const_init(const struct unit_system *us, struct swift_params *params,
internal_const
->
const_earth_mass
=
internal_const
->
const_earth_mass
=
const_earth_mass_cgs
/
const_earth_mass_cgs
/
units_general_cgs_conversion_factor
(
us
,
dimension_mass
);
units_general_cgs_conversion_factor
(
us
,
dimension_mass
);
/* Calculate the reduced hubble constant prefactor */
const
float
dimension_hubble
[
5
]
=
{
0
,
0
,
-
1
,
0
,
0
};
/* [s^-1] */
internal_const
->
const_reduced_hubble
=
const_reduced_hubble_cgs
/
units_general_cgs_conversion_factor
(
us
,
dimension_hubble
);
const
float
dimension_time
[
5
]
=
{
0
,
0
,
1
,
0
,
0
};
/* [s] */
const
float
dimension_time
[
5
]
=
{
0
,
0
,
1
,
0
,
0
};
/* [s] */
internal_const
->
const_year
=
internal_const
->
const_year
=
...
@@ -136,6 +131,11 @@ void phys_const_init(const struct unit_system *us, struct swift_params *params,
...
@@ -136,6 +131,11 @@ void phys_const_init(const struct unit_system *us, struct swift_params *params,
internal_const
->
const_primordial_He_fraction
=
internal_const
->
const_primordial_He_fraction
=
const_primordial_He_fraction_cgs
/
const_primordial_He_fraction_cgs
/
units_general_cgs_conversion_factor
(
us
,
dimension_Yp
);
units_general_cgs_conversion_factor
(
us
,
dimension_Yp
);
const
float
dimension_reduced_hubble
[
5
]
=
{
0
,
0
,
-
1
,
0
,
0
};
/* [s^-1] */
internal_const
->
const_reduced_hubble
=
const_reduced_hubble_cgs
/
units_general_cgs_conversion_factor
(
us
,
dimension_reduced_hubble
);
}
}
/**
/**
...
...
This diff is collapsed.
Click to expand it.
src/physical_constants.h
+
1
−
1
View file @
708023e4
...
@@ -97,7 +97,7 @@ struct phys_const {
...
@@ -97,7 +97,7 @@ struct phys_const {
/*! Primordial Helium fraction */
/*! Primordial Helium fraction */
double
const_primordial_He_fraction
;
double
const_primordial_He_fraction
;
/*!
Unit factor of the r
educed hubble constant */
/*!
R
educed hubble constant
units (i.e. H_0 / h)
*/
double
const_reduced_hubble
;
double
const_reduced_hubble
;
};
};
...
...
This diff is collapsed.
Click to expand it.
src/physical_constants_cgs.h
+
3
−
2
View file @
708023e4
...
@@ -98,7 +98,8 @@ const double const_T_CMB_0_cgs = 2.7255;
...
@@ -98,7 +98,8 @@ const double const_T_CMB_0_cgs = 2.7255;
/*! Primordial Helium fraction [-] */
/*! Primordial Helium fraction [-] */
const
double
const_primordial_He_fraction_cgs
=
0
.
245
;
const
double
const_primordial_He_fraction_cgs
=
0
.
245
;
/*! km/s/Mpc to cgs conversion 100 * 1e5 / 3.08567781E24 */
/*! Reduced Hubble constant units (i.e. H_0 / h == 100 km / s / Mpc in CGS)
const
double
const_reduced_hubble_cgs
=
3.240779e-18
;
* [s^-1] */
const
double
const_reduced_hubble_cgs
=
3.2407792894458e-18
;
#endif
/* SWIFT_PHYSICAL_CONSTANTS_CGS_H */
#endif
/* SWIFT_PHYSICAL_CONSTANTS_CGS_H */
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment