https://mooseframework.inl.gov
Loading...
Searching...
No Matches
LogConstantDT.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#include "LogConstantDT.h"
11
13
16{
19 "TimeStepper which imposes a time step constant in the logarithmic space");
20 params.addRequiredRangeCheckedParam<Real>("log_dt", "log_dt > 0", "Time step in log10(time)");
22 "first_dt", "first_dt > 0", "Initial time step (in absolute time)");
23 params.addRangeCheckedParam<Real>(
24 "growth_factor",
25 2,
26 "growth_factor>=1",
27 "Maximum ratio of new to previous timestep sizes following a step that required the time"
28 " step to be cut due to a failed solve.");
29 return params;
30}
31
33 : TimeStepper(parameters),
34 _log_dt(getParam<Real>("log_dt")),
35 _first_dt(getParam<Real>("first_dt")),
36 _dt_factor(std::pow(10.0, _log_dt)),
37 _growth_factor(getParam<Real>("growth_factor"))
38{
39}
40
41Real
46
47Real
49{
50 Real next = _time * _dt_factor;
51 return std::min(next - _time, _growth_factor * getCurrentDT());
52}
registerMooseObject("MooseApp", LogConstantDT)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void addRequiredRangeCheckedParam(const std::string &name, const std::string &parsed_function, const std::string &doc_string)
These methods add an range checked parameters.
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump.
void addRangeCheckedParam(const std::string &name, const T &value, const std::string &parsed_function, const std::string &doc_string)
Simple time-stepper which imposes a time step constant in the logarithmic space.
virtual Real computeInitialDT() override
Computes time step size for the initial time step.
const Real _growth_factor
virtual Real computeDT() override
Computes time step size after the initial time step.
const Real _dt_factor
const Real _first_dt
first time step (in absolute time)
static InputParameters validParams()
LogConstantDT(const InputParameters &parameters)
Base class for time stepping.
Definition TimeStepper.h:23
static InputParameters validParams()
Definition TimeStepper.C:16
Real getCurrentDT()
Get the current_dt.
Definition TimeStepper.h:85
Real & _time
Values from executioner.