Nuetron star cooling and heating code.
The code solves temperature evolution of spherically symmetric and isothermal NS, along with the evolution of the imbalance among chemical potentials.
The imbalance causes the internal heating.
The code can also incorporate the heating caused by dark matter accretion.
See the official site.
The code is tested on Julia 1.3.1.
For mac homebrew user
$ brew cask install julia
Please install gfortran
in advance.
$ julia
julia> ]
(v1.3) pkg> add https://github.com/yng87/NSHeat.jl.git
Then in your julia code, you can use NSHeat by
using NSHeat
The dependent modules are automatically installed.
If the automatic installation fails, please install them manually:
pkg> add [package name]
When you encounter error in building NSHeat, try pkg> resolve
.
If you build it by yourself, just download zip. In your julia code, specify the path explicitly:
push!(LOAD_PATH, "path/to/NSHeat")
using NSHeat
You may need to install other packages by add [package name]
.
Please take a look at test/test.ipynb
.
One can set the parameters of a neutron star by the following ways:
- From input cards: You can pass paramter card by
model, core, env, var = setup("path/to/ini/file/")
These four variables are basic objects in NSHeat, corresponding to the following four structs respectively:
-
ModelParams
: model specification such as EOS or superfluid gap models. -
StarCoreParams
: T=0 quantities given by EOS such as Fermi momenta or critical temperatures of nucleons. -
EnvelopeParams
: envelope paramters govering the surface photon emission -
StarVariables
: temperature and chemical potentials which change by time
- Directly in the code:
See e.g.,
scripts/test_cool.jl
Then you can solve cooling/heating ODE by
sol = cooling(model, core, env, var)
or
sol = heating(model, core, env, var)
sol
stores the solution of ODE.
The results are placed in the directory you specified in model.output_dir
write_ini(sol, model) # save the model parameters
output_T(sol, model, core, env, var) # save temperature and chemical potential
output_LC(sol, model, core, env, var) # save luminosities and heat capacities
Julia DifferentialEquation.jl offers a lot of solvers for an ODE problem.
Among them, radau
is the best for this NS evolution, in particular for late time heating problem.