Aether  0.0
Ionosphere-Thermosphere model
constants.h
1 // Copyright 2020, the Aether Development Team (see doc/dev_team.md for members)
2 // Full license can be found in License.md
3 
4 #ifndef INCLUDE_CONSTANTS_H_
5 #define INCLUDE_CONSTANTS_H_
6 
7 #include <vector>
8 
9 // -------------------------------------------------------------------------
10 // Physical Constants
11 // - Naming standards:
12 // - Names start with a "c" to indicate they are constants
13 // - Names should be all CAPS (except for "c" at start)
14 // - Should use common abbreviations for names and not whole names
15 // -------------------------------------------------------------------------
16 
17 // avogadros_number (per mole)
18 const precision_t cNA = 6.02214086e23;
19 
20 // boltzmanns_constant (m2 kg /s2 /K)
21 const precision_t cKB = 1.38064852e-23;
22 
23 // Universal Gas Constant (J/K/mol)
24 const precision_t cR = cNA * cKB;
25 
26 // Mass of a proton (kg)
27 const precision_t cMP = 1.6726219e-27;
28 
29 // Atomic Mass Unit (kk)
30 const precision_t cAMU = cMP;
31 
32 // Mass of an electron (kg)
33 const precision_t cME = 9.1094e-31;
34 
35 // Plancks Constant (Js)
36 const precision_t cH = 6.6261e-34;
37 
38 // Elemental Charge (C (J/eV))
39 const precision_t cE = 1.6022e-19;
40 
41 // Speed of Light (m/s)
42 const precision_t cC = 2.9979e8;
43 
44 // -------------------------------------------------------------------------
45 // Stellar constants:
46 // -------------------------------------------------------------------------
47 
48 // gravitational_constant (m3/kg/s2)
49 const precision_t cG = 6.67408e-11;
50 
51 // This is for our sun (solar mass in kg):
52 const precision_t cMSOL = 1.989e30;
53 
54 // -------------------------------------------------------------------------
55 // Some constants for time
56 // -------------------------------------------------------------------------
57 
58 const std::vector<int> cDAYS {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
59 const int cREFYEAR = 1965;
60 const double cREFJULIAN = 2438762.0;
61 const double cJULIAN2000 = 2451545.0;
62 
63 // -------------------------------------------------------------------------
64 // Some Constants for Angles
65 // -------------------------------------------------------------------------
66 
67 const precision_t cPI = 3.141592653589793;
68 const precision_t cTWOPI = 2*cPI;
69 
70 // -------------------------------------------------------------------------
71 // Conversion Constants:
72 // - Naming standards:
73 // - Names start with a "c" to indicate they are constants
74 // - Names have a lower-case "to" in them to indicate conversion
75 // - Names are all UPPER CASE otherwise
76 // -------------------------------------------------------------------------
77 
78 const precision_t cDtoR = cPI/180.0;
79 const precision_t cRtoD = 180.0/cPI;
80 
81 // -------------------------------------------------------------------------
82 // converting time between seconds and other units of time:
83 // -------------------------------------------------------------------------
84 
85 // Years <-> Seconds:
86 const double cYtoS = 31536000.0;
87 const double cStoY = 1.0 / cYtoS;
88 
89 // Days <-> Seconds:
90 const double cDtoS = 86400.0;
91 const double cStoD = 1.0 / cDtoS;
92 
93 // Hours <-> Seconds:
94 const double cHtoS = 3600.0;
95 const double cStoH = 1.0 / cHtoS;
96 
97 // Minutes <-> Seconds:
98 const double cMtoS = 60.0;
99 const double cStoM = 1.0 / cMtoS;
100 
101 // MilliSeconds <-> Seconds:
102 const double cMStoS = 1.0/1000.0;
103 const double cStoMS = 1000.0;
104 
105 // -------------------------------------------------------------------------
106 // converting lengths between meters and other units of measurement:
107 // -------------------------------------------------------------------------
108 
109 // kilometer <-> meter:
110 const precision_t cKMtoM = 1000.0;
111 const precision_t cMtoKM = 1.0 / cKMtoM;
112 
113 // Angstrom <-> Meter
114 const precision_t cAtoM = 1.0e-10;
115 
116 // AU <-> Meter
117 const precision_t cAUtoM = 1.495978707e11;
118 
119 const precision_t pcm3topm3 = 1e6; // /cm3 to /m3
120 const precision_t pcm2topm2 = 1e4; // /cm2 to /m2
121 const precision_t pcmtopm = 100.0; // /cm to /m
122 
123 // -------------------------------------------------------------------------
124 // B-Field
125 // -------------------------------------------------------------------------
126 
127 const float cNTtoT = 1e-9; // nT to T
128 
129 #endif // INCLUDE_CONSTANTS_H_