Protected Member Functions | Protected Attributes | List of all members
o2scl::nstar_cold Class Reference

Naive static cold neutron star. More...

#include <nstar_cold.h>

Public Member Functions

Basic operation
void set_eos (eos_had_base &he)
 Set the equation of state. More...
 
int calc_eos (double np_0=0.0)
 Calculate the given equation of state.
 
double calc_urca (double np_0=0.0)
 Compute the density at which the direct Urca process is allowe. More...
 
int calc_nstar ()
 Calculate the M vs. R curve.
 
int fixed (double target_mass)
 Calculate the profile for a fixed gravitational mass.
 

Public Attributes

Default objects
fermion np
 The default neutron.
 
fermion pp
 The default proton.
 
fermion_zerot fzt
 Zero-temperature fermion thermodynamics.
 
tov_solve def_tov
 The default TOV equation solver.
 
root_cern def_root
 The default equation solver for the EOS.
 
eos_tov_interp def_eos_tov
 Default EOS object for the TOV solver.
 

Protected Member Functions

double solve_fun (double x)
 Solve to ensure zero charge in $ \beta $-equilibrium.
 

Protected Attributes

bool eos_set
 True if equation of state has been set.
 
fermion e
 The electron.
 
fermion mu
 The muon.
 
eos_had_basehep
 A pointer to the equation of state.
 
tov_solvetp
 A pointer to the TOV object.
 
rootrp
 A pointer to the solver.
 
std::shared_ptr< table_units<> > eost
 Storage for the EOS table.
 
double barn
 The baryon density.
 
The thermodynamic information
thermo hb
 
thermo h
 
thermo l
 

Output

bool well_formed
 If true, the energy density of the EOS is monotonically increasing and the pressure is always positive.
 
double pressure_dec
 The smallest baryon density where the pressure starts to decrease. More...
 
double allow_urca
 The smallest density where Urca becomes allowed. More...
 
double deny_urca
 The smallest density where Urca becomes disallowed. More...
 
double acausal
 The density at which the EOS becomes acausal. More...
 
double acausal_pr
 The pressure at which the EOS becomes acausal. More...
 
double acausal_ed
 The energy density at which the EOS becomes acausal. More...
 
double solver_tol
 Solver tolerance (default $ 10^{-4} $)
 
int verbose
 Verbosity parameter (default 0)
 
void set_eos_table (std::shared_ptr< table_units<> > t)
 Return the results data table. More...
 
std::shared_ptr< table_units<> > get_eos_results ()
 Get the eos table (after having called calc_eos())
 
std::shared_ptr< table_units<> > get_tov_results ()
 Get the results from the TOV (after having called calc_nstar())
 

Configuration

double nb_start
 The starting baryon density (default 0.05)
 
double nb_end
 The final baryon density (default 2.0)
 
double dnb
 The baryon density stepsize (default 0.01)
 
bool include_muons
 If true, include muons (default false)
 
bool err_nonconv
 If true, throw an exception if the solver fails or if the EOS is not well-formed (default true)
 
int set_root (root<> &rf)
 Set the equation solver for the EOS.
 
int set_tov (tov_solve &ts)
 Specify the object for solving the TOV equations. More...
 

Detailed Description

This uses eos_had_base::calc_e() to compute the equation of state of zero-temperature beta-equilibrated neutron star matter and tov_solve::mvsr() to compute the mass versus radius curve.

The neutron, proton, electron and muon are given masses according to their values in o2scl_mks after a conversion to units of $ 1/\mathrm{fm} $.

There is an example for the usage of this class given in the Cold neutron star example.

If err_nonconv is true and the solver fails, the error handler is called.


EOS Output

The function calc_eos() generates an object of type table_units, which contains the following columns

If include_muons is true, the table has additional columns

If the energy density is always positive and increasing, and the pressure is always positive and increasing, then the EOS is well-formed and well_formed is true. The variable pressure_dec records the lowest baryon density where the pressure decreases with increasing density. If err_nonconv is true and the EOS is not well formed, the error handler is called, and the remaining columns below are not computed.

After computing the equation of state, calc_eos() also adds the following columns

The condition for the direct Urca process is the area of the triangle formed by the neutron, proton, and electron Fermi momenta. Using the definition of the semi-perimeter,

\[ s \equiv \left( k_{F,n}+k_{F,p}+k_{F,e} \right)/2 \]

Heron's formula gives the triangle area as

\[ a=\sqrt{s(s-k_{F,n})(s-k_{F,p})(s-k_{F,e})} \, . \]

The column in the eos table labeled urca is $ a^2 $ . If this quantity is positive, then direct Urca is allowed. The variable allow_urca is the smallest density for which the direct Urca process turns on, and deny_urca is the smallest density for which the direct Urca process turns off.

The squared speed of sound (in units of $ c $ ) is calculated by

\[ c_s^2 = \frac{ d P }{d \varepsilon} \]

and this is placed in the column labeled cs2. If the EOS is not well-formed, then this column is set to zero. If cs2 is larger than 1, the EOS is said to be "acausal". The variables acausal, acausal_ed, and acausal_pr record the baryon density, energy density, and pressure where the EOS becomes acausal. The adabatic index is calculated by

\[ \Gamma = \frac{ d \ln P} { d \ln \varepsilon} \]

Note that $ \Gamma $ must be greater than $ 4/3 $ at the center of the neutron star for stability. (This is a necessary, but not sufficient condition.) If the EOS is not well-formed then this column is set to zero.


TOV Output

The TOV table contains all the columns typically generated for mass versus radius tables in tov_solve, as well as columns containing the central values of al the densities and chemical potentials, and all the other columns computed for the EOS above.


Todo:
Maybe calc_eos() doesn't really need a thermo object since it can use the default EOS thermo object and we can get rid of the class variables h, hb, and l
Idea for Future:

Warn if the EOS becomes pure neutron matter.

Some of the auxillary quantities can be computed directly without using the table methods and the EOS calculation would be a bit faster.

Definition at line 188 of file nstar_cold.h.

Member Function Documentation

◆ calc_urca()

double o2scl::nstar_cold::calc_urca ( double  np_0 = 0.0)

This is faster than using calc_eos() since it does nothing other than computes the critical density. It does not store the equation of state.

◆ set_eos()

void o2scl::nstar_cold::set_eos ( eos_had_base he)
inline

This should be set before calling calc_eos().

Definition at line 200 of file nstar_cold.h.

◆ set_eos_table()

void o2scl::nstar_cold::set_eos_table ( std::shared_ptr< table_units<> >  t)
inline

This function immediately adds four constants to the table, schwarz, Msun, pi and mproton.

Definition at line 291 of file nstar_cold.h.

◆ set_tov()

int o2scl::nstar_cold::set_tov ( tov_solve ts)
inline

The default uses the low-density equation of state with tov::verbose=0. In calc_nstar(), the units are set by calling tov_solve::set_units().

Definition at line 346 of file nstar_cold.h.

Member Data Documentation

◆ acausal

double o2scl::nstar_cold::acausal

If this is zero, then the EOS is causal at all baryon densities in the specified range

Definition at line 263 of file nstar_cold.h.

◆ acausal_ed

double o2scl::nstar_cold::acausal_ed

If this is zero, then the EOS is causal at all baryon densities in the specified range

Definition at line 277 of file nstar_cold.h.

◆ acausal_pr

double o2scl::nstar_cold::acausal_pr

If this is zero, then the EOS is causal at all baryon densities in the specified range

Definition at line 270 of file nstar_cold.h.

◆ allow_urca

double o2scl::nstar_cold::allow_urca

If this is zero after calling calc_eos(), then direct Urca is never allowed.

Definition at line 248 of file nstar_cold.h.

◆ deny_urca

double o2scl::nstar_cold::deny_urca

If this is zero after calling calc_eos(), then direct Urca is not disallowed at a higher density than it becomes allowed.

Definition at line 256 of file nstar_cold.h.

◆ pressure_dec

double o2scl::nstar_cold::pressure_dec

If this is zero after calling calc_eos(), then the pressure does not decrease in the specified range of baryon density

Definition at line 241 of file nstar_cold.h.


The documentation for this class was generated from the following file:

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