fundamentalConstants.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2026 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Description
25  Fundamental dimensioned constants
26 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "fundamentalConstants.H"
30 #include "universalConstants.H"
32 #include "atomicConstants.H"
34 #include "standardConstants.H"
35 #include "dimensionedConstants.H"
36 
37 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
38 
39 // Universal constants
40 
41 namespace Foam
42 {
43 namespace constant
44 {
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 // Note: cannot use dimless etc. as they may not have been constructed yet
49 
50 
52 (
54  (
56  "c",
57  units::lookup("m")/units::lookup("s"),
58  2.99792e+08
59  )
60 );
61 
63 (
65  (
67  "G",
68  pow(units::lookup("m"), 3)
69  /units::lookup("kg")
70  /pow(units::lookup("s"), 2),
71  6.67429e-11
72  )
73 );
74 
76 (
78  (
80  "h",
81  units::lookup("kg")*pow(units::lookup("m"), 2)/units::lookup("s"),
82  6.62607e-34
83  )
84 );
85 
86 
87 // Electromagnetic
88 
90 (
92  (
94  "e",
95  units::lookup("A")*units::lookup("s"),
96  1.60218e-19
97  )
98 );
99 
100 
101 // Atomic
102 
104 (
106  (
108  "me",
109  units::lookup("kg"),
110  9.10938e-31
111  )
112 );
113 
115 (
117  (
119  "mp",
120  units::lookup("kg"),
121  1.67262e-27
122  )
123 );
124 
125 
126 // Physico-chemical
127 
129 (
131  (
133  "mu",
134  units::lookup("kg"),
135  1.66054e-27
136  )
137 );
138 
140 (
141  dimensionedScalar("NA", dimensionSet(0, 0, 0, 0, -1), 6.02214e+23)
142 );
143 
145 (
147  (
149  "NA",
150  "NNA",
151  pow(units::lookup("mol"), -1),
152  NA.value()
153  )
154 );
155 
157 (
159  (
161  "k",
162  units::lookup("kg")*pow(units::lookup("m"), 2)
163  /pow(units::lookup("s"), 2)/units::lookup("K"),
164  1.38065e-23
165  )
166 );
167 
168 
169 // Standard
170 
172 (
174  (
176  "pStd",
177  dimensionSet(1, -1, -2, 0, 0)
178  )
179 );
180 
182 (
184  (
186  "Tstd",
187  dimensionSet(0, 0, 0, 1, 0)
188  )
189 );
190 
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 
194 } // End namespace constant
195 } // End namespace Foam
196 
197 // ************************************************************************* //
const Type & value() const
Return const reference to value.
Dictionary reading and supplying the dimensioned constants used within OpenFOAM, particularly for the...
Fundamental dimensioned constants.
const dimensionedScalar mp
Proton mass.
const dimensionedScalar me
Electron mass.
const char *const group
Group name for atomic constants.
const dimensionedScalar e
Elementary charge.
const char *const group
Group name for electromagnetic constants.
const dimensionedScalar k
Boltzmann constant.
const dimensionedScalar NNA
Avagadro number: default SI units: [1/kmol].
const dimensionedScalar mu
Atomic mass unit.
const char *const group
Group name for physico-chemical constants.
const dimensionedScalar NA
Avagadro number: default SI units: [1/mol].
const dimensionedScalar pStd
Standard pressure.
const dimensionedScalar Tstd
Standard temperature.
const char *const group
Group name for standard constants.
const dimensionedScalar G
Newtonian constant of gravitation.
const dimensionedScalar c
Speed of light in a vacuum.
const char *const group
Group name for universal constants.
const dimensionedScalar h
Planck constant.
const unitSet & lookup(const word &unitName)
Lookup and return the named unit from the table.
Definition: units.C:346
Namespace for OpenFOAM.
tmp< DimensionedField< typename powProduct< Type, r >::type, GeoMesh, Field > > pow(const DimensionedField< Type, GeoMesh, PrimitiveField > &df, typename powProduct< Type, r >::type)
dimensionedScalar dimensionedConstant(const char *const group, const char *name, const dimensionSet &dimensions)
Construct and return a constant by looking up from the DimensionedConstants.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.