dune_core/consts.rs
1//! Physical constants and reference values, byte for byte the 3f5's
2//! (`corpus/spice3f5/src/include/const.h` and `lib/fte/ivars.c`).
3//! Names in comments are the C names.
4
5/// Electron charge, C (`CHARGE`).
6pub const CHARGE: f64 = 1.6021918e-19;
7
8/// 0 °C in kelvin (`CONSTCtoK`).
9pub const CTOK: f64 = 273.15;
10
11/// Boltzmann constant, J/K (`CONSTboltz`).
12pub const BOLTZ: f64 = 1.3806226e-23;
13
14/// Reference temperature, 27 °C in kelvin (`REFTEMP`).
15pub const REFTEMP: f64 = 300.15;
16
17/// k/q, V/K (`CONSTKoverQ`).
18pub const KOVERQ: f64 = BOLTZ / CHARGE;
19
20/// √2 (`CONSTroot2`).
21pub const ROOT2: f64 = std::f64::consts::SQRT_2;
22
23/// e (`CONSTe`).
24pub const E: f64 = std::f64::consts::E;
25
26/// Thermal voltage at `REFTEMP`, V (`CONSTvt0`).
27pub const VT0: f64 = KOVERQ * REFTEMP;