Skip to content

Commit

Permalink
Switch both stars to Massless remnants during a CE merger, resolve #1265
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilya Mandel committed Nov 28, 2024
1 parent 6f99f8a commit 1a412ce
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 37 deletions.
16 changes: 8 additions & 8 deletions src/BaseBinaryStar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1692,10 +1692,7 @@ void BaseBinaryStar::ResolveCommonEnvelopeEvent() {
m_Flags.stellarMerger = true;
}
}

/* Ilya - should we execute the following statement if a stellar merger has occurred - we won't have stored post CEE stellar values for the stars... */
/* I suppose we could still execute line 1688 above sto set the binary values */
/* note we could have set the stellar merger flag as late as line 1692 above */

(void)PrintCommonEnvelope(); // print (log) common envelope details

}
Expand All @@ -1721,9 +1718,8 @@ void BaseBinaryStar::ResolveMainSequenceMerger() {
double tau1 = m_Star1->Tau();
double tau2 = m_Star2->Tau();

// /*ILYA*/ temporary solution, should use TAMS core mass
double TAMSCoreMass1 = 0.3 * mass1;
double TAMSCoreMass2 = 0.3 * mass2;
double TAMSCoreMass1 = m_Star1->TAMSCoreMass();
double TAMSCoreMass2 = m_Star2->TAMSCoreMass();

double q = std::min(mass1 / mass2, mass2 / mass1);
double phi = 0.3 * q / (1.0 + q) / (1.0 + q); // fraction of mass lost in merger, Wang+ 2022, https://www.nature.com/articles/s41550-021-01597-5
Expand Down Expand Up @@ -3088,8 +3084,12 @@ EVOLUTION_STATUS BaseBinaryStar::Evolve() {
if (StellarMerger() && !HasOneOf({ STELLAR_TYPE::MASSLESS_REMNANT })) { // have stars merged without merger already being resolved?
if (m_Star1->IsOneOf(MAIN_SEQUENCE) && m_Star2->IsOneOf(MAIN_SEQUENCE) && OPTIONS->EvolveMainSequenceMergers()) // yes - both MS and evolving MS merger products?
ResolveMainSequenceMerger(); // yes - handle main sequence mergers gracefully; no need to change evolution status
else
else {
// make both stars massless remnants if merging during CE, so this is recorded in the Switch log; eventually, will want to implement a more careful prescription for the merger product, perhaps allowing further evolution of the merger product
m_Star1->SwitchTo(STELLAR_TYPE::MASSLESS_REMNANT);
m_Star2->SwitchTo(STELLAR_TYPE::MASSLESS_REMNANT);
evolutionStatus = EVOLUTION_STATUS::STELLAR_MERGER; // no - for now, stop evolution
}
}
else if (HasStarsTouching()) { // binary components touching? (should usually be avoided as MT or CE or merger should happen prior to this)
evolutionStatus = EVOLUTION_STATUS::STARS_TOUCHING; // yes - stop evolution
Expand Down
2 changes: 2 additions & 0 deletions src/BaseStar.h
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,8 @@ class BaseStar {
void StashSupernovaDetails(const STELLAR_TYPE p_StellarType,
const SSE_SN_RECORD_TYPE p_RecordType = SSE_SN_RECORD_TYPE::DEFAULT) { LOGGING->StashSSESupernovaDetails(this, p_StellarType, p_RecordType); }

virtual double TAMSCoreMass() const { return 0.0; } // except MS stars

virtual void UpdateAfterMerger(double p_Mass, double p_HydrogenMass) { } // Default is NO-OP
virtual void UpdateAgeAfterMassLoss() { } // Default is NO-OP

Expand Down
1 change: 1 addition & 0 deletions src/HG.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ class HG: virtual public BaseStar, public GiantBranch {
bool ShouldEvolveOnPhase() const { return (utils::Compare(m_Age, m_Timescales[static_cast<int>(TIMESCALE::tBGB)]) < 0); } // Evolve on HG phase if age < Base Giant Branch timescale
bool ShouldSkipPhase() const { return false; } // Never skip HG phase

double TAMSCoreMass() const { return 0.0; }
void UpdateAfterMerger(double p_Mass, double p_HydrogenMass) { } // Nothing to do for stars beyond the Main Sequence for now
void UpdateAgeAfterMassLoss(); // Per Hurley et al. 2000, section 7.1

Expand Down
54 changes: 26 additions & 28 deletions src/MainSequence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -636,20 +636,7 @@ double MainSequence::CalculateConvectiveCoreRadius() const {
* @return Mass of convective core in Msol
*/
double MainSequence::CalculateConvectiveCoreMass() const {

// We need TAMSCoreMass, which is just the core mass at the start of the HG phase.
// Since we are on the main sequence here, we can clone this object as an HG object
// and, as long as it is initialised (to correctly set Tau to 0.0 on the HG phase),
// we can query the cloned object for its core mass.
//
// The clone should not evolve, and so should not log anything, but to be sure the
// clone does not participate in logging, we set its persistence to EPHEMERAL.

HG *clone = HG::Clone(static_cast<HG&>(const_cast<MainSequence&>(*this)), OBJECT_PERSISTENCE::EPHEMERAL);
double TAMSCoreMass = clone->CoreMass(); // get core mass from clone
delete clone; clone = nullptr; // return the memory allocated for the clone

double finalConvectiveCoreMass = TAMSCoreMass;
double finalConvectiveCoreMass = TAMSCoreMass(); // core mass at TAMS
double initialConvectiveCoreMass = finalConvectiveCoreMass / 0.6;
return (initialConvectiveCoreMass - m_Tau * (initialConvectiveCoreMass - finalConvectiveCoreMass));
}
Expand Down Expand Up @@ -849,23 +836,34 @@ STELLAR_TYPE MainSequence::ResolveEnvelopeLoss(bool p_Force) {
*/
void MainSequence::UpdateMinimumCoreMass() {
if (OPTIONS->RetainCoreMassDuringCaseAMassTransfer()) {

// We need TAMSCoreMass, which is just the core mass at the start of the HG phase.
// Since we are on the main sequence here, we can clone this object as an HG object
// and, as long as it is initialised (to correctly set Tau to 0.0 on the HG phase),
// we can query the cloned object for its core mass.
//
// The clone should not evolve, and so should not log anything, but to be sure the
// clone does not participate in logging, we set its persistence to EPHEMERAL.

HG *clone = HG::Clone(static_cast<HG&>(const_cast<MainSequence&>(*this)), OBJECT_PERSISTENCE::EPHEMERAL);
double TAMSCoreMass = clone->CoreMass(); // get core mass from clone
delete clone; clone = nullptr; // return the memory allocated for the clone

m_MinimumCoreMass = std::max(m_MinimumCoreMass, CalculateTauOnPhase() * TAMSCoreMass); // update minimum core mass
m_MinimumCoreMass = std::max(m_MinimumCoreMass, CalculateTauOnPhase() * TAMSCoreMass()); // update minimum core mass
}
}

/*
* Return the expected core mass at terminal age main sequence, i.e., at the start of the HG phase
*
* double TAMSCoreMass() const
*
*
* @return TAMS core Mass (Msol)
*
*/
double MainSequence::TAMSCoreMass() const {
// Since we are on the main sequence here, we can clone this object as an HG object
// and, as long as it is initialised (to correctly set Tau to 0.0 on the HG phase),
// we can query the cloned object for its core mass.
//
// The clone should not evolve, and so should not log anything, but to be sure the
// clone does not participate in logging, we set its persistence to EPHEMERAL.

HG *clone = HG::Clone(static_cast<HG&>(const_cast<MainSequence&>(*this)), OBJECT_PERSISTENCE::EPHEMERAL);
double TAMSCoreMass = clone->CoreMass(); // get core mass from clone
delete clone; clone = nullptr; // return the memory allocated for the clone

return TAMSCoreMass;
}


/*
* Sets the mass and age of a merge product of two main sequence stars
Expand Down
2 changes: 2 additions & 0 deletions src/MainSequence.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ class MainSequence: virtual public BaseStar {
STELLAR_TYPE ResolveEnvelopeLoss(bool p_Force = false);

bool ShouldEvolveOnPhase() const { return (m_Age < m_Timescales[static_cast<int>(TIMESCALE::tMS)]); } // Evolve on MS phase if age in MS timescale

double TAMSCoreMass() const;

void UpdateInitialMass() { m_Mass0 = m_Mass; } // Per Hurley et al. 2000, section 7.1

Expand Down
2 changes: 2 additions & 0 deletions src/Star.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,8 @@ class Star {


STELLAR_TYPE SwitchTo(const STELLAR_TYPE p_StellarType, bool p_SetInitialType = false);

double TAMSCoreMass() const { return m_Star->TAMSCoreMass(); }

void UpdateAfterMerger(double p_Mass, double p_HydrogenMass) { m_Star->UpdateAfterMerger(p_Mass, p_HydrogenMass); }
void UpdateAgeAfterMassLoss() { m_Star->UpdateAgeAfterMassLoss(); }
Expand Down
4 changes: 3 additions & 1 deletion src/changelog.h
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,9 @@
// - Fixed bugs in vector3d related to indexing and rotation
// - Added tweak for circular systems at first SN, to fix the x-axis along the separation vector
// 03.09.03 IM - Nov 28, 2024 - Enhancement, defect repair:
// - Delay changing stellar types until after checking for whether remnant cores would touch in a common enevelope, use core radii instead (fix to #1286)
// - Delay changing stellar types until after checking for whether remnant cores would touch in a common enevelope, use core radii instead (partial fix to #1286)
// - Define a new function MainSequence::TAMSCoreMass(); use it for determining the amount of He in a star during MS mergers
// - Switch both stars to Massless remnants during a CE merger, resolve #1265
const std::string VERSION_STRING = "03.09.03";

# endif // __changelog_h__

0 comments on commit 1a412ce

Please sign in to comment.