From 3025992c5b27c62aa3f1eab8015c692b014ab7ac Mon Sep 17 00:00:00 2001 From: Ilya Mandel Date: Mon, 18 Aug 2025 13:19:39 +1000 Subject: [PATCH 1/3] MALTSEV and Piersanti fixes --- src/GiantBranch.cpp | 2 ++ src/Makefile | 2 +- src/WhiteDwarfs.cpp | 3 ++- src/changelog.h | 5 ++++- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/GiantBranch.cpp b/src/GiantBranch.cpp index fd14743c7..ef8c47261 100644 --- a/src/GiantBranch.cpp +++ b/src/GiantBranch.cpp @@ -1320,6 +1320,8 @@ double GiantBranch::CalculateRemnantMassByMaltsev2024(const double p_COCoreMass, delete newStar; newStar = nullptr; // return the memory allocated for the new star } + if(massTransferCase == MT_CASE::NONE && HydrogenAbundanceSurface() == 0.0) // if a star was stripped by winds, treat it as if it experienced Case B mass transfer + massTransferCase = MT_CASE::B; // apply the appropriate remnant mass prescription for the chosen MT case switch (massTransferCase) { // which MT_CASE? diff --git a/src/Makefile b/src/Makefile index a20730c19..4af5547a6 100644 --- a/src/Makefile +++ b/src/Makefile @@ -40,7 +40,7 @@ ifneq ($(filter staticfast,$(MAKECMDGOALS)),) endif -CXXFLAGS := -std=c++17 -g -fnon-call-exceptions -Wall -Woverloaded-virtual -Wno-vla-cxx-extension $(OPTFLAGS) +CXXFLAGS := -std=c++17 -g -fnon-call-exceptions -Wall -Woverloaded-virtual -Wno-vla-extension $(OPTFLAGS) ICFLAGS := -I$(GSLINCDIR) -I$(BOOSTINCDIR) -I$(HDF5INCDIR) -I. LIBS := -lm -lz -ldl -lpthread diff --git a/src/WhiteDwarfs.cpp b/src/WhiteDwarfs.cpp index c10d18f4e..707570b2c 100644 --- a/src/WhiteDwarfs.cpp +++ b/src/WhiteDwarfs.cpp @@ -118,7 +118,8 @@ double WhiteDwarfs::CalculateEtaPTY(const double p_MassTransferRate) { etaPTY = -WD_PIERSANTI_M102_G0 + WD_PIERSANTI_M102_G1 * massRate - WD_PIERSANTI_M102_G2 * massRate_2 + WD_PIERSANTI_M102_G3 * massRate_3; } - return etaPTY; + // Returned eta should be between 0 and 1 + return std::min( std::max(etaPTY, 0.0), 1.0); } diff --git a/src/changelog.h b/src/changelog.h index ae6fd9382..3c48f6fb9 100644 --- a/src/changelog.h +++ b/src/changelog.h @@ -1647,6 +1647,9 @@ // - Fixed online docs for omissions in v03.22.02: // - fixed description for "--initial-mass-function" in "program-options-list-defaults.rst", and // - changed "--initial-mass-power" to "--initial-mass-function-power" in "program-options-list-defaults.rst" +// 03.23.01 IM - August 18, 2025 - Enhancement, defect repair: +// - In the MALTSEV SN prescription, treat wind-stripped stars as if they experienced case B mass transfer +// - Limit the output of CalculateEtaPTY() [Helium accretion efficiency onto WDs from Piersanti+ 2014, A3] to be in [0,1] // // // Version string format is MM.mm.rr, where @@ -1658,7 +1661,7 @@ // if MM is incremented, set mm and rr to 00, even if defect repairs and minor enhancements were also made // if mm is incremented, set rr to 00, even if defect repairs were also made -const std::string VERSION_STRING = "03.23.00"; +const std::string VERSION_STRING = "03.23.01"; # endif // __changelog_h__ From c179069ce7345c23a7b06dd3929dca74219fe536 Mon Sep 17 00:00:00 2001 From: jeffriley Date: Mon, 18 Aug 2025 13:33:34 +1000 Subject: [PATCH 2/3] Update GiantBranch.cpp - formatting Changed to prevent compiler warning re indenting --- src/GiantBranch.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/GiantBranch.cpp b/src/GiantBranch.cpp index ef8c47261..73dfcb7b8 100644 --- a/src/GiantBranch.cpp +++ b/src/GiantBranch.cpp @@ -1320,8 +1320,8 @@ double GiantBranch::CalculateRemnantMassByMaltsev2024(const double p_COCoreMass, delete newStar; newStar = nullptr; // return the memory allocated for the new star } - if(massTransferCase == MT_CASE::NONE && HydrogenAbundanceSurface() == 0.0) // if a star was stripped by winds, treat it as if it experienced Case B mass transfer - massTransferCase = MT_CASE::B; + if (massTransferCase == MT_CASE::NONE && HydrogenAbundanceSurface() == 0.0) massTransferCase = MT_CASE::B; // if a star was stripped by winds, treat it as if it experienced Case B mass transfer + // apply the appropriate remnant mass prescription for the chosen MT case switch (massTransferCase) { // which MT_CASE? From 887c20d4834b2515a10e758c23bb2d9eed450cc4 Mon Sep 17 00:00:00 2001 From: jeffriley Date: Mon, 18 Aug 2025 13:34:07 +1000 Subject: [PATCH 3/3] Update WhiteDwarfs.cpp minor formatting --- src/WhiteDwarfs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WhiteDwarfs.cpp b/src/WhiteDwarfs.cpp index 707570b2c..a61ac02d9 100644 --- a/src/WhiteDwarfs.cpp +++ b/src/WhiteDwarfs.cpp @@ -119,7 +119,7 @@ double WhiteDwarfs::CalculateEtaPTY(const double p_MassTransferRate) { } // Returned eta should be between 0 and 1 - return std::min( std::max(etaPTY, 0.0), 1.0); + return std::min(std::max(etaPTY, 0.0), 1.0); }