Skip to content

Commit

Permalink
Added support for new CalculateCoreRadius() function that returns rem…
Browse files Browse the repository at this point in the history
…nant radius
  • Loading branch information
vkapil1 committed Mar 27, 2024
1 parent 2542b44 commit eaf8b3a
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,23 @@ Following is an alphabetical list of stellar properties available for inclusion
* - Header Strings:
- Mass_Core@\ CO, Mass_Core@CO(1), Mass_Core@CO(2), Mass_Core@CO(SN), Mass_Core@CO(CP)

.. flat-table::
:widths: 25 75 1 1
:header-rows: 0
:class: aligned-text

* - :cspan:`2` **CORE_RADIUS**
-
* - Data type:
- DOUBLE
* - COMPAS variable:
- BaseStar::m_CoreRadius
* - Description:
- Core radius (\ :math:`R\odot`).
* - Header Strings:
- Radius_Core, Radius_Core(1), Radius_Core(2), Radius_Core(SN), Radius_Core(CP)


.. _stellar-props-D:

:ref:`Back to Top <stellar-props-top>`
Expand Down
1 change: 1 addition & 0 deletions src/BaseStar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ COMPAS_VARIABLE BaseStar::StellarPropertyValue(const T_ANY_PROPERTY p_Property)
case ANY_STAR_PROPERTY::CO_CORE_MASS_AT_COMPACT_OBJECT_FORMATION: value = SN_COCoreMassAtCOFormation(); break;
case ANY_STAR_PROPERTY::CORE_MASS: value = CoreMass(); break;
case ANY_STAR_PROPERTY::CORE_MASS_AT_COMPACT_OBJECT_FORMATION: value = SN_CoreMassAtCOFormation(); break;
case ANY_STAR_PROPERTY::CORE_RADIUS: value = CalculateCoreRadius(); break;
case ANY_STAR_PROPERTY::DRAWN_KICK_MAGNITUDE: value = SN_DrawnKickMagnitude(); break;
case ANY_STAR_PROPERTY::DOMINANT_MASS_LOSS_RATE: value = DominantMassLossRate(); break;
case ANY_STAR_PROPERTY::DT: value = Dt(); break;
Expand Down
3 changes: 2 additions & 1 deletion src/BaseStar.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class BaseStar {
double CalculateConvectiveEnvelopeBindingEnergy(const double p_CoreMass, const double p_ConvectiveEnvelopeMass, const double p_Radius, const double p_Lambda);

virtual double CalculateConvectiveEnvelopeMass() const { return 0.0; }

virtual double CalculateCoreRadius() const { return 0.0; }
virtual double CalculateCriticalMassRatio(const bool p_AccretorIsDegenerate);
virtual double CalculateCriticalMassRatioClaeys14(const bool p_AccretorIsDegenerate) const { return 0.0; } // Default is 0.0
double CalculateCriticalMassRatioGe20(const QCRIT_PRESCRIPTION p_qCritPrescription) { return InterpolateGe20QCrit(p_qCritPrescription); }
Expand Down Expand Up @@ -321,6 +321,7 @@ class BaseStar {
double m_Age; // Current effective age (changes with mass loss/gain)(myrs)
double m_COCoreMass; // Current CO core mass (Msol)
double m_CoreMass; // Current core mass (Msol)
double m_CoreRadius; // Current core radius (Rsol)
double m_Dt; // Current timestep (myrs)
bool m_EnvelopeJustExpelledByPulsations; // Flag to know if the convective envelope has just been expelled by pulsations
double m_HeCoreMass; // Current He core mass (Msol)
Expand Down
2 changes: 2 additions & 0 deletions src/GiantBranch.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class GiantBranch: virtual public BaseStar, public MainSequence {
static double CalculateCoreMass_Luminosity_Lx_Static(const DBL_VECTOR &p_GBParams);
static double CalculateCoreMass_Luminosity_Mx_Static(const DBL_VECTOR &p_GBParams);

double CalculateCoreRadius() const { return CalculateRemnantRadius(); }

double CalculateCriticalMassRatioClaeys14(const bool p_AccretorIsDegenerate) const;
double CalculateCriticalMassRatioHurleyHjellmingWebbink() const;

Expand Down
2 changes: 2 additions & 0 deletions src/Remnants.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class Remnants: virtual public BaseStar, public HeGB {

double CalculateCoreMassOnPhase() const { return m_Mass; } // Return m_Mass

double CalculateCoreRadius() const { return 0.0; }

double CalculateCriticalMassRatio(const bool p_AccretorIsDegenerate) { return 0.0; } // Should never be called...

void CalculateGBParams(const double p_Mass, DBL_VECTOR &p_GBParams) { GiantBranch::CalculateGBParams(p_Mass, p_GBParams); } // Default to GiantBranch
Expand Down
6 changes: 6 additions & 0 deletions src/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -1836,6 +1836,7 @@ const COMPASUnorderedMap<PROPERTY_TYPE, std::string> PROPERTY_TYPE_LABEL = {
CORE_MASS, \
CORE_MASS_AT_COMMON_ENVELOPE, \
CORE_MASS_AT_COMPACT_OBJECT_FORMATION, \
CORE_RADIUS, \
DRAWN_KICK_MAGNITUDE, \
DOMINANT_MASS_LOSS_RATE, \
DT, \
Expand Down Expand Up @@ -1991,6 +1992,7 @@ const COMPASUnorderedMap<STAR_PROPERTY, std::string> STAR_PROPERTY_LABEL = {
{ STAR_PROPERTY::CORE_MASS, "CORE_MASS" },
{ STAR_PROPERTY::CORE_MASS_AT_COMMON_ENVELOPE, "CORE_MASS_AT_COMMON_ENVELOPE" },
{ STAR_PROPERTY::CORE_MASS_AT_COMPACT_OBJECT_FORMATION, "CORE_MASS_AT_COMPACT_OBJECT_FORMATION" },
{ STAR_PROPERTY::CORE_RADIUS, "CORE_RADIUS" },
{ STAR_PROPERTY::DRAWN_KICK_MAGNITUDE, "DRAWN_KICK_MAGNITUDE" },
{ STAR_PROPERTY::DOMINANT_MASS_LOSS_RATE, "DOMINANT_MASS_LOSS_RATE"},
{ STAR_PROPERTY::DT, "DT" },
Expand Down Expand Up @@ -2879,6 +2881,7 @@ const std::map<ANY_STAR_PROPERTY, PROPERTY_DETAILS> ANY_STAR_PROPERTY_DETAIL = {
{ ANY_STAR_PROPERTY::CORE_MASS, { TYPENAME::DOUBLE, "Mass_Core", "Msol", 14, 6 }},
{ ANY_STAR_PROPERTY::CORE_MASS_AT_COMMON_ENVELOPE, { TYPENAME::DOUBLE, "Mass_Core@CE", "Msol", 14, 6 }},
{ ANY_STAR_PROPERTY::CORE_MASS_AT_COMPACT_OBJECT_FORMATION, { TYPENAME::DOUBLE, "Mass_Core@CO", "Msol", 14, 6 }},
{ ANY_STAR_PROPERTY::CORE_RADIUS, { TYPENAME::DOUBLE, "Radius_Core", "Rsol", 14, 6 }},
{ ANY_STAR_PROPERTY::DRAWN_KICK_MAGNITUDE, { TYPENAME::DOUBLE, "Drawn_Kick_Magnitude", "kms^-1", 14, 6 }},
{ ANY_STAR_PROPERTY::DOMINANT_MASS_LOSS_RATE, { TYPENAME::INT, "Dominant_Mass_Loss_Rate", "-", 4, 1 }},
{ ANY_STAR_PROPERTY::DT, { TYPENAME::DOUBLE, "dT", "Myr", 24, 15}},
Expand Down Expand Up @@ -3478,6 +3481,8 @@ const ANY_PROPERTY_VECTOR BSE_DETAILED_OUTPUT_REC = {
STAR_2_PROPERTY::HE_CORE_MASS,
STAR_1_PROPERTY::CO_CORE_MASS,
STAR_2_PROPERTY::CO_CORE_MASS,
STAR_1_PROPERTY::CORE_RADIUS,
STAR_2_PROPERTY::CORE_RADIUS,
STAR_1_PROPERTY::RADIUS,
STAR_2_PROPERTY::RADIUS,
BINARY_PROPERTY::ROCHE_LOBE_RADIUS_1,
Expand Down Expand Up @@ -3742,6 +3747,7 @@ const ANY_PROPERTY_VECTOR SSE_DETAILED_OUTPUT_REC = {
STAR_PROPERTY::CORE_MASS,
STAR_PROPERTY::CO_CORE_MASS,
STAR_PROPERTY::HE_CORE_MASS,
STAR_PROPERTY::CORE_RADIUS,
STAR_PROPERTY::MDOT,
STAR_PROPERTY::DOMINANT_MASS_LOSS_RATE,
STAR_PROPERTY::TIMESCALE_MS
Expand Down

0 comments on commit eaf8b3a

Please sign in to comment.