Skip to content

yng87/NSHeat.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NSHeat

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 because of the entropy production.

Julia installation

See the official site.

For mac homebrew user

$ brew cask install julia

Package installation

From GitHub

$ julia
julia> ]
(v1.0) pkg> add https://github.com/basspale/NSHeat.jl.git

Then in your julia code, you can use NSHeat by

using NSHeat

Manual installation

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].

How to run

Set Model parameters

NSHeat uses four structures to manage the calculation.

  • 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

One can set the parameters for each struct by the following way:

  1. From input cards: .ini file is supported. See test/sample.ini and test/test.jl

  2. Directly in the code: See e.g., test/test_cool.jl

Solve ODE

The basic usage is read from the test codes in test/ (In particular, see notebook test/test.ipynb at first).

The calculation goes as follows:

When passing the parameters by ini file, NS parameters are set by

model, core, env, var = setup("path/to/ini/file/")

These four variables have type of sturcts defined above respectively.

Then you can solve ODE by

sol = heating(model, core, env, var)

or

sol = cooling(model, core, env, var)

sol stores the solution of ODE.

The results are placed in the directory you specified in ini card by

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

ODE Solver

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.

About

Nuetron star cooling and heating code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published