LORENE
unites.h
1 /*
2  * Lorene's units
3  *
4  */
5 
6 /*
7  * Copyright (c) 1999-2001 Eric Gourgoulhon
8  *
9  * This file is part of LORENE.
10  *
11  * LORENE is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * LORENE is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with LORENE; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24  *
25  */
26 
27 
28 /*
29  * $Id: unites.h,v 1.11 2023/01/27 16:09:41 j_novak Exp $
30  * $Log: unites.h,v $
31  * Revision 1.11 2023/01/27 16:09:41 j_novak
32  * Comments.
33  *
34  * Revision 1.10 2023/01/17 15:01:25 j_novak
35  * Update of the value of g_si from CODATA 2018. New definition of rhonuc_si
36  * as 0.1 unified atomic mass unit per Fermi^3. Note that results with Lorene
37  * may change because of these updates.
38  *
39  * Revision 1.9 2016/12/05 15:28:52 j_novak
40  * Suppressed the use of 'pow' to avoid compilation warnings.
41  *
42  * Revision 1.8 2015/03/17 14:20:00 j_novak
43  * New class Hot_eos to deal with temperature-dependent EOSs.
44  *
45  * Revision 1.7 2014/10/13 08:52:37 j_novak
46  * Lorene classes and functions now belong to the namespace Lorene.
47  *
48  * Revision 1.6 2014/06/30 14:34:57 j_novak
49  * Update of the values of some constants (G, M_sol and MeV).
50  *
51  * Revision 1.5 2014/05/13 10:06:12 j_novak
52  * Change of magnetic units, to make the Lorene unit system coherent. Magnetic field is now expressed in Lorene units. Improvement on the comments on units.
53  *
54  * Revision 1.4 2004/12/01 12:28:32 p_grandclement
55  * Include math.h in unite.h
56  *
57  * Revision 1.3 2004/03/25 10:28:56 j_novak
58  * All LORENE's units are now defined in the namespace Unites (in file unites.h).
59  *
60  * Revision 1.2 2004/03/22 13:12:43 j_novak
61  * Modification of comments to use doxygen instead of doc++
62  *
63  * Revision 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon
64  * LORENE
65  *
66  * Revision 1.2 2000/03/17 15:28:29 eric
67  * Ajout de ggrav (G).
68  *
69  * Revision 1.1 1999/12/06 13:35:10 eric
70  * Initial revision
71  *
72  *
73  * $Header: /cvsroot/Lorene/C++/Include/unites.h,v 1.11 2023/01/27 16:09:41 j_novak Exp $
74  *
75  */
76 
77  //--------------------------//
78  // Standard LORENE units //
79  //--------------------------//
80 
81 namespace Lorene {
89  namespace Unites {
90 
91  //*** G constant and density unit before January 2023 ***
92  // To reproduce pre-2023 results, please change the difinitions of
93  // g_si and rhonuc_si by uncommenting the following two lines and commenting
94  // the new corresponding ones:
95  //const double g_si = 6.6738E-11 ; ///< Newton gravitational constant [SI]
96  //const double rhonuc_si = 1.66E+17 ; ///< Nuclear density [kg/m3]
97 
98  const double g_si = 6.6743E-11 ;
99  const double c_si = 2.99792458E+8 ;
100  const double kB_si = 1.380649E-23 ;
101  const double m_u_si = 1.6605390666E-27 ;
102  const double mev_si = 1.602176634E-13 ;
103  const double rhonuc_si = m_u_si * 1.e44 ;
105  const double km_si = 1.E+3 ;
106  const double msol_si = 1.9885E+30 ;
107 
108  const double r_unit = 1.e4 ;
109  const double v_unit = c_si ;
110  const double rho_unit = rhonuc_si ;
111  const double t_unit = r_unit/v_unit ;
112  const double m_unit = rho_unit * r_unit*r_unit*r_unit ;
113  const double g_unit = 1./(rho_unit*t_unit*t_unit) ;
114  const double f_unit = 1./t_unit ;
115 
116  const double ggrav = g_si / g_unit ;
117  const double qpig = 4 * M_PI * ggrav ;
118  const double msol = msol_si/m_unit ;
119  const double km = km_si/r_unit ;
120  const double mevpfm3 = mev_si/( rho_unit * v_unit *v_unit) *1.e45 ;
123  const double m_u_mev = m_u_si *c_si*c_si / mev_si ;
124  }
125 
126 
127  //----------------------------------//
128  // Electro-magnetic LORENE units //
129  //----------------------------------//
130 
131 
132 
138  namespace Unites_mag {
139  using namespace Unites ;
140  const double mu_si = 1.2566370614359173e-6 ;
141 
142  const double j_unit = 1e11 ;
143 
145  const double mag_unit = rho_unit*v_unit*v_unit/ (r_unit * j_unit) ;
147  const double elec_unit = mag_unit * v_unit ;
149  const double mu0_unit = rho_unit*v_unit*v_unit / (j_unit*j_unit*r_unit*r_unit);
151  const double mu0 = mu_si / mu0_unit ;
152  }
153 
154 }
Lorene prototypes.
Definition: app_hor.h:67
Standard units of space, time and mass.
Standard electro-magnetic units.