Mathematical and physical constants. More...
Namespaces | |
| namespace | imperial |
| Imperial volume measurements | |
| namespace | us_customary |
| US customary volume measurements | |
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 | radian = 1 |
| const double | pascal = 1 |
| Pa. | |
| const double | newton = 1 |
| N. | |
| const double | deci = 1e-1 |
| d | |
| const double | centi = 1e-2 |
| c | |
| const double | milli = 1e-3 |
| m | |
| const double | micro = 1e-6 |
| \( \mu \) | |
| const double | nano = 1e-9 |
| n | |
| const double | pico = 1e-12 |
| p | |
| const double | femto = 1e-15 |
| f | |
| const double | atto = 1e-18 |
| a | |
| const double | zepto = 1e-21 |
| z | |
| const double | yocto = 1e-24 |
| y | |
| const double | ronto = 1e-27 |
| r | |
| const double | quecto = 1e-30 |
| q | |
| const double | deka = 1e1 |
| da | |
| const double | hecto = 1e2 |
| h | |
| const double | kilo = 1e3 |
| k | |
| const double | mega = 1e6 |
| M. | |
| const double | giga = 1e9 |
| G. | |
| const double | tera = 1e12 |
| T. | |
| const double | peta = 1e15 |
| P. | |
| const double | exa = 1e18 |
| E. | |
| const double | zeta = 1e21 |
| Z. | |
| const double | yotta = 1e24 |
| Y. | |
| const double | ronna = 1e27 |
| R. | |
| const double | quetta = 1e30 |
| Q. | |
| const double | gram = 1e-3 |
| g | |
| const double | liter = 1e-3 |
| L. | |
| const double | angstrom = 1e-10 |
| Angstrom. | |
| const double | tonne = 1e3 |
| aka "metric ton" | |
| 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 | zero_fahrenheit = zero_celsius - 32*rankine |
| 0 \(^{\circ}\) F (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 | bar = 1e5 |
| deprecated unit of pressure | |
| const double | mmhg = 133.322387415 |
| millimiter of mercury | |
| const double | torr = atmosphere/760 |
| Torr | |
| const double | astronomical_unit = 149597870700. |
| au | |
| const double | short_ton = 2000*pound_mass |
| (imperial) short ton | |
| const double | long_ton = 2240*pound_mass |
| (imperial) long ton | |
Mathematical and physical constants.
Definition of mathematical and physical constants, including unit conversions, as const global variables.
| 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::radian = 1 |
Dimensionless unit, which I would argue is not a unit at all, but it's here anyway.
| 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.