Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementing the Shikauchi+ (2024) core mass prescription for main sequence stars #1292

Merged
merged 32 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
006ef72
Resolve merge conflicts
brcekadam Nov 1, 2024
76ed1ab
Resolve merge conflicts
brcekadam Nov 1, 2024
c1c2899
Resolve merge conflict
brcekadam Nov 1, 2024
697a9a4
Resolve merge conflict
brcekadam Nov 1, 2024
2c415c6
Resolve merge conflicts
brcekadam Sep 25, 2024
220b466
Resolve merge conflicts
brcekadam Nov 1, 2024
e90d028
Fixed issues with --main-sequence-core-mass-prescription
brcekadam Aug 30, 2024
836871f
Resolve merge conflicts
brcekadam Nov 3, 2024
af542fe
Resolve merge conflicts
brcekadam Nov 3, 2024
777f67d
Resolve merge conflicts
brcekadam Nov 3, 2024
681d88d
Resolve merge conflicts
brcekadam Nov 3, 2024
57992ff
Fixed stellar tracks, code clean up, added comments
brcekadam Oct 17, 2024
b8fd492
Rejuvenation implementation
brcekadam Nov 1, 2024
762323a
Rejuvenation fix and code clean up
brcekadam Nov 5, 2024
d3fef43
Merge branch 'TeamCOMPAS:dev' into CaseAMassTransferTest
brcekadam Nov 18, 2024
2ceb240
Merger treatment, rejuvenation fix, code cleanup
brcekadam Nov 18, 2024
202741f
Code cleanup
brcekadam Nov 18, 2024
c8db394
Merge branch 'TeamCOMPAS:dev' into ShikauchiCoreMassPrescription
brcekadam Nov 18, 2024
1e72c50
Resolve merge conflict
brcekadam Nov 25, 2024
964b54b
Merge branch 'TeamCOMPAS:dev' into ShikauchiCoreMassPrescription
brcekadam Nov 26, 2024
6af1e08
Rejuvenation fix and code cleanup
brcekadam Nov 26, 2024
50f4be5
Minor code cleanup
brcekadam Nov 27, 2024
925e9fd
Resolve merge conflict
brcekadam Nov 27, 2024
214467f
Minor code cleanup
brcekadam Nov 27, 2024
c1e2400
Resolve merge conflicts
brcekadam Dec 4, 2024
71f3b32
Added utils::Compare(), fixed Q_CNO definition, fixed redius at TAMS,…
brcekadam Dec 20, 2024
536615a
Fixes based on comments
brcekadam Jan 9, 2025
f44666c
Code cleanup; a few minor changes
jeffriley Jan 13, 2025
58912d1
Update changelog.h
brcekadam Jan 15, 2025
1deda5d
A few minor changes
brcekadam Jan 16, 2025
9fcb88c
Small change in MainSequence.h
brcekadam Jan 16, 2025
13c10b2
Minor cleanup
jeffriley Jan 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading