CORSIKA  @c8_version@
The framework to simulate particle cascades for astroparticle physics
PhysicalConstants.hpp
Go to the documentation of this file.
1 /*
2  * (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu
3  *
4  *
5  * This software is distributed under the terms of the GNU General Public
6  * Licence version 3 (GPL Version 3). See file LICENSE for a full version of
7  * the license.
8  */
9 
10 #pragma once
11 
13 
25 namespace corsika::constants {
26 
27  using namespace phys::units;
28 
29  // acceleration of free-fall, standard
30  constexpr quantity<acceleration_d> g_sub_n{Rep(9.80665L) * meter / square(second)};
31 
32  // Avogadro constant
33  constexpr quantity<dimensions<0, 0, 0, 0, 0, -1>> N_sub_A{Rep(6.02214199e+23L) / mole};
34 
35  // elementary charge
36  constexpr quantity<electric_charge_d> e{Rep(1.6021766208e-19L) * coulomb};
37 
38  // vacuum permittivity
39  constexpr quantity<dimensions<-3, -1, 4, 2>> epsilonZero{Rep(8.8541878128e-12L) *
40  farad / meter};
41 
42  // electronvolt
43  // constexpr quantity<hepenergy_d> eV{e / coulomb * joule};
44 
45  // Planck constant
46  constexpr quantity<dimensions<2, 1, -1>> h{Rep(6.62606876e-34L) * joule * second};
47  constexpr quantity<dimensions<2, 1, -1>> hBar{h / (2 * M_PI)};
48 
49  // speed of light in a vacuum
50  constexpr quantity<speed_d> c{Rep(299792458L) * meter / second};
51  constexpr auto cSquared = c * c;
52 
53  // hbar * c
55  Rep(1.973'269'78e-7L) * electronvolt * meter}; // from RPP 2018
56 
57  auto constexpr invGeVsq = 1e-18 / (electronvolt * electronvolt);
58 
59  // unified atomic mass unit
60  constexpr quantity<mass_d> u{Rep(1.6605402e-27L) * kilogram};
61 
62  auto constexpr nucleonMass = 0.5 * (0.93827 + 0.93957) * 1e9 * electronvolt;
63 
64  // molar gas constant
65  auto constexpr R = Rep(8.314'459'8) * joule / (mole * kelvin);
66 
70  namespace EarthRadius {
71  static constexpr auto Mean{6'371'000 * meter};
72  static constexpr auto Geomagnetic_reference{6'371'200 * meter};
73  static constexpr auto Equatorial{6'378'137 * meter};
74  static constexpr auto Polar{6'356'752 * meter};
75  static constexpr auto PolarCurvature{6'399'593 * meter};
76  } // namespace EarthRadius
77 
78  // etc.
79 
80 } // namespace corsika::constants
Physical and mathematical constants with units.
We could drag dimensions around individually, but it&#39;s much more convenient to package them...
Definition: quantity.hpp:62
namespace units.
Import and extend the phys::units package.
class "quantity" is the heart of the library.
Definition: quantity.hpp:54
constexpr detail::Power< D, 2, X > square(quantity< D, X > const &x)
square.
Definition: quantity.hpp:650