NEURON
nrnunits.h
Go to the documentation of this file.
1 #pragma once
2 
3 /**
4  NMODL translated MOD files get unit constants typically from
5  share/lib/nrnunits.lib. But there were other source files that
6  hardcode some of the constants. Here we gather a few modern units into
7  a single place (but, unfortunately, also in nrnunits.lib).
8 
9  These come from https://physics.nist.gov/cuu/Constants/index.html.
10  Termed the "2018 CODATA recommended values", they became available
11  on 20 May 2019 and replace the 2014 CODATA set.
12 
13  See oc/hoc_init.c, nrnoc/eion.c, nrniv/kschan.h
14 **/
15 
16 
17 constexpr double _electron_charge_codata2018 = 1.602176634e-19; /* coulomb exact*/
18 constexpr double _avogadro_number_codata2018 = 6.02214076e+23; /* exact */
19 constexpr double _boltzmann_codata2018 = 1.380649e-23; /* joule/K exact */
21  _avogadro_number_codata2018; /* 96485.33212... coulomb/mol */
22 constexpr double _gasconstant_codata2018 =
23  _boltzmann_codata2018 * _avogadro_number_codata2018; /* 8.314462618... joule/mol-K */
24 
25 /* e/k in K/millivolt */
27  _boltzmann_codata2018; /* 11.604518... K/mV */
constexpr double _e_over_k_codata2018
Definition: nrnunits.h:26
constexpr double _avogadro_number_codata2018
Definition: nrnunits.h:18
constexpr double _boltzmann_codata2018
Definition: nrnunits.h:19
constexpr double _faraday_codata2018
Definition: nrnunits.h:20
constexpr double _gasconstant_codata2018
Definition: nrnunits.h:22
constexpr double _electron_charge_codata2018
NMODL translated MOD files get unit constants typically from share/lib/nrnunits.lib.
Definition: nrnunits.h:17