Skip to content

Commit 7b75a11

Browse files
committed
Cleaned up treatment of HG donors having CONVECTIVE envelopes in LEGACY; fixes an issue with missed failed CEs introduced in 02.25.01
1 parent da42e90 commit 7b75a11

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

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; fixes an issue with missed failed CEs 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__

0 commit comments

Comments
 (0)