![]() |
Takes care of the temperature and entropy updates due to the nuclear energy release. More...
Functions/Subroutines | |
subroutine, public | nuclear_heating_init (T9, rho, Ye, Y, entropy) |
Nuclear heating initialization routine. More... | |
subroutine, private | start_heating (T9, rho, Ye, Y, entropy) |
Initialize the entrop and temperature for the heating. More... | |
subroutine | reset_qdot (time) |
Reset the qdot variable. More... | |
subroutine | calculate_qdot (rrate, Y, h) |
subroutine | output_debug_nufrac (rrate_array, length) |
Output the heating fractions to a debug file. More... | |
subroutine, public | nuclear_heating_update (nr_count, rho, Ye, pf, Y_p, Y, entropy_p, entropy, T9_p, T9, T9_tr_p, T9_tr, timestep, T9conv) |
Modifies the temperature and entropy to account for nuclear heating. More... | |
subroutine, private | nuclear_heating_energy (rho, Ye, pf, Y_p, Y, entropy_p, entropy, T9_p, T9, T9_tr_p, T9_tr, eos_status) |
Modifies the temperature to account for nuclear heating. More... | |
subroutine, private | nuclear_heating_entropy (rho, Ye, pf, Y_p, Y, entropy_p, entropy, T9, eos_status) |
Modifies the temperature and ent_p to account for nuclear heating. More... | |
subroutine, public | output_nuclear_heating (cnt, ctime) |
Output data related to nuclear heating. More... | |
Variables | |
real(r_kind), private | engen_nuc |
Total energy, generated by nuclear reactions. More... | |
integer, private | engen_unit |
Engen output file. More... | |
integer, private | debug_temp |
Debug file for temperature integration. More... | |
integer, private | debug_heatfrac |
Debug file for the heating fraction. More... | |
real(r_kind), save, public | qdot_bet = 0 |
Total energy radiated away by. More... | |
real(r_kind), save, public | qdot_nu = 0 |
Total energy added to the system by neutrino. More... | |
real(r_kind), save, public | qdot_th = 0 |
Total energy lost by thermal neutrinos. More... | |
real(r_kind), private | debug_ffn_qd =0 |
debug variable for the qdot caused by ffn rates More... | |
real(r_kind), private | debug_nu_qd =0 |
debug variable for the qdot caused by nu rates More... | |
real(r_kind), private | debug_bet_qd =0 |
debug variable for the qdot caused by beta decay rates More... | |
Takes care of the temperature and entropy updates due to the nuclear energy release.
subroutine nuclear_heating::calculate_qdot | ( | type(reactionrate_type), intent(in) | rrate, |
real(r_kind), dimension(net_size), intent(in) | Y, | ||
real(r_kind), intent(in) | h | ||
) |
[in] | rrate | Reaction rate |
[in] | y | Abundances |
[in] | h | timestep |
Definition at line 200 of file nuclear_heating.f90.
|
private |
Modifies the temperature to account for nuclear heating.
Here, an additional equation is calculated for the temperature. The temperature is calculated by:
\[ \dot{T}_\mathrm{nuc} = \frac{1}{c_v} \sum_i M_i dY_i \]
with the symbols defined as:
For heating_mode 2, the temperature is calculated by:
\[ \dot{T}_\mathrm{nuc} = \dot{T}_\mathrm{nuc} + \dot{T}_\mathrm{tr} \]
where \(\dot{T}_\mathrm{tr}\) is the temperature change of the external conditions, i.e., the trajectory or the analytic equation. For heating_mode 3, the temperature is calculated by:
\[ \dot{T}_\mathrm{nuc} = \dot{T}_\mathrm{nuc} + \dot{T}_\mathrm{ad} \]
where \(\dot{T}_\mathrm{ad}\) is the temperature change assuming adiabatic conditions.
[in] | rho | density |
[in] | ye | electron fraction |
[out] | pf | partition functions |
[in] | y_p | abundances |
[in] | y | abundances at the next step |
[in] | entropy_p | entropy |
[out] | entropy | entropy for the next step |
[in,out] | t9 | temperature at the next step |
[in] | t9_p | temperature at the previous step |
[in] | t9_tr_p | temperature of the trajectory/analytic (prev.) |
[in] | t9_tr | temperature of the trajectory/analytic |
[out] | eos_status | status of the EOS call |
Definition at line 460 of file nuclear_heating.f90.
|
private |
Modifies the temperature and ent_p to account for nuclear heating.
Here, an additional equation is calculated for the entropy. The entropy is calculated by:
\[ E_\mathrm{gen} = \sum_i (m_i c^2 + \mu_i + Z_i \mu_e) dY_i -\Delta q \]
, where \( \mu_i \) is given by
\[ \mu_i = -k_B T \log \left( \frac{g_i G_i}{\rho N_A Y_i} \left(\frac{2 \pi m_ic^2 k_B T}{h^2 c^2}\right)^{1.5} \right) \]
and the nuclear mass defined by the atomic mass excess:
\[ m_ic^2 = M_i +Am_uc^2 - Z_i m_e c^2 .\]
The symbols are defined as:
The entropy is converted to a temperature via the equation of state at the end of this subroutine. Furthermore, \( \Delta q \) is the energy loss due neutrinos that won't thermalize (parameter_class::heating_frac , beta_decay_file , neutrino_loss_file).
Edited:
[in] | rho | density |
[in] | ye | electron fraction |
[out] | pf | partition functions |
[in] | y_p | abundances |
[in] | y | abundances at the next step |
[in] | entropy_p | entropy |
[out] | entropy | entropy for the next step |
[in,out] | t9 | temperature at the next step |
[out] | eos_status | Status of the EOS call |
Definition at line 601 of file nuclear_heating.f90.
subroutine, public nuclear_heating::nuclear_heating_init | ( | real(r_kind), intent(in) | T9, |
real(r_kind), intent(in) | rho, | ||
real(r_kind), intent(in) | Ye, | ||
real(r_kind), dimension(net_size), intent(in) | Y, | ||
real(r_kind), intent(out) | entropy | ||
) |
Nuclear heating initialization routine.
This subroutine creates some files (e.g., debug_engen.dat_) and prepares the header for the engen.dat file
Edited:
[in] | t9 | temperature [GK] |
[in] | rho | density [g/cm^3] |
[in] | ye | electron fraction |
[in] | y | abundances |
[out] | entropy | [kB/baryon] |
Definition at line 50 of file nuclear_heating.f90.
subroutine, public nuclear_heating::nuclear_heating_update | ( | integer, intent(in) | nr_count, |
real(r_kind), intent(in) | rho, | ||
real(r_kind), intent(in) | Ye, | ||
real(r_kind), dimension(0:net_size), intent(out) | pf, | ||
real(r_kind), dimension(net_size), intent(in) | Y_p, | ||
real(r_kind), dimension(net_size), intent(in) | Y, | ||
real(r_kind), intent(in) | entropy_p, | ||
real(r_kind), intent(out) | entropy, | ||
real(r_kind), intent(in) | T9_p, | ||
real(r_kind), intent(inout) | T9, | ||
real(r_kind), intent(in) | T9_tr_p, | ||
real(r_kind), intent(in) | T9_tr, | ||
real(r_kind), intent(in) | timestep, | ||
real(r_kind), intent(out) | T9conv | ||
) |
Modifies the temperature and entropy to account for nuclear heating.
The temperature/entropy is solved (explicitely) in the same Newton-Raphson scheme as used for the abundances in e.g., timestep_module::advance_implicit_euler and timestep_module::advance_gear.
There are 3 different heating modes:
Value | Evolved variable | Additional source term |
---|---|---|
0 | No heating | - |
1 | Entropy | adiabatic |
2 | Temperature | trajectory |
3 | Temperature | adiabatic |
[in] | nr_count | NR-iteration count |
[in] | rho | density |
[in] | ye | electron fraction |
[out] | pf | partition functions |
[in] | y_p | abundances |
[in] | y | abundances at the next step |
[in] | entropy_p | entropy |
[out] | entropy | entropy for the next step |
[in] | t9_tr_p | temperature of the trajectory/analytic (prev.) |
[in] | t9_tr | temperature of the trajectory/analytic |
[in] | t9_p | temperature at the previous step |
[in,out] | t9 | temperature at the next step |
[in] | timestep | timestep (s) |
[out] | t9conv | Convergence of the temperature |
Definition at line 319 of file nuclear_heating.f90.
subroutine nuclear_heating::output_debug_nufrac | ( | type(reactionrate_type), dimension(length), intent(in) | rrate_array, |
integer, intent(in) | length | ||
) |
Output the heating fractions to a debug file.
This subroutine outputs the heating fractions to a debug file. This is useful for debugging purposes. The file is called debug_heating_nufrac.dat and is located in the output directory. An example could look like
Group Isotope Source Nu_frac Q_value 1 n wc12 0.40000 0.78230 1 t wc12 0.40000 0.01860 1 he3 ec 0.40000 -0.01900 1 he6 wc12 0.55394 3.50510 1 li9 wc12 0.45403 13.60600 ...
[in] | length | Amount of reactions |
[in] | rrate_array | Reaction rate array |
Definition at line 266 of file nuclear_heating.f90.
subroutine, public nuclear_heating::output_nuclear_heating | ( | integer, intent(in) | cnt, |
real(r_kind), intent(in) | ctime | ||
) |
Output data related to nuclear heating.
For example the energy generation in the file engen.dat
# 1:iteration 2:time[s] 3:timestep[s] 4:E_gen(tot) [erg/g] 5:E_gen(t) [erg/(g*s )] 6:E_gen(t) [MeV/(baryon*s)] 0 0.000000000000000E+00 0.000000000000000E+00 0.000000000000000E+00 0.000000000000000E+00 0.000000000000000E+00 0 2.000000000000000E-12 2.000000000000000E-12 2.100942703338183E+08 5.252356611052194E+19 5.443684205322992E+01 1 6.000000000000000E-12 4.000000000000000E-12 6.302695988823750E+08 5.252191701420075E+19 5.443513288527704E+01 ...
Edited:
[in] | cnt | current iteration |
[in] | ctime | current global time [s] |
Definition at line 756 of file nuclear_heating.f90.
subroutine nuclear_heating::reset_qdot | ( | real(r_kind), intent(in) | time | ) |
Reset the qdot variable.
This is called by the Jacobian init whenever recalculating the jacobian.
[in] | time | Current time |
Definition at line 154 of file nuclear_heating.f90.
|
private |
Initialize the entrop and temperature for the heating.
[in] | t9 | temperature [GK] |
[in] | rho | density [g/cm^3] |
[in] | ye | electron fraction |
[in] | y | abundances |
[out] | entropy | [kB/baryon] |
Definition at line 118 of file nuclear_heating.f90.
|
private |
debug variable for the qdot caused by beta decay rates
Definition at line 28 of file nuclear_heating.f90.
|
private |
debug variable for the qdot caused by ffn rates
Definition at line 26 of file nuclear_heating.f90.
|
private |
Debug file for the heating fraction.
Definition at line 19 of file nuclear_heating.f90.
|
private |
debug variable for the qdot caused by nu rates
Definition at line 27 of file nuclear_heating.f90.
|
private |
Debug file for temperature integration.
Definition at line 18 of file nuclear_heating.f90.
|
private |
Total energy, generated by nuclear reactions.
Definition at line 16 of file nuclear_heating.f90.
|
private |
Engen output file.
Definition at line 17 of file nuclear_heating.f90.
real(r_kind), save, public nuclear_heating::qdot_bet = 0 |
Total energy radiated away by.
Definition at line 21 of file nuclear_heating.f90.
real(r_kind), save, public nuclear_heating::qdot_nu = 0 |
Total energy added to the system by neutrino.
Definition at line 22 of file nuclear_heating.f90.
real(r_kind), save, public nuclear_heating::qdot_th = 0 |
Total energy lost by thermal neutrinos.
Definition at line 23 of file nuclear_heating.f90.