eos_crust.h
Go to the documentation of this file.
1 /*
2  -------------------------------------------------------------------
3 
4  Copyright (C) 2006-2017, Andrew W. Steiner
5 
6  This file is part of O2scl.
7 
8  O2scl is free software; you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation; either version 3 of the License, or
11  (at your option) any later version.
12 
13  O2scl is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with O2scl. If not, see <http://www.gnu.org/licenses/>.
20 
21  -------------------------------------------------------------------
22 */
23 /** \file eos_crust.h
24  \brief File defining \ref o2scl::eos_crust
25 */
26 #ifndef O2SCL_BPS_EOS_H
27 #define O2SCL_BPS_EOS_H
28 
29 #include <o2scl/part.h>
30 #include <o2scl/mroot.h>
31 #include <o2scl/eos_base.h>
32 #include <o2scl/mroot_hybrids.h>
33 #include <o2scl/fermion.h>
34 #include <o2scl/nucmass.h>
35 
36 #ifndef DOXYGEN_NO_O2NS
37 namespace o2scl {
38 #endif
39 
40  /** \brief Baym-Pethick-Sutherland equation of state
41 
42  This calculates the equation of state of electrons and nuclei
43  using the approach of \ref Baym71tg (based on the discussion in
44  \ref Shapiro83) between about \f$8 \times 10^{6}
45  ~\mathrm{g}/\mathrm{cm}^3\f$ and \f$4.3 \times 10^{11}
46  ~\mathrm{g}/\mathrm{cm}^3\f$. Below these densities, more
47  complex Coulomb corrections need to be considered, and above
48  these densities, neutron drip is important.
49 
50  The default mass formula is semi-empirical
51  \f{eqnarray*}
52  M(A,Z)&=&(A-Z) m_n+Z (m_p+m_e)-
53  15.76 A-17.81 A^{2/3} \\
54  && -0.71 Z^2 /A^{1/3}-
55  94.8/A \left(A/2-Z\right)^2+E_{\mathrm{pair}}
56  \f}
57  where
58  \f[
59  E_{\mathrm{pair}} = \pm 39/A^{3/4}
60  \f]
61  if the nucleus is odd-odd (plus sign) or even-even (minus sign)
62  and \f$E_{\mathrm{pair}}\f$ is zero for odd-even and even-odd
63  nuclei. The nuclei are assumed not to contribute to the
64  pressure. The electronic contribution to the pressure is assumed
65  to be equal to the Fermi gas contribution plus a "lattice"
66  contribution
67  \f[
68  \varepsilon_L = -1.444 Z^{2/3} e^2 n_e^{4/3}
69  \f]
70  This is Eq. 2.7.2 in \ref Shapiro83. The rest mass energy of
71  the nucleons is included in the energy density.
72 
73  The original results from \ref Baym71tg are stored as a \ref table
74  in file <tt>data/o2scl/bps.eos</tt>. The testing code for this
75  class compares the calculations to the table and matches to
76  within .2 percent for the energy density and 9 percent for the
77  pressure (for a fixed baryon number density).
78 
79  \future Can the pressure be made to match more closely?
80  \future Convert to a \ref o2scl::eos_had_base object and offer an
81  associated interface?
82 
83  */
84  class eos_crust : public eos_base {
85 
86  public:
87 
89 
90  eos_crust();
91 
92  virtual ~eos_crust() {};
93 
94  /** \brief Calculate the equation of state as a function of
95  the baryon number density \c barn
96 
97  This calculates the equation of state as a function of the
98  baryon number density in \f$\mathrm{fm}^{-3}\f$, returning the
99  representative nucleus with proton number \c Z and atomic
100  number \c A. The pressure and energy density are returned
101  in \c th in \f$\mathrm{fm}^{-4}\f$.
102  */
103  virtual int calc_density(double barn, thermo &th, int &Z, int &A);
104 
105  /** \brief Calculate the equation of state as a function of
106  the pressure
107 
108  This calculates the equation of state as a function of the
109  pressure, returning the representative nucleus with proton
110  number \c Z and atomic number \c A and the baryon number
111  density \c barn in \f$\mathrm{fm}^{-3}\f$. The energy density
112  is also returned in \f$\mathrm{fm}^{-4}\f$ in \c th.
113  */
114  virtual int calc_pressure(thermo &th, double &barn, int &Z, int &A);
115 
116  /** \brief The electron lattice energy */
117  virtual double lattice_energy(int Z);
118 
119  /** \brief Get a pointer to the electron
120  */
121  virtual const fermion &get_electron() { return e; }
122 
123  /** \brief The mass formula
124 
125  The nuclear mass without the contribution of the rest mass
126  of the electrons. The electron rest mass energy is included
127  in the electron thermodynamics elsewhere.
128  */
129  virtual double mass_formula(int Z, int A);
130 
131  /// Return string denoting type ("eos_crust")
132  virtual const char *type() { return "eos_crust"; }
133 
134  /// Default mass formula
136 
137  /// Set the nuclear mass formula to be used
139  nmp=&nm;
140  return 0;
141  }
142 
143  /// Compute the ground state assuming a fixed atomic number
144  int calc_density_fixedA(double barn, thermo &th, int &Z, int A);
145 
146  /** \brief The electron thermodynamics
147 
148  \note The electron rest mass is included by default in
149  the energy density and the chemical potential
150  */
152 
153  protected:
154 
155 #ifndef DOXYGEN_INTERNAL
156 
157  /// Zero-temperature thermodynamics for the electrons
159 
160  /// Solve Equation 2.7.4 for a given pressure
161  virtual int eq274(size_t nv, const ubvector &nx, ubvector &ny,
162  int &Zt);
163 
164  /// The Gibbs free energy
165  double gibbs(int Z, int A);
166 
167  /// The energy density
168  double energy(double barn, int Z, int A);
169 
170  /// A solver to solve Eq. 2.7.4
172 
173  /// The nuclear mass formula
175 
176 #endif
177 
178  };
179 
180 #ifndef DOXYGEN_NO_O2NS
181 }
182 #endif
183 
184 #endif
Equation of state base class.
Definition: eos_base.h:39
Baym-Pethick-Sutherland equation of state.
Definition: eos_crust.h:84
virtual int calc_density(double barn, thermo &th, int &Z, int &A)
Calculate the equation of state as a function of the baryon number density barn.
const double barn
nucmass * nmp
The nuclear mass formula.
Definition: eos_crust.h:174
int calc_density_fixedA(double barn, thermo &th, int &Z, int A)
Compute the ground state assuming a fixed atomic number.
virtual int calc_pressure(thermo &th, double &barn, int &Z, int &A)
Calculate the equation of state as a function of the pressure.
nucmass_semi_empirical def_mass
Default mass formula.
Definition: eos_crust.h:135
virtual const fermion & get_electron()
Get a pointer to the electron.
Definition: eos_crust.h:121
mroot_hybrids< mm_funct11 > gs
A solver to solve Eq. 2.7.4.
Definition: eos_crust.h:171
int set_mass_formula(nucmass &nm)
Set the nuclear mass formula to be used.
Definition: eos_crust.h:138
virtual double mass_formula(int Z, int A)
The mass formula.
double gibbs(int Z, int A)
The Gibbs free energy.
virtual const char * type()
Return string denoting type ("eos_crust")
Definition: eos_crust.h:132
virtual double lattice_energy(int Z)
The electron lattice energy.
double energy(double barn, int Z, int A)
The energy density.
virtual int eq274(size_t nv, const ubvector &nx, ubvector &ny, int &Zt)
Solve Equation 2.7.4 for a given pressure.
fermion_zerot fzt
Zero-temperature thermodynamics for the electrons.
Definition: eos_crust.h:158
fermion e
The electron thermodynamics.
Definition: eos_crust.h:151

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).