criptic v1
Cosmic Ray Interstellar Propagation Tool using Itô Calculus
Loading...
Searching...
No Matches
Constants.H
Go to the documentation of this file.
1
13#ifndef _CONSTANTS_H_
14#define _CONSTANTS_H_
15
16#include <gsl/gsl_const_cgsm.h>
17#include <gsl/gsl_const_mksa.h>
18#include <gsl/gsl_const_num.h>
19#include "../Definitions.H"
20#include "Types.H"
21#include "Units.H"
22
23namespace criptic {
24
28 namespace constants {
29
30#ifdef CRIPTIC_UNITS_CGS
31
32 // CGS units
33 static constexpr Real c
34 = GSL_CONST_CGSM_SPEED_OF_LIGHT;
35 static constexpr Real mp
36 = GSL_CONST_CGSM_MASS_PROTON;
37 static constexpr Real me
38 = GSL_CONST_CGSM_MASS_ELECTRON;
39 static constexpr Real sigmaT
40 = GSL_CONST_CGSM_THOMSON_CROSS_SECTION;
41 static constexpr Real kB =
42 GSL_CONST_CGSM_BOLTZMANN;
43 static constexpr Real h =
44 GSL_CONST_CGSM_PLANCKS_CONSTANT_H;
45 static constexpr Real hBar =
46 GSL_CONST_CGSM_PLANCKS_CONSTANT_HBAR;
47 static constexpr Real e =
48 GSL_CONST_CGSM_ELECTRON_CHARGE * c;
57 static constexpr Real a0 =
58 GSL_CONST_CGSM_BOHR_RADIUS;
59 static constexpr Real Ryd =
60 GSL_CONST_CGSM_RYDBERG;
61 static constexpr Real sigmaSB =
62 GSL_CONST_CGSM_STEFAN_BOLTZMANN_CONSTANT;
63 static constexpr Real r0 =
64 e * e / (me * c * c);
65 static constexpr Real Msun =
66 GSL_CONST_CGSM_SOLAR_MASS;
67 static constexpr Real Lsun =
68 3.828e33;
69 static constexpr Real amu =
70 GSL_CONST_CGSM_UNIFIED_ATOMIC_MASS;
72#elif defined(CRIPTIC_UNITS_MKS)
73
74 // MKS units
75 static constexpr Real c
76 = GSL_CONST_MKSA_SPEED_OF_LIGHT;
77 static constexpr Real mp
78 = GSL_CONST_MKSA_MASS_PROTON;
79 static constexpr Real me
80 = GSL_CONST_MKSA_MASS_ELECTRON;
81 static constexpr Real sigmaT
82 = GSL_CONST_MKSA_THOMSON_CROSS_SECTION;
83 static constexpr Real kB =
84 GSL_CONST_MKSA_BOLTZMANN;
85 static constexpr Real h =
86 GSL_CONST_MKSA_PLANCKS_CONSTANT_H;
87 static constexpr Real hBar =
88 GSL_CONST_MKSA_PLANCKS_CONSTANT_HBAR;
89 static constexpr Real e =
90 GSL_CONST_MKSA_ELECTRON_CHARGE;
91 static constexpr Real a0 =
92 GSL_CONST_MKSA_BOHR_RADIUS;
93 static constexpr Real Ryd =
94 GSL_CONST_MKSA_RYDBERG;
95 static constexpr Real sigamSB =
96 GSL_CONST_MKSA_STEFAN_BOLTZMANN_CONSTANT;
97 static constexpr Real eps0 =
98 GSL_CONST_MKSA_VACUUM_PERMITTIVITY;
99 static constexpr Real mu0 =
100 GSL_CONST_MKSA_VACUUM_PERMEABILITY;
101 static constexpr Real r0 =
102 e * e / (4.0 * M_PI * eps0 * me * c * c);
103 static constexpr Real Msun =
104 GSL_CONST_MKSA_SOLAR_MASS;
105 static constexpr Real Lsun =
106 3.828e26;
107 static constexpr Real amu =
108 GSL_CONST_MKSA_UNIFIED_ATOMIC_MASS;
110#endif
111
112 // Additional constants derived from the above
113 static constexpr Real c2 = c*c;
114 static constexpr Real c3 = c*c*c;
115 static constexpr Real e2 = e*e;
116 static constexpr Real e3 = e*e*e;
117 static constexpr Real mp_c = mp * c;
118 static constexpr Real mp_c2 = mp * c2;
119 static constexpr Real me_c = me * c;
120 static constexpr Real me_c2 = me * c2;
121 static constexpr Real alpha =
122 GSL_CONST_NUM_FINE_STRUCTURE;
123 static constexpr Real aR = 4.0 * sigmaSB / c;
125 // Particle masses and related quantities -- from CODATA 2018
126 static constexpr Real mPi0 = 134.9758 * units::MeV / c2;
127 static constexpr Real mPic = 139.57061 * units::MeV / c2;
128 static constexpr Real mMu = 105.6583755 * units::MeV / c2;
129 static constexpr Real Tpth = 2 * mPi0 * c2 +
130 mPi0 * c2 * mPi0 * c2 /
131 (2 * mp_c2);
132 static constexpr Real rMuPi = mMu / mPic;
135 // Masses of astrophysically-important light isotopes -- all taken from
136 // https://physics.nist.gov/cgi-bin/Compositions/stand_alone.pl. Note
137 // the namine convention for isotopes: mXn is the mass of the isotope of
138 // element X with atomic number n. When one isotope is overwhelmingly
139 // dominant, for example carbon 12, mX without the trailing number gives
140 // the mass of the dominant isotope. The only except to this is for
141 // hydrogen, where the mass of deuterium is mDeut -- this is to avoid
142 // the confusion that would result from calling it mH2, which could be
143 // either the mass of deuterium, or of the H2 molecule.
144 static constexpr Real mH = 1.007825032239 * amu;
145 static constexpr Real mDeut = 2.0141017781212 * amu;
146 static constexpr Real mHe3 = 3.016029320125 * amu;
147 static constexpr Real mHe4 = 4.002603254136 * amu;
148 static constexpr Real mHe = mHe4;
149 static constexpr Real mLi6 = 6.015122887416 * amu;
150 static constexpr Real mLi7 = 7.016003436645 * amu;
151 static constexpr Real mBe = 9.01218306582 * amu;
152 static constexpr Real mB10 = 10.0129369541 * amu;
153 static constexpr Real mB11 = 11.0093053645 * amu;
154 static constexpr Real mC12 = 12.0 * amu;
155 static constexpr Real mC13 = 13.0033548350723 * amu;
156 static constexpr Real mC14 = 14.003241988440 * amu;
157 static constexpr Real mC = mC12;
158 static constexpr Real mN14 = 14.0030740044320 * amu;
159 static constexpr Real mN15 = 15.0001088988864 * amu;
160 static constexpr Real mN = mN14;
161 static constexpr Real mO16 = 15.9949146195717 * amu;
162 static constexpr Real mO17 = 16.9991317565069 * amu;
163 static constexpr Real mO18 = 17.9991596128676 * amu;
164 static constexpr Real mO = mO16;
166 // Nuclear binding energies -- in units of mp c²
167 static constexpr Real BE_carbon12 = 92.16175014 * units::MeV / constants::mp_c2;
168 static constexpr Real BE_boron10 = 64.7507 * units::MeV / constants::mp_c2;
169 static constexpr Real BE_nitrogen14 = 104.658 * units::MeV / constants::mp_c2;
170 static constexpr Real BE_boron11 = 76.204 * units::MeV / constants::mp_c2;
171 static constexpr Real BE_oxygen16 = 127.619 * units::MeV / constants::mp_c2;
172 }
173}
174
175
176#endif
177// _CONSTANTS_H_
Basic integer and real types.
Data file of unit conversions.
static constexpr Real mBe
Definition Constants.H:151
static constexpr Real aR
Definition Constants.H:123
static constexpr Real e3
Definition Constants.H:116
static constexpr Real mC12
Definition Constants.H:154
static constexpr Real BE_boron10
Definition Constants.H:168
static constexpr Real mLi7
Definition Constants.H:150
static constexpr Real mC
Definition Constants.H:157
static constexpr Real mB11
Definition Constants.H:153
static constexpr Real BE_nitrogen14
Definition Constants.H:169
static constexpr Real rMuPi
Definition Constants.H:132
static constexpr Real BE_carbon12
Definition Constants.H:167
static constexpr Real Tpth
Definition Constants.H:129
static constexpr Real Lsun
Definition Constants.H:67
static constexpr Real mHe3
Definition Constants.H:146
static constexpr Real BE_boron11
Definition Constants.H:170
static constexpr Real mO
Definition Constants.H:164
static constexpr Real mHe
Definition Constants.H:148
static constexpr Real mMu
Definition Constants.H:128
static constexpr Real mPi0
Definition Constants.H:126
static constexpr Real me_c2
Definition Constants.H:120
static constexpr Real mp_c2
Definition Constants.H:118
static constexpr Real c3
Definition Constants.H:114
static constexpr Real mH
Definition Constants.H:144
static constexpr Real mB10
Definition Constants.H:152
static constexpr Real mO16
Definition Constants.H:161
static constexpr Real sigmaSB
Definition Constants.H:61
static constexpr Real mN
Definition Constants.H:160
static constexpr Real c
Definition Constants.H:34
static constexpr Real BE_oxygen16
Definition Constants.H:171
static constexpr Real alpha
Definition Constants.H:121
static constexpr Real sigmaT
Definition Constants.H:40
static constexpr Real mDeut
Definition Constants.H:145
static constexpr Real mC13
Definition Constants.H:155
static constexpr Real mHe4
Definition Constants.H:147
static constexpr Real me_c
Definition Constants.H:119
static constexpr Real hBar
Definition Constants.H:45
static constexpr Real me
Definition Constants.H:38
static constexpr Real mN15
Definition Constants.H:159
static constexpr Real Ryd
Definition Constants.H:59
static constexpr Real mp
Definition Constants.H:36
static constexpr Real a0
Definition Constants.H:57
static constexpr Real mC14
Definition Constants.H:156
static constexpr Real e2
Definition Constants.H:115
static constexpr Real mO18
Definition Constants.H:163
static constexpr Real mN14
Definition Constants.H:158
static constexpr Real h
Definition Constants.H:43
static constexpr Real kB
Definition Constants.H:41
static constexpr Real mPic
Definition Constants.H:127
static constexpr Real c2
Definition Constants.H:113
static constexpr Real r0
Definition Constants.H:63
static constexpr Real amu
Definition Constants.H:69
static constexpr Real mp_c
Definition Constants.H:117
static constexpr Real mO17
Definition Constants.H:162
static constexpr Real Msun
Definition Constants.H:65
static constexpr Real e
Definition Constants.H:47
static constexpr Real mLi6
Definition Constants.H:149
static constexpr Real MeV
Definition Units.H:66
The primary namespace for criptic objects.
Definition AdvancePacket.H:25
double Real
Definition Types.H:38