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

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

Public Member Functions

procedure, pass(this) init (this, params)
 Initialize object.
 
procedure, pass(this) set_dt (this, time, cfl)
 Set time stepping.
 
procedure, pass(this) first_dt (this, time, cfl)
 The first time step of a variable time step run.
 
procedure, pass(this) land (this, time, time_to_next)
 Fit the time step to land on the next scheduled time.
 

Public Attributes

logical is_variable_dt = .false.
 
real(kind=dp) cfl_trg = 0.0_dp
 
real(kind=dp) cfl_avg = 0.0_dp
 
real(kind=dp) init_dt = huge(0.0_dp)
 
real(kind=dp) max_dt = 0.0_dp
 
real(kind=dp) min_dt = 0.0_dp
 
integer max_update_frequency = 0
 
integer min_update_frequency = 0
 
integer dt_last_change = -1
 Number of time steps since the time step last changed, 0 at the step it changed, -1 until the first time step.
 
real(kind=dp) alpha = 0.0_dp
 coefficient of running average
 
real(kind=dp) max_dt_increase_factor = 0.0_dp
 
real(kind=dp) min_dt_decrease_factor = 0.0_dp
 
real(kind=dp) dev_tol = 0.0_dp
 
logical exact_output_time = .false.
 Whether to fit the time step so that the scheduled sampling and output times, and the end time, are reached exactly.
 
real(kind=dp) dt_previous = 0.0_dp
 The step taken last.
 

Detailed Description

Definition at line 57 of file time_step_controller.f90.

Member Function/Subroutine Documentation

◆ first_dt()

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

Definition at line 84 of file time_step_controller.f90.

◆ init()

procedure, pass(this) time_step_controller::time_step_controller_t::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 80 of file time_step_controller.f90.

◆ land()

procedure, pass(this) time_step_controller::time_step_controller_t::land ( class(time_step_controller_t), intent(inout)  this,
type(time_state_t), intent(inout)  time,
real(kind=dp), intent(in)  time_to_next 
)
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 86 of file time_step_controller.f90.

◆ set_dt()

procedure, pass(this) time_step_controller::time_step_controller_t::set_dt ( class(time_step_controller_t), intent(inout)  this,
type(time_state_t), intent(inout)  time,
real(kind=dp), intent(in)  cfl 
)
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 82 of file time_step_controller.f90.

Member Data Documentation

◆ alpha

real(kind=dp) time_step_controller::time_step_controller_t::alpha = 0.0_dp

Definition at line 69 of file time_step_controller.f90.

◆ cfl_avg

real(kind=dp) time_step_controller::time_step_controller_t::cfl_avg = 0.0_dp

Definition at line 60 of file time_step_controller.f90.

◆ cfl_trg

real(kind=dp) time_step_controller::time_step_controller_t::cfl_trg = 0.0_dp

Definition at line 59 of file time_step_controller.f90.

◆ dev_tol

real(kind=dp) time_step_controller::time_step_controller_t::dev_tol = 0.0_dp

Definition at line 72 of file time_step_controller.f90.

◆ dt_last_change

integer time_step_controller::time_step_controller_t::dt_last_change = -1

Definition at line 68 of file time_step_controller.f90.

◆ dt_previous

real(kind=dp) time_step_controller::time_step_controller_t::dt_previous = 0.0_dp

Definition at line 77 of file time_step_controller.f90.

◆ exact_output_time

logical time_step_controller::time_step_controller_t::exact_output_time = .false.

Definition at line 75 of file time_step_controller.f90.

◆ init_dt

real(kind=dp) time_step_controller::time_step_controller_t::init_dt = huge(0.0_dp)

Definition at line 61 of file time_step_controller.f90.

◆ is_variable_dt

logical time_step_controller::time_step_controller_t::is_variable_dt = .false.

Definition at line 58 of file time_step_controller.f90.

◆ max_dt

real(kind=dp) time_step_controller::time_step_controller_t::max_dt = 0.0_dp

Definition at line 62 of file time_step_controller.f90.

◆ max_dt_increase_factor

real(kind=dp) time_step_controller::time_step_controller_t::max_dt_increase_factor = 0.0_dp

Definition at line 70 of file time_step_controller.f90.

◆ max_update_frequency

integer time_step_controller::time_step_controller_t::max_update_frequency = 0

Definition at line 64 of file time_step_controller.f90.

◆ min_dt

real(kind=dp) time_step_controller::time_step_controller_t::min_dt = 0.0_dp

Definition at line 63 of file time_step_controller.f90.

◆ min_dt_decrease_factor

real(kind=dp) time_step_controller::time_step_controller_t::min_dt_decrease_factor = 0.0_dp

Definition at line 71 of file time_step_controller.f90.

◆ min_update_frequency

integer time_step_controller::time_step_controller_t::min_update_frequency = 0

Definition at line 65 of file time_step_controller.f90.


The documentation for this type was generated from the following file: