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

Use the same definition of G, Mpc and M_sun in all the examples.

parent 8810779b
# Define the system of units to use internally.
InternalUnitSystem:
UnitMass_in_cgs: 1.98848e39 # 10^6 solar masses
UnitLength_in_cgs: 3.0856776e21 # Kiloparsecs
UnitLength_in_cgs: 3.08567758e21 # Kiloparsecs
UnitVelocity_in_cgs: 1e5 # Kilometres per second
UnitCurrent_in_cgs: 1 # Amperes
UnitTemp_in_cgs: 1 # Kelvin
......
# Define the system of units to use internally.
InternalUnitSystem:
UnitMass_in_cgs: 1.98848e33 # M_sun
UnitLength_in_cgs: 3.0856776e21 # kpc
UnitLength_in_cgs: 3.08567758e21 # kpc
UnitVelocity_in_cgs: 1e5 # km/s
UnitCurrent_in_cgs: 1 # Amperes
UnitTemp_in_cgs: 1 # Kelvin
......
......@@ -32,9 +32,8 @@ import random
# physical constants in cgs
NEWTON_GRAVITY_CGS = 6.67408e-8
SOLAR_MASS_IN_CGS = 1.98848e33
PARSEC_IN_CGS = 3.0856776e18
PROTON_MASS_IN_CGS = 1.672621898e24
YEAR_IN_CGS = 3.154e+7
PARSEC_IN_CGS = 3.08567758e18
YEAR_IN_CGS = 3.15569252e7
# choice of units
const_unit_length_in_cgs = (1000*PARSEC_IN_CGS)
......
......@@ -109,7 +109,7 @@ def rotation_velocity_at_r(r, params):
)
central_mass = float(params["PointMassPotential:mass"])
G = 6.674e-8
G = 6.67408e-8
v = np.sqrt( G * central_mass / r)
......
# Define the system of units to use internally.
InternalUnitSystem:
UnitMass_in_cgs: 1.989e43 # 10^10 M_sun in grams
UnitLength_in_cgs: 3.085678e24 # Mpc in centimeters
UnitMass_in_cgs: 1.98848e43 # 10^10 M_sun in grams
UnitLength_in_cgs: 3.08567758e24 # Mpc in centimeters
UnitVelocity_in_cgs: 1e5 # km/s in centimeters per second
UnitCurrent_in_cgs: 1 # Amperes
UnitTemp_in_cgs: 1 # Kelvin
......
# Define the system of units to use internally.
InternalUnitSystem:
UnitMass_in_cgs: 1.989e43 # 10^10 M_su in grams
UnitLength_in_cgs: 3.085678e24 # Mpc in centimeters
UnitMass_in_cgs: 1.98848e43 # 10^10 M_sun in grams
UnitLength_in_cgs: 3.08567758e24 # Mpc in centimeters
UnitVelocity_in_cgs: 1e5 # km/s in centimeters per second
UnitCurrent_in_cgs: 1 # Amperes
UnitTemp_in_cgs: 1 # Kelvin
Cosmology:
Omega_m: 1.
Omega_lambda: 0.
Omega_b: 1.
h: 1.
a_begin: 0.00990099
a_end: 1.0
# Parameters governing the time integration
TimeIntegration:
dt_min: 1e-7 # The minimal time-step size of the simulation (in internal units).
......@@ -20,11 +28,11 @@ Snapshots:
# Parameters governing the conserved quantities statistics
Statistics:
delta_time: 10. # Time between statistics output
delta_time: 1.02 # Time between statistics output
# Parameters for the hydrodynamics scheme
SPH:
resolution_eta: 1.2348 # Target smoothing length in units of the mean inter-particle separation (1.2348 == 48Ngbs with the cubic spline kernel).
resolution_eta: 1.2348 # Target smoothing length in units of the mean inter-particle separation
CFL_condition: 0.1 # Courant-Friedrich-Levy condition for time integration.
# Parameters related to the initial conditions
......@@ -36,14 +44,6 @@ Scheduler:
cell_split_size: 50
tasks_per_cell: 125
Cosmology:
Omega_m: 1.
Omega_lambda: 0.
Omega_b: 1.
h: 1.
a_begin: 0.00990099
a_end: 1.0
Gravity:
mesh_side_length: 16
eta: 0.025
......
......@@ -170,7 +170,7 @@ __attribute__((always_inline)) INLINE static void gravity_init_gpart(
* @param gp The particle to act upon
* @param const_G Newton's constant in internal units.
* @param potential_normalisation Term to be added to all the particles.
* @param Are we using periodic BCs?
* @param periodic Are we using periodic BCs?
*/
__attribute__((always_inline)) INLINE static void gravity_end_force(
struct gpart* gp, float const_G, const float potential_normalisation,
......
......@@ -93,6 +93,6 @@ const double const_solar_mass_cgs = 1.98848e33;
const double const_earth_mass_cgs = 5.9724e27;
/*! Temperature of the CMB at present day [K] */
const double const_T_CMB_0_cgs = 2.72556;
const double const_T_CMB_0_cgs = 2.7255;
#endif /* SWIFT_PHYSICAL_CONSTANTS_CGS_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