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-2025 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()["m"]/units()["s"],
58  2.99792e+08
59  )
60 );
61 
63 (
65  (
67  "G",
68  pow(units()["m"], 3)/units()["kg"]/pow(units()["s"], 2),
69  6.67429e-11
70  )
71 );
72 
74 (
76  (
78  "h",
79  units()["kg"]*pow(units()["m"], 2)/units()["s"],
80  6.62607e-34
81  )
82 );
83 
84 
85 // Electromagnetic
86 
88 (
90  (
92  "e",
93  units()["A"]*units()["s"],
94  1.60218e-19
95  )
96 );
97 
98 
99 // Atomic
100 
102 (
104  (
106  "me",
107  units()["kg"],
108  9.10938e-31
109  )
110 );
111 
113 (
115  (
117  "mp",
118  units()["kg"],
119  1.67262e-27
120  )
121 );
122 
123 
124 // Physico-chemical
125 
127 (
129  (
131  "mu",
132  units()["kg"],
133  1.66054e-27
134  )
135 );
136 
138 (
139  dimensionedScalar("NA", dimensionSet(0, 0, 0, 0, -1), 6.02214e+23)
140 );
141 
143 (
145  (
147  "NA",
148  "NNA",
149  pow(units()["mol"], -1),
150  NA.value()
151  )
152 );
153 
155 (
157  (
159  "k",
160  units()["kg"]*pow(units()["m"], 2)/pow(units()["s"], 2)/units()["K"],
161  1.38065e-23
162  )
163 );
164 
165 
166 // Standard
167 
169 (
171  (
173  "Pstd",
174  dimensionSet(1, -1, -2, 0, 0)
175  )
176 );
177 
179 (
181  (
183  "Tstd",
184  dimensionSet(0, 0, 0, 1, 0)
185  )
186 );
187 
188 
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 
191 } // End namespace constant
192 } // End namespace Foam
193 
194 // ************************************************************************* //
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.
Namespace for OpenFOAM.
const HashTable< unitConversion > & units()
Get the table of unit conversions.
void pow(LagrangianPatchField< typename powProduct< Type, r >::type > &f, const LagrangianPatchField< Type > &f1)
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.