Chemistry C API¶
Some Definitions¶
The mass of element i ejected by a SNII and synthesized by a star of mass m writes:
The mass of element i ejected by a SNII issue from the non processed part of a star of mass m writes:
Where we have defined the helium core mass fraction as:
with , the mass of the remnant.
Some variables¶
table containing 1-helium core, 1-residual and yields for all elements
Initialisation functions¶
-
void allocate_chimie()¶
This function allocates all varaiables related to the chemistry
-
void set_table(int i)¶
Set the chemistry table to use
-
void read_chimie(char *filename, int it)¶
Read the chemistry table
-
void init_chimie(void)¶
This function initializes the chemistry parameters
-
void check_chimie(void)¶
This function performe simple checks to validate the chemistry initialization
-
int get_nelts()¶
Return the number of elements considered
-
float get_SolarMassAbundance(i)¶
Return the solar mass abundance of elt i
-
char *get_Element(i)¶
Return the label of element i
IMF functions¶
-
static double get_imf(double m)¶
This function returns the mass fraction of a star of mass m using the current IMF
-
static double get_imf_M(double m1, double m2)¶
This function returns the mass fraction between m1 and m2 per mass unit, using the current IMF
-
static double get_imf_N(double m1, double m2)¶
This function returns the number fraction between m1 and m2 per mass unit, using the current IMF
-
static double imf_sampling()¶
Sample the imf using monte carlo approach
-
void init_imf(void)¶
This function initializes the imf parameters defined in the chemistry file. It compute the normalization factor
ensuring:
Lifetime functions¶
-
double star_lifetime(double z, double m)¶
Return the lifetime of a star of mass m and metallicity z
-
double star_mass_from_age(double z, double t)¶
Return the mass of a star having a livetime t and a metallicity z
Dying stars functions¶
number of dying stars in a mass range¶
-
double DYIN_rate(double m1, double m2)¶
compute the number of stars between m1 and m2 masses in code unit
-
double SNII_rate(double m1, double m2)¶
compute the number of SNII between m1 and m2 masses in code unit
-
double SNIa_rate(double m1, double m2)¶
compute the number of SNIa between m1 and m2 masses in code unit
DYIN mass ejection¶
-
void DYIN_mass_ejection(double m1, double m2)¶
Compute the mass fraction and yields of dying stars with masses between m1 and m2. Only masses lower than
are conserned. Store the result in the global variable
MassFracDYIN
:MassFracDYIN[0] = total gas MassFracDYIN[1] = helium core (i.e. alpha(m)) MassFracDYIN[i] = frac mass elt i.
-
void DYIN_single_mass_ejection(double m1)¶
Compute the mass fraction and yields of a dying stars of masse m1. Only masses lower than
are conserned. Store the result in the global variable
SingleMassFracDYIN
:SingleMassFracDYIN[0] = total gas SingleMassFracDYIN[1] = helium core (i.e. alpha(m)) SingleMassFracDYIN[i] = frac mass elt i.
SNII mass ejection¶
-
void SNII_mass_ejection(double m1, double m2)¶
Warning
in the old version the mass ejected by SNII also included the mass ejected by smaller mass objects. This is now corrected.
Compute the mass fraction and yields of SNII stars with masses between m1 and m2. Only masses in the range
are conserned. Store the result in the global variable
MassFracSNII
:MassFracSNII[0] = total gas per mass unit = 1-w (1 - mass fract of residual) MassFracSNII[1] = 1-helium core (i.e. non processed elts) MassFracSNII[i+2] = mass fract of elt i. (syntetised elts)
-
void SNII_single_mass_ejection(double m1)¶
Warning
in the old version the mass ejected by SNII also included the mass ejected by smaller mass objects. This is now corrected.
Compute the mass fraction and yields of a SNII stars of masse m1. Only masses in the range
are conserned. Store the result in the global variable
SingleMassFracSNII
:SingleMassFracSNII[0] = total gas per mass unit = 1-w (1 - mass fract of residual) SingleMassFracSNII[1] = 1-helium core (i.e. non processed elts) SingleMassFracSNII[i+2] = mass fract of elt i. (syntetised elts)
SNIa mass ejection¶
-
void SNIa_mass_ejection(double m1, double m2)¶
Compute the total mass and element mass per mass unit of SNIa stars with masses between m1 and m2. Store the result in the global variable
MassFracSNIa
:MassFracSNIa[0] = total gas per mass unit = 1-w (1 - mass fract of residual) MassFracSNIa[1] = -1 (unused) MassFracSNIa[i+2] = mass fract of elt i. (SNIa yields)
-
void SNIa_single_mass_ejection(double m1)¶
Compute the total mass mass of element of a SNIa stars of masse m1. Store the result in the global variable
SingleMassFracSNIa
:SingleMassFracSNIa[0] = total gas per mass unit = 1-w (1 - mass fract of residual) SingleMassFracSNIa[1] = -1 (unused) SingleMassFracSNIa[i] = mass fract of elt i. (SNIa yields)
Total mass ejection¶
-
void Total_mass_ejection(double m1, double m2, double M0, double *z)¶
Sum the contribution in mass and yields of all stars in the mass range m1,m2. Store the result in the global variable EjectedMass:
EjectedMass[0] = total gas EjectedMass[1] = unused EjectedMass[i+2] = mass of elt i.
FOR THE MOMENT:
- contrib of SNII (= all stars) - contrib of SNIa
Warning
in fact, we do not relly compute
. This value is already sorted in
Elt[i].MSNIa
.
-
void DYIN_Total_single_mass_ejection(double m1, double *z)¶
Mass and element ejected by a single dying stars of mass m1. This takes into account processed and non processed gas The results are stored in:
SingleEjectedMass[0] = gas mass SingleEjectedMass[1] = unsued SingleEjectedMass[i+2] = mass of elt i.
-
void SNII_Total_single_mass_ejection(double m1, double *z)¶
Mass and element ejected by a single SNII of mass m1. This takes into account processed and non processed gas The results are stored in:
SingleEjectedMass[0] = gas mass SingleEjectedMass[1] = unsued SingleEjectedMass[i+2] = mass of elt i.
-
void SNIa_Total_single_mass_ejection(double m1, double *z)¶
Mass and element ejected by a single SNIa of mass m1. The results are stored in:
SingleEjectedMass[0] = gas mass SingleEjectedMass[1] = unsued SingleEjectedMass[i+2] = mass of elt i.
-
void Total_single_mass_ejection(double m1, double *z, double NSNII, double NSNIa, double NDYIN)¶
Sum the contribution in mass and yields of one star of mass m1. Store the result in the global variable EjectedMass:
SingleEjectedMass[0] = total gas SingleEjectedMass[1] = unused SingleEjectedMass[i+2] = mass of elt i.
FOR THE MOMENT:
- contrib of SNII (= all stars) - contrib of SNIa
Warning
in fact, we do not relly compute
. This value is already sorted in
Elt[i].MSNIa
.