Skip to content

Commit c030f64

Browse files
author
Ilya Mandel
committed
03.21.00
1 parent 6d56cea commit c030f64

File tree

10 files changed

+89
-32
lines changed

10 files changed

+89
-32
lines changed

compas_python_utils/preprocessing/compasConfigDefault.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
##~!!~## COMPAS option values
2-
##~!!~## File Created Wed Jun 25 11:07:34 2025 by COMPAS v03.20.06
2+
##~!!~## File Created Sun Jul 6 16:42:54 2025 by COMPAS v03.21.00
33
##~!!~##
44
##~!!~## The default COMPAS YAML file (``compasConfigDefault.yaml``), as distributed, has
55
##~!!~## all COMPAS option entries commented so that the COMPAS default value for the
@@ -27,10 +27,10 @@ booleanChoices:
2727
# --check-photon-tiring-limit: False # Default: False
2828
# --use-mass-loss: True # Default: True
2929
# --enable-rotationally-enhanced-mass-loss: False # Default: False
30-
# --enhance-CHE-lifetimes-luminosities: False # Default: False
30+
# --enhance-CHE-lifetimes-luminosities: True # Default: True
3131
# --expel-convective-envelope-above-luminosity-threshold: False # Default: False
3232
# --natal-kick-for-PPISN: False # Default: False
33-
# --scale-CHE-mass-loss-with-surface-helium-abundance: False # Default: False
33+
# --scale-CHE-mass-loss-with-surface-helium-abundance: True # Default: True
3434

3535
### BINARY PROPERTIES
3636
# --allow-touching-at-birth: False # Default: False # record binaries that have stars touching at birth in output files
@@ -166,6 +166,7 @@ numericalChoices:
166166
# --common-envelope-mass-accretion-max: 0.100000 # Default: 0.100000 # For 'MACLEOD+2014' [Msol]
167167
# --common-envelope-mass-accretion-min: 0.040000 # Default: 0.040000 # For 'MACLEOD+2014' [Msol]
168168
# --common-envelope-recombination-energy-density: 15000000000000.00 # Default: 15000000000000.00
169+
# --common-envelope-second-stage-beta: 0.000000 # Default: 0.000000
169170
# --common-envelope-slope-kruckow: -0.833333 # Default: -0.833333
170171
# --maximum-mass-donor-nandez-ivanova: 2.000000 # Default: 2.000000
171172

@@ -272,6 +273,7 @@ stringChoices:
272273
# --common-envelope-formalism: 'ENERGY' # Default: 'ENERGY' # Options: ['TWO_STAGE','ENERGY']
273274
# --common-envelope-lambda-prescription: 'LAMBDA_NANJING' # Default: 'LAMBDA_NANJING' # Options: ['LAMBDA_DEWI','LAMBDA_KRUCKOW','LAMBDA_NANJING','LAMBDA_LOVERIDGE','LAMBDA_FIXED'] # Xu & Li 2010
274275
# --common-envelope-mass-accretion-prescription: 'ZERO' # Default: 'ZERO' # Options: ['CHEVALIER','MACLEOD','UNIFORM','CONSTANT','ZERO']
276+
# --common-envelope-second-stage-gamma-prescription: 'ISOTROPIC' # Default: 'ISOTROPIC' # Options: ['ARBITRARY','MACLEOD_LINEAR','CIRCUMBINARY','ISOTROPIC','JEANS']
275277

276278
### TIDES
277279
# --tides-prescription: 'NONE' # Default: 'NONE' # Options: ['KAPIL2025','PERFECT','NONE']

online-docs/pages/User guide/Program options/program-options-list-defaults.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ Default = FALSE
398398

399399
**--enhance-CHE-lifetimes-luminosities** |br|
400400
Enhance lifetimes and luminosities of CH stars using a fit to detailed models from Szecsi et al. (2015)
401-
Default = FALSE
401+
Default = TRUE
402402

403403
**--envelope-state-prescription** |br|
404404
Prescription for determining whether the envelope of the star is convective or radiative. |br|
@@ -513,7 +513,7 @@ Default = Sampled from IMF
513513

514514
**--initial-mass-2** |br|
515515
Initial mass for the secondary star when evolving in BSE mode (:math:`M_\odot`). |br|
516-
Default = Sampled from IMF
516+
Default = Sampled from the mass ratio distribution specified by ``--mass-ratio-distribution`` (see also ``--mass-ratio-max``, ``-mass-ratio-min``, ``--minimum-secondary-mass'')
517517
518518
**--initial-mass-function [ -i ]** |br|
519519
Initial mass function. |br|
@@ -1290,7 +1290,7 @@ Default = DECIN2023 |br|
12901290
**--scale-CHE-mass-loss-with-surface-helium-abundance** |br|
12911291
Scale mass loss for chemically homogeneously evolving (CHE) stars with the surface helium abundance.
12921292
Transition from OB to WR mass loss towards the end of the main sequence.
1293-
Default = False
1293+
Default = TRUE
12941294

12951295
**--scale-terminal-wind-velocity-with-metallicity-power** |br|
12961296
Scale terminal wind velocity with metallicity to this power

online-docs/pages/whats-new.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ What's new
33

44
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``.
55

6+
**03.21.00 July 6, 2025**
7+
* - Changed default values of --enhance-CHE-lifetimes-luminosities and --scale-CHE-mass-loss-with-surface-helium-abundance to true
8+
* Added options to set beta and gamma prescription for second stage of 2-stage CE (``--common-envelope-second-stage-beta``, ``--common-envelope-second-stage-gamma-prescription``)
9+
610
**03.20.06 June 25, 2025**
711

812
* The MAXWELLIAN NS CCSN kick changed from the Hobbs value of 265 km/s to 217 km/s based on 48 younger than 10 Myr pulsars with proper motions from Disberg & Mandel (2025) sample; corrects Hobbs+ 2005 missing Jacobian

src/BaseBinaryStar.cpp

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,21 +1643,21 @@ void BaseBinaryStar::ResolveCommonEnvelopeEvent() {
16431643
// note that in the case where both stars are in RLOF (m_RLOFDetails.simultaneousRLOF), star 1 is arbitrarily first to transfer its radiative intershell
16441644
if (m_Star1->IsRLOF()) {
16451645
if (utils::Compare(endOfFirstStageMass1 - m_Mass1Final, 0.0) > 0) {
1646-
m_SemiMajorAxis = CalculateMassTransferOrbit(endOfFirstStageMass1, -(endOfFirstStageMass1 - m_Mass1Final), endOfFirstStageMass2, m_Star2->IsDegenerate(), 0.0);
1646+
m_SemiMajorAxis = CalculateMassTransferOrbit(endOfFirstStageMass1, -(endOfFirstStageMass1 - m_Mass1Final), endOfFirstStageMass2, m_Star2->IsDegenerate(), OPTIONS->CommonEnvelopeSecondStageBeta(), true);
16471647
}
16481648

16491649
if (utils::Compare(endOfFirstStageMass2 - m_Mass2Final, 0.0) > 0) {
1650-
m_SemiMajorAxis = CalculateMassTransferOrbit(endOfFirstStageMass2, -(endOfFirstStageMass2 - m_Mass2Final), m_Mass1Final, m_Star1->IsDegenerate(), 0.0);
1650+
m_SemiMajorAxis = CalculateMassTransferOrbit(endOfFirstStageMass2, -(endOfFirstStageMass2 - m_Mass2Final), m_Mass1Final, m_Star1->IsDegenerate(), OPTIONS->CommonEnvelopeSecondStageBeta(), true);
16511651
}
16521652
}
16531653

16541654
else if (m_Star2->IsRLOF()) {
16551655
if (utils::Compare(endOfFirstStageMass2 - m_Mass2Final, 0.0) > 0) {
1656-
m_SemiMajorAxis = CalculateMassTransferOrbit(endOfFirstStageMass2, -(endOfFirstStageMass2 - m_Mass2Final), endOfFirstStageMass1, m_Star1->IsDegenerate(), 0.0);
1656+
m_SemiMajorAxis = CalculateMassTransferOrbit(endOfFirstStageMass2, -(endOfFirstStageMass2 - m_Mass2Final), endOfFirstStageMass1, m_Star1->IsDegenerate(), OPTIONS->CommonEnvelopeSecondStageBeta(), true);
16571657
}
16581658

16591659
if (utils::Compare(endOfFirstStageMass1 - m_Mass1Final, 0.0) > 0) {
1660-
m_SemiMajorAxis = CalculateMassTransferOrbit(endOfFirstStageMass1, -(endOfFirstStageMass1 - m_Mass1Final), m_Mass2Final, m_Star2->IsDegenerate(), 0.0);
1660+
m_SemiMajorAxis = CalculateMassTransferOrbit(endOfFirstStageMass1, -(endOfFirstStageMass1 - m_Mass1Final), m_Mass2Final, m_Star2->IsDegenerate(), OPTIONS->CommonEnvelopeSecondStageBeta(), true);
16611661
}
16621662
}
16631663
} break;
@@ -1824,18 +1824,22 @@ double BaseBinaryStar::CalculateRocheLobeRadius_Static(const double p_MassPrimar
18241824
* Calculation is based on user-specified Angular Momentum Loss prescription
18251825
*
18261826
*
1827-
* double CalculateGammaAngularMomentumLoss_Static(const double p_DonorMass, const double p_AccretorMass, const bool p_IsAccretorDegenerate)
1827+
* double CalculateGammaAngularMomentumLoss_Static(const double p_DonorMass, const double p_AccretorMass, const bool p_IsAccretorDegenerate, const bool p_IsCommonEnvelope)
18281828
*
18291829
* @param [IN] p_DonorMass The mass of the donor (Msol)
18301830
* @param [IN] p_AccretorMass The mass of the accretor (Msol)
18311831
* @param [IN] p_IsAccretorDegenerate True if the accretor is a degenerate star, false otherwise (need to know up front to keep this function static)
1832+
* @param [IN] p_IsCommonEnvelope True if this function is being called while in the (second stage of a 2-stage) CE
18321833
* @return The fraction of specific angular momentum with which the non-accreted mass leaves the system
18331834
*/
1834-
double BaseBinaryStar::CalculateGammaAngularMomentumLoss_Static(const double p_DonorMass, const double p_AccretorMass, const bool p_IsAccretorDegenerate) {
1835+
double BaseBinaryStar::CalculateGammaAngularMomentumLoss_Static(const double p_DonorMass, const double p_AccretorMass, const bool p_IsAccretorDegenerate, const bool p_IsCommonEnvelope) {
18351836

18361837
double gamma;
1838+
MT_ANGULAR_MOMENTUM_LOSS_PRESCRIPTION gammaPrescription = OPTIONS->MassTransferAngularMomentumLossPrescription();
1839+
if(p_IsCommonEnvelope)
1840+
gammaPrescription = OPTIONS->CommonEnvelopeSecondStageGammaPrescription();
18371841

1838-
switch (OPTIONS->MassTransferAngularMomentumLossPrescription()) { // which prescription?
1842+
switch (gammaPrescription) { // which prescription?
18391843

18401844
case MT_ANGULAR_MOMENTUM_LOSS_PRESCRIPTION::JEANS : gamma = p_AccretorMass / p_DonorMass; break; // vicinity of the donor
18411845

@@ -1847,7 +1851,7 @@ double BaseBinaryStar::CalculateGammaAngularMomentumLoss_Static(const double p_D
18471851
double sumMasses = p_DonorMass + p_AccretorMass;
18481852
gamma = (M_SQRT2 * sumMasses * sumMasses) / (p_DonorMass * p_AccretorMass);
18491853
} break;
1850-
1854+
18511855
case MT_ANGULAR_MOMENTUM_LOSS_PRESCRIPTION::MACLEOD_LINEAR : { // linear interpolation on separation between accretor and L2 point
18521856
// interpolate in separation between a_acc and a_L2, both normalized to units of separation a
18531857
double q = p_AccretorMass / p_DonorMass;
@@ -1885,20 +1889,23 @@ double BaseBinaryStar::CalculateGammaAngularMomentumLoss_Static(const double p_D
18851889
* const double p_DeltaMassDonor,
18861890
* const double p_AccretorMass,
18871891
const bool p_IsAccretorDegenerate,
1888-
* const double p_FractionAccreted)
1892+
* const double p_FractionAccreted
1893+
* const bool p_IsCommonEnvelope)
18891894
*
18901895
* @param [IN] p_DonorMass Donor mass
18911896
* @param [IN] p_DeltaMassDonor Change in donor mass
18921897
* @param [IN] p_AccretorMass Accretor mass
18931898
* @param [IN] p_IsAccretorDegenerate Flag for degenerate accretors
18941899
* @param [IN] p_FractionAccreted Mass fraction lost from donor accreted by accretor
1900+
* @param [IN] p_IsCommonEnvelope True if this function is being called while in the (second stage of a 2-stage) CE
18951901
* @return Semi-major axis
18961902
*/
18971903
double BaseBinaryStar::CalculateMassTransferOrbit(const double p_DonorMass,
18981904
const double p_DeltaMassDonor,
18991905
const double p_AccretorMass,
19001906
const bool p_IsAccretorDegenerate,
1901-
const double p_FractionAccreted) {
1907+
const double p_FractionAccreted,
1908+
const bool p_IsCommonEnvelope) {
19021909

19031910
double semiMajorAxis = m_SemiMajorAxis;
19041911

@@ -1910,21 +1917,21 @@ double BaseBinaryStar::CalculateMassTransferOrbit(const double p
19101917

19111918
// Use boost adaptive ODE solver for speed and accuracy
19121919
struct ode {
1913-
double p_MassDonor0, p_MassAccretor0, p_FractionAccreted, p_IsAccretorDegenerate;
1914-
ode(double massDonor0, double massAccretor0, double fractionAccreted, bool isAccretorDegenerate) : p_MassDonor0(massDonor0), p_MassAccretor0(massAccretor0), p_FractionAccreted(fractionAccreted), p_IsAccretorDegenerate(isAccretorDegenerate) {}
1920+
double p_MassDonor0, p_MassAccretor0, p_FractionAccreted, p_IsAccretorDegenerate, p_IsCommonEnvelope;
1921+
ode(double massDonor0, double massAccretor0, double fractionAccreted, bool isAccretorDegenerate, bool isCommonEnvelope) : p_MassDonor0(massDonor0), p_MassAccretor0(massAccretor0), p_FractionAccreted(fractionAccreted), p_IsAccretorDegenerate(isAccretorDegenerate), p_IsCommonEnvelope(isCommonEnvelope) {}
19151922

19161923
// x is the current state of the ODE (x[0] = semi-major axis a)
19171924
// dxdm is the change of state wrt mass (dxdm[0] = dadm)
19181925
// p_MassChange is the cumulative change in mass of the star(s)
19191926
void operator()(state_type const& x, state_type& dxdm, double p_MassChange ) const {
19201927
double massD = p_MassDonor0 + p_MassChange;
19211928
double massA = p_MassAccretor0 - p_MassChange * p_FractionAccreted;
1922-
double jLoss = CalculateGammaAngularMomentumLoss_Static(massD, massA, p_IsAccretorDegenerate);
1929+
double jLoss = CalculateGammaAngularMomentumLoss_Static(massD, massA, p_IsAccretorDegenerate, p_IsCommonEnvelope);
19231930
dxdm[0] = (-2.0 / massD) * (1.0 - (p_FractionAccreted * (massD / massA)) - ((1.0 - p_FractionAccreted) * (jLoss + 0.5) * (massD / (massA + massD)))) * x[0];
19241931
}
19251932
};
19261933

1927-
integrate_adaptive(controlled_stepper, ode{ p_DonorMass, p_AccretorMass, p_FractionAccreted, p_IsAccretorDegenerate }, x, 0.0, p_DeltaMassDonor, p_DeltaMassDonor / 1000.0);
1934+
integrate_adaptive(controlled_stepper, ode{ p_DonorMass, p_AccretorMass, p_FractionAccreted, p_IsAccretorDegenerate, p_IsCommonEnvelope }, x, 0.0, p_DeltaMassDonor, p_DeltaMassDonor / 1000.0);
19281935
semiMajorAxis = x[0];
19291936
}
19301937

@@ -2166,7 +2173,7 @@ void BaseBinaryStar::CalculateMassTransfer(const double p_Dt) {
21662173
m_Donor->SetMassTransferDiffAndResolveWDShellChange(massDiffDonor); // set new mass of donor
21672174
m_Accretor->SetMassTransferDiffAndResolveWDShellChange(massGainAccretor); // set new mass of accretor
21682175

2169-
aFinal = CalculateMassTransferOrbit(m_Donor->Mass(), massDiffDonor, *m_Accretor, m_FractionAccreted); // calculate new orbit
2176+
aFinal = CalculateMassTransferOrbit(m_Donor->Mass(), massDiffDonor, *m_Accretor, m_FractionAccreted, false); // calculate new orbit
21702177
m_aMassTransferDiff = aFinal - aInitial; // set change in orbit (semi-major axis)
21712178

21722179
STELLAR_TYPE stellarTypeDonor = m_Donor->StellarType(); // donor stellar type before resolving envelope loss

src/BaseBinaryStar.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,8 @@ class BaseBinaryStar {
440440
double CalculateDOmegaTidalDt(const DBL_DBL_DBL_DBL p_ImKnm, const BinaryConstituentStar* p_Star);
441441
double CalculateDSemiMajorAxisTidalDt(const DBL_DBL_DBL_DBL p_ImKnm, const BinaryConstituentStar* p_Star);
442442

443-
static double CalculateGammaAngularMomentumLoss_Static(const double p_DonorMass, const double p_AccretorMass, const bool p_IsAccretorDegenerate);
444-
double CalculateGammaAngularMomentumLoss(const double p_DonorMass, const double p_AccretorMass) { return CalculateGammaAngularMomentumLoss_Static(p_DonorMass, p_AccretorMass, m_Accretor->IsDegenerate()); }
443+
static double CalculateGammaAngularMomentumLoss_Static(const double p_DonorMass, const double p_AccretorMass, const bool p_IsAccretorDegenerate, const bool p_IsCommonEnvelope);
444+
double CalculateGammaAngularMomentumLoss(const double p_DonorMass, const double p_AccretorMass) { return CalculateGammaAngularMomentumLoss_Static(p_DonorMass, p_AccretorMass, m_Accretor->IsDegenerate(), false); }
445445
double CalculateGammaAngularMomentumLoss() { return CalculateGammaAngularMomentumLoss(m_Donor->Mass(), m_Accretor->Mass()); }
446446

447447

@@ -451,13 +451,15 @@ class BaseBinaryStar {
451451
const double p_DeltaMassDonor,
452452
const double p_AccretorMass,
453453
const bool p_IsAccretorDegenerate,
454-
const double p_FractionAccreted);
454+
const double p_FractionAccreted,
455+
const bool p_IsCommonEnvelope);
455456

456457

457458
double CalculateMassTransferOrbit(const double p_DonorMass,
458459
const double p_DeltaMassDonor,
459460
BinaryConstituentStar& p_Accretor,
460-
const double p_FractionAccreted) { return CalculateMassTransferOrbit(p_DonorMass, p_DeltaMassDonor, p_Accretor.Mass(), p_Accretor.IsDegenerate(), p_FractionAccreted); }
461+
const double p_FractionAccreted,
462+
const bool p_IsCommonEnvelope) { return CalculateMassTransferOrbit(p_DonorMass, p_DeltaMassDonor, p_Accretor.Mass(), p_Accretor.IsDegenerate(), p_FractionAccreted, p_IsCommonEnvelope); }
461463

462464

463465

@@ -616,7 +618,7 @@ class BaseBinaryStar {
616618
// mass / donated mass is used
617619
double beta = (utils::Compare(m_FractionAccreted, 0.0) >=0 ) ? m_FractionAccreted : std::min(m_MaximumAccretedMass/p_dM, 1.0);
618620

619-
double semiMajorAxis = m_Binary->CalculateMassTransferOrbit(donorMass, -p_dM , *m_Accretor, beta);
621+
double semiMajorAxis = m_Binary->CalculateMassTransferOrbit(donorMass, -p_dM , *m_Accretor, beta, false);
620622
double RLRadius = semiMajorAxis * (1.0 - m_Binary->Eccentricity()) * CalculateRocheLobeRadius_Static(donorMass - p_dM, accretorMass + (beta * p_dM)) * AU_TO_RSOL;
621623

622624
double radiusAfterMassLoss = m_Donor->CalculateRadiusOnMassChange(-p_dM);

0 commit comments

Comments
 (0)