Mathematical and physical constants. More...
Variables | |
mathematical constants | |
const double | pi = M_PI |
\( \pi \) | |
const double | degree = pi/180 |
\( ^{\circ} \) | |
SI definitions | |
Exact numerical values of physical constants based on the 2019 redefinition of SI base units. I expect only a few of these constants will be useful for CFD, but might as well include them all for completeness. | |
const double | caesium133_freq = 9192631770 |
\( \Delta \nu_{Cs} \) | |
const double | light_speed = 299792458 |
\( c \) | |
const double | plank = 6.62607015e-34 |
\( h \) | |
const double | electron_charge = 1.602176634e-19 |
\( e \) | |
const double | boltzmann = 1.380649e-23 |
\( k \) | |
const double | avogadro = 6.02214076e23 |
\( mol \) | |
const double | lum_eff_540e12 = 683 |
\( K_{cd} \) | |
empirical values | |
const double | specific_gas_air = 287.05287 |
\( R_{air} \) defined to match ICAO Standard Atmosphere | |
const double | earth_radius = 6356766 |
\( \) | |
derived quantities | |
const double | universal_gas = boltzmann*avogadro |
\( R_u \) | |
const double | mol_mass_air = universal_gas/specific_gas_air |
\( \mu_{air} \) | |
const double | stefan_boltzmann = 2*math::pow(pi, 5)*math::pow(boltzmann, 4)/(15*math::pow(light_speed, 2)*math::pow(plank, 3)) |
\( \sigma \) | |
unit definitions | |
Conversion factors from various units to standard SI units. Since hexed works exclusively in SI units, these are the values of each of these units in [m, kg, s, K]. E.g. If you have a wing with a chord of 3 feet, then you should tell hexed it's chord is | |
const double | meter = 1 |
m | |
const double | kilogram = 1 |
kg | |
const double | second = 1 |
s | |
const double | kelvin = 1 |
K. | |
const double | std_grav = 9.80665 |
\( g_0 \) standard gravity | |
const double | foot = 0.3048 |
ft | |
const double | yard = 3*foot |
yd | |
const double | inch = foot/12 |
in | |
const double | mile = 5280*foot |
mi | |
const double | nautical_mile = 1852 |
nmi | |
const double | pound_mass = 0.45359237 |
\( lb_m \) | |
const double | slug = pound_mass*std_grav/foot*second*second |
slug | |
const double | minute = 60*second |
min | |
const double | hour = 60*minute |
hr | |
const double | rankine = 5./9. |
\( ^{\circ} \) R | |
const double | pound_force = std_grav*pound_mass |
\( lb_f \) | |
const double | knot = nautical_mile/hour |
kn | |
const double | zero_celsius = 273.15 |
0 \( ^{\circ} \) C (not technically a unit but still important) | |
const double | atmosphere = 101325 |
atm | |
const double | calorie = 4.184 |
ISO thermochemical calorie | |
const double | btu = calorie*rankine*pound_mass/1e-3 |
British Thermal Unit obtained by converting the calorimetric definition of calorie to imperial units. | |
const double | gallon = 4.54609e-3 |
Imperial gallon | |
const double | fluid_ounce = gallon/160. |
Imperial fluid ounce | |
Mathematical and physical constants.
Ports hexed.constants
into Python.
Definition of mathematical and physical constants, including unit conversions, as const
global variables.
constants.hpp
const double hexed::constants::pi = M_PI |
\( \pi \)
Obviously a computed value, not a definition, but should be exact to machine epsilon. As we all know, the numeric value of this is 3.
const double hexed::constants::slug = pound_mass*std_grav/foot*second*second |
This definition may seem backward from the perspective of [slug, ft, s] proponents, but
\[ slug \cdot ft/s^2 = lb_f = g_0 lb_m \]
is an exact equation for the slug since the pound mass has been exactly defined by the international yard and pound.