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 Ensure that the adiabatic index of the central density 00095 is greater than 4/3 00096 \future Warn if the EOS becomes pure neutron matter. 00097 */ 00098 00099 class cold_nstar { 00100 public: 00101 00102 cold_nstar(); 00103 00104 /// \name Basic operation 00105 //@{ 00106 /** 00107 \brief Set the equation of state 00108 00109 This should be set before calling calc_eos(). 00110 */ 00111 int set_eos(hadronic_eos &he) { 00112 hep=&he; 00113 eos_set=true; 00114 return 0; 00115 } 00116 00117 /** 00118 \brief Calculate the given equation of state 00119 */ 00120 int calc_eos(double np_0=0.0); 00121 00122 /** 00123 \brief Compute the density at which the direct Urca process is allowed 00124 00125 This is faster than using calc_eos() since it does nothing 00126 other than computes the critical density. It does not store 00127 the equation of state. 00128 */ 00129 double calc_urca(double np_0=0.0); 00130 00131 /** \brief Calculate the M vs. R curve 00132 */ 00133 int calc_nstar(); 00134 //@} 00135 00136 /** \brief The starting baryon density (default 0.05) 00137 */ 00138 double nb_start; 00139 00140 /** \brief The final baryon density (default 2.0) 00141 */ 00142 double nb_end; 00143 00144 /** \brief The baryon density stepsize (default 0.01) 00145 */ 00146 double dnb; 00147 00148 /** \brief If true, include muons (default false) 00149 */ 00150 bool include_muons; 00151 00152 /// \name Output 00153 //@{ 00154 /** 00155 \brief The smallest baryon density where the pressure decreases 00156 00157 If this is zero after calling calc_eos(), then 00158 the pressure does not decrease in the specified range 00159 of baryon density 00160 */ 00161 double min_bad; 00162 00163 /** 00164 \brief The smallest density where Urca becomes allowed 00165 00166 If this is zero after calling calc_eos(), then direct 00167 Urca is never allowed. 00168 */ 00169 double allow_urca; 00170 00171 /** 00172 \brief The smallest density where Urca becomes disallowed 00173 00174 If this is zero after calling calc_eos(), then direct 00175 Urca is not disallowed at a higher density than 00176 it becomes allowed. 00177 */ 00178 double deny_urca; 00179 00180 /** 00181 \brief The density at which the EOS becomes acausal 00182 00183 If this is zero, then the EOS is causal at all baryon densities 00184 in the specified range 00185 */ 00186 double acausal; 00187 00188 /** 00189 \brief The pressure at which the EOS becomes acausal 00190 00191 If this is zero, then the EOS is causal at all baryon densities 00192 in the specified range 00193 */ 00194 double acausal_pr; 00195 00196 /** 00197 \brief The energy density at which the EOS becomes acausal 00198 00199 If this is zero, then the EOS is causal at all baryon densities 00200 in the specified range 00201 */ 00202 double acausal_ed; 00203 00204 /** 00205 \brief Solver tolerance (default \f$ 10^{-4} \f$) 00206 */ 00207 double solver_tol; 00208 00209 /** 00210 \brief Get the eos table (after having called calc_eos()) 00211 */ 00212 table &get_eos_results() { 00213 return eost; 00214 } 00215 00216 /** 00217 \brief Get the results from the TOV (after having called calc_nstar()) 00218 */ 00219 table &get_tov_results() { 00220 return tp->get_results(); 00221 } 00222 00223 //@} 00224 00225 /** 00226 \brief Set the neutron and proton 00227 00228 The default objects are of type \ref fermion, with mass 00229 o2scl_fm_const::mass_neutron and o2scl_fm_const::mass_proton. 00230 These defaults will give incorrect results for 00231 non-relativistic equations of state. 00232 */ 00233 int set_n_and_p(fermion &n, fermion &p) { 00234 np=&n; 00235 pp=&p; 00236 return 0; 00237 } 00238 00239 /// The default neutron 00240 eff_fermion def_n; 00241 00242 /// The default proton 00243 eff_fermion def_p; 00244 00245 /** 00246 \brief Specify the object for solving the TOV equations 00247 00248 The default uses the low-density equation of state with 00249 tov::verbose=0. In calc_nstar(), the units are set by calling 00250 tov_solve::set_units(). 00251 */ 00252 int set_tov(tov_solve &ts) { 00253 tp=&ts; 00254 return 0; 00255 } 00256 00257 /** \brief The default TOV equation solver 00258 */ 00259 tov_solve def_tov; 00260 00261 /** \brief Set the equation solver for the EOS 00262 */ 00263 int set_root(root<int ,funct<int> > &rf) { 00264 rp=&rf; 00265 return 0; 00266 } 00267 00268 /** 00269 \brief The default equation solver for the EOS 00270 */ 00271 cern_mroot_root<int ,funct<int> > def_root; 00272 00273 /// Default EOS object for the TOV solver 00274 tov_interp_eos def_tov_eos; 00275 00276 #ifndef DOXYGEN_INTERNAL 00277 00278 protected: 00279 00280 /// \name The thermodynamic information 00281 //@{ 00282 thermo hb, h, l; 00283 //@} 00284 00285 /// Solve to ensure zero charge in \f$ \beta \f$-equilibrium 00286 int solve_fun(double x, double &y, int &vp); 00287 00288 /// True if equation of state has been set 00289 bool eos_set; 00290 00291 /// The electron 00292 fermion e; 00293 00294 /// The muon 00295 fermion mu; 00296 00297 /// A pointer to the equation of state 00298 hadronic_eos *hep; 00299 00300 /// A pointer to the neutron 00301 fermion *np; 00302 00303 /// A pointer to the proton 00304 fermion *pp; 00305 00306 /// A pointer to the TOV object 00307 tov_solve *tp; 00308 00309 /// A pointer to the solver 00310 root<int ,funct<int> > *rp; 00311 00312 /// Storage for the EOS table 00313 table eost; 00314 00315 /// The baryon density 00316 double barn; 00317 00318 #endif 00319 00320 }; 00321 00322 00323 #ifndef DOXYGENP 00324 } 00325 #endif 00326 00327 #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