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

#include <Processes.h>

Inheritance diagram for CommonEnvelope:
MaccretionProcess Process

Public Types

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

Public Member Functions

 CommonEnvelope (_UNUSED IO *_io=nullptr, bool reg=true)
 
CommonEnvelopeInstance (IO *_io) override
 
std::string name () override
 
int special_evolve (Binstar *binstar) override
 
std::string log_message_swallowed (Binstar *binstar)
 
virtual double NS_DBmag_accretion (_UNUSED Binstar *b, _UNUSED Star *s, _UNUSED double DM) const
 
virtual double NS_DOmegaRem_accretion (_UNUSED Binstar *b, _UNUSED Star *s, _UNUSED double DM) const
 
virtual ProcessInstance (_UNUSED IO *_io)
 
virtual int evolve (_UNUSED Binstar *binstar)
 
virtual int special_evolve (_UNUSED Binstar *binstar)
 
double get (const size_t &id)
 
double get_var (const size_t &starID, const size_t &propID)
 
std::string & get_msg ()
 
void restore ()
 
int modify_SemimajorDV_by_a_factor (double factor)
 
int modify_EccentricityDV_by_a_factor (double factor)
 
bool is_mass_transfer_happening ()
 
virtual bool is_process_ongoing () const
 
void set_event (double code)
 Events handling. More...
 
double get_event ()
 
void reset_event ()
 
void special_evolution_alarm_switch_on ()
 Three methods to handle the private member special_evolution_alarm. More...
 
void special_evolution_alarm_switch_off ()
 
bool is_special_evolution_alarm_on () const
 
virtual double estimate_accreted_mass (_UNUSED double DM, _UNUSED Star *donor, _UNUSED Star *accretor, _UNUSED Binstar *binstar) const
 

Static Public Member Functions

static std::string log_mess (Binstar *binstar, Star *primary, Star *secondary)
 

Static Public Attributes

static size_t ID
 
static CommonEnvelope _commonenvelope
 
static std::vector< Process * > all
 
static _PrintMap PrintMap
 

Protected Member Functions

int init (Binstar *binstar)
 
int whoisprimary (Binstar *binstar)
 
double final_mass_after_coalescence ()
 
std::string main_coalesce (Binstar *binstar)
 
std::string coalesce (Binstar *binstar)
 
std::string coalesce_with_bindingEnergy (Binstar *binstar)
 
int lose_the_envelope (Binstar *binstar)
 
double hurley_rm_x (double Z)
 
double hurley_final_mass (const double Ebindf, const double toll=1e-3, const double maxit=100)
 
virtual int accrete_mass (_UNUSED Binstar *binstar)
 
virtual void handle_NS_massaccretion (_UNUSED Binstar *b, _UNUSED Star *s, _UNUSED double DM)
 
void Register (Process *_p, size_t *id, const std::string &_name)
 
void set (const size_t &id, const double &value)
 
void set_var (const size_t &starID, const size_t &propID, const double &value)
 
void set_msg (const std::string &str)
 
void set_V_to_0 ()
 

Protected Attributes

Stardonor = nullptr
 
Staraccretor = nullptr
 
SevnLogging svlog
 
Orbital_changeorb_change = nullptr
 
std::uniform_real_distribution< double > _uniform_real
 

Private Attributes

Starprimary
 
Starsecondary
 
double lambda
 
double alpha
 
double a_fin
 
double ecc_fin
 
double M_env_primary
 
double M_core_primary
 
double R_core_primary
 
double M_env_secondary
 
double M_core_secondary
 
double R_core_secondary
 
double RL_primary_final
 
double RL_secondary_final
 
double Ebind_ini
 
double Eorb_ini
 
double Eorb_fin
 
bool isinisialised =false
 
std::vector< double > VB
 
std::vector< std::vector< double > > VS
 
std::string message
 
double event_code =-1
 
bool special_evolution_alarm =false
 

Static Private Attributes

static size_t size = 0
 

Member Typedef Documentation

◆ _PrintMap

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

Constructor & Destructor Documentation

◆ CommonEnvelope()

CommonEnvelope::CommonEnvelope ( _UNUSED IO _io = nullptr,
bool  reg = true 
)
inline

Member Function Documentation

◆ accrete_mass()

virtual int MaccretionProcess::accrete_mass ( _UNUSED Binstar binstar)
inlineprotectedvirtualinherited

Function in which the mass accretion is handled. This function should take care of changing all the single stellar evolution properties (not only the mass) The change of binary parameters such as Semimajor axis and Eccentricity are instead changed inside evolve using the methods DA and DE.

Parameters
binstarPointer to the binary star
Returns
EXIT SUCCESS

◆ coalesce()

std::string CommonEnvelope::coalesce ( Binstar binstar)
protected

Handling the coalesce after the common envelope using the SEVN2 formalism.

Parameters
binstarPointer to the binary system
Returns
A string with the log message from MIX::log_message

Estimate the effective a_fin, it is the one for wich RL=rc

Check if a primary-secondary swap is needed

◆ coalesce_with_bindingEnergy()

std::string CommonEnvelope::coalesce_with_bindingEnergy ( Binstar binstar)
protected

Handling the coalesce after coalesce after the common envelope using the SEVN1 binding energy approach

Parameters
binstarPointer to the binary system
Returns
A string with the log message from MIX::log_message

ESTIMATE THE FINAL ENVELOPE ENERGY

ESTIMATE THE CORE OF THE NEW STAR

◆ estimate_accreted_mass()

virtual double Process::estimate_accreted_mass ( _UNUSED double  DM,
_UNUSED Star donor,
_UNUSED Star accretor,
_UNUSED Binstar binstar 
) const
inlinevirtualinherited

Public interface to allow the user to get information without actually evolving the systems. NOTICE: to be self-consistent the protected and private methods (such DA and DE should use these methods) when changing the properties of stars and binaries. This function should be an interface for the user to return the amount of mass accreted on the accretor given the binary, the donor and the available amount of mass DM. NOTICE: internally the accrete mass should use this method to be self-consistent

Parameters
DMamount of mass available to be accreted in Msun.
donorPointer to the Star that is donating the mass
accretorPointer to the star that is receiving the mass
binstarPointer to the binary system hosting the donor and the accretore
Returns
the amount of accreted mass

Reimplemented in WindaccretionHurley.

◆ evolve()

virtual int Process::evolve ( _UNUSED Binstar binstar)
inlinevirtualinherited

◆ final_mass_after_coalescence()

double CommonEnvelope::final_mass_after_coalescence ( )
protected

Estimate the final mass after CE coalescence using a simple precription: Mf = (Mc1 + Mc2) + K_NCE * (M2_NCE) + k_CE * (M1_CE + M2_CE), where:

  • Mc1, Mc2: Masses of the cores (He + CO)
  • K_NCE: fraction [0,1] of the (non core) mass of the secondary M2_NCE not participating to the CE (e.g. MS) reteained after the CE
  • K_CE: fraction [0,1] of the (non core) mass of the primary M1_CE and secondary M2_CE participating to the CE reteained after the CE
    Parameters
    primaryPointer to the primary star, NB this is the star starting the CE, it has to have a core.
    secondaryPointer to the secondary star
    Returns
    Final total mass after CE

◆ get()

double Process::get ( const size_t &  id)
inlineinherited

◆ get_event()

double Process::get_event ( )
inlineinherited

◆ get_msg()

std::string & Process::get_msg ( )
inlineinherited

◆ get_var()

double Process::get_var ( const size_t &  starID,
const size_t &  propID 
)
inlineinherited

◆ handle_NS_massaccretion()

void MaccretionProcess::handle_NS_massaccretion ( _UNUSED Binstar b,
_UNUSED Star s,
_UNUSED double  DM 
)
protectedvirtualinherited

It is a wrapper of all the necessray function calls to set the DV of NS properties after mass accretion

Parameters
sPointer to the ns star
dMMass accreted in Msun

◆ hurley_final_mass()

double CommonEnvelope::hurley_final_mass ( const double  Ebindf,
const double  toll = 1e-3,
const double  maxit = 100 
)
inlineprotected

◆ hurley_rm_x()

double CommonEnvelope::hurley_rm_x ( double  Z)
inlineprotected

◆ init()

int CommonEnvelope::init ( Binstar binstar)
protected

◆ Instance() [1/2]

virtual Process * Process::Instance ( _UNUSED IO _io)
inlinevirtualinherited

◆ Instance() [2/2]

CommonEnvelope * CommonEnvelope::Instance ( IO _io)
inlineoverride

◆ is_mass_transfer_happening()

bool Process::is_mass_transfer_happening ( )
inlineinherited

Check if this process is changing the mass

Returns
false if the DV regarding the Mass of both stars is currently set to 0, true otherwise

◆ is_process_ongoing()

virtual bool Process::is_process_ongoing ( ) const
inlinevirtualinherited

Check if the current process is ongoing

Returns
true if the process is ongoing, false otherwise

Reimplemented in Kollision, Hardening, Windaccretion, WindaccretionHurley, and WindaccretionDisabled.

◆ is_special_evolution_alarm_on()

bool Process::is_special_evolution_alarm_on ( ) const
inlineinherited

◆ log_mess()

std::string CommonEnvelope::log_mess ( Binstar binstar,
Star primary,
Star secondary 
)
static

◆ log_message_swallowed()

std::string CommonEnvelope::log_message_swallowed ( Binstar binstar)

Swallowed after CE, assumint always that the swallowed star is the primary

Parameters
binstarpointer to the binary
Returns
A string log message

◆ lose_the_envelope()

int CommonEnvelope::lose_the_envelope ( Binstar binstar)
protected

Remove the envelope after the CE phase.

Parameters
binstarPointer to the binary system.
Returns
EXIT_SUCCESS

◆ main_coalesce()

std::string CommonEnvelope::main_coalesce ( Binstar binstar)
protected

Let the two stars coalesce after the common envelope.

Parameters
binstarPointer to the binary system
Returns
A string with the log message from MIX::log_message

START

Initial check

◆ modify_EccentricityDV_by_a_factor()

int Process::modify_EccentricityDV_by_a_factor ( double  factor)
inlineinherited

Correct the VB cell containing the Eccentricity variation

Parameters
factorcorrection factor the new DE will be DE*factor.
Returns
EXIT_SUCCESS

◆ modify_SemimajorDV_by_a_factor()

int Process::modify_SemimajorDV_by_a_factor ( double  factor)
inlineinherited

Correct the VB cell containing the Semimajor variation

Parameters
factorcorrection factor the new DA will be DA*factor.
Returns
EXIT_SUCCESS

◆ name()

std::string CommonEnvelope::name ( )
inlineoverridevirtual

Reimplemented from Process.

◆ NS_DBmag_accretion()

double MaccretionProcess::NS_DBmag_accretion ( _UNUSED Binstar b,
_UNUSED Star s,
_UNUSED double  DM 
) const
virtualinherited

This function estimate the increment or decrement of NS Bmag due do the accretion of material

Parameters
sPointer to the star that is accreting
dMMass accreted in Msun
Returns
THe difference in Bmag after accretion

Checks

◆ NS_DOmegaRem_accretion()

double MaccretionProcess::NS_DOmegaRem_accretion ( _UNUSED Binstar b,
_UNUSED Star s,
_UNUSED double  DM 
) const
virtualinherited

This function estimate the increment or decrement of NS angular velocity OmegaRem due do the accretion of material

Parameters
sPointer to the star that is accreting
dMMass accreted in Msun
Returns
THe difference in OmegaRem after accretion

Checks

◆ Register()

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

◆ reset_event()

void Process::reset_event ( )
inlineinherited

◆ restore()

void Process::restore ( )
inlineinherited

◆ set()

void Process::set ( const size_t &  id,
const double &  value 
)
inlineprotectedinherited

◆ set_event()

void Process::set_event ( double  code)
inlineinherited

Events handling.

◆ set_msg()

void Process::set_msg ( const std::string &  str)
inlineprotectedinherited

◆ set_V_to_0()

void Process::set_V_to_0 ( )
inlineprotectedinherited

◆ set_var()

void Process::set_var ( const size_t &  starID,
const size_t &  propID,
const double &  value 
)
inlineprotectedinherited

◆ special_evolution_alarm_switch_off()

void Process::special_evolution_alarm_switch_off ( )
inlineinherited

◆ special_evolution_alarm_switch_on()

void Process::special_evolution_alarm_switch_on ( )
inlineinherited

Three methods to handle the private member special_evolution_alarm.

◆ special_evolve() [1/2]

virtual int Process::special_evolve ( _UNUSED Binstar binstar)
inlinevirtualinherited

Reimplemented in StandardCircularisation.

◆ special_evolve() [2/2]

int CommonEnvelope::special_evolve ( Binstar binstar)
override

LOG PRINT

◆ whoisprimary()

int CommonEnvelope::whoisprimary ( Binstar binstar)
protected

Initialise the primary and secondary attribute with the stars in the binary system. The primary is the star in the system that has a core and is overfilling the Roche Lobe. If both stars satisfied these conditions, the primary is the star that is more overfilling the Roche Lobe (R1/RL1>R2/RL2).

Parameters
binstarPointer to the binary system
Returns
EXIT_SUCCESS or throw an error.
Exceptions
sevenstd::bse_errorThrown if neither of the two stars has a core and is overfilling the Roche Lobe (The system should not start a CE).

Set primary and secondary

Member Data Documentation

◆ _commonenvelope

CommonEnvelope CommonEnvelope::_commonenvelope
static

◆ _uniform_real

std::uniform_real_distribution<double> Process::_uniform_real
protectedinherited

◆ a_fin

double CommonEnvelope::a_fin
private

◆ accretor

Star* Process::accretor = nullptr
protectedinherited

◆ all

std::vector< Process * > Process::all
staticinherited

◆ alpha

double CommonEnvelope::alpha
private

◆ donor

Star* Process::donor = nullptr
protectedinherited

◆ Ebind_ini

double CommonEnvelope::Ebind_ini
private

◆ ecc_fin

double CommonEnvelope::ecc_fin
private

◆ Eorb_fin

double CommonEnvelope::Eorb_fin
private

◆ Eorb_ini

double CommonEnvelope::Eorb_ini
private

◆ event_code

double Process::event_code =-1
privateinherited

◆ ID

size_t CommonEnvelope::ID
static

Define all the Process ID

◆ isinisialised

bool CommonEnvelope::isinisialised =false
private

◆ lambda

double CommonEnvelope::lambda
private

◆ M_core_primary

double CommonEnvelope::M_core_primary
private

◆ M_core_secondary

double CommonEnvelope::M_core_secondary
private

◆ M_env_primary

double CommonEnvelope::M_env_primary
private

◆ M_env_secondary

double CommonEnvelope::M_env_secondary
private

◆ message

std::string Process::message
privateinherited

◆ orb_change

Orbital_change* Process::orb_change = nullptr
protectedinherited

◆ primary

Star* CommonEnvelope::primary
private

◆ PrintMap

Process::_PrintMap Process::PrintMap
staticinherited

◆ R_core_primary

double CommonEnvelope::R_core_primary
private

◆ R_core_secondary

double CommonEnvelope::R_core_secondary
private

◆ RL_primary_final

double CommonEnvelope::RL_primary_final
private

◆ RL_secondary_final

double CommonEnvelope::RL_secondary_final
private

◆ secondary

Star* CommonEnvelope::secondary
private

◆ size

size_t Process::size = 0
staticprivateinherited

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

◆ special_evolution_alarm

bool Process::special_evolution_alarm =false
privateinherited

Member used to check if a special evolution is required

◆ svlog

SevnLogging Process::svlog
protectedinherited

◆ VB

std::vector<double> Process::VB
privateinherited

values of the properties of the binary system (e.g. processes change eccentricity, semimajor...)

◆ VS

std::vector<std::vector<double> > Process::VS
privateinherited

variations of the single star parameters due to binary stellar evolution processes (e.g. mass, radius...)


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