![]() |
Module to calculate NSE. More...
Functions/Subroutines | |
subroutine, public | nse_init () |
Allocates and initialises various arrays needed for the nse calculation. More... | |
subroutine, public | winnse_guess (t9, rho, ye, yn_guess, yp_guess, ysol) |
Calculate NSE composition with an initial guess. More... | |
subroutine, public | winnse_descend (t9strt, t9fnl, rho, ye, yni, ypi, ysol) |
This routine descends from an initially high temperature, at which the NSE abudances can be accurately predicted, to the desired temperature. More... | |
subroutine, private | winnse_calc (t9, rho, ye, yn, yp, imax, kit) |
Solves the nse-equations. More... | |
subroutine, private | winnse_calc_hybrid_powell (t9, rho, ye, yn, yp, imax, kit) |
Solves the nse-equations using the Powell hybrid method. More... | |
subroutine, private | winnse_calc_nr (t9, rho, ye, yn, yp, imax, kit) |
Solves the nse-equations using a 2-dimensional newton-raphson scheme. More... | |
subroutine, private | nse_screen (t9, rho, ye) |
Calls screening subroutine and adds subsequent proton capture screening corrections in scrn(1:zmax). More... | |
subroutine, private | wincnse_calc (t9, rho) |
Calculates the nse coefficients C, as given in Hix,Thielemann '99, Eq.25. More... | |
Variables | |
real(r_kind), dimension(:), allocatable, public | ynse |
NSE abundances. More... | |
real(r_kind), dimension(:), allocatable, public | pf |
Partition function for a given temperature. More... | |
real(r_kind), dimension(:), allocatable, private | gg |
\( G(Z,A)=(2J_0+1) \) where \( J_0 \) is the spin of the ground state More... | |
real(r_kind), dimension(:), allocatable, private | be |
Binding energy, calculated using mass excesses. More... | |
real(r_kind), dimension(:), allocatable, private | scrn |
Screening correction (details see nse_screen) More... | |
real(r_kind), dimension(:), allocatable, public | cnse |
NSE coefficients (details see cnsecalc) More... | |
real(r_kind), public | ye_ext |
Electron fraction to pass to external function. More... | |
integer, dimension(:), allocatable, public | aa |
Mass number. More... | |
integer, dimension(:), allocatable, public | zz |
Proton number. More... | |
integer, dimension(:), allocatable, public | nn |
Neutron number. More... | |
integer, private | zmax |
Highest proton number occuring in network. More... | |
Module to calculate NSE.
The winnse_module calculates NSE composition (with or without screening corrections). For this it uses various inputs as, e.g., the partition functions, binding energies, and the spin of the ground state of each nucleus. The necessary data is stored in global_class::isotope.
The NSE composition favors different nuclei, dependent on the conditions. A rough overview is given by:
subroutine, public winnse_module::nse_init |
Allocates and initialises various arrays needed for the nse calculation.
This subroutine also writes the content of global_class::isotope into shorter variables, such as aa, nn, and gg. In addition it calculates the binding energy
\[ Be(i) = Z(i) \cdot (Z_{me} + e_{m}) + N(i) \cdot N_{me} - M_{exc}(i) \]
with the mass excess of protons (Z), neutrons (N), and the isotope (i), \( Z_{me} \), \( N_{me} \), and \( M_{exc} \). The mass of the electrons (e) is given by \( e_{m} \). Furthermore it calculates \( 1 + 2 \cdot J \) with J being the spin of the ground state.
Edited: 12.01.14
Definition at line 74 of file winnse_module.f90.
|
private |
Calls screening subroutine and adds subsequent proton capture screening corrections in scrn(1:zmax).
This subroutine iterates over all possible amount of protons of a nucleus (up to zmax). It uses the subroutine screen to calculate the screening corrections. After it has been called, the array scrn contains summed screening corrections for proton captures from z=1 to z=i for scrn(i) on symmetric nuclei ( \( A = 2 \cdot Z \)).
Edited:
[in] | t9 | temperature in GK |
[in] | rho | density in g/cm^3 |
[in] | ye | electron fraction |
Definition at line 584 of file winnse_module.f90.
|
private |
Calculates the nse coefficients C, as given in Hix,Thielemann '99, Eq.25.
This subroutine calculates:
\[ \frac{G(^A Z)}{2^A} \left( \frac{ \rho N_A }{\theta} \right)^{A-1} A^{\frac{3}{2}} \exp{ \left( \frac{B(^A Z)}{k_B T} \right)} \]
,where \( G \) are the partition functions, A the mass number, \( \rho \) the density, \( N_A \) avogadros number, B the binding energy, \( k_B \) the boltzman constant, and T the temperature. Theta is a helper variable and given by:
\[ \theta = \left( \frac{m_u k_B T}{2\pi \hbar^2} \right) \]
The result is stored in the array cnse.
Edited:
[in] | t9 | temperature in GK |
[in] | rho | density in g/cm^3 |
Definition at line 626 of file winnse_module.f90.
|
private |
Solves the nse-equations.
This subroutine solves the NSE equations. It hereby choses between two different solvers as defined by the parameter parameter_class::nse_solver that is defined as in the following table:
nse_solver | Solver |
---|---|
0 | Newton-Raphson |
1 | Powell's hybrid method |
[in] | t9 | temperature in GK |
[in] | rho | density in g/cm^3 |
[in] | ye | electron fraction |
[in,out] | yn | neutron abundance |
[in,out] | yp | proton abundance |
[in] | imax | max. number of iterations |
[out] | kit | actual number of iterations |
Definition at line 274 of file winnse_module.f90.
|
private |
Solves the nse-equations using the Powell hybrid method.
This subroutine solves the NSE equations. It's two dimensional as the unknowns are the neutron abundances Yn and proton abundances Yp. The underlying constraints are mass conservation \( \sum X_i = \sum Y_i \cdot A_i = 1 \) and charge conservation \( \sum Y_i \cdot Z_i = y_e \). The subroutine makes use of the minpack routine fsolve.
[in] | t9 | temperature in GK |
[in] | rho | density in g/cm^3 |
[in] | ye | electron fraction |
[in,out] | yn | neutron abundance |
[in,out] | yp | proton abundance |
[in] | imax | max. number of iterations |
[out] | kit | actual number of iterations |
Definition at line 322 of file winnse_module.f90.
|
private |
Solves the nse-equations using a 2-dimensional newton-raphson scheme.
This subroutine solves the NSE equations. It's two dimensional as the unknowns are the neutron abundances Yn and proton abundances Yp. The underlying constraints are mass conservation \( \sum X_i = \sum Y_i \cdot A_i = 1 \) and charge conservation \( \sum Y_i \cdot Z_i = y_e \). Furthermore it uses the so called saha equation:
\[ Y(N,Z) = G_{N,Z}(\rho N_A)^{N+Z-1}\frac{\left( N +Z \right)^{3/2}}{2^{N+Z}}\left(\frac{2\pi \hbar} {m_\mathrm{u} k_{\mathrm{B}}T}\right)^{\frac{3}{2}(N+Z-1)} \mathrm{exp}(B_{N,Z}/ k_B T)Y^{N}_\mathrm{n} Y^Z_\mathrm{p}, \]
Edited:
[in] | t9 | temperature in GK |
[in] | rho | density in g/cm^3 |
[in] | ye | electron fraction |
[in,out] | yn | neutron abundance |
[in,out] | yp | proton abundance |
[in] | imax | max. number of iterations |
[out] | kit | actual number of iterations |
Definition at line 400 of file winnse_module.f90.
subroutine, public winnse_module::winnse_descend | ( | real(r_kind), intent(in) | t9strt, |
real(r_kind), intent(in) | t9fnl, | ||
real(r_kind), intent(in) | rho, | ||
real(r_kind), intent(in) | ye, | ||
real(r_kind), intent(in) | yni, | ||
real(r_kind), intent(in) | ypi, | ||
real(r_kind), dimension(net_size), intent(inout) | ysol | ||
) |
This routine descends from an initially high temperature, at which the NSE abudances can be accurately predicted, to the desired temperature.
At high temperatures, the solution is more stable and the solution of NSE at a high temperature can be used as an initial guess of a lower temperature. This increases the stability of the calculation and it can iterate to the input temperature "t9fnl". The temperature step is adaptive in this process, however, if it becomes too small ( \( 10^{-20} \) GK) an error is raised.
[in] | t9strt | high initial temperature in GK |
[in] | t9fnl | desired temperature in GK |
[in] | rho | density in g/cm^3 |
[in] | ye | electron fraction |
[in] | yni | neutron abundance |
[in] | ypi | proton abundance |
[in,out] | ysol | [out] nse abundances |
Definition at line 176 of file winnse_module.f90.
subroutine, public winnse_module::winnse_guess | ( | real(r_kind), intent(in) | t9, |
real(r_kind), intent(in) | rho, | ||
real(r_kind), intent(in) | ye, | ||
real(r_kind), intent(in) | yn_guess, | ||
real(r_kind), intent(in) | yp_guess, | ||
real(r_kind), dimension(net_size), intent(inout) | ysol | ||
) |
Calculate NSE composition with an initial guess.
The subroutine tries to calculate nse with an initial guess and if it does not converge, it descends from a high temperature. This routine is used if the parameter parameter_class::nse_calc_every is not equal to zero.
[in] | t9 | desired temperature in GK |
[in] | rho | density in g/cm^3 |
[in] | ye | electron fraction |
[in] | yn_guess | neutron abundance |
[in] | yp_guess | proton abundance |
[in,out] | ysol | [out] nse abundances |
Definition at line 115 of file winnse_module.f90.
integer, dimension(:), allocatable, public winnse_module::aa |
Mass number.
Definition at line 45 of file winnse_module.f90.
|
private |
Binding energy, calculated using mass excesses.
Definition at line 40 of file winnse_module.f90.
real(r_kind), dimension(:), allocatable, public winnse_module::cnse |
NSE coefficients (details see cnsecalc)
Definition at line 42 of file winnse_module.f90.
|
private |
\( G(Z,A)=(2J_0+1) \) where \( J_0 \) is the spin of the ground state
Definition at line 39 of file winnse_module.f90.
integer, dimension(:), allocatable, public winnse_module::nn |
Neutron number.
Definition at line 47 of file winnse_module.f90.
real(r_kind), dimension(:), allocatable, public winnse_module::pf |
Partition function for a given temperature.
Definition at line 38 of file winnse_module.f90.
|
private |
Screening correction (details see nse_screen)
Definition at line 41 of file winnse_module.f90.
real(r_kind), public winnse_module::ye_ext |
Electron fraction to pass to external function.
Definition at line 43 of file winnse_module.f90.
real(r_kind), dimension(:), allocatable, public winnse_module::ynse |
NSE abundances.
Definition at line 37 of file winnse_module.f90.
|
private |
Highest proton number occuring in network.
Definition at line 49 of file winnse_module.f90.
integer, dimension(:), allocatable, public winnse_module::zz |
Proton number.
Definition at line 46 of file winnse_module.f90.