eos_crust_virial.h
Go to the documentation of this file.
1 /*
2  -------------------------------------------------------------------
3 
4  Copyright (C) 2013-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_virial.h
24  \brief File defining \ref o2scl::eos_crust_virial
25 */
26 #ifndef O2SCL_VIRIAL_EOS_H
27 #define O2SCL_VIRIAL_EOS_H
28 
29 #include <cmath>
30 #include <o2scl/constants.h>
31 #include <o2scl/lib_settings.h>
32 #include <o2scl/interp.h>
33 #include <o2scl/boson.h>
34 #include <o2scl/eos_had_base.h>
35 
36 #ifndef DOXYGEN_NO_O2NS
37 namespace o2scl {
38 #endif
39 
40  /** \brief Virial EOS for neutrons, protons, deuterons, and alpha
41  particles
42 
43  Virial EOS from \ref Horowitz06 and \ref Horowitz06b .
44 
45  \note This class likely fails for temperatures
46  smaller than 1 MeV and larger than 20 MeV.
47 
48  \warning This class is implemented as a \ref
49  o2scl::eos_had_temp_pres_base object because it might be helpful
50  to be able to use \ref
51  o2scl::eos_had_temp_pres_base::calc_temp_e(), but because of the
52  alpha particles and deuterons, some of the other \ref
53  o2scl::eos_had_base methods don't have the correct
54  interpretation.
55  */
57 
58  protected:
59 
60  /// \name Interpolation objects for virial coefficients
61  //@{
62  std::vector<double> Tv, bnv, Tbnpv, bpnv, Tbpnpv;
63  std::vector<double> banv, Tbanpv, bav, Tbapv;
64  interp_vec<std::vector<double> > ibn, iTbnp, ibpn, iTbpnp,
65  iban, iTbanp, iba, iTbap;
66  //@}
67 
68  public:
69 
71 
72  virtual ~eos_crust_virial() {
73  }
74 
75  /// Internal alpha particle
77 
78  /// Internal deuteron
80 
81  /** \brief Equation of state as a function of the chemical potentials
82  */
83  virtual int calc_p(fermion &ne, fermion &pr, thermo &th) {
84  O2SCL_ERR("Virial EOS does not work at T=0",exc_efailed);
85  return 0;
86  }
87 
88  /** \name The virial coefficients and their temperature derivatives
89 
90  These functions assume that the temperature is specified in
91  MeV. Note that the temperature derivative functions are
92  multiplied by the temperature after taking the derivative to
93  make them unitless (as in \ref Horowitz06), thus all of
94  these functions return values without units.
95  */
96  //@{
97  virtual double bn(double T);
98  virtual double ban(double T);
99  virtual double ba(double T);
100  virtual double bpn(double T);
101  virtual double Tbn_prime(double T);
102  virtual double Tban_prime(double T);
103  virtual double Tba_prime(double T);
104  virtual double Tbpn_prime(double T);
105  //@}
106 
107  /** \brief Equation of state as a function of the chemical potentials
108  at finite temperature
109 
110  As in \ref o2scl::eos_had_temp_base::calc_temp_p() the
111  temperature argument should be in \f$ \mathrm{fm}^{-1} \f$,
112  even though the virial coefficient functions take their
113  temperature arguments in MeV.
114  */
115  virtual int calc_temp_p(fermion &n, fermion &p, double T,
116  thermo &th);
117 
118  /** \brief Equation of state as a function of the chemical
119  potentials at finite temperature with alpha particles and
120  deuterons
121  */
122  virtual int calc_temp_p_alpha(fermion &n, fermion &p, boson &d, boson &a,
123  double T, thermo &th);
124 
125  /// Fit the virial coefficients to analytical functions
126  void fit();
127 
128  };
129 
130 #ifndef DOXYGEN_NO_O2NS
131 }
132 #endif
133 
134 #endif
virtual int calc_temp_p(fermion &n, fermion &p, double T, thermo &th)
Equation of state as a function of the chemical potentials at finite temperature. ...
void fit()
Fit the virial coefficients to analytical functions.
Virial EOS for neutrons, protons, deuterons, and alpha particles.
exc_efailed
virtual int calc_temp_p_alpha(fermion &n, fermion &p, boson &d, boson &a, double T, thermo &th)
Equation of state as a function of the chemical potentials at finite temperature with alpha particles...
A hadronic EOS at finite temperature based on a function of the chemical potentials [abstract base]...
boson deuteron
Internal deuteron.
boson alpha
Internal alpha particle.
#define O2SCL_ERR(d, n)
virtual int calc_p(fermion &ne, fermion &pr, thermo &th)
Equation of state as a function of the chemical potentials.

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