Skip to content

Commit 7833145

Browse files
committed
Fixing metallicity discrepancy
1 parent 323b990 commit 7833145

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/Options.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,8 +439,8 @@ void Options::OptionValues::Initialise() {
439439

440440

441441
// Metallicity options
442-
m_Metallicity = 0.0142; // Solar metallicity Asplund+2010 (note that ZSOL is something different)
443-
m_MetallicityDistribution.type = METALLICITY_DISTRIBUTION::ZSOLAR;
442+
m_Metallicity = ZSOL_ASPLUND;
443+
m_MetallicityDistribution.type = METALLICITY_DISTRIBUTION::ZSOLAR;
444444
m_MetallicityDistribution.typeString = METALLICITY_DISTRIBUTION_LABEL.at(m_MetallicityDistribution.type);
445445
m_MetallicityDistributionMin = MINIMUM_METALLICITY;
446446
m_MetallicityDistributionMax = MAXIMUM_METALLICITY;

src/constants.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@ constexpr double G_SN = G * 1.0E-9 / KG_TO_MSO
225225
constexpr double G_SOLAR_YEAR = 3.14E7; // Gravitational constant in Lsol Rsol yr Msol^-2 for calculating photon tiring limit
226226

227227
constexpr double RSOL = 6.957E8; // Solar Radius (in m)
228-
constexpr double ZSOL = 0.02; // Solar Metallicity
228+
constexpr double ZSOL = 0.02; // Solar Metallicity used in scalings
229+
constexpr double ZSOL_ASPLUND = 0.0142; // Solar Metallicity (Asplund+ 2010) used in initial condition
229230
constexpr double TSOL = 5778.0; // Solar Temperature in kelvin
230231

231232
constexpr double AU = 149597870700.0; // 1 AU (Astronomical Unit) in metres

src/utils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1083,7 +1083,7 @@ namespace utils {
10831083
switch (p_Zdist) { // which distribution?
10841084

10851085
case METALLICITY_DISTRIBUTION::ZSOLAR: // ZSOLAR - all systems have Z = ZSOLAR
1086-
metallicity = ZSOL;
1086+
metallicity = ZSOL_ASPLUND;
10871087
break;
10881088

10891089
case METALLICITY_DISTRIBUTION::LOGUNIFORM: { // LOGUNIFORM - sample Z uniformly in the log

0 commit comments

Comments
 (0)