https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PIDTransientControl.h
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#pragma once
11
12#include "Control.h"
13
19{
20public:
22
28
29 virtual void execute() override;
30
35 virtual void initialSetup() override;
36
40 virtual void timestepSetup() override;
41
42private:
48 const Real _Kint;
50 const Real _Kpro;
52 const Real _Kder;
54 const Real _start_time;
56 const Real _stop_time;
68 Real & _integral;
73 Real & _value;
75 Real & _value_old;
79 Real & _old_delta;
86};
Real PostprocessorValue
various MOOSE typedefs
Definition MooseTypes.h:230
Base class for Control objects.
Definition Control.h:44
Base class for function objects.
Definition Function.h:30
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
A time-dependent control of an input parameter or a postprocessor, which aims at making a postprocess...
Real _delta_prev_tstep
the difference with the target from the previous time step, used if a time step fails
const bool _reset_integral_windup
Whether to reset the PID integral error when the error crosses 0, to avoid windup.
const Real _minimum_output_value
Limiting minimum value for the output of the PID controller.
bool _has_recovered
whether the app has recovered once, because the logic for setting the value is different after having...
const Function & _target
The target 1D time-dependent function for the postprocessor.
Real & _value
Saved value of the controlled parameter at the end of a timestep.
Real & _integral_old
Saved value of the integral at the beginning of a timestep, to recover from a failed solve.
const PostprocessorValue & _current
The current value of the target postprocessor.
const bool _reset_every_timestep
Whether to reset the PID integral error when changing timestep, to limit its action to within couplin...
const Real _maximum_output_value
Limiting maximum value for the output of the PID controller.
Real & _integral
Integral of the error.
const Real _Kder
The coefficient multiplying the derivative of the error.
const Real _Kpro
The coefficient multiplying the error.
virtual void initialSetup() override
Called once at the beginning of the simulation, used to initialize recovered control values.
Real & _old_delta
the previous value of the difference with the target, to detect changes of sign, and to compute the d...
virtual void timestepSetup() override
Used to reset the PID when failing a timestep and the control is executed on timestep_end.
virtual void execute() override
Execute the control.
const Real _stop_time
The time to stop using the PID controller on.
static InputParameters validParams()
const Real _maximum_change_rate
Limiting maximum value for the rate of change of output of the PID controller.
const Real _start_time
The time to start the PID controller on.
int & _t_step_old
the previous time step
Real & _value_old
Saved value of the controlled parameter at the beginning of a timestep, to recover from a failed solv...
Real _old_delta_prev_tstep
the difference with the target from the second-to-last iteration of previous time step,...
const Real _Kint
The coefficient multiplying the integral of the error.