Constants.hpp
Go to the documentation of this file.
1 // -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 // vi: set et ts=4 sw=4 sts=4:
3 /*
4  Copyright (C) 2011-2013 by Andreas Lauser
5  Copyright (C) 2011 by Bernd Flemisch
6 
7  This file is part of the Open Porous Media project (OPM).
8 
9  OPM is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 2 of the License, or
12  (at your option) any later version.
13 
14  OPM is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with OPM. If not, see <http://www.gnu.org/licenses/>.
21 */
26 #ifndef OPM_CONSTANTS_HPP
27 #define OPM_CONSTANTS_HPP
28 
29 #include <cmath>
30 
31 namespace Opm
32 {
33 
38 template<class Scalar>
39 class Constants
40 { public:
44  static const Scalar R;
45 
49  static const Scalar Na;
50 
54  static const Scalar kb;
55 
59  static const Scalar c;
60 
64  static const Scalar G;
65 
69  static const Scalar h;
70 
74  static const Scalar hRed;
75 };
76 
77 template<class Scalar>
78 const Scalar Constants<Scalar>::R = 8.314472;
79 template <class Scalar>
80 const Scalar Constants<Scalar>::Na = 6.02214179e23;
81 template <class Scalar>
82 const Scalar Constants<Scalar>::kb = R/Na;
83 template <class Scalar>
84 const Scalar Constants<Scalar>::c = 299792458.0;
85 template <class Scalar>
86 const Scalar Constants<Scalar>::G = 6.67428e-11;
87 template <class Scalar>
88 const Scalar Constants<Scalar>::h = 6.62606896e-34;
89 template <class Scalar>
90 const Scalar Constants<Scalar>::hRed = h / (2 * M_PI);
91 } // namespace Opm
92 
93 #endif
static const Scalar R
The ideal gas constant [J/(mol K)].
Definition: Constants.hpp:44
Definition: Air_Mesitylene.hpp:31
static const Scalar Na
The Avogadro constant [1/mol].
Definition: Constants.hpp:49
static const Scalar G
Newtonian constant of gravitation [m^3/(kg s^2)].
Definition: Constants.hpp:64
static const Scalar h
Planck constant [J s].
Definition: Constants.hpp:69
static const Scalar hRed
Reduced Planck constant [J s].
Definition: Constants.hpp:74
static const Scalar c
Speed of light in vacuum [m/s].
Definition: Constants.hpp:59
static const Scalar kb
The Boltzmann constant [J/K].
Definition: Constants.hpp:54
A central place for various physical constants occuring in some equations.
Definition: Constants.hpp:39