00001 /* 00002 ------------------------------------------------------------------- 00003 00004 Copyright (C) 2006, 2007, 2008, 2009, Andrew W. Steiner 00005 00006 This file is part of O2scl. 00007 00008 O2scl is free software; you can redistribute it and/or modify 00009 it under the terms of the GNU General Public License as published by 00010 the Free Software Foundation; either version 3 of the License, or 00011 (at your option) any later version. 00012 00013 O2scl is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 GNU General Public License for more details. 00017 00018 You should have received a copy of the GNU General Public License 00019 along with O2scl. If not, see <http://www.gnu.org/licenses/>. 00020 00021 ------------------------------------------------------------------- 00022 */ 00023 #ifndef O2SCL_COLD_NSTAR_H 00024 #define O2SCL_COLD_NSTAR_H 00025 00026 #include <o2scl/hadronic_eos.h> 00027 #include <o2scl/tov_solve.h> 00028 #include <o2scl/table.h> 00029 #include <o2scl/fermion.h> 00030 #include <o2scl/cern_mroot_root.h> 00031 #include <o2scl/cern_mroot.h> 00032 #include <o2scl/gsl_mroot_hybrids.h> 00033 #include <o2scl/tov_eos.h> 00034 00035 #ifndef DOXYGENP 00036 namespace o2scl { 00037 #endif 00038 00039 /** 00040 \brief Naive static cold neutron star 00041 \nosubgrouping 00042 00043 This uses hadronic_eos::calc_e() to compute the equation of 00044 state of zero-temperature beta-equilibrated neutron star 00045 matter and tov_solve::mvsr() to compute the mass versus 00046 radius curve. 00047 00048 The electron and muon are given masses 00049 o2scl_fm_const::mass_electron and o2scl_fm_const::mass_muon, 00050 respectively. 00051 00052 The energy density and pressure are both calculated 00053 in units \f$ \mathrm{fm}^{-4} \f$ and the baryon 00054 density in \f$ \mathrm{fm}^{-3} \f$ 00055 00056 The condition for Urca is the area of the triangle 00057 formed by the neutron, proton, and electron Fermi momenta. 00058 00059 Using the definition of the semi-perimeter, 00060 \f[ 00061 s \equiv \left( k_{F,n}+k_{F,p}+k_{F,e} \right)/2 00062 \f] 00063 Heron's formula gives the triangle area as 00064 \f[ 00065 a=\sqrt{s(s-k_{F,n})(s-k_{F,p})(s-k_{F,e})} 00066 \f] 00067 00068 The column in the eos \ref table labeled \c urca 00069 is \f$ a^2 \f$ . If this quantity is positive, then 00070 direct Urca is allowed. 00071 00072 The squared speed of sound (in units of \f$ c \f$ ) 00073 is calculated by 00074 \f[ 00075 c_s^2 = \frac{ d P }{d \varepsilon} 00076 \f] 00077 and this is placed in the column labeled \c cs2. 00078 00079 The adabatic index is calculated by 00080 \f[ 00081 \Gamma = \frac{ d \ln P} { d \ln \varepsilon} 00082 \f] 00083 Note that \f$ \Gamma \f$ must be greater than \f$ 4/3 \f$ 00084 at the center of the neutron star for stability. (This 00085 is a necessary, but not sufficient condition.) 00086 00087 Note that if the speed of sound is non-monotonic, then 00088 calc_eos() will only record the lowest density for which 00089 the EOS becomes acausal. 00090 00091 There is an example for the usage of this class given 00092 in <tt>examples/ex_cold_nstar.cpp</tt>. 00093 00094 \future Convert tables to table_units 00095 \future Ensure that the adiabatic index of the central density 00096 is greater than 4/3 00097 \future Warn if the EOS becomes pure neutron matter. 00098 */ 00099 00100 class cold_nstar { 00101 public: 00102 00103 cold_nstar(); 00104 00105 /// \name Basic operation 00106 //@{ 00107 /** 00108 \brief Set the equation of state 00109 00110 This should be set before calling calc_eos(). 00111 */ 00112 int set_eos(hadronic_eos &he) { 00113 hep=&he; 00114 eos_set=true; 00115 return 0; 00116 } 00117 00118 /** 00119 \brief Calculate the given equation of state 00120 */ 00121 int calc_eos(double np_0=0.0); 00122 00123 /** 00124 \brief Compute the density at which the direct Urca process is allowed 00125 00126 This is faster than using calc_eos() since it does nothing 00127 other than computes the critical density. It does not store 00128 the equation of state. 00129 */ 00130 double calc_urca(double np_0=0.0); 00131 00132 /** \brief Calculate the M vs. R curve 00133 */ 00134 int calc_nstar(); 00135 //@} 00136 00137 /** \brief The starting baryon density (default 0.05) 00138 */ 00139 double nb_start; 00140 00141 /** \brief The final baryon density (default 2.0) 00142 */ 00143 double nb_end; 00144 00145 /** \brief The baryon density stepsize (default 0.01) 00146 */ 00147 double dnb; 00148 00149 /** \brief If true, include muons (default false) 00150 */ 00151 bool include_muons; 00152 00153 /// \name Output 00154 //@{ 00155 /** 00156 \brief The smallest baryon density where the pressure decreases 00157 00158 If this is zero after calling calc_eos(), then 00159 the pressure does not decrease in the specified range 00160 of baryon density 00161 */ 00162 double min_bad; 00163 00164 /** 00165 \brief The smallest density where Urca becomes allowed 00166 00167 If this is zero after calling calc_eos(), then direct 00168 Urca is never allowed. 00169 */ 00170 double allow_urca; 00171 00172 /** 00173 \brief The smallest density where Urca becomes disallowed 00174 00175 If this is zero after calling calc_eos(), then direct 00176 Urca is not disallowed at a higher density than 00177 it becomes allowed. 00178 */ 00179 double deny_urca; 00180 00181 /** 00182 \brief The density at which the EOS becomes acausal 00183 00184 If this is zero, then the EOS is causal at all baryon densities 00185 in the specified range 00186 */ 00187 double acausal; 00188 00189 /** 00190 \brief The pressure at which the EOS becomes acausal 00191 00192 If this is zero, then the EOS is causal at all baryon densities 00193 in the specified range 00194 */ 00195 double acausal_pr; 00196 00197 /** 00198 \brief The energy density at which the EOS becomes acausal 00199 00200 If this is zero, then the EOS is causal at all baryon densities 00201 in the specified range 00202 */ 00203 double acausal_ed; 00204 00205 /** 00206 \brief Solver tolerance (default \f$ 10^{-4} \f$) 00207 */ 00208 double solver_tol; 00209 00210 /** 00211 \brief Get the eos table (after having called calc_eos()) 00212 */ 00213 table &get_eos_results() { 00214 return eost; 00215 } 00216 00217 /** 00218 \brief Get the results from the TOV (after having called calc_nstar()) 00219 */ 00220 table &get_tov_results() { 00221 return tp->get_results(); 00222 } 00223 00224 //@} 00225 00226 /** 00227 \brief Set the neutron and proton 00228 00229 The default objects are of type \ref fermion, with mass 00230 o2scl_fm_const::mass_neutron and o2scl_fm_const::mass_proton. 00231 These defaults will give incorrect results for 00232 non-relativistic equations of state. 00233 */ 00234 int set_n_and_p(fermion &n, fermion &p) { 00235 np=&n; 00236 pp=&p; 00237 return 0; 00238 } 00239 00240 /// The default neutron 00241 eff_fermion def_n; 00242 00243 /// The default proton 00244 eff_fermion def_p; 00245 00246 /** 00247 \brief Specify the object for solving the TOV equations 00248 00249 The default uses the low-density equation of state with 00250 tov::verbose=0. In calc_nstar(), the units are set by calling 00251 tov_solve::set_units(). 00252 */ 00253 int set_tov(tov_solve &ts) { 00254 tp=&ts; 00255 return 0; 00256 } 00257 00258 /** \brief The default TOV equation solver 00259 */ 00260 tov_solve def_tov; 00261 00262 /** \brief Set the equation solver for the EOS 00263 */ 00264 int set_root(root<int,funct<int> > &rf) { 00265 rp=&rf; 00266 return 0; 00267 } 00268 00269 /** 00270 \brief The default equation solver for the EOS 00271 */ 00272 cern_mroot_root<int,funct<int> > def_root; 00273 00274 /// Default EOS object for the TOV solver 00275 tov_interp_eos def_tov_eos; 00276 00277 #ifndef DOXYGEN_INTERNAL 00278 00279 protected: 00280 00281 /// \name The thermodynamic information 00282 //@{ 00283 thermo hb, h, l; 00284 //@} 00285 00286 /// Solve to ensure zero charge in \f$ \beta \f$-equilibrium 00287 int solve_fun(double x, double &y, int &vp); 00288 00289 /// True if equation of state has been set 00290 bool eos_set; 00291 00292 /// The electron 00293 fermion e; 00294 00295 /// The muon 00296 fermion mu; 00297 00298 /// A pointer to the equation of state 00299 hadronic_eos *hep; 00300 00301 /// A pointer to the neutron 00302 fermion *np; 00303 00304 /// A pointer to the proton 00305 fermion *pp; 00306 00307 /// A pointer to the TOV object 00308 tov_solve *tp; 00309 00310 /// A pointer to the solver 00311 root<int,funct<int> > *rp; 00312 00313 /// Storage for the EOS table 00314 table eost; 00315 00316 /// The baryon density 00317 double barn; 00318 00319 #endif 00320 00321 }; 00322 00323 00324 #ifndef DOXYGENP 00325 } 00326 #endif 00327 00328 #endif
Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.
Project hosting provided by
,
O2scl Sourceforge Project Page