![]() |
The timestep_module contains all timestep subroutines and newton-raphsons to solve the ODE system. More...
Functions/Subroutines | |
subroutine | timestep (ctime, temp, dens, entropy, Y, dYdt, Ye, delYe, h, evmode) |
Network timestepping along the thermodynamic trajectory, specified by {ztime, ztemp, zdens}[zsteps]. More... | |
subroutine, private | restrict_timestep (ctime, h, temp, dens, ttemp, tdens) |
Restricting the previously selected timestep. More... | |
real(r_kind) function, private | ye_timestep (h, Ye, delYe) |
Estimate the timestep from the change of electron fraction. More... | |
real(r_kind) function, private | abchange_timestep (h, Y, dYdt) |
Estimate the timestep from the abundances change. More... | |
real(r_kind) function, private | hydro_timestep (h1, ctime, temp, dens, entropy, ttemp, tdens, Ye) |
Estimate the hydro timestep. More... | |
subroutine, public | select_optimistic_timestep (init) |
Selects the timestep. More... | |
subroutine, private | update_hydro (time_i, temperature, density, radius, entropy, efraction, T_tr) |
Returns temperature, density, and radius for a given time "time_i". More... | |
subroutine, public | advance_implicit_euler (cnt) |
Advance system to the next step for the implicit Euler method. More... | |
subroutine, public | advance_gear (cnt) |
Advance system to the next step using the Gear method (using gear_module) More... | |
The timestep_module contains all timestep subroutines and newton-raphsons to solve the ODE system.
This module contains several different treatments for the timestep and for solving the ODE with different solvers (so far implicit euler and gear). The gear solver develops its own timestep in gear_module. It is only affected by the subroutine restrict_timestep.
|
private |
Estimate the timestep from the abundances change.
In the network evolution mode, the timestep is calculated based on the most changing isotope. The timestep is the maximum of :
\[ h = \eta \cdot \left|\frac{Y}{\Delta Y} \right| \]
for all nuclei above a certain threshold abundance parameter_class::timestep_Ymin. The factor \( \eta \) is determined by the parameter parameter_class::timestep_factor.
Created: OK 28.08.2017
[in] | y | abundances |
[in] | dydt | change of abundances |
[in] | h | timescale on which this change happens |
Definition at line 372 of file timestep_module.f90.
subroutine, public timestep_module::advance_gear | ( | integer, intent(in) | cnt | ) |
Advance system to the next step using the Gear method (using gear_module)
This subroutine is similar to advance_implicit_euler. However, no additional check for convergence is done after the newton-raphson. This is not necessary as the Gear solver has its estimate of a possible error in the next step, given by evolving higher orders and comparing to lower ones.
Edited:
[in] | cnt | global iteration counter |
Definition at line 827 of file timestep_module.f90.
subroutine, public timestep_module::advance_implicit_euler | ( | integer, intent(in) | cnt | ) |
Advance system to the next step for the implicit Euler method.
This subroutine solves one timestep for the implicit Euler method via a newton-raphson (NR) scheme. The maximum amount of iterations for the NR is controlled by the parameter parameter_class::nr_maxcount. The NR is successful if the mass conservation deviates less than parameter_class::nr_tol. If the maximum iterations have been reached without convergence, it repeats the calculation with half of the timestep. This is done parameter_class::adapt_stepsize_maxcount many times. If after this amount of iterations still no convergence could be achieved it will raise an error.
Edited:
[in] | cnt | global iteration counter |
Definition at line 635 of file timestep_module.f90.
|
private |
Estimate the hydro timestep.
The timestep is restricted by the change of the hydrodynamic conditions (i.e., temperature and density). The maximum change of them is determined by the parameter parameter_class::timestep_hydro_factor. If the temperature or density change to rapidly the timestep will be decreased and ultimately, if the timestep is lower than \( 10^{-24}s \) an exception will be raised and the code terminates. The subroutine is also responsible to update the next temperature (ttemp) and density (tdens) that are used in restrict_timestep.
Created: OK 28.08.2017
[in] | h1 | timescale on which this change happens |
[in] | ctime | current time |
[in] | temp | temperature at ctime |
[in] | dens | density at ctime |
[in] | entropy | [kB/baryon] |
[in,out] | ttemp | computed temperature at ctime + h |
[in,out] | tdens | computed density at ctime + h |
[in] | ye | electron fraction |
Definition at line 414 of file timestep_module.f90.
|
private |
Restricting the previously selected timestep.
Possible restrictions are given by the termination criterion and the trajectory datapoints as well as custom selected snapshots. Furthermore, it is restricted to hit the NSE transition temperature (parameter_class::nsetemp_cold).
Edited:
[in] | ctime | current time |
[in] | temp | temperature [GK] |
[in] | dens | density [g/cm^3] |
[in] | ttemp | temperature [GK] of the next step |
[in] | tdens | density [g/cm^3] of the next step |
[in,out] | h | resulting timestep |
Definition at line 140 of file timestep_module.f90.
subroutine, public timestep_module::select_optimistic_timestep | ( | logical, intent(inout) | init | ) |
Selects the timestep.
This subroutine is the main interface to the driver.f90 . It calls timestep and initializes the timestep in case of the first call.
Edited:
Definition at line 496 of file timestep_module.f90.
subroutine timestep_module::timestep | ( | real(r_kind), intent(in) | ctime, |
real(r_kind), intent(in) | temp, | ||
real(r_kind), intent(in) | dens, | ||
real(r_kind), intent(in) | entropy, | ||
real(r_kind), dimension(net_size), intent(in) | Y, | ||
real(r_kind), dimension(net_size), intent(in) | dYdt, | ||
real(r_kind), intent(in) | Ye, | ||
real(r_kind), intent(in) | delYe, | ||
real(r_kind), intent(inout) | h, | ||
integer, intent(in) | evmode | ||
) |
Network timestepping along the thermodynamic trajectory, specified by {ztime, ztemp, zdens}[zsteps].
This subroutine calls more specific subroutines to calculate the timestep. This also depends on the conditions. For example, in NSE it call ye_timestep, while it calls abchange_timestep otherwise.
Edited:
[in] | ctime | current time |
[in] | temp | temperature [GK] |
[in] | dens | density [g/cm^3] |
[in] | entropy | [kB/baryon] |
[in] | y | abundances |
[in] | dydt | change of abundances |
[in] | ye | electron fraction |
[in] | delye | change of elec.fraction (Ye-Ye_p) |
[in,out] | h | resulting timestep |
[in] | evmode | zone evolution mode |
Definition at line 53 of file timestep_module.f90.
|
private |
Returns temperature, density, and radius for a given time "time_i".
The time, entropy, and electron fraction are only inputs and are not changed. The update depends on the trajectory mode of the run and can be either interpolated from a trajectory, got from the expansion, or from an analytic expression.
Edited:
[in] | time_i | Time [s] |
[in] | entropy | Entropy [kB/nuc] |
[in] | efraction | Electron fraction |
[in,out] | temperature | temperature at time_i |
[in,out] | density | density at time_i |
[in,out] | radius | radius at time_i |
[out] | t_tr | temperature at time_i, ignoring heating |
Definition at line 538 of file timestep_module.f90.
|
private |
Estimate the timestep from the change of electron fraction.
In NSE, only (slow) weak reactions are taken into account when calculating the timestep. Therefore, only the change in \( y_e \) is considered here and the timestep is usually larger than in the full network mode. The timestep is calculated by:
\[ h = h_\mathrm{old} \cdot \eta \frac{y_e}{|\Delta y_e|} \]
with \( \eta \) being the parameter parameter_class::timestep_factor.
Created: OK 28.08.2017
[in] | ye | electron fraction |
[in] | delye | change of the electron fraction |
[in] | h | timescale on which this change happens |
Definition at line 343 of file timestep_module.f90.