SEVN
Loading...
Searching...
No Matches
Lambda Class Reference

#include <property.h>

Inheritance diagram for Lambda:
JIT_Property Derived_Property Property

Public Types

typedef std::map< std::string, size_t > _PrintMap
 

Public Member Functions

 Lambda (bool reg=true)
 
LambdaInstance () override
 
std::string name () const override
 
std::string units () override
 
void set_remnant (_UNUSED Star *s) override
 
void evolve_remnant (_UNUSED Star *s) override
 
void evolve_nakedco (_UNUSED Star *s) override
 
double get (_UNUSED const Star *s=NULL) override
 
void evolve (_UNUSED Star *s) override
 
void update_from_binary (_UNUSED Star *s, _UNUSED const double &DV, _UNUSED Binstar *b) override
 
virtual void update_from_binary (_UNUSED Star *s, const double &DV, _UNUSED Binstar *b=nullptr)
 
void set_empty (_UNUSED Star *s) override
 
void evolve_empty (_UNUSED Star *s) override
 
void update_derived (_UNUSED Star *s) override
 
virtual void restore () override
 
virtual void synch () override
 
double get_fk (_UNUSED const Star *s=NULL) override
 
double get_0_fk (_UNUSED const Star *s=NULL) override
 
double get_0 (_UNUSED const Star *s=NULL) override
 
virtual void copy_V_from (Property *p)
 
virtual void resynch (_UNUSED const double &dt, _UNUSED bool set0=true)
 
virtual void resynch (_UNUSED Star *s)
 
virtual void set_empty_in_bse (_UNUSED Star *s, _UNUSED Binstar *b)
 
virtual void set_remnant_in_bse (_UNUSED Star *s, _UNUSED Binstar *b)
 
virtual size_t TabID ()
 
virtual void special_evolve (_UNUSED Star *s)
 
virtual void evolve_fake (Star *s)
 
virtual void init (_UNUSED const double &a)
 
virtual void evolve_real ()
 
virtual void update_variation ()
 
virtual void correct_interpolation_errors (_UNUSED Star *s)
 
virtual void correct_interpolation_errors_real (_UNUSED Star *s)
 
virtual void reset ()
 
virtual void changed_track (_UNUSED Star *s, _UNUSED Star *s_jtrack)
 
double get_fk_raw (_UNUSED const Star *s=NULL) const
 
double get_0_fk_raw (_UNUSED const Star *s=NULL) const
 
double get_raw (_UNUSED const Star *s=NULL) const
 
double get_0_raw (_UNUSED const Star *s=NULL) const
 
virtual double get_Vlast (_UNUSED const Star *s) const
 
double * get_wm ()
 
double * get_wz ()
 
virtual void set_w (_UNUSED Star *s)
 
virtual bool are_table_loaded () const
 
virtual void set_refpointers (_UNUSED Star *s)
 

Static Public Member Functions

static size_t size ()
 

Public Attributes

double * val_ref [4]
 
double * val_in [4]
 

Static Public Attributes

static size_t ID
 
static Lambda _lambda
 
static _PrintMap PrintMap
 
static vector< Property * > all
 

Protected Member Functions

double estimate_lambda (const Star *star)
 
bool new_estimate_needed ()
 
void set (const double &a) override
 
void set_fk (const double &a)
 
void set_0_fk (const double &a)
 
virtual void set_0 (const double &a)
 
void set_VBIN (const size_t &id, const double &a)
 
virtual void safety_check ()
 
void Register (Property *_p, size_t *id, const std::string &_name)
 

Protected Attributes

double value
 
double value0
 
double Dvalue
 
double V
 
double V0
 
vector< double > VBIN
 
double interpolating_values [4]
 
double wM [4]
 
double wZ [2]
 
SevnLogging svlog
 

Static Protected Attributes

static size_t _size = 0
 

Private Member Functions

double estimate_lambda_BSE (const Star *star, bool whole_cenv=false, bool m0_as_hurley=false)
 
double estimate_lambda_Parsec (const Star *star)
 
double estimate_lambda_Claeys14 (const Star *star, bool whole_cenv=false)
 
double estimate_lambda_Izzard04 (const Star *star, bool whole_cenv=false)
 
double estimate_lambda_Klencki21 (const Star *star, bool interpolate=false)
 
double estimate_lambda_Nanjing (const Star *star, bool interpolate=false)
 
double get_M0_BSE (const Star *s)
 
double get_Rzams (const Star *s)
 
void copy_V_from (_UNUSED Property *p) override
 
virtual bool amiderived ()
 

Private Attributes

double Mzams_cachedM =0
 
double Zmet_cachedM =0
 
double M0_cached =0
 
double Mzams_cachedR =0
 
double Zmet_cachedR =0
 
double Rzams_cached =0
 
bool first_call =true
 
std::unique_ptr< Lambda_Baselambda_base_ptr
 
unsigned int last_evolve_number =0
 
unsigned int evolve_number =0
 

Member Typedef Documentation

◆ _PrintMap

typedef std::map<std::string,size_t> Property::_PrintMap
inherited

Constructor & Destructor Documentation

◆ Lambda()

Lambda::Lambda ( bool  reg = true)
inline

Member Function Documentation

◆ amiderived()

virtual bool Derived_Property::amiderived ( )
inlineprivatevirtualinherited

Check if this is a derived. A property is defined dervied if it is estimated by the combination of other properties and it is not the derivative of a property.

Returns
true if it is derived, false if it is not (overrided in the derived properties)

Reimplemented from Property.

◆ are_table_loaded()

virtual bool Property::are_table_loaded ( ) const
inlinevirtualinherited

Reimplemented in TableProperty.

◆ changed_track()

virtual void Property::changed_track ( _UNUSED Star s,
_UNUSED Star s_jtrack 
)
inlinevirtualinherited

Handle the modification of the property after a track change. It does nothing by default.

Parameters
sThe star for which we are changing the tracks.
s_jtrackThe star that we are using to get info of the new tracks.

Reimplemented in Localtime, Timestep, Radius, Mass, MHE, MCO, Phase, Luminosity, Inertia, RHE, RCO, Hsup, HEsup, Csup, Nsup, Osup, Qconv, Tconv, Depthconv, dMcumul_binary, AngMomSpin, and Temperature.

◆ copy_V_from() [1/2]

void Derived_Property::copy_V_from ( _UNUSED Property p)
inlineoverrideprivateinherited

Disable copy

Parameters
p

◆ copy_V_from() [2/2]

virtual void Property::copy_V_from ( Property p)
inlinevirtualinherited

Reimplemented in R_object, and Mass_obejct.

◆ correct_interpolation_errors()

virtual void Property::correct_interpolation_errors ( _UNUSED Star s)
inlinevirtualinherited

Reimplemented in Mass, MHE, MCO, RHE, and RCO.

◆ correct_interpolation_errors_real()

virtual void Property::correct_interpolation_errors_real ( _UNUSED Star s)
inlinevirtualinherited

Reimplemented in Mass, MHE, MCO, Inertia, RHE, and RCO.

◆ estimate_lambda()

double Lambda::estimate_lambda ( const Star star)
protected

Estimate the lambda for a given star. The binding energy of an envelope is Ebind = Integrate^Mtot_Mcore dM - G M(r)/r + alpha_th*U, where U is the internal energy and alpha_th a fraction of internal energy used to unbound the envelope. For simplicity we can write Ebind_s = -G Mtot Menv / lambda R, where lambda is the factor for which Ebind_s=Ebind. Usually, the lambda is taken between two extrema: lambda_g obtained considering only the gravitational energy (alpha_th=0) and lambda_b obtained consider a fully efficiency of the internal energy in unbounding the envelope (alpha_th=1). The implementation depends on the Common envelope models and common envelope parameters

Parameters
starStar for which we want to estimate the binding energy
Returns

◆ estimate_lambda_BSE()

double Lambda::estimate_lambda_BSE ( const Star star,
bool  whole_cenv = false,
bool  m0_as_hurley = false 
)
private

Estimate lambda following exactly the implementation of lambda in Mobse The mass fraction of the convective envelope over the whole envelope will be used

Parameters
starStar for which we want to estimate the binding energy
whole_cenvIf true conside that all the envelope is convective
Returns

Initial checks

Start Estimate

The final lambda depends on the fraction of the mass convective envelope over the total envelope mass. If we are using convective tables just use the table value, otherwise estimate the Mcenv using analytic approximation from Hurley (see Qconv::estimate_without_table) fcenv=Qconv, If whole_cenv is true consider the whole envelope as convective fcenv=1

◆ estimate_lambda_Claeys14()

double Lambda::estimate_lambda_Claeys14 ( const Star star,
bool  whole_cenv = false 
)
private

Estimate lambda following Claeys+14 (Appendix A, https://www.aanda.org/articles/aa/pdf/2014/03/aa22714-13.pdf) The mass of the convective envelope in Msun will be used

Parameters
starStar for which we want to estimate the binding energy
whole_cenvIf true conside that all the envelope is convective
Returns

Initial checks

Start Estimate

The final lambda depends on the Mass of the convective envelope. If we are using convective tables just use the table value, otherwise estimate the Mcenv using analytic approximation from Hurley (see Qconv::estimate_without_table) Mcenv_env=Qconv*Mass, If whole_cenv is true consider the whole envelope as convective

Estimate lam2 (needed only for Mcenv<1)

Estimate lam1 (needed only for Mcenv>0)

Estimate ionization contribution //Eq. A6

Final lambda_ce estimate //Eq. A1 without 2, see comment above

◆ estimate_lambda_Izzard04()

double Lambda::estimate_lambda_Izzard04 ( const Star star,
bool  whole_cenv = false 
)
private

Estimate lambda following Izzard+04 (Appendix E, http://personal.ph.surrey.ac.uk/~ri0005/doc/thesis/thesis.pdf), it is similar to Claeys+14, but lambda1 is multiplied by 2 before to add the correction for the ionization terms The mass of the convective envelope in Msun will be used

Parameters
starStar for which we want to estimate the binding energy
whole_cenvIf true conside that all the envelope is convective
Returns

Initial checks

Start Estimate

The final lambda depends on the Mass of the convective envelope. If we are using convective tables just use the table value, otherwise estimate the Mcenv using analytic approximation from Hurley (see Qconv::estimate_without_table) Mcenv_env=Qconv*Mass, If whole_cenv is true consider the whole envelope as convective

Estimate lam2 (needed only for Mcenv<1)

Estimate lam1 (needed only for Mcenv>0)

Multiply by 2

Estimate ionization contribution //Eq. A6

Final lambda_ce estimate //Eq. A1 without 2, see comment above

◆ estimate_lambda_Klencki21()

double Lambda::estimate_lambda_Klencki21 ( const Star star,
bool  interpolate = false 
)
private

Estimate lambda using tables from Klencki+21 The Lambda fit comes from Appendix A in Klencki+21 (https://ui.adsabs.harvard.edu/abs/2021A%26A...645A..54K/abstract). Lambda is thus estimated as: log10(lambda) = a*x^3 + b*x^2 + c*x + d where x=log10(R) The value of a,b,c,d depends on the Mass (Mzams), Z (metallicity) and Radius.

Parameters
starPointer to the star
interpolateif true, estimate lambda interpolating between lambdas for tracks in Klencki+21 tables if false, use a quantised formalism, i.e. for a Mzams and a Z not present in the table, the closed track with Mtrack>Mzams and Ztrack>Z. If Mzams<10, Mtracks=10 is used, for Z/Zsun<0.01, Z/Zsun=0.01 is used.
Returns
Lambda

◆ estimate_lambda_Nanjing()

double Lambda::estimate_lambda_Nanjing ( const Star star,
bool  interpolate = false 
)
private

Estimate Lambda using fitting equations from the work of Xi&Liu10 (https://iopscience.iop.org/article/10.1088/0004-637X/716/1/114) + its errata corrige (https://iopscience.iop.org/article/10.1088/0004-637X/722/2/1985). The implementation is taken directly from the COMPAS code https://github.com/TeamCOMPAS/COMPAS that is based on the STARTRACK implementation (see Dominik+12, https://ui.adsabs.harvard.edu/abs/2012ApJ...759...52D/abstract). Lambda is thus estimated as:

 y = a + b1*x + b2*x^2 + b3+*x^3 + b4*x^4 + b5*x^5

 where y is in general lambda (gravitational or considering also the thermal energy), sometime it is 1/lambda
 or sometime it is log lambda.
 x in general is the Radius, but sometime it is the mass of the envelope.
Parameters
starPointer to the star
interpolateif true, estimate lambda interpolating between lambdas for tracks in Xu&Lu10 if false, use a quantised formalism, i.e. for a Mzams not in the table use, the closed track with Mtrack>Mzams and Ztrack>Z.
Returns
Lambda

◆ estimate_lambda_Parsec()

double Lambda::estimate_lambda_Parsec ( const Star star)
private

Estimate lambda from the Parsec tracks. This is an experimental function based on the first results of Mario and her student. At the moment we use a very super preliminary results: it seems that expect for the very last stellar phase, the lambda estimated from Parsec tracks is a scaled (0.1) version of Claeys et al. 2014 (Appendix A)

Parameters
starStar for which we want to estimate the binding energy
Returns

◆ evolve()

void JIT_Property::evolve ( _UNUSED Star s)
inlineoverridevirtualinherited

Reimplemented from Property.

Reimplemented in NSsalpha.

◆ evolve_empty()

void JIT_Property::evolve_empty ( _UNUSED Star s)
inlineoverridevirtualinherited

Reimplemented from Property.

◆ evolve_fake()

void Property::evolve_fake ( Star s)
virtualinherited

Set v0=v

Move to new value in the interpolating track

Find new values at times t for the interpolatring tracks using linear interpolation

Find the interpolating z value, M1*v1 + M2*v2

Find the final interpolated value, v=Z1*v1 + Z2*v2

Reimplemented in Radius.

◆ evolve_nakedco()

void Lambda::evolve_nakedco ( _UNUSED Star s)
inlineoverridevirtual

Reimplemented from JIT_Property.

◆ evolve_real()

virtual void Property::evolve_real ( )
inlinevirtualinherited

◆ evolve_remnant()

void Lambda::evolve_remnant ( _UNUSED Star s)
inlineoverridevirtual

Reimplemented from JIT_Property.

◆ get()

double Lambda::get ( _UNUSED const Star s = NULL)
overridevirtual

Estimate the lambda for a given star. The binding energy of an envelope is Ebind = Integrate^Mtot_Mcore dM - G M(r)/r + alpha_th*U, where U is the internal energy and alpha_th a fraction of internal energy used to unbound the envelope. For simplicity we can write Ebind_s = -G Mtot Menv / lambda R, where lambda is the factor for which Ebind_s=Ebind. Usually, the lambda is taken between two extrema: lambda_g obtained considering only the gravitational energy (alpha_th=0) and lambda_b obtained consider a fully efficiency of the internal energy in unbounding the envelope (alpha_th=1). The implementation depends on the Common envelope models and common envelope parameters

Parameters
starStar for which we want to estimate the binding energy
Returns

JIT properties

Reimplemented from Property.

◆ get_0()

double JIT_Property::get_0 ( _UNUSED const Star s = NULL)
inlineoverridevirtualinherited

Reimplemented from Property.

◆ get_0_fk()

double JIT_Property::get_0_fk ( _UNUSED const Star s = NULL)
inlineoverridevirtualinherited

Reimplemented from Property.

◆ get_0_fk_raw()

double Property::get_0_fk_raw ( _UNUSED const Star s = NULL) const
inlineinherited

◆ get_0_raw()

double Property::get_0_raw ( _UNUSED const Star s = NULL) const
inlineinherited

◆ get_fk()

double JIT_Property::get_fk ( _UNUSED const Star s = NULL)
inlineoverridevirtualinherited

Here Star is optional, because it is needed only by property that have to estimate V on the fly. Notice that const Star*s means that inside the function we can only call method that we are sure will not change the Star s.

Reimplemented from Property.

◆ get_fk_raw()

double Property::get_fk_raw ( _UNUSED const Star s = NULL) const
inlineinherited

◆ get_M0_BSE()

double Lambda::get_M0_BSE ( const Star s)
private

Pointer to Lambda Klencki class Estimate the bse-like parameter M0 (it is the mass at the end of the MS) We estimate it creating an auxilixiary star with the same Mzams and Z and estimate the mass at the tms. Since this value depends only on Mzams and Z, the results is cached in the member variable M0_cached.

Parameters
sPointer to the star
Returns
M0 in Msun

◆ get_raw()

double Property::get_raw ( _UNUSED const Star s = NULL) const
inlineinherited

◆ get_Rzams()

double Lambda::get_Rzams ( const Star s)
private

Estimate the Radius at ZAMS We estimate it creating an auxilixiary star with the same Mzams and Z. Since this value depends only on Mzams and Z, the result is cached in the member variable Rzams_cached.

Parameters
sPointer to the star
Returns
Radius at MZAMS in Rsun

◆ get_Vlast()

virtual double Property::get_Vlast ( _UNUSED const Star s) const
inlinevirtualinherited

Get the value of the property expected at the end of the evolution (before becoming a remnant). It is based on the last values of the tables.

Parameters
sPointer to the star
Returns
The value of the property at the end of the evolution estimated as the weighted mean of the interpolating track values

◆ get_wm()

double * Property::get_wm ( )
inlineinherited

◆ get_wz()

double * Property::get_wz ( )
inlineinherited

◆ init()

virtual void Property::init ( _UNUSED const double &  a)
inlinevirtualinherited

◆ Instance()

Lambda * Lambda::Instance ( )
inlineoverridevirtual

Implements Property.

◆ name()

std::string Lambda::name ( ) const
inlineoverridevirtual

Reimplemented from JIT_Property.

◆ new_estimate_needed()

bool JIT_Property::new_estimate_needed ( )
inlineprotectedinherited

◆ Register()

void Property::Register ( Property _p,
size_t *  id,
const std::string &  _name 
)
inlineprotectedinherited

◆ reset()

virtual void Property::reset ( )
inlinevirtualinherited

Reset to 0

◆ restore()

virtual void JIT_Property::restore ( )
inlineoverridevirtualinherited

Reimplemented from Property.

◆ resynch() [1/2]

virtual void Property::resynch ( _UNUSED const double &  dt,
_UNUSED bool  set0 = true 
)
inlinevirtualinherited

◆ resynch() [2/2]

virtual void Property::resynch ( _UNUSED Star s)
inlinevirtualinherited

◆ safety_check()

virtual void Property::safety_check ( )
inlineprotectedvirtualinherited

Reimplemented in Radius, and Mass.

◆ set()

void JIT_Property::set ( const double &  a)
inlineoverrideprotectedvirtualinherited

Reimplemented from Property.

◆ set_0()

virtual void Property::set_0 ( const double &  a)
inlineprotectedvirtualinherited

Reimplemented in Radius.

◆ set_0_fk()

void Property::set_0_fk ( const double &  a)
inlineprotectedinherited

◆ set_empty()

void JIT_Property::set_empty ( _UNUSED Star s)
inlineoverridevirtualinherited

Reimplemented from Property.

◆ set_empty_in_bse()

virtual void Property::set_empty_in_bse ( _UNUSED Star s,
_UNUSED Binstar b 
)
inlinevirtualinherited

Set empty method to be used during BSE evolution

Parameters
spointer to Star
bpointer to Binary

Reimplemented in Timestep.

◆ set_fk()

void Property::set_fk ( const double &  a)
inlineprotectedinherited

◆ set_refpointers()

virtual void Property::set_refpointers ( _UNUSED Star s)
inlinevirtualinherited

◆ set_remnant()

void Lambda::set_remnant ( _UNUSED Star s)
inlineoverridevirtual

Reimplemented from JIT_Property.

◆ set_remnant_in_bse()

virtual void Property::set_remnant_in_bse ( _UNUSED Star s,
_UNUSED Binstar b 
)
inlinevirtualinherited

Set remnant method to be used during BSE evolution

Parameters
spointer to Star
bpointer to Binary

Reimplemented in Timestep.

◆ set_VBIN()

void Property::set_VBIN ( const size_t &  id,
const double &  a 
)
inlineprotectedinherited

◆ set_w()

virtual void Property::set_w ( _UNUSED Star s)
inlinevirtualinherited

Reimplemented in TableProperty.

◆ size()

static size_t Property::size ( )
inlinestaticinherited

◆ special_evolve()

virtual void Property::special_evolve ( _UNUSED Star s)
inlinevirtualinherited

Reimplemented in Localtime, Worldtime, and Phase.

◆ synch()

virtual void JIT_Property::synch ( )
inlineoverridevirtualinherited

Reimplemented from Derived_Property.

◆ TabID()

virtual size_t Property::TabID ( )
inlinevirtualinherited

◆ units()

std::string Lambda::units ( )
inlineoverridevirtual

Reimplemented from Property.

◆ update_derived()

void JIT_Property::update_derived ( _UNUSED Star s)
inlineoverridevirtualinherited

Not needed to update JIT properties after binary evolution, they are estimated on request

Reimplemented from Property.

◆ update_from_binary() [1/2]

void JIT_Property::update_from_binary ( _UNUSED Star s,
_UNUSED const double &  DV,
_UNUSED Binstar b 
)
inlineoverrideinherited

◆ update_from_binary() [2/2]

virtual void Property::update_from_binary ( _UNUSED Star s,
const double &  DV,
_UNUSED Binstar b = nullptr 
)
inlinevirtualinherited

Reimplemented in dMcumul_RLO, and Radius.

◆ update_variation()

virtual void Property::update_variation ( )
inlinevirtualinherited

Member Data Documentation

◆ _lambda

Lambda Lambda::_lambda
static

◆ _size

size_t Property::_size = 0
staticprotectedinherited

Instruction for adding new property PROP 1- Add the size_t PROP::ID 2- Initialise the static (fake) instance PROP PROP::_prop. NB: take care of the order of initilisation. The properies will be evolved exactly in the same order in which they are initialised here Define: @size: total number of instances of Property and derived classes (both fake and real). @all: vector containing all the (pointers) to the Property. @PrintMap: map containing the pair (Property_name, Property_id) for output purpose. Note all and PrintMap are filled during the instantiation of the fake Processes (see below)

◆ all

vector< Property * > Property::all
staticinherited

◆ Dvalue

double Property::Dvalue
protectedinherited

◆ evolve_number

unsigned int JIT_Property::evolve_number =0
privateinherited

◆ first_call

bool Lambda::first_call =true
private

Lambda Klencki

◆ ID

size_t Lambda::ID
static

◆ interpolating_values

double Property::interpolating_values[4]
protectedinherited

◆ lambda_base_ptr

std::unique_ptr<Lambda_Base> Lambda::lambda_base_ptr
private

Used in some lambda estimate (e.g. Klencki) to check if it is needed to initialise stuff

◆ last_evolve_number

unsigned int JIT_Property::last_evolve_number =0
privateinherited

◆ M0_cached

double Lambda::M0_cached =0
private

◆ Mzams_cachedM

double Lambda::Mzams_cachedM =0
private

Cached values for BSE-like MOBSE-like lambdas

◆ Mzams_cachedR

double Lambda::Mzams_cachedR =0
private

◆ PrintMap

Property::_PrintMap Property::PrintMap
staticinherited

◆ Rzams_cached

double Lambda::Rzams_cached =0
private

◆ svlog

SevnLogging Property::svlog
protectedinherited

◆ V

double Property::V
protectedinherited

◆ V0

double Property::V0
protectedinherited

◆ val_in

double* Property::val_in[4]
inherited

◆ val_ref

double* Property::val_ref[4]
inherited

◆ value

double Property::value
protectedinherited

◆ value0

double Property::value0
protectedinherited

◆ VBIN

vector<double> Property::VBIN
protectedinherited

◆ wM

double Property::wM[4]
protectedinherited

◆ wZ

double Property::wZ[2]
protectedinherited

◆ Zmet_cachedM

double Lambda::Zmet_cachedM =0
private

◆ Zmet_cachedR

double Lambda::Zmet_cachedR =0
private

The documentation for this class was generated from the following files: