changa 3.5
Loading...
Searching...
No Matches
starlifetime.h
1#ifndef STARTIME_H_INCLUDED
2#define STARTIME_H_INCLUDED
3/*
4 Uses Raiteri, Villata, and Navarro (A&A, 315, 105, 1996) fit to
5 Padova group stellar models to find stellar lifetimes as a
6 function of mass, M,and metallicity, Z.
7
8 log t = a0(Z) + a1(Z)*log(M) + a2(Z)*(log(M))**2
9
10 where t is stellar lifetime in years, M is stellar mass
11 in solar masses, and Z, defined as the total mass fracion in
12 elements heavier than He, is in the range 0.0004-0.05.
13 Coefficients are given as follows:
14
15 a0(Z) = 10.13 + 0.07547*log(Z) - 0.008084*(log(Z))**2
16
17 a1(Z) = -4.424 + 0.7939*log(Z) - 0.1187*(log(Z))**2
18
19 a2(Z) = 1.262 + 0.3385*log(Z) - 0.1187*(log(Z))**2
20
21 zmin, zmax = minimum and maximum metallicity in stellar lifetimes equation
22 zsol = solar metal abundance
23 xoxsol = solar oxygen abundance */
24
27class Padova {
28 double a00, a01, a02;
29 double a10, a11, a12;
30 double a20, a21, a22;
31 mutable double a0, a1, a2;
32 double zmin, zmax, zsol, xoxsol;
33 void CoefInit (double dMetals) const;
34 public:
35 Padova() : a00(10.13), a01(0.07547), a02(-0.008084),
36 a10(-4.424),a11(-0.7939), a12(-0.1187),
37 a20(1.262),a21(0.3385),a22(0.05417),
38 a0(0.0), a1(0.0), a2(0.0),
39 zmin(7e-5), zmax(3e-2), zsol(0.02), xoxsol(9e-3) {}
40
41 double Lifetime(double dStarMass, double dMetals) const;
42 double StarMass(double dStarLtime, double dMetals) const;
43 void pup(PUP::er& p) {
44 p | a00;
45 p | a01;
46 p | a02;
47 p | a10;
48 p | a11;
49 p | a12;
50 p | a20;
51 p | a21;
52 p | a22;
53 p | a0;
54 p | a1;
55 p | a2;
56 p | zmin;
57 p | zmax;
58 p | zsol;
59 p | xoxsol;
60 }
61 };
62
63
64#endif