Skip to content

Commit 67d0727

Browse files
Moving CalculateMassAcceptanceRate to WhiteDwarfs for COWDs and ONeWDs
1 parent 87ba9bc commit 67d0727

File tree

7 files changed

+38
-81
lines changed

7 files changed

+38
-81
lines changed

src/COWD.cpp

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,5 @@
11
#include "COWD.h"
22

3-
/* For COWDs, calculate:
4-
*
5-
* (a) the maximum mass acceptance rate of this star, as the accretor, during mass transfer, and
6-
* (b) the retention efficiency parameter
7-
*
8-
*
9-
* For a given mass transfer rate, this function computes the amount of mass a WD would retain after
10-
* flashes, as given by appendix B of Claeys+ 2014.
11-
* https://ui.adsabs.harvard.edu/abs/2014A%26A...563A..83C/abstract
12-
*
13-
*
14-
* DBL_DBL CalculateMassAcceptanceRate(const double p_DonorMassRate, const bool p_IsHeRich)
15-
*
16-
* @param [IN] p_DonorMassRate Mass transfer rate from the donor
17-
* @param [IN] p_IsHeRich Material is He-rich or not
18-
* @return Tuple containing the Maximum Mass Acceptance Rate (Msun/yr) and Retention Efficiency Parameter
19-
*/
20-
DBL_DBL COWD::CalculateMassAcceptanceRate(const double p_DonorMassRate, const bool p_IsHeRich) {
21-
22-
m_AccretionRegime = DetermineAccretionRegime(p_DonorMassRate, p_IsHeRich);
23-
24-
double acceptanceRate = 0.0; // acceptance mass rate - default = 0.0
25-
double fractionAccreted = 0.0; // accretion fraction - default = 0.0
26-
27-
acceptanceRate = p_DonorMassRate * CalculateEtaHe(p_DonorMassRate);
28-
if (!p_IsHeRich) acceptanceRate *= CalculateEtaH(p_DonorMassRate);
29-
30-
fractionAccreted = acceptanceRate / p_DonorMassRate;
31-
32-
return std::make_tuple(acceptanceRate, fractionAccreted);
33-
}
34-
35-
363
/*
374
* Specifies next stage, if the star changes its phase.
385
*

src/COWD.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,7 @@ class COWD: virtual public BaseStar, public WhiteDwarfs {
6767
const double p_Metallicity) const { return CalculateLuminosityOnPhase_Static(p_Mass, p_Time, p_Metallicity); }
6868
double CalculateLuminosityOnPhase() const { return CalculateLuminosityOnPhase(m_Mass, m_Age, m_Metallicity); } // Use class member variables
6969

70-
DBL_DBL CalculateMassAcceptanceRate(const double p_DonorMassRate,
71-
const bool p_IsHeRich);
72-
DBL_DBL CalculateMassAcceptanceRate(const double p_DonorMassRate,
73-
const double p_AccretorMassRate,
74-
const bool p_IsHeRich) { return CalculateMassAcceptanceRate(p_DonorMassRate, p_IsHeRich); } // Ignore the input accretion rate for WDs
75-
70+
7671
STELLAR_TYPE EvolveToNextPhase();
7772
bool IsSupernova() const { return m_HeShellDetonation || IsMassAboveChandrasekhar(); };
7873
bool ShouldEvolveOnPhase() const { return m_OffCenterIgnition ? false : !IsSupernova(); }; // From https://ui.adsabs.harvard.edu/abs/2017MNRAS.472.1593W/abstract around the end of section 3.2. Also, allows SN.

src/NS.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ class NS: virtual public BaseStar, public Remnants {
101101

102102
double CalculateBirthMagneticField();
103103
double CalculateBirthSpinPeriod();
104+
105+
double CalculateCriticalMassRatioHurleyHjellmingWebbink() const { return 0.0; }
104106

105107
static double CalculateLuminosityOnPhase_Static(const double p_Mass, const double p_Time);
106108
double CalculateLuminosityOnPhase() const { return CalculateLuminosityOnPhase_Static(m_Mass, m_Age); } // Use class member variables

src/ONeWD.cpp

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,5 @@
11
#include "ONeWD.h"
22

3-
/* For ONeWDs, calculate:
4-
*
5-
* (a) the maximum mass acceptance rate of this star, as the accretor, during mass transfer, and
6-
* (b) the retention efficiency parameter
7-
*
8-
* This currently uses the same prescription as for COWDs, but we may consider different
9-
* prescriptions in the future.
10-
*
11-
* For a given mass transfer rate, this function computes the amount of mass a WD would retain after
12-
* flashes, as given by appendix B of Claeys+ 2014.
13-
* https://ui.adsabs.harvard.edu/abs/2014A%26A...563A..83C/abstract
14-
*
15-
*
16-
* DBL_DBL CalculateMassAcceptanceRate(const double p_DonorMassRate, const bool p_IsHeRich)
17-
*
18-
* @param [IN] p_DonorMassRate Mass transfer rate from the donor (Msun/Myr)
19-
* @param [IN] p_IsHeRich Material is He-rich or not
20-
* @return Tuple containing the Maximum Mass Acceptance Rate (Msun/yr) and Retention Efficiency Parameter
21-
*/
22-
DBL_DBL ONeWD::CalculateMassAcceptanceRate(const double p_DonorMassRate, const bool p_IsHeRich) {
23-
24-
m_AccretionRegime = DetermineAccretionRegime(p_DonorMassRate, p_IsHeRich);
25-
26-
double acceptanceRate = 0.0; // acceptance mass rate - default = 0.0
27-
double fractionAccreted = 0.0; // accretion fraction - default = 0.0
28-
29-
acceptanceRate = p_DonorMassRate * CalculateEtaHe(p_DonorMassRate);
30-
if (!p_IsHeRich) acceptanceRate *= CalculateEtaH(p_DonorMassRate);
31-
32-
fractionAccreted = acceptanceRate / p_DonorMassRate;
33-
34-
return std::make_tuple(acceptanceRate, fractionAccreted);
35-
}
36-
373
/*
384
* Allow evolution to a new phase (currently, only SN)
395
*

src/ONeWD.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,7 @@ class ONeWD: virtual public BaseStar, public WhiteDwarfs {
7070

7171
double CalculateLuminosityOnPhase() const { return CalculateLuminosityOnPhase(m_Mass, m_Age, m_Metallicity); } // Use class member variables
7272

73-
DBL_DBL CalculateMassAcceptanceRate(const double p_DonorMassRate,
74-
const bool p_IsHeRich);
75-
DBL_DBL CalculateMassAcceptanceRate(const double p_DonorMassRate,
76-
const double p_AccretorMassRate,
77-
const bool p_IsHeRich) { return CalculateMassAcceptanceRate(p_DonorMassRate, p_IsHeRich); } // Ignore the input accretion rate for WDs
78-
73+
7974
STELLAR_TYPE EvolveToNextPhase();
8075
bool IsSupernova() const;
8176
bool ShouldEvolveOnPhase() const;

src/WhiteDwarfs.cpp

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,38 @@ double WhiteDwarfs::CalculateLuminosityOnPhase_Static(const double p_Mass, const
140140
return (635.0 * p_Mass * PPOW(p_Metallicity, 0.4)) / PPOW(p_BaryonNumber * (p_Time + 0.1), 1.4);
141141
}
142142

143+
/* Calculate:
144+
*
145+
* (a) the maximum mass acceptance rate of this star, as the accretor, during mass transfer, and
146+
* (b) the retention efficiency parameter
147+
*
148+
* Currently used for COWDs and ONeWDs
149+
*
150+
* For a given mass transfer rate, this function computes the amount of mass a WD would retain after
151+
* flashes, as given by appendix B of Claeys+ 2014.
152+
* https://ui.adsabs.harvard.edu/abs/2014A%26A...563A..83C/abstract
153+
*
154+
*
155+
* DBL_DBL CalculateMassAcceptanceRate(const double p_DonorMassRate, const bool p_IsHeRich)
156+
*
157+
* @param [IN] p_DonorMassRate Mass transfer rate from the donor
158+
* @param [IN] p_IsHeRich Material is He-rich or not
159+
* @return Tuple containing the Maximum Mass Acceptance Rate (Msun/yr) and Retention Efficiency Parameter
160+
*/
161+
DBL_DBL WhiteDwarfs::CalculateMassAcceptanceRate(const double p_DonorMassRate, const bool p_IsHeRich) {
162+
163+
m_AccretionRegime = DetermineAccretionRegime(p_DonorMassRate, p_IsHeRich);
164+
165+
double acceptanceRate = 0.0; // acceptance mass rate - default = 0.0
166+
double fractionAccreted = 0.0; // accretion fraction - default = 0.0
167+
168+
acceptanceRate = p_DonorMassRate * CalculateEtaHe(p_DonorMassRate);
169+
if (!p_IsHeRich) acceptanceRate *= CalculateEtaH(p_DonorMassRate);
170+
171+
fractionAccreted = acceptanceRate / p_DonorMassRate;
172+
173+
return std::make_tuple(acceptanceRate, fractionAccreted);
174+
}
143175

144176
/*
145177
* Calculate the radius of a white dwarf - good for all types of WD

src/WhiteDwarfs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ class WhiteDwarfs: virtual public BaseStar, public Remnants {
7676

7777
double Calculatel0Ritter() const { return (m_Metallicity > 0.01) ? L0_RITTER_HIGH_Z : L0_RITTER_LOW_Z; }
7878

79-
virtual DBL_DBL CalculateMassAcceptanceRate(const double p_DonorMassRate,
80-
const bool p_IsHeRich) { return std::make_tuple(0.0, 0.0); }
79+
DBL_DBL CalculateMassAcceptanceRate(const double p_DonorMassRate,
80+
const bool p_IsHeRich);
8181
DBL_DBL CalculateMassAcceptanceRate(const double p_DonorMassRate,
8282
const double p_AccretorMassRate,
8383
const bool p_IsHeRich) { return CalculateMassAcceptanceRate(p_DonorMassRate, p_IsHeRich); }

0 commit comments

Comments
 (0)