Skip to content

Commit 121a795

Browse files
authored
Merge pull request #734 from TeamCOMPAS/HGCEfix
Clean-up of CE treatment
2 parents da42e90 + 85b10fe commit 121a795

File tree

6 files changed

+16
-10
lines changed

6 files changed

+16
-10
lines changed

src/BaseBinaryStar.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1526,7 +1526,7 @@ void BaseBinaryStar::ResolveCommonEnvelopeEvent() {
15261526
m_Flags.stellarMerger = true;
15271527
}
15281528
}
1529-
else {
1529+
if (!m_Flags.stellarMerger) {
15301530

15311531
STELLAR_TYPE stellarType1 = m_Star1->StellarType(); // star 1 stellar type before resolving envelope loss
15321532
STELLAR_TYPE stellarType2 = m_Star2->StellarType(); // star 2 stellar type before resolving envelope loss

src/HG.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -729,8 +729,6 @@ double HG::CalculateZeta(ZETA_PRESCRIPTION p_ZetaPrescription) {
729729

730730
case ENVELOPE::CONVECTIVE:
731731
zeta = CalculateZadiabatic(p_ZetaPrescription);
732-
if (OPTIONS->EnvelopeStatePrescription() == ENVELOPE_STATE_PRESCRIPTION::LEGACY && StellarType() == STELLAR_TYPE::HERTZSPRUNG_GAP)
733-
zeta = OPTIONS->ZetaRadiativeEnvelopeGiant(); // HG stars within LEGACY prescription are hardcoded to use zeta=ZetaRadiativeEnvelopeGiant despite nominally being convective
734732
break;
735733

736734
default: // shouldn't happen
@@ -753,11 +751,14 @@ double HG::CalculateZeta(ZETA_PRESCRIPTION p_ZetaPrescription) {
753751
*/
754752
ENVELOPE HG::DetermineEnvelopeType() const {
755753

756-
ENVELOPE envelope = ENVELOPE::CONVECTIVE; // default envelope type is CONVECTIVE
754+
ENVELOPE envelope = ENVELOPE::RADIATIVE; // default envelope type is RADIATIVE
757755

758-
switch (OPTIONS->EnvelopeStatePrescription()) { // which envelope prescription?
756+
switch (OPTIONS->EnvelopeStatePrescription()) { // which envelope prescription?
759757

760758
case ENVELOPE_STATE_PRESCRIPTION::LEGACY:
759+
envelope = ENVELOPE::RADIATIVE; // default treatment
760+
break;
761+
761762
case ENVELOPE_STATE_PRESCRIPTION::HURLEY: // Eq. (39,40) of Hurley+ (2002) and end of section 7.2 of Hurley+ (2000) describe gradual growth of convective envelope over HG; we approximate it as convective here
762763
envelope = ENVELOPE::CONVECTIVE;
763764
break;

src/HeHG.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,11 +325,14 @@ double HeHG::CalculateLambdaNanjing() const {
325325
*/
326326
ENVELOPE HeHG::DetermineEnvelopeType() const {
327327

328-
ENVELOPE envelope = ENVELOPE::CONVECTIVE; // default envelope type is CONVECTIVE
328+
ENVELOPE envelope = ENVELOPE::RADIATIVE; // default envelope type is RADIATIVE
329329

330-
switch (OPTIONS->EnvelopeStatePrescription()) { // which envelope prescription?
330+
switch (OPTIONS->EnvelopeStatePrescription()) { // which envelope prescription?
331331

332332
case ENVELOPE_STATE_PRESCRIPTION::LEGACY:
333+
envelope = ENVELOPE::RADIATIVE; // default treatment
334+
break;
335+
333336
case ENVELOPE_STATE_PRESCRIPTION::HURLEY: // Eq. (39,40) of Hurley+ (2002) and end of section 7.2 of Hurley+ (2000) describe gradual growth of convective envelope over HG, but we approximate it as already convective here
334337
envelope = ENVELOPE::CONVECTIVE;
335338
break;

src/changelog.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,9 @@
859859
// 02.26.02 RTW - Dec 17, 2021 - Defect repair, Code cleanup:
860860
// - Changed all occurences of PPOW(base, 1.0/3.0) with std::cbrt, as the former could not handle negative bases
861861
// - Changed all occurences of sqrt with std::sqrt for consistency with the above change
862+
// 02.26.03 IM - Jan 10, 2022 - Defect repair, code cleanup:
863+
// - Cleaned up treatment of HG donors having CONVECTIVE envelopes in LEGACY; fixed an issues with CEs from HG donors introduced in 02.25.01
862864

863-
const std::string VERSION_STRING = "02.26.02";
865+
const std::string VERSION_STRING = "02.26.03";
864866

865867
# endif // __changelog_h__

src/constants.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2623,7 +2623,7 @@ const std::map<ANY_STAR_PROPERTY, PROPERTY_DETAILS> ANY_STAR_PROPERTY_DETAIL = {
26232623
{ ANY_STAR_PROPERTY::ZETA_HURLEY, { TYPENAME::DOUBLE, "Zeta_Hurley", "-", 14, 6 }},
26242624
{ ANY_STAR_PROPERTY::ZETA_HURLEY_HE, { TYPENAME::DOUBLE, "Zeta_Hurley_He", "-", 14, 6 }},
26252625
{ ANY_STAR_PROPERTY::ZETA_SOBERMAN, { TYPENAME::DOUBLE, "Zeta_Soberman", "-", 14, 6 }},
2626-
{ ANY_STAR_PROPERTY::ZETA_SOBERMAN_HE, { TYPENAME::DOUBLE, "Zeta_SoberMan_He", "-", 14, 6 }}
2626+
{ ANY_STAR_PROPERTY::ZETA_SOBERMAN_HE, { TYPENAME::DOUBLE, "Zeta_Soberman_He", "-", 14, 6 }}
26272627
};
26282628

26292629
// map BINARY_PROPERTY_DETAIL

utils/example_plots/methods_paper_plots/detailed_evolution/pythonSubmitDemo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ class pythonProgramOptions:
186186
common_envelope_mass_accretion_max = 0.10 # For 'MACLEOD+2014' [Msol]
187187
envelope_state_prescription = 'LEGACY'
188188
common_envelope_allow_radiative_envelope_survive = False
189-
common_envelope_allow_immediate_RLOF_post_CE_survive = False
189+
common_envelope_allow_immediate_RLOF_post_CE_survive = True
190190

191191
mass_loss_prescription = 'VINK'
192192
luminous_blue_variable_prescription = 'HURLEY_ADD'

0 commit comments

Comments
 (0)