![]() |
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... | |
logical, private | nu_shutoff_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 |
Contains subroutines to assemble the system Jacobian and changes in the abundances.
Edited:
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).
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) \) |
Edited:
[in] | time | time [s] |
[in] | itemp | temperature in units of 10**9 K |
[in] | rho | baryon density [g/cm^3] |
[in] | ye | electron fraction |
[in] | rkm | current radius im km |
[in] | y | isotope abundances |
[in,out] | dydt | change in abundances due to reaction rates |
[in] | evolution_mode | state of the network |
Definition at line 289 of file jacobian_class.f90.
|
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.
Edited:
[in,out] | rrate_array | Rate array |
[in] | time | Time [s] |
[in] | temp | Temperature |
[in] | idx | Index of rate in array |
[in] | rho | Density |
[in] | ye | Electron fraction |
[in] | rkm | Radius in km |
[out] | rat_calc | Calculated reaction rate |
Definition at line 56 of file jacobian_class.f90.
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).
Edited:
[in] | time | time [s] |
[in] | itemp | initial temperature in units of 10**9 K |
[in] | rho | baryon density [g/cm^3] |
[in] | rkm | current radius im km |
[in] | y | current isotope abundances |
[in] | y_p | isotope abundances for the previous step |
[in,out] | dydt | change in abundances due to reaction rates |
[in,out] | rhs | right-hand side of the num. integration scheme |
[in] | h | timestep size |
[in] | evolution_mode | Evolution mode of the network |
Definition at line 538 of file jacobian_class.f90.
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.
Definition at line 480 of file jacobian_class.f90.
|
private |
Indicator for debug statement.
Definition at line 27 of file jacobian_class.f90.
|
private |
Indicator for debug statement.
Definition at line 28 of file jacobian_class.f90.
|
private |
Definition at line 29 of file jacobian_class.f90.
|
private |
Definition at line 29 of file jacobian_class.f90.
|
private |
Definition at line 29 of file jacobian_class.f90.
|
private |
Definition at line 29 of file jacobian_class.f90.
|
private |
Definition at line 29 of file jacobian_class.f90.
|
private |
Maximum cutoff for the reaction rates.
Definition at line 26 of file jacobian_class.f90.
|
private |
Minimum cutoff for the reaction rates.
Definition at line 25 of file jacobian_class.f90.