21 "Running time-weighted mean of a functor, starting at a given simulation time.");
23 params.
addRequiredParam<MooseFunctorName>(
"functor",
"The variable or functor to time-average.");
24 params.
addRequiredParam<Real>(
"start_time",
"Simulation time at which averaging starts.");
25 MooseEnum schemes(
"implicit-euler trapezoidal-rule",
"implicit-euler");
27 "time_integration_scheme",
29 "Quadrature of the time integral of the functor. 'implicit-euler' uses the current value "
30 "over each time step, 'trapezoidal-rule' the mean of the current and old values.");
36 _functor(getFunctor<Real>(
"functor")),
38 _start_time(getParam<Real>(
"start_time")),
39 _scheme(getParam<
MooseEnum>(
"time_integration_scheme").getEnum<
Scheme>()),
40 _averaging(declareRestartableData<bool>(
"averaging", false)),
41 _t_start(declareRestartableData<Real>(
"t_start", 0.0))
44 paramError(
"variable",
"The averaged variable must be elemental (CONSTANT MONOMIAL).");
74 const Real w = std::min(
_dt, T);
82 const Real u_begin = u + (u_old - u) * w /
_dt;
83 u_step = 0.5 * (u + u_begin);
registerMooseObject("MooseApp", CumulativeTimeAverageFunctorAux)
bool isNodal() const
Nodal or elemental kernel?
const Elem *const & _current_elem
Current element (valid only for elemental kernels)
unsigned int _qp
Quadrature point index.
static InputParameters validParams()
Running (time-weighted) mean of a functor (FE, FV or linear FV variable, or any functor) over [t_star...
CumulativeTimeAverageFunctorAux(const InputParameters ¶meters)
const VariableValue & _mean_old
Value of the average at the previous time step.
virtual Real computeValue() override
Compute and return the value of the aux variable.
Scheme
Quadratures of the time integral of the functor over a time step, in the order of the time_integratio...
const Real _start_time
Time at which averaging starts.
bool & _averaging
Restartable state.
virtual void timestepSetup() override
Gets called at the beginning of the timestep before this object is asked to do its job.
static InputParameters validParams()
Real & _t_start
Beginning of the averaging interval, never earlier than start_time.
const Scheme _scheme
Quadrature of the time integral of the functor over a time step.
const Moose::Functor< Real > & _functor
Quantity being averaged.
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Real & _dt
Time step size.
A structure that is used to evaluate Moose functors logically at an element/cell center.