Skip to content

Commit 326930c

Browse files
author
Ilya Mandel
committed
Typo fixes
1 parent d3790b5 commit 326930c

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/CH.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ double CH::CalculateMassLossRateBelczynski2010() {
346346
MdotWR = BaseStar::CalculateMassLossRateWolfRayetZDependent(0.0);
347347

348348
// Calculate fraction for combining these into total mass-loss rate
349-
fractionOB = CalculateMassLossRateFractionOB(m_HeliumAbundanceSurface);
349+
fractionOB = CalculateMassLossFractionOB(m_HeliumAbundanceSurface);
350350

351351
}
352352

@@ -381,7 +381,7 @@ double CH::CalculateMassLossRateMerritt2025() {
381381
double Mdot = 0.0;
382382
double MdotOB = 0.0;
383383
double MdotWR = 0.0;
384-
double weight = 1.0; // Initialised to 1.0 to allow us to use the OB mass loss rate by default
384+
double fractionOB = 1.0; // Initialised to 1.0 to allow us to use the OB mass loss rate by default
385385

386386
// Calculate OB mass loss rate according to the chosen prescription
387387
MdotOB = BaseStar::CalculateMassLossRateOB(OPTIONS->OBMassLossPrescription());
@@ -397,14 +397,14 @@ double CH::CalculateMassLossRateMerritt2025() {
397397
delete clone; clone = nullptr; // return the memory allocated for the clone
398398

399399
// Calculate weight for combining these into total mass-loss rate
400-
weight = CalculateMassLossRateWeightOB(m_HeliumAbundanceSurface);
400+
fractionOB = CalculateMassLossFractionOB(m_HeliumAbundanceSurface);
401401
}
402402

403+
// Finally, combine each of these prescriptions according to the OB wind fraction
404+
Mdot = (fractionOB * MdotOB) + ((1.0 - fractionOB) * MdotWR);
405+
403406
// Set dominant mass loss rate
404-
m_DominantMassLossRate = weight == 0 ? MASS_LOSS_TYPE::WR : MASS_LOSS_TYPE::OB;
405-
406-
// Finally, combine each of these prescriptions according to the weight
407-
Mdot = (weight * MdotOB) + ((1.0 - weight) * MdotWR);
407+
m_DominantMassLossRate = (fractionOB * MdotOB) > ((1.0 - fractionOB) * MdotWR) ? MASS_LOSS_TYPE::OB : MASS_LOSS_TYPE::WR;
408408

409409
// Enhance mass loss rate due to rotation
410410
Mdot *= CalculateMassLossRateEnhancementRotation();

src/CH.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class CH: virtual public BaseStar, public MS_gt_07 {
7474
// Mass loss rate
7575
double CalculateMassLossRateBelczynski2010();
7676
double CalculateMassLossRateMerritt2025();
77-
double CalculateMassLossRateFractionOB(const double p_HeliumAbundanceSurface);
77+
double CalculateMassLossFractionOB(const double p_HeAbundanceSurface) const;
7878

7979
// Radius
8080
double CalculateRadiusOnPhase() const { return m_RZAMS; } // Constant from birth

src/changelog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1666,7 +1666,7 @@
16661666
// - Clamped gamma to [0.0, gamma] in Mainsequence.cpp::CalculateGamma() (per discussion just after eq 23 - confirmed in BSE Fortran source)
16671667
// 03.26.00 IM - September 2, 2025 - Enhancement, defect repairs:
16681668
// - First (simplified) implementation of the Lau+ (2024) Hamstars thermally limited accretion prescription
1669-
// - Corrected errors in combining OB and WR winds in CH::CalculateMassLossRateBelczynski2010() and CH::CalculateMassLossRateFractionOB() [previously CalculateMassLossRateWeightOB()]
1669+
// - Corrected errors in combining OB and WR winds in CH::CalculateMassLossRateBelczynski2010(), CalculateMassLossRateMerritt2025() and CH::CalculateMassLossFractionOB() [previously CalculateMassLossRateWeightOB()]
16701670
//
16711671
// Version string format is MM.mm.rr, where
16721672
//

0 commit comments

Comments
 (0)