Skip to content

Commit a0f1b2b

Browse files
author
Ilya Mandel
committed
Cleaned up code
1 parent 5bbe932 commit a0f1b2b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/BaseBinaryStar.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2063,16 +2063,17 @@ void BaseBinaryStar::CalculateMassTransfer(const double p_Dt) {
20632063

20642064
std::tie(std::ignore, m_FractionAccreted) = m_Accretor->CalculateMassAcceptanceRate(donorMassLossRateThermal,
20652065
m_Accretor->CalculateThermalMassAcceptanceRate(accretorRLradius), donorIsHeRich);
2066-
std::cout<<"donor mass"<<m_Donor->Mass()<<"donorMassLossRateThermal"<<donorMassLossRateThermal<<"acc"<<m_Accretor->CalculateThermalMassAcceptanceRate(accretorRLradius)<<"m_Frac"<<m_FractionAccreted<<std::endl;
20672066
double massDiffDonor = MassLossToFitInsideRocheLobe(this, m_Donor, m_Accretor, m_FractionAccreted, 0.0); // use root solver to determine how much mass should be lost from the donor to allow it to fit within the Roche lobe, fixed beta
2067+
double betaThermal = m_FractionAccreted; // may need these later if the mass transfer proceeds on a thermal timescale, so we store them to avoid recomputing
2068+
double massDiffDonorThermal = massDiffDonor;
20682069

20692070
// can the mass transfer happen on a nuclear timescale?
20702071
if (m_Donor->IsOneOf(NON_COMPACT_OBJECTS)) {
20712072
// if MT_ACCRETION_EFFICIENCY_PRESCRIPTION::FIXED_FRACTION, then CalculateMassAcceptanceRate() already computed the correct m_FractionAccreted and massDiffDonor (no difference between nuclear and thermal timescale MT)
20722073
if (OPTIONS->MassTransferAccretionEfficiencyPrescription() == MT_ACCRETION_EFFICIENCY_PRESCRIPTION::THERMALLY_LIMITED) {
20732074
// technically, we do not know how much mass the accretor should gain until we do the calculation,
20742075
// which impacts the RL size, so we will check whether a nuclear timescale MT was feasible later
2075-
massDiffDonor = MassLossToFitInsideRocheLobe(this, m_Donor, m_Accretor, -1.0, m_Dt); // use root solver to determine how much mass should be lost from the donor to allow it to fit within the Roche lobe, estimating accretion efficiency based on a mass donation rate of massDiffDonor/m_Dt for self-consistency
2076+
massDiffDonor = MassLossToFitInsideRocheLobe(this, m_Donor, m_Accretor, -1.0, m_Dt); // use root solver to determine how much mass should be lost from the donor to allow it to fit within the Roche lobe, estimating accretion efficiency based on a mass donation rate of massDiffDonor/m_Dt for self-consistency
20762077
std::tie(std::ignore, m_FractionAccreted) = m_Accretor->CalculateMassAcceptanceRate(massDiffDonor/m_Dt,
20772078
m_Accretor->CalculateThermalMassAcceptanceRate(accretorRLradius), donorIsHeRich);
20782079
}
@@ -2087,12 +2088,13 @@ void BaseBinaryStar::CalculateMassTransfer(const double p_Dt) {
20872088
m_ZetaLobe = zetaLobe;
20882089
}
20892090
}
2090-
if (m_MassTransferTimescale != MT_TIMESCALE::NUCLEAR) { // thermal timescale mass transfer (we will check for dynamically unstable / CE mass transfer later); m_FractionAccreted and massDiffDonor already computed for this case
2091+
if (m_MassTransferTimescale != MT_TIMESCALE::NUCLEAR) { // thermal timescale mass transfer (we will check for dynamically unstable / CE mass transfer later)
2092+
m_FractionAccreted = betaThermal; // m_FractionAccreted and massDiffDonor already computed for the thermal mass transfer case
2093+
massDiffDonor = massDiffDonorThermal;
20912094
m_ZetaLobe = CalculateZetaRocheLobe(jLoss, m_FractionAccreted);
20922095
m_ZetaStar = m_Donor->CalculateZetaAdiabatic();
20932096
m_MassLossRateInRLOF = donorMassLossRateThermal;
20942097
m_MassTransferTimescale = MT_TIMESCALE::THERMAL;
2095-
std::cout<<"massDiffDonor"<<massDiffDonor<<"m_FractionAccreted"<<m_FractionAccreted<<std::endl;
20962098
}
20972099

20982100
double aInitial = m_SemiMajorAxis; // semi-major axis in default units, AU, current timestep

0 commit comments

Comments
 (0)