jacobian_class Module Reference

Contains subroutines to assemble the system Jacobian and changes in the abundances. More...

Functions/Subroutines

subroutine, private calculate_reaction_rate (time, temp, rho, Ye, rkm, rrate_array, idx, rat_calc)
 Subroutine to calculate the reaction rates. More...
 
subroutine, public abchange (time, itemp, rho, Ye, rkm, Y, dYdt, evolution_mode)
 This subroutine calculates the change in abundances (dYdt) due to reaction rates at given temperature (temp) and density (rho). More...
 
logical function skip_rate (rat, rrate_in, Y)
 Function to decide whether a rate can contribute or not. More...
 
subroutine, public jacobi_init (time, itemp, rho, rkm, Y, Y_p, dYdt, rhs, h, evolution_mode)
 This subroutine calculates the entries in the jacobian and the right-hand side of the numerical integration scheme (rhs). More...
 

Variables

real(r_kind), parameter, private rate_min_cutoff = 1d-50
 Minimum cutoff for the reaction rates. More...
 
real(r_kind), parameter, private rate_max_cutoff = 1d99
 Maximum cutoff for the reaction rates. More...
 
logical, private freeze_rate_indicator = .False.
 Indicator for debug statement. More...
 
real(r_kind), private old_time =-99
 
real(r_kind), private old_temp =-99
 
real(r_kind), private old_dens =-99
 
real(r_kind), private old_ye =-99
 
real(r_kind), private old_rad =-99
 

Detailed Description

Contains subroutines to assemble the system Jacobian and changes in the abundances.

Edited:

  • 23.01.21, MR - fixed overflows and turned off fission in NSE

Function/Subroutine Documentation

◆ abchange()

subroutine, public jacobian_class::abchange ( real(r_kind), intent(in)  time,
real(r_kind), intent(in)  itemp,
real(r_kind), intent(in)  rho,
real(r_kind), intent(in)  Ye,
real(r_kind), intent(in)  rkm,
real(r_kind), dimension(:), intent(in)  Y,
real(r_kind), dimension(:), intent(inout)  dYdt,
integer, intent(in)  evolution_mode 
)

This subroutine calculates the change in abundances (dYdt) due to reaction rates at given temperature (temp) and density (rho).

The underlying differential equation is given by:

\[ \mathrm{dYdt}_i = \underbrace{\sum _j N_j ^i \lambda _j Y_j}_\text{Decays and photodisintegrations} + \underbrace{\sum _{j,k} \frac{N^i _{j,k}}{1+\delta _{jk}}\rho N_{\mathrm{A}} \langle \sigma v \rangle _{j,k}Y_jY_k}_\text{two-body reactions}+\underbrace{\sum _{j,k,l}\frac{N^i_{j,k,l}} {1+\Delta_{jkl}}\rho ^2N_{\mathrm{A}}^2\langle \sigma v\rangle _{j,k,l} Y_j Y_k Y_l}_\text{three-body reactions} \]

where the amount of synthesized and destroyed nuclei N_j is stored in global_class::rrate%ch_amount, the reaction rates come from various sources, but mostly from reaclib (see network_init_module::network_init, nucstuff_class::calc_t9_pow). The individual terms in the equation above are treated with the help of the reaclib chapters, the first term is given by chapter 1-3, the second one by 4-7, the third one 8-9 (see also Reaclib chapters).

Reaclib chapters
Chapter Equation
1 \( e_1 \rightarrow e_2 \)
2 \( e_1 \rightarrow e_2 + e_3 \)
3 \( e_1 \rightarrow e_2 + e_3 + e_4 \)
4 \( e_1 + e_2 \rightarrow e_3 \)
5 \( e_1 + e_2 \rightarrow e_3 + e_4 \)
6 \( e_1 + e_2 \rightarrow e_3 + e_4 + e_5 \)
7 \( e_1 + e_2 \rightarrow e_3 + e_4 + e_5 +e_6\)
8 \( e_1 + e_2 + e_3 \rightarrow e_4 (+ e_5 + e_6) \)
Note
When single_zone_vars::evolution_mode is equal to EM_NSE, this subroutine will ignore strong reactions and only calculate the contribution of weak reactions.
This routine can be used to calculate the jacobian of the original Reaclib format without chapter 9-11 as well as the modern format with chapter 9-11.
See also
jacobi_init, Hix & Thielemann 1999, Winteler 2013, Lippuner & Roberts 2017

Edited:

  • 12.01.14
  • 26.07.22, MR: Cleaned up the subroutine
  • 06.02.23, MR: Implemented parameter freeze_rate_temp.
Parameters
[in]timetime [s]
[in]itemptemperature in units of 10**9 K
[in]rhobaryon density [g/cm^3]
[in]yeelectron fraction
[in]rkmcurrent radius im km
[in]yisotope abundances
[in,out]dydtchange in abundances due to reaction rates
[in]evolution_modestate of the network

Definition at line 288 of file jacobian_class.f90.

Here is the call graph for this function:

◆ calculate_reaction_rate()

subroutine, private jacobian_class::calculate_reaction_rate ( real(r_kind), intent(in)  time,
real(r_kind), intent(in)  temp,
real(r_kind), intent(in)  rho,
real(r_kind), intent(in)  Ye,
real(r_kind), intent(in)  rkm,
type(reactionrate_type), dimension(nreac), intent(inout), optional  rrate_array,
integer, intent(in), optional  idx,
real(r_kind), intent(out), optional  rat_calc 
)
private

Subroutine to calculate the reaction rates.

The calculation depends on the source flag of the reaction rate. While reaclib rates are done by a simple fit formula, tabulated rates have to be interpolated, theoretical weak rates have to interpolate on a temperature-density grid, etc.

See also
reaclib_rate_module::calculate_reacl_rate, tabulated_rate_module::calculate_tab_rate, tw_rate_module::calculate_twr_rate

Edited:

  • 26.07.22, MR: Created this subroutine from code snippets that were flying around in Jacobi_init and abchange.
Parameters
[in,out]rrate_arrayRate array
[in]timeTime [s]
[in]tempTemperature
[in]idxIndex of rate in array
[in]rhoDensity
[in]yeElectron fraction
[in]rkmRadius in km
[out]rat_calcCalculated reaction rate

Definition at line 55 of file jacobian_class.f90.

Here is the call graph for this function:

◆ jacobi_init()

subroutine, public jacobian_class::jacobi_init ( real(r_kind), intent(in)  time,
real(r_kind), intent(in)  itemp,
real(r_kind), intent(in)  rho,
real(r_kind), intent(in)  rkm,
real(r_kind), dimension(:), intent(in)  Y,
real(r_kind), dimension(:), intent(in)  Y_p,
real(r_kind), dimension(:), intent(inout)  dYdt,
real(r_kind), dimension(:), intent(inout)  rhs,
real(r_kind), intent(in)  h,
integer, intent(in)  evolution_mode 
)

This subroutine calculates the entries in the jacobian and the right-hand side of the numerical integration scheme (rhs).

The jacobian is calculated by

\[ J = \frac{\mathrm{dYdt}}{dY}. \]

The values are directly stored into a sparse format (see pardiso_class::vals).

Note
When single_zone_vars::evolution_mode is equal to EM_NSE, this subroutine will ignore strong reactions and only calculate the contribution of weak reactions.
This routine can be used to calculate the jacobian of the original Reaclib format without chapter 9-11 as well as the modern format with chapter 9-11.
See also
abchange, Hix & Thielemann 1999, Winteler 2013, Lippuner & Roberts 2017

Edited:

  • 26.07.22, MR: Cleaned up the subroutine
  • 06.02.23, MR: Implemented parameter freeze_rate_temp.
Parameters
[in]timetime [s]
[in]itempinitial temperature in units of 10**9 K
[in]rhobaryon density [g/cm^3]
[in]rkmcurrent radius im km
[in]ycurrent isotope abundances
[in]y_pisotope abundances for the previous step
[in,out]dydtchange in abundances due to reaction rates
[in,out]rhsright-hand side of the num. integration scheme
[in]htimestep size
[in]evolution_modeEvolution mode of the network

Definition at line 522 of file jacobian_class.f90.

Here is the call graph for this function:

◆ skip_rate()

logical function jacobian_class::skip_rate ( real(r_kind), intent(in)  rat,
type(reactionrate_type), intent(in)  rrate_in,
real(r_kind), dimension(net_size), intent(in)  Y 
)

Function to decide whether a rate can contribute or not.

This function returns true if the rate should not be considered in the differential equation. This can happen by a small value of the rate or by zero abundance of the reactants.

Author
M. Reichert
Date
14.02.23

Definition at line 465 of file jacobian_class.f90.

Here is the call graph for this function:

Variable Documentation

◆ freeze_rate_indicator

logical, private jacobian_class::freeze_rate_indicator = .False.
private

Indicator for debug statement.

Definition at line 27 of file jacobian_class.f90.

◆ old_dens

real(r_kind), private jacobian_class::old_dens =-99
private

Definition at line 28 of file jacobian_class.f90.

◆ old_rad

real(r_kind), private jacobian_class::old_rad =-99
private

Definition at line 28 of file jacobian_class.f90.

◆ old_temp

real(r_kind), private jacobian_class::old_temp =-99
private

Definition at line 28 of file jacobian_class.f90.

◆ old_time

real(r_kind), private jacobian_class::old_time =-99
private

Definition at line 28 of file jacobian_class.f90.

◆ old_ye

real(r_kind), private jacobian_class::old_ye =-99
private

Definition at line 28 of file jacobian_class.f90.

◆ rate_max_cutoff

real(r_kind), parameter, private jacobian_class::rate_max_cutoff = 1d99
private

Maximum cutoff for the reaction rates.

Definition at line 26 of file jacobian_class.f90.

◆ rate_min_cutoff

real(r_kind), parameter, private jacobian_class::rate_min_cutoff = 1d-50
private

Minimum cutoff for the reaction rates.

Definition at line 25 of file jacobian_class.f90.