BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
constants.hpp
Go to the documentation of this file.
1/*
2 * BELFEM -- The Berkeley Lab Finite Element Framework
3 * Copyright (c) 2026, The Regents of the University of California,
4 * through Lawrence Berkeley National Laboratory (subject to receipt of any required
5 * approvals from the U.S. Dept. of Energy). All rights reserved.
6 *
7 * Developers: Christian Messe, Gregory Giard
8 *
9 * See the top-level LICENSE file for the complete license and disclaimer.
10 */
11
12
13#ifndef BELFEM_CONSTANTS_HPP
14#define BELFEM_CONSTANTS_HPP
15#include <cmath>
16#include "typedefs.hpp"
17
18#if defined(__clang__)
19#pragma clang diagnostic push
20#pragma clang diagnostic ignored "-Wunused-variable"
21
22#elif defined(__GNUC__) || defined(__GNUG__)
23#pragma GCC diagnostic push
24#pragma GCC diagnostic ignored "-Wunused-variable"
25#endif
26
27#define BELFEM_TREF 298.15
28#define BELFEM_PREF 100000.0
29
30namespace belfem
31{
32 namespace constant
33 {
34//------------------------------------------------------------------------------
35// MATH
36//------------------------------------------------------------------------------
37
41 const real pi = 3.141592653589793238462643383279502884;
42
43// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
44
48 const real phi = 0.5 * ( 1.0 + std::sqrt( 5.0 ) );
49
50// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
51
55 const real deg = pi / 180.0;
56
57//------------------------------------------------------------------------------
58// GENERAL PHYSICS
59//------------------------------------------------------------------------------
60
65 const real c = 299792458.0 ;
66
67// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
68
73 const real mu0 = 1.25663706212e-6;
74
75// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
76
80 const real nu0 = 1./mu0 ;
81
82// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
83
87 const real epsilon0 = 1.0/( mu0*std::pow( c, 2 ) );
88
89// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
90
96 const real G = 6.67430e-11;
97
98// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
99
104 const real e = 1.602176634e-19 ;
105
106
107//------------------------------------------------------------------------------
108// THERMODYNAMICS
109//------------------------------------------------------------------------------
110
114 const real calTh = 4.184;
115
116//------------------------------------------------------------------------------
117
122 const real kB = 1.380649e-23;
123
124
125//------------------------------------------------------------------------------
126
131 const real NA = 6.02214076e23;
132
133//------------------------------------------------------------------------------
134
139 const real u = 0.001 / NA ;
140
141//------------------------------------------------------------------------------
142
149 const real Rm = kB * NA; // 8.3144598;
150
151//------------------------------------------------------------------------------
152
156 const real Rm_cal = Rm / calTh;
157
158//------------------------------------------------------------------------------
159
166 const real h = 6.62607015e-34;
167
168//------------------------------------------------------------------------------
169
173 const real sigma = 2.0 * std::pow( pi, 5 )
174 * std::pow( kB, 4 ) /
175 ( 15.0 * std::pow( h, 3 ) * std::pow( c, 2 ) );
176
177//------------------------------------------------------------------------------
178
182 const real L0 = std::pow( pi * kB / e , 2 ) / 3.0 ;
183
184//------------------------------------------------------------------------------
185// EARTH
186//------------------------------------------------------------------------------
187
192 const real g0 = 9.80665;
193
194//------------------------------------------------------------------------------
195
199 const real mu_earth = 3.986004418e14;
200
201//------------------------------------------------------------------------------
202
206 const real R_earth = std::sqrt( mu_earth / g0 );
207
208//------------------------------------------------------------------------------
209// astronomy
210//------------------------------------------------------------------------------
211
212 // julian day number for 01/01/2000 00:00 UT
213 const real y2k = 2451544.5 ;
214
215 // Astronomical unit https://www.britannica.com/science/astronomical-unit
216 const real AU = 149597870700. ;
217
218
219 }
220}
221
222#if defined(__clang__)
223#pragma clang diagnostic pop
224#elif defined(__GNUC__) || defined(__GNUG__)
225#pragma GCC diagnostic pop
226#endif
227
228#endif //BELFEM_CONSTANTS_HPP
Definition constants.hpp:33
const real e
elementary charge in C https://physics.nist.gov/cgi-bin/cuu/Value?e
Definition constants.hpp:104
const real AU
Definition constants.hpp:216
const real phi
golden number
Definition constants.hpp:48
const real Rm
Gas constant in J/(K*mol) ( exact ) http://physics.nist.gov/cgi-bin/cuu/Value?r.
Definition constants.hpp:149
const real mu0
magnetic constant in V*s/(A*m) ( recommended value ) http://physics.nist.gov/cgi-bin/cuu/Value?...
Definition constants.hpp:73
const real Rm_cal
Gas Constant in cal/(K*mol).
Definition constants.hpp:156
const real L0
Sommerfeld value for the Lorentz number in V^2/K^2.
Definition constants.hpp:182
const real NA
Avogadro constant ( exact ) https://physics.nist.gov/cgi-bin/cuu/Value?na|search_for=avogadro.
Definition constants.hpp:131
const real u
atomic mass unit-kilogram relationship https://physics.nist.gov/cgi-bin/cuu/Value?...
Definition constants.hpp:139
const real mu_earth
gravity parameter Earth ( G * M_earth )
Definition constants.hpp:199
const real nu0
inverse of magnetic constant in (A*m)/(V*s)
Definition constants.hpp:80
const real epsilon0
electric constant in A*s/(V*m)
Definition constants.hpp:87
const real c
speed of light in m/s ( exact ) http://physics.nist.gov/cgi-bin/cuu/Value?c
Definition constants.hpp:65
const real pi
circle number
Definition constants.hpp:41
const real deg
degree
Definition constants.hpp:55
const real calTh
thermal calorie in SI units J/cal
Definition constants.hpp:114
const real sigma
Stephan Boltzman constant.
Definition constants.hpp:173
const real h
Planck constant in J / Hz ( exact ) http://physics.nist.gov/cgi-bin/cuu/Value?h.
Definition constants.hpp:166
const real g0
earth gravitational acceleration at sea level in m/s^2 https://physics.nist.gov/cgi-bin/cuu/Value?...
Definition constants.hpp:192
const real R_earth
reference radius for Earth
Definition constants.hpp:206
const real kB
Boltzman constant ( exact ) https://physics.nist.gov/cgi-bin/cuu/Value?k|search_for=boltzman.
Definition constants.hpp:122
const real G
gravity constant in N*m^2 / kg^2
Definition constants.hpp:96
const real y2k
Definition constants.hpp:213
USER GUIDES:
Definition cl_Capacitor.cpp:16
double real
Definition typedefs.hpp:36