Neko 1.99.9
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
time_step_controller Module Reference

Implements type time_step_controller.

Data Types

type  time_step_controller_t
 Provides a tool to set time step dt. More...
 

Functions/Subroutines

subroutine time_step_controller_init (this, params)
 Constructor.
 
pure real(kind=dp) function time_step_controller_first_dt (this, time, cfl)
 The first time step of a variable time step run: the one giving the target CFL number, limited by timestep, max_timestep and min_timestep where given.
 
subroutine time_step_controller_set_dt (this, time, cfl)
 Set new dt based on cfl if requested.
 
subroutine time_step_controller_land (this, time, time_to_next)
 Fit the time step so that the next scheduled time, or the end time, is reached exactly.
 

Variables

real(kind=dp), parameter, public landing_tol = 1.0e-6_dp
 Relative tolerance on the number of steps up to a scheduled time, so that round-off in the accumulated time does not add a step, and on the change of the step that counts as one.
 
real(kind=dp), parameter max_landing_steps = 1.0e15_dp
 Largest number of steps up to a scheduled time that is still fitted.
 

Function/Subroutine Documentation

◆ time_step_controller_first_dt()

pure real(kind=dp) function time_step_controller::time_step_controller_first_dt ( class(time_step_controller_t), intent(in)  this,
type(time_state_t), intent(in)  time,
real(kind=dp), intent(in)  cfl 
)
private
Parameters
timeThe time state, whose dt is the step the CFL number was computed with.
cflThe CFL number of that step.

Definition at line 157 of file time_step_controller.f90.

◆ time_step_controller_init()

subroutine time_step_controller::time_step_controller_init ( class(time_step_controller_t), intent(inout)  this,
type(json_file), intent(inout)  params 
)
Parameters
paramsThe time settings of the case file, case.time.

Definition at line 94 of file time_step_controller.f90.

Here is the call graph for this function:

◆ time_step_controller_land()

subroutine time_step_controller::time_step_controller_land ( class(time_step_controller_t), intent(inout)  this,
type(time_state_t), intent(inout)  time,
real(kind=dp), intent(in)  time_to_next 
)
private
Parameters
timeThe time state, whose dt is the step proposed by the CFL controller, adjusted in place.
time_to_nextThe time until the next scheduled time, as time_to_next of the controllers gives it, huge(0.0_dp) if none.

To be called right after set_dt. The time up to the next target is divided into the number of equal steps nearest, in ratio, to the proposed step, within min_dt_decrease_factor and max_dt_increase_factor of the previous step and below max_timestep. As long as the CFL controller keeps the step and the step divides the remaining time, which it does between scheduled times and at those of equal intervals, the step is returned unchanged. The end is the target if the next scheduled time is within min_dt_decrease_factor times the previous step of it, and that scheduled time is executed at the end. A scheduled time closer than that is passed, and executed at the first step past it.

Designed for output intervals of several steps, the same for all controllers or whole multiples of each other. Schedules that produce scheduled times close to each other make the step shorter than needed.

Definition at line 286 of file time_step_controller.f90.

Here is the call graph for this function:

◆ time_step_controller_set_dt()

subroutine time_step_controller::time_step_controller_set_dt ( class(time_step_controller_t), intent(inout)  this,
type(time_state_t), intent(inout)  time,
real(kind=dp), intent(in)  cfl 
)
private
Parameters
timeThe time state, whose dt is the step taken last on entry and the step about to be taken on exit.
cflcourant number of current iteration. @Algorithm:
  1. Set the first time step such that cfl is the set one;
  2. During time-stepping, adjust dt when cfl_avg is offset by 20%.
  3. An exact zero cfl, e.g. from a zero velocity field, puts no limit on dt, so the first time step is the initial one and a later one is increased by the maximum increase factor. With exact_output_time the step is then fitted to the next scheduled time by land, which is to be called right after.

Definition at line 181 of file time_step_controller.f90.

Here is the call graph for this function:

Variable Documentation

◆ landing_tol

real(kind=dp), parameter, public time_step_controller::landing_tol = 1.0e-6_dp

Definition at line 51 of file time_step_controller.f90.

◆ max_landing_steps

real(kind=dp), parameter time_step_controller::max_landing_steps = 1.0e15_dp
private

Definition at line 54 of file time_step_controller.f90.