26 #ifndef O2SCL_VIRIAL_EOS_H
27 #define O2SCL_VIRIAL_EOS_H
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>
36 #ifndef DOXYGEN_NO_O2NS
58 std::vector<double> Tv, bnv, Tbnpv, bpnv, Tbpnpv;
59 std::vector<double> banv, Tbanpv, bav, Tbapv;
61 iban, iTbanp, iba, iTbap;
77 {0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0},
78 {1,0.288,0.032,19.4,-43.8,1.51,1.21,2.55,1.59},
79 {2,0.303,0.012,6.10,-7.39,2.26,0.90,4.12,2.95},
80 {3,0.306,0.005,4.01,-3.54,2.57,0.63,5.64,4.81},
81 {4,0.307,0.002,3.19,-2.30,2.73,0.44,7.44,7.90},
82 {5,0.308,0.002,2.74,-1.73,2.81,0.32,9.57,11.3},
83 {6,0.308,0.003,2.46,-1.40,2.86,0.23,11.9,14.3},
84 {7,0.308,0.004,2.26,-1.18,2.89,0.18,14.3,16.3},
85 {8,0.309,0.006,2.11,-1.04,2.92,0.15,16.5,17.3},
86 {9,0.310,0.008,2.00,-0.93,2.93,0.14,18.6,17.5},
87 {10,0.311,0.010,1.91,-0.85,2.95,0.13,20.4,17.0},
88 {12,0.313,0.013,1.76,-0.73,2.97,0.12,23.3,14.7},
89 {14,0.315,0.014,1.66,-0.65,2.98,0.10,25.4,11.7},
90 {16,0.317,0.014,1.57,-0.59,3.00,0.07,26.7,8.48},
91 {18,0.319,0.013,1.51,-0.55,3.00,0.02,27.5,5.44},
92 {20,0.320,0.011,1.45,-0.52,3.00,-0.04,28.0,2.69}};
93 for(
size_t i=0;i<16;i++) {
94 Tv.push_back(arr[i][0]);
95 bnv.push_back(arr[i][1]);
96 Tbnpv.push_back(arr[i][2]);
97 bpnv.push_back(arr[i][3]);
98 Tbpnpv.push_back(arr[i][4]);
99 banv.push_back(arr[i][5]);
100 Tbanpv.push_back(arr[i][6]);
101 bav.push_back(arr[i][7]);
102 Tbapv.push_back(arr[i][8]);
135 virtual double bn(
double T) {
139 virtual double ban(
double T) {
143 virtual double ba(
double T) {
147 virtual double bpn(
double T) {
151 virtual double Tbn_prime(
double T) {
152 return iTbnp.
eval(T);
155 virtual double Tban_prime(
double T) {
156 return iTbanp.
eval(T);
159 virtual double Tba_prime(
double T) {
160 return iTbap.
eval(T);
163 virtual double Tbpn_prime(
double T) {
164 return iTbpnp.
eval(T);
186 a.
mu=2.0*p.mu+2.0*n.mu;
189 double zn, zp, za, zd;
190 if (n.inc_rest_mass) {
191 zn=exp((n.mu-n.m)/T);
195 if (p.inc_rest_mass) {
196 zp=exp((p.mu-p.m)/T);
200 za=zp*zp*zn*zn*exp(-(a.
m-2.0*n.m-2.0*p.m)/T);
201 zd=zp*zn*exp(-(d.
m-n.m-p.m)/T);
205 double lambda3=pow(lambda,3.0);
206 double lambdaa3=pow(lambdaa,3.0);
208 double lambdad3=pow(lambdad,3.0);
210 th.
pr=T*(2.0/lambda3*(zn+zp+(zn*zn+zp*zp)*bn(TMeV)+2.0*zp*zn*bpn(TMeV))
211 +1.0/lambdaa3*(za+za*za*ba(TMeV)+2.0*za*(zn+zp)*ban(TMeV)));
213 n.n=2.0/lambda3*(zn+2.0*zn*zn*bn(TMeV)+2.0*zp*zn*bpn(TMeV)+
214 8.0*za*zn*ban(TMeV));
215 p.n=2.0/lambda3*(zp+2.0*zp*zp*bn(TMeV)+2.0*zp*zn*bpn(TMeV)+
216 8.0*za*zp*ban(TMeV));
217 a.
n=1.0/lambdaa3*(za+2.0*za*za*ba(TMeV)+2.0*za*(zn+zp)*ban(TMeV));
220 th.
en=5.0*th.
pr/2.0/T-n.n*log(zn)-p.n*log(zp)-a.
n*log(za)+
221 2.0/lambda3*((zn*zn+zp*zp)*Tbn_prime(TMeV)+
222 2.0*zp*zn*Tbpn_prime(TMeV))+
223 1.0/lambdaa3*(za*za*Tba_prime(TMeV)+2.0*za*(zn+zp)*Tban_prime(TMeV));
226 if (n.inc_rest_mass) {
229 th.
ed+=n.n*n.mu+n.n*n.m;
231 if (p.inc_rest_mass) {
234 th.
ed+=p.n*p.mu+p.n*p.m;
254 #ifndef DOXYGEN_NO_O2NS
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. ...
virtual double convert(std::string from, std::string to, double val)
lib_settings_class o2scl_settings
const double mass_deuteron
Virial EOS for neutrons, protons, deuterons, and alpha particles.
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.
convert_units & get_convert_units()
virtual void init(double mass, double dof)
virtual double eval(const double x0) const
virtual int calc_p(fermion &ne, fermion &pr, thermo &th)
Equation of state as a function of the chemical potentials.
void set(size_t n, const vec_t &x, const vec2_t &y)