Skip to content

Commit

Permalink
Merge pull request TeamCOMPAS#1292 from brcekadam/ShikauchiCoreMassPr…
Browse files Browse the repository at this point in the history
…escription

Implementing the Shikauchi+ (2024) core mass prescription for main sequence stars
  • Loading branch information
jeffriley authored Jan 16, 2025
2 parents e512bd8 + 13c10b2 commit efbcf46
Show file tree
Hide file tree
Showing 20 changed files with 530 additions and 102 deletions.
1 change: 1 addition & 0 deletions compas_python_utils/preprocessing/compasConfigDefault.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ stringChoices:
# --initial-mass-function: 'KROUPA' # Default: 'KROUPA' # Options: ['KROUPA','UNIFORM','POWERLAW','SALPETER']
# --LBV-mass-loss-prescription: 'HURLEY_ADD' # Default: 'HURLEY_ADD' # Options: ['BELCZYNSKI','HURLEY','HURLEY_ADD','ZERO','NONE']
# --luminous-blue-variable-prescription: 'HURLEY_ADD' # Default: 'HURLEY_ADD' # Options: ['BELCZYNSKI','HURLEY','HURLEY_ADD','ZERO','NONE']
# --main-sequence-core-mass-prescription: 'MANDEL' # Default: 'MANDEL' # Options: ['SHIKAUCHI','MANDEL','ZERO']
# --mass-loss-prescription: 'MERRITT2024' # Default: 'MERRITT2024' # Options: ['MERRITT2024','BELCZYNSKI2010','HURLEY','ZERO','NONE']
# --OB-mass-loss: 'VINK2021' # Default: 'VINK2021' # Options: ['KRTICKA2018','BJORKLUND2022','VINK2021','VINK2001','ZERO','NONE']
# --OB-mass-loss-prescription: 'VINK2021' # Default: 'VINK2021' # Options: ['KRTICKA2018','BJORKLUND2022','VINK2021','VINK2001','ZERO','NONE']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,15 @@ Default = 4.2

:ref:`Back to Top <options-props-top>`

**--main-sequence-core-mass-prescription** |br|
Main sequence core mass prescription. |br|
Options: {ZERO, MANDEL, SHIKAUCHI} |br|
``ZERO`` : No core mass treatment, set to zero |br|
``MANDEL`` : The core following case A mass transfer is set equal to the expected core mass of a newly formed HG star
with mass equal to that of the donor, scaled by the fraction of the donor's MS lifetime at mass transfer |br|
``SHIKAUCHI`` : Core mass according to Shikauchi et al. (2024) |br|
Default = MANDEL |br|

**--mass-change-fraction** |br|
Approximate desired fractional change in stellar mass on phase when setting SSE and BSE timesteps (applied before ``--timestep--multiplier``). |br|
Recommended value is 0.005. |br|
Expand Down Expand Up @@ -1161,7 +1170,8 @@ Default = MULLERMANDEL
If TRUE, preserve a larger donor core mass following case A mass transfer. |br|
The core is set equal to the expected core mass of a newly formed HG star with mass equal to that of the donor,
scaled by the fraction of the donor's MS lifetime at mass transfer. |br|
Default = TRUE
Default = TRUE |br|
DEPRECATION NOTICE: this option has been deprecated and will soon be removed. Please use ``--main-sequence-core-mass-prescription MANDEL`` in future.

**--revised-energy-formalism-nandez-ivanova** |br|
Enable revised energy formalism of Nandez & Ivanova. |br|
Expand Down Expand Up @@ -1418,7 +1428,7 @@ Go to :ref:`the top of this page <options-props-top>` for the full alphabetical
**Stellar evolution and winds**

--use-mass-loss, --check-photon-tiring-limit, --cool-wind-mass-loss-multiplier, --luminous-blue-variable-prescription, --LBV-mass-loss-prescription
--luminous-blue-variable-multiplier, --mass-loss-prescription, --overall-wind-mass-loss-multiplier, --wolf-rayet-multiplier,
--luminous-blue-variable-multiplier, --main-sequence-core-mass-prescription, --mass-loss-prescription, --overall-wind-mass-loss-multiplier, --wolf-rayet-multiplier,
--expel-convective-envelope-above-luminosity-threshold, --luminosity-to-mass-threshold,
--OB-mass-loss, --OB-mass-loss-prescription, --RSG-mass-loss, --RSG-mass-loss-prescription, --VMS-mass-loss, --vms-mass-loss-prescription, --WR-mass-loss, --WR-mass-loss-prescription

Expand Down
6 changes: 6 additions & 0 deletions online-docs/pages/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ What's new

Following is a brief list of important updates to the COMPAS code. A complete record of changes can be found in the file ``changelog.h``.

**03.12.00 Jan 16, 2025**
* Added convective core mass prescription for main sequence stars from Shikauchi+ (2024), describing how the core mass evolves under mass loss and mass gain.
* New command line option ``--main-sequence-core-mass-prescription`` with arguments ``SHIKAUCHI`` (new prescription), ``MANDEL`` (replaces the functionality of ``--retain-core-mass-during-caseA-mass-transfer``), and ``ZERO`` (core mass set to zero, no treatment).
* Added new luminosity prescription for main sequence stars from Shikauchi+ (2024).
* Added treatment for rejuvenation of main sequence accretors when the new prescription is used.

**03.10.00 Nov 29, 2024**

Added functionality to log stellar mergers in the BSE switchlog file.
Expand Down
29 changes: 23 additions & 6 deletions src/BaseBinaryStar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1736,8 +1736,22 @@ void BaseBinaryStar::ResolveMainSequenceMerger() {

double finalMass = (1.0 - phi) * (mass1 + mass2);
double initialHydrogenFraction = m_Star1->InitialHydrogenAbundance();
double finalHydrogenMass = finalMass * initialHydrogenFraction - tau1 * TAMSCoreMass1 * initialHydrogenFraction - tau2 * TAMSCoreMass2 * initialHydrogenFraction;

double finalHydrogenMass;
if ((OPTIONS->MainSequenceCoreMassPrescription() == CORE_MASS_PRESCRIPTION::SHIKAUCHI) &&
(utils::Compare(m_Star1->MZAMS(), SHIKAUCHI_LOWER_MASS_LIMIT) >= 0) &&
(utils::Compare(m_Star2->MZAMS(), SHIKAUCHI_LOWER_MASS_LIMIT) >= 0)) {

double coreMass1 = m_Star1->MainSequenceCoreMass();
double coreMass2 = m_Star2->MainSequenceCoreMass();

double coreHeliumMass1 = m_Star1->HeliumAbundanceCore() * coreMass1;
double coreHeliumMass2 = m_Star2->HeliumAbundanceCore() * coreMass2;

finalHydrogenMass = finalMass * initialHydrogenFraction - coreHeliumMass1 - coreHeliumMass2;
}
else finalHydrogenMass = finalMass * initialHydrogenFraction - tau1 * TAMSCoreMass1 * initialHydrogenFraction - tau2 * TAMSCoreMass2 * initialHydrogenFraction;

m_SemiMajorAxis = std::numeric_limits<float>::infinity(); // set separation to infinity to avoid subsequent fake interactions with a massless companion (RLOF, CE, etc.)

m_Star1->UpdateAfterMerger(finalMass, finalHydrogenMass);
Expand Down Expand Up @@ -2088,22 +2102,25 @@ void BaseBinaryStar::CalculateMassTransfer(const double p_Dt) {
}
else { // have required mass loss
massDiffDonor = -massDiffDonor; // set mass difference
m_Donor->UpdateMinimumCoreMass(); // reset the minimum core mass following case A
m_Donor->UpdateTotalMassLossRate(massDiffDonor / (p_Dt * MYR_TO_YEAR)); // update mass loss rate for MS donor
m_Donor->UpdateMainSequenceCoreMass(p_Dt, massDiffDonor / (p_Dt * MYR_TO_YEAR)); // update core mass for MS donor
}
}

if (!m_CEDetails.CEEnow) { // CE flagged?
// no
m_MassTransferTrackerHistory = m_Donor == m_Star1 ? MT_TRACKING::STABLE_1_TO_2_SURV : MT_TRACKING::STABLE_2_TO_1_SURV; // record what happened - for later printing
double massGainAccretor = -massDiffDonor * m_FractionAccreted; // set accretor mass gain to mass loss * conservativeness

m_MassTransferTrackerHistory = m_Donor == m_Star1 ? MT_TRACKING::STABLE_1_TO_2_SURV : MT_TRACKING::STABLE_2_TO_1_SURV; // record what happened - for later printing

double massGainAccretor = -massDiffDonor * m_FractionAccreted; // set accretor mass gain to mass loss * conservativeness
double omegaDonor_pre_MT = m_Donor->Omega(); // used if full donor envelope is removed

m_Accretor->UpdateTotalMassLossRate(massGainAccretor / (p_Dt * MYR_TO_YEAR)); // update mass gain rate for MS accretor
m_Accretor->UpdateMainSequenceCoreMass(p_Dt, massGainAccretor / (p_Dt * MYR_TO_YEAR)); // update core mass for MS accretor

m_Donor->SetMassTransferDiffAndResolveWDShellChange(massDiffDonor); // set new mass of donor
m_Accretor->SetMassTransferDiffAndResolveWDShellChange(massGainAccretor); // set new mass of accretor

aFinal = CalculateMassTransferOrbit(m_Donor->Mass(), massDiffDonor, *m_Accretor, m_FractionAccreted); // calculate new orbit

m_aMassTransferDiff = aFinal - aInitial; // set change in orbit (semi-major axis)

STELLAR_TYPE stellarTypeDonor = m_Donor->StellarType(); // donor stellar type before resolving envelope loss
Expand Down
14 changes: 10 additions & 4 deletions src/BaseStar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,13 @@ BaseStar::BaseStar(const unsigned long int p_RandomSeed,
m_Dt = DEFAULT_INITIAL_DOUBLE_VALUE;
m_Tau = DEFAULT_INITIAL_DOUBLE_VALUE;
m_Age = 0.0; // ensure age = 0.0 at construction (rather than default initial value)
m_MainSequenceCoreMass = DEFAULT_INITIAL_DOUBLE_VALUE;
m_Mass = m_MZAMS;
m_Mass0 = m_MZAMS;
m_MinimumCoreMass = 0.0;
m_Luminosity = m_LZAMS;
m_Radius = m_RZAMS;
m_Temperature = m_TZAMS;
m_TotalMassLossRate = DEFAULT_INITIAL_DOUBLE_VALUE;
m_ComponentVelocity = Vector3d();

m_OmegaCHE = CalculateOmegaCHE(m_MZAMS, m_Metallicity);
Expand Down Expand Up @@ -2709,7 +2710,9 @@ double BaseStar::CalculateMassLossRate() {

mDot = mDot * OPTIONS->OverallWindMassLossMultiplier(); // apply overall wind mass loss multiplier
}


UpdateTotalMassLossRate(-mDot); // update total mass loss rate

return mDot;
}

Expand Down Expand Up @@ -4571,12 +4574,15 @@ STELLAR_TYPE BaseStar::EvolveOnPhase(const double p_DeltaTime) {
STELLAR_TYPE stellarType = m_StellarType;

if (ShouldEvolveOnPhase()) { // evolve timestep on phase

UpdateMainSequenceCoreMass(p_DeltaTime, -m_Mdot); // update core mass, relevant for MS stars

m_Tau = CalculateTauOnPhase();

m_COCoreMass = CalculateCOCoreMassOnPhase();
m_CoreMass = CalculateCoreMassOnPhase();
m_HeCoreMass = CalculateHeCoreMassOnPhase();

m_Luminosity = CalculateLuminosityOnPhase();

// Calculate abundances
Expand Down Expand Up @@ -4627,7 +4633,7 @@ STELLAR_TYPE BaseStar::ResolveEndOfPhase(const bool p_ResolveEnvelopeLoss) {
if (p_ResolveEnvelopeLoss) stellarType = ResolveEnvelopeLoss(); // if required, resolve envelope loss if it occurs

if (stellarType == m_StellarType) { // staying on phase?

m_Tau = CalculateTauAtPhaseEnd();

m_COCoreMass = CalculateCOCoreMassAtPhaseEnd();
Expand Down
Loading

0 comments on commit efbcf46

Please sign in to comment.