https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
PIDControl Class Reference

This block represents a proportional-integral-derivative controller (PID controller). More...

#include <PIDControl.h>

Inheritance diagram for PIDControl:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 PIDControl (const InputParameters &parameters)
 
virtual void execute ()
 
virtual void init ()
 
const std::vector< std::string > & getControlDataDependencies () const
 Return the Controls that must run before this Control.
 
std::vector< std::string > & getDependencies ()
 
virtual bool enabled () const
 
std::shared_ptr< MooseObjectgetSharedPtr ()
 
std::shared_ptr< const MooseObjectgetSharedPtr () const
 
bool isKokkosObject () const
 
MooseAppgetMooseApp () const
 
const std::string & type () const
 
const std::string & name () const
 
std::string typeAndName () const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
MooseObjectName uniqueName () const
 
const InputParametersparameters () const
 
const hit::Node * getHitNode () const
 
bool hasBase () const
 
const std::string & getBase () const
 
const TgetParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const TqueryParam (const std::string &name) const
 
const TgetRenamedParam (const std::string &old_name, const std::string &new_name) const
 
T getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &name) const
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void paramError (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramInfo (const std::string &param, Args... args) const
 
std::string messagePrefix (const bool hit_prefix=true) const
 
std::string errorPrefix (const std::string &) const
 
void mooseError (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecatedNoTrace (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
void callMooseError (std::string msg, const bool with_prefix, const hit::Node *node=nullptr, const bool show_trace=true) const
 
std::string getDataFileName (const std::string &param) const
 
std::string getDataFileNameByName (const std::string &relative_path) const
 
std::string getDataFilePath (const std::string &relative_path) const
 
bool isImplicit ()
 
Moose::StateArg determineState () const
 
virtual void initialSetup ()
 
virtual void timestepSetup ()
 
virtual void jacobianSetup ()
 
virtual void residualSetup ()
 
virtual void subdomainSetup ()
 
virtual void customSetup (const ExecFlagType &)
 
const ExecFlagEnumgetExecuteOnEnum () const
 
const FunctiongetFunction (const std::string &name) const
 
const FunctiongetFunctionByName (const FunctionName &name) const
 
bool hasFunction (const std::string &param_name) const
 
bool hasFunctionByName (const FunctionName &name) const
 
Moose::Kokkos::Function getKokkosFunction (const std::string &name) const
 
const TgetKokkosFunction (const std::string &name) const
 
Moose::Kokkos::Function getKokkosFunctionByName (const FunctionName &name) const
 
const TgetKokkosFunctionByName (const FunctionName &name) const
 
bool hasKokkosFunction (const std::string &param_name) const
 
bool hasKokkosFunctionByName (const FunctionName &name) const
 
UserObjectName getUserObjectName (const std::string &param_name) const
 
const TgetUserObject (const std::string &param_name, bool is_dependency=true) const
 
const TgetUserObjectByName (const UserObjectName &object_name, bool is_dependency=true) const
 
const UserObjectBasegetUserObjectBase (const std::string &param_name, bool is_dependency=true) const
 
const UserObjectBasegetUserObjectBaseByName (const UserObjectName &object_name, bool is_dependency=true) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
PerfGraphperfGraph ()
 
bool isDefaultPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
bool hasPostprocessor (const std::string &param_name, const unsigned int index=0) const
 
bool hasPostprocessorByName (const PostprocessorName &name) const
 
std::size_t coupledPostprocessors (const std::string &param_name) const
 
const PostprocessorName & getPostprocessorName (const std::string &param_name, const unsigned int index=0) const
 
const VectorPostprocessorValuegetVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name, bool needs_broadcast) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
bool hasVectorPostprocessor (const std::string &param_name, const std::string &vector_name) const
 
bool hasVectorPostprocessor (const std::string &param_name) const
 
bool hasVectorPostprocessorByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
bool hasVectorPostprocessorByName (const VectorPostprocessorName &name) const
 
const VectorPostprocessorName & getVectorPostprocessorName (const std::string &param_name) const
 
const PostprocessorValuegetPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOld (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOld (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOlder (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOlder (const std::string &param_name, const unsigned int index=0) const
 
virtual const PostprocessorValuegetPostprocessorValueByName (const PostprocessorName &name) const
 
virtual const PostprocessorValuegetPostprocessorValueByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOldByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOldByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOlderByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOlderByName (const PostprocessorName &name) const
 
bool isVectorPostprocessorDistributed (const std::string &param_name) const
 
bool isVectorPostprocessorDistributed (const std::string &param_name) const
 
bool isVectorPostprocessorDistributedByName (const VectorPostprocessorName &name) const
 
bool isVectorPostprocessorDistributedByName (const VectorPostprocessorName &name) const
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Static Public Member Functions

static InputParameters validParams ()
 
static void callMooseError (MooseApp *const app, const InputParameters &params, std::string msg, const bool with_prefix, const hit::Node *node, const bool show_trace=true)
 
static MultiMooseEnum getExecuteOptions ()
 

Public Attributes

 usingCombinedWarningSolutionWarnings
 
const ConsoleStream _console
 

Static Public Attributes

static const std::string type_param
 
static const std::string name_param
 
static const std::string unique_name_param
 
static const std::string app_param
 
static const std::string moose_base_param
 
static const std::string kokkos_object_param
 

Protected Member Functions

template<typename T >
TdeclareComponentControlData (const std::string &data_name)
 Declare control data with name 'component:data_name'.
 
template<typename T >
TdeclareControlData (const std::string &data_name)
 Declare control data with name 'data_name'.
 
template<typename T >
const TgetControlData (const std::string &param_name)
 Get a reference to control data that are specified in the input parameter 'param_name'.
 
template<typename T >
const TgetControlDataOld (const std::string &param_name)
 Get a reference to control data value from a previous time step that is specified in the input parameter 'param_name'.
 
template<typename T >
const TgetControlDataByName (const std::string &data_name)
 Get a reference to control data that are specified by 'data_name' name.
 
template<typename T >
const TgetControlDataOldByName (const std::string &data_name)
 Get a reference to control data value from previous time step that is specified by 'data_name' name.
 
template<typename T >
const TgetComponentControlDataOld (const std::string &data_name)
 Get a reference to a component control data value from previous time step.
 
bool hasControllableParameterByName (const std::string &name) const
 
void flagInvalidSolutionInternal (const InvalidSolutionID invalid_solution_id) const
 
InvalidSolutionID registerInvalidSolutionInternal (const std::string &message, const bool warning) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level, const std::string &live_message, const bool print_dots=true) const
 
std::string timedSectionName (const std::string &section_name) const
 
virtual void addUserObjectDependencyHelper (const UserObjectBase &) const
 
TdeclareRestartableData (const std::string &data_name, Args &&... args)
 
ManagedValue< TdeclareManagedRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
const TgetRestartableData (const std::string &data_name) const
 
TdeclareRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
TdeclareRecoverableData (const std::string &data_name, Args &&... args)
 
TdeclareRestartableDataWithObjectName (const std::string &data_name, const std::string &object_name, Args &&... args)
 
TdeclareRestartableDataWithObjectNameWithContext (const std::string &data_name, const std::string &object_name, void *context, Args &&... args)
 
std::string restartableName (const std::string &data_name) const
 
virtual void addPostprocessorDependencyHelper (const PostprocessorName &) const
 
virtual void addVectorPostprocessorDependencyHelper (const VectorPostprocessorName &) const
 
const ReporterContextBasegetReporterContextBaseByName (const ReporterName &reporter_name) const
 
const ReporterNamegetReporterName (const std::string &param_name) const
 
virtual void addReporterDependencyHelper (const ReporterName &)
 
ControllableParameter getControllableParameter (const std::string &param_name)
 
ControllableParameter getControllableParameter (const std::string &param_name)
 
ControllableParameter getControllableParameterByName (const std::string &param_name)
 
ControllableParameter getControllableParameterByName (const std::string &tag, const std::string &object_name, const std::string &param_name)
 
ControllableParameter getControllableParameterByName (const MooseObjectName &object_name, const std::string &param_name)
 
ControllableParameter getControllableParameterByName (const MooseObjectParameterName &param_name)
 
ControllableParameter getControllableParameterByName (const std::string &param_name)
 
ControllableParameter getControllableParameterByName (const std::string &tag, const std::string &object_name, const std::string &param_name)
 
ControllableParameter getControllableParameterByName (const MooseObjectName &object_name, const std::string &param_name)
 
ControllableParameter getControllableParameterByName (const MooseObjectParameterName &param_name)
 
T getControllableValue (const std::string &name, bool warn_when_values_differ=true)
 
T getControllableValue (const std::string &name, bool warn_when_values_differ=true)
 
T getControllableValueByName (const std::string &name, bool warn_when_values_differ=true)
 
T getControllableValueByName (const std::string &object_name, const std::string &param_name, bool warn_when_values_differ=true)
 
T getControllableValueByName (const MooseObjectName &object_name, const std::string &param_name, bool warn_when_values_differ=true)
 
T getControllableValueByName (const std::string &tag, const std::string &object_name, const std::string &param_name, bool warn_when_values_differ=true)
 
T getControllableValueByName (const MooseObjectParameterName &desired, bool warn_when_values_differ=true)
 
T getControllableValueByName (const std::string &name, bool warn_when_values_differ=true)
 
T getControllableValueByName (const std::string &object_name, const std::string &param_name, bool warn_when_values_differ=true)
 
T getControllableValueByName (const MooseObjectName &object_name, const std::string &param_name, bool warn_when_values_differ=true)
 
T getControllableValueByName (const std::string &tag, const std::string &object_name, const std::string &param_name, bool warn_when_values_differ=true)
 
T getControllableValueByName (const MooseObjectParameterName &desired, bool warn_when_values_differ=true)
 
void setControllableValue (const std::string &name, const T &value)
 
void setControllableValue (const std::string &name, const T &value)
 
void setControllableValueByName (const std::string &name, const T &value)
 
void setControllableValueByName (const std::string &object_name, const std::string &param_name, const T &value)
 
void setControllableValueByName (const MooseObjectName &object_name, const std::string &param_name, const T &value)
 
void setControllableValueByName (const std::string &tag, const std::string &object_name, const std::string &param_name, const T &value)
 
void setControllableValueByName (const MooseObjectParameterName &name, const T &value)
 
void setControllableValueByName (const std::string &name, const T &value)
 
void setControllableValueByName (const std::string &object_name, const std::string &param_name, const T &value)
 
void setControllableValueByName (const MooseObjectName &object_name, const std::string &param_name, const T &value)
 
void setControllableValueByName (const std::string &tag, const std::string &object_name, const std::string &param_name, const T &value)
 
void setControllableValueByName (const MooseObjectParameterName &name, const T &value)
 
const TgetReporterValue (const std::string &param_name, const std::size_t time_index=0)
 
const TgetReporterValue (const std::string &param_name, ReporterMode mode, const std::size_t time_index=0)
 
const TgetReporterValue (const std::string &param_name, const std::size_t time_index=0)
 
const TgetReporterValue (const std::string &param_name, ReporterMode mode, const std::size_t time_index=0)
 
const TgetReporterValueByName (const ReporterName &reporter_name, const std::size_t time_index=0)
 
const TgetReporterValueByName (const ReporterName &reporter_name, ReporterMode mode, const std::size_t time_index=0)
 
const TgetReporterValueByName (const ReporterName &reporter_name, const std::size_t time_index=0)
 
const TgetReporterValueByName (const ReporterName &reporter_name, ReporterMode mode, const std::size_t time_index=0)
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 

Protected Attributes

const Real & _value
 input data
 
const Real & _set_point
 set point
 
const Real & _K_p
 The coefficient for the proportional term.
 
const Real & _K_i
 The coefficient for the integral term.
 
const Real & _K_d
 The coefficient for the derivative term.
 
Real & _output
 The output computed by the PID controller.
 
const Real & _initial_value
 Initial value.
 
Real & _integral
 The integral value accumulated over time.
 
const Real & _integral_old
 The old value of _integral.
 
Real & _error
 The current value of the error.
 
const Real & _error_old
 The old value of the error.
 
THMProblem_sim
 
std::vector< std::string > _control_data_depends_on
 A list of control data that are required to run before this control may run.
 
FEProblemBase_fe_problem
 
std::vector< std::string > _depends_on
 
const bool & _enabled
 
MooseApp_app
 
Factory_factory
 
ActionFactory_action_factory
 
const std::string & _type
 
const std::string & _name
 
const InputParameters_pars
 
MooseApp_pg_moose_app
 
const std::string _prefix
 
const InputParameters_ti_params
 
FEProblemBase_ti_feproblem
 
bool _is_implicit
 
Real & _t
 
const Real & _t_old
 
int_t_step
 
Real & _dt
 
Real & _dt_old
 
bool _is_transient
 
const ExecFlagEnum_execute_enum
 
const ExecFlagType_current_execute_flag
 
MooseApp_restartable_app
 
const std::string _restartable_system_name
 
const THREAD_ID _restartable_tid
 
const bool _restartable_read_only
 
const Parallel::Communicator & _communicator
 

Private Member Functions

const Moose::FunctionBasegetKokkosFunctionByNameHelper (const FunctionName &name) const
 
const UserObjectBasegetUserObjectFromFEProblem (const UserObjectName &object_name, const THREAD_ID tid=0) const
 
const TcastUserObject (const UserObjectBase &uo_base, const std::string &param_name="") const
 
void mooseObjectError (const std::string &param_name, std::stringstream &oss) const
 
const std::string & userObjectType (const UserObjectBase &uo) const
 
const std::string & userObjectName (const UserObjectBase &uo) const
 
RestartableDataValueregisterRestartableDataOnApp (std::unique_ptr< RestartableDataValue > data, THREAD_ID tid) const
 
void registerRestartableNameWithFilterOnApp (const std::string &name, Moose::RESTARTABLE_FILTER filter)
 
RestartableData< T > & declareRestartableDataHelper (const std::string &data_name, void *context, Args &&... args) const
 
const PostprocessorName & getPostprocessorNameInternal (const std::string &param_name, const unsigned int index, const bool allow_default_value=true) const
 
bool isDefaultPostprocessorValueByName (const PostprocessorName &name) const
 
PostprocessorValue getDefaultPostprocessorValueByName (const PostprocessorName &name) const
 
void checkParam (const std::string &param_name, const unsigned int index=std::numeric_limits< unsigned int >::max()) const
 
bool postprocessorsAdded () const
 
const VectorPostprocessorValuegetVectorPostprocessorByNameHelper (const VectorPostprocessorName &name, const std::string &vector_name, bool broadcast, std::size_t t_index) const
 
const VectorPostprocessorContext< VectorPostprocessorValue > & getVectorPostprocessorContextByNameHelper (const VectorPostprocessorName &name, const std::string &vector_name) const
 
bool vectorPostprocessorsAdded () const
 
bool reportersAdded () const
 
void possiblyCheckHasReporter (const ReporterName &reporter_name, const std::string &param_name="") const
 
const PostprocessorValuegetPostprocessorValueInternal (const std::string &param_name, unsigned int index, std::size_t t_index) const
 
const PostprocessorValuegetPostprocessorValueInternal (const std::string &param_name, unsigned int index, std::size_t t_index) const
 
const PostprocessorValuegetPostprocessorValueByNameInternal (const PostprocessorName &name, std::size_t t_index) const
 
const PostprocessorValuegetPostprocessorValueByNameInternal (const PostprocessorName &name, std::size_t t_index) const
 
void possiblyCheckHasVectorPostprocessor (const std::string &param_name, const std::string &vector_name) const
 
void possiblyCheckHasVectorPostprocessor (const std::string &param_name, const std::string &vector_name) const
 
void possiblyCheckHasVectorPostprocessorByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
void possiblyCheckHasVectorPostprocessorByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 

Static Private Member Functions

static const hit::Node * getHitNode (const InputParameters &params)
 
static std::string messagePrefix (const InputParameters &params, const bool hit_prefix)
 

Private Attributes

InputParameterWarehouse_input_parameter_warehouse
 
const ParallelParamObject_parent
 
const MooseBase_si_moose_base
 
const FEProblemBase_si_problem
 
const std::string _ti_name
 
ExecFlagEnum _empty_execute_enum
 
const MooseObject_fni_object
 
const InputParameters_fni_params
 
FEProblemBase_fni_feproblem
 
const THREAD_ID _fni_tid
 
const MooseObject_uoi_moose_object
 
const FEProblemBase_uoi_feproblem
 
const THREAD_ID _uoi_tid
 
const RestartableDataMapName _metaname
 
std::string _restartable_name
 
const MooseObject_ppi_moose_object
 
const InputParameters_ppi_params
 
const FEProblemBase_ppi_feproblem
 
std::map< PostprocessorName, std::unique_ptr< PostprocessorValue > > _default_values
 
const bool _broadcast_by_default
 
const MooseObject_vpi_moose_object
 
const FEProblemBase_vpi_feproblem
 
const THREAD_ID _vpi_tid
 
const InputParameters_ri_params
 
FEProblemBase_ri_fe_problem_base
 
const ReporterData_ri_reporter_data
 
const MooseObject_ri_moose_object
 

Detailed Description

This block represents a proportional-integral-derivative controller (PID controller).

It continuously calculates an error value e(t) as the difference between a desired setpoint and a measured process variable and applies a correction based on proportional, integral, and derivative terms.

Definition at line 20 of file PIDControl.h.

Constructor & Destructor Documentation

◆ PIDControl()

PIDControl::PIDControl ( const InputParameters parameters)

Definition at line 30 of file PIDControl.C.

32 _value(getControlData<Real>("input")),
33 _set_point(getControlData<Real>("set_point")),
34 _K_p(getParam<Real>("K_p")),
35 _K_i(getParam<Real>("K_i")),
36 _K_d(getParam<Real>("K_d")),
37 _output(declareComponentControlData<Real>("output")),
38 _initial_value(getParam<Real>("initial_value")),
39 _integral(declareComponentControlData<Real>("integral")),
40 _integral_old(getComponentControlDataOld<Real>("integral")),
41 _error(declareComponentControlData<Real>("error")),
42 _error_old(getComponentControlDataOld<Real>("error"))
43{
45}
const InputParameters & parameters() const
Real & _output
The output computed by the PID controller.
Definition PIDControl.h:39
const Real & _K_p
The coefficient for the proportional term.
Definition PIDControl.h:33
const Real & _K_d
The coefficient for the derivative term.
Definition PIDControl.h:37
const Real & _value
input data
Definition PIDControl.h:29
const Real & _error_old
The old value of the error.
Definition PIDControl.h:49
const Real & _integral_old
The old value of _integral.
Definition PIDControl.h:45
const Real & _set_point
set point
Definition PIDControl.h:31
Real & _error
The current value of the error.
Definition PIDControl.h:47
Real & _integral
The integral value accumulated over time.
Definition PIDControl.h:43
const Real & _K_i
The coefficient for the integral term.
Definition PIDControl.h:35
const Real & _initial_value
Initial value.
Definition PIDControl.h:41

Member Function Documentation

◆ declareComponentControlData()

template<typename T >
T & THMControl::declareComponentControlData ( const std::string &  data_name)
protectedinherited

Declare control data with name 'component:data_name'.

Parameters
data_nameA unique name for the control data

Definition at line 101 of file THMControl.h.

102{
103 std::string full_name = name() + ":" + data_name;
104 ControlData<T> * data_ptr = _sim->declareControlData<T>(full_name, this);
105 return data_ptr->set();
106}
const double T
Concrete definition of a parameter value for a specified type.
Definition ControlData.h:92
const std::string & name() const
ControlData< T > * declareControlData(const std::string &name, THMControl *ctrl)
Declare control data of type T and name 'name', if it does not exist it will be created.
Definition Simulation.h:311
THMProblem * _sim
Definition THMControl.h:90

◆ declareControlData()

template<typename T >
T & THMControl::declareControlData ( const std::string &  data_name)
protectedinherited

Declare control data with name 'data_name'.

Parameters
data_nameA unique name for the control data

Definition at line 110 of file THMControl.h.

111{
112 ControlData<T> * data_ptr = _sim->declareControlData<T>(data_name, this);
113 return data_ptr->set();
114}

◆ execute()

void PIDControl::execute ( )
virtual

Implements Control.

Definition at line 48 of file PIDControl.C.

◆ getComponentControlDataOld()

template<typename T >
const T & THMControl::getComponentControlDataOld ( const std::string &  data_name)
protectedinherited

Get a reference to a component control data value from previous time step.

Parameters
data_nameThe name of the control data

Definition at line 165 of file THMControl.h.

166{
167 std::string full_name = name() + ":" + data_name;
168 return getControlDataOldByName<T>(full_name);
169}

◆ getControlData()

template<typename T >
const T & THMControl::getControlData ( const std::string &  param_name)
protectedinherited

Get a reference to control data that are specified in the input parameter 'param_name'.

Parameters
param_nameThe parameter name that contains the name of the control data

Definition at line 118 of file THMControl.h.

119{
120 std::string data_name = getParam<std::string>(param_name);
121 return getControlDataByName<T>(data_name);
122}

◆ getControlDataByName()

template<typename T >
const T & THMControl::getControlDataByName ( const std::string &  data_name)
protectedinherited

Get a reference to control data that are specified by 'data_name' name.

Parameters
data_nameThe name of the control data

Definition at line 134 of file THMControl.h.

135{
136 ControlData<T> * data_ptr = _sim->getControlData<T>(data_name);
137 if (data_ptr == nullptr)
138 mooseError("Trying to get control data '",
139 data_name,
140 "', but it does not exist in the system. Check your spelling.");
141
142 // set up dependencies for this control object
143 auto it = std::find(_control_data_depends_on.begin(), _control_data_depends_on.end(), data_name);
144 if (it == _control_data_depends_on.end())
145 _control_data_depends_on.push_back(data_name);
146
147 return data_ptr->get();
148}
const T & get() const
void mooseError(Args &&... args) const
ControlData< T > * getControlData(const std::string &name)
Get control data of type T and name 'name', if it does not exist it will be created.
Definition Simulation.h:290
std::vector< std::string > _control_data_depends_on
A list of control data that are required to run before this control may run.
Definition THMControl.h:93

◆ getControlDataDependencies()

const std::vector< std::string > & THMControl::getControlDataDependencies ( ) const
inlineinherited

Return the Controls that must run before this Control.

Definition at line 26 of file THMControl.h.

27 {
29 }

Referenced by Simulation::controlDataIntegrityCheck().

◆ getControlDataOld()

template<typename T >
const T & THMControl::getControlDataOld ( const std::string &  param_name)
protectedinherited

Get a reference to control data value from a previous time step that is specified in the input parameter 'param_name'.

Parameters
param_nameThe parameter name that contains the name of the control data

Definition at line 126 of file THMControl.h.

127{
128 std::string data_name = getParam<std::string>(param_name);
129 return getControlDataOldByName<T>(data_name);
130}

◆ getControlDataOldByName()

template<typename T >
const T & THMControl::getControlDataOldByName ( const std::string &  data_name)
protectedinherited

Get a reference to control data value from previous time step that is specified by 'data_name' name.

Parameters
data_nameThe name of the control data

Definition at line 152 of file THMControl.h.

153{
154 ControlData<T> * data_ptr = _sim->getControlData<T>(data_name);
155 if (data_ptr == nullptr)
156 mooseError("Trying to get control data '",
157 data_name,
158 "', but it does not exist in the system. Check your spelling.");
159
160 return data_ptr->getOld();
161}
const T & getOld() const

◆ init()

virtual void THMControl::init ( )
inlinevirtualinherited

Reimplemented in ParsedFunctionControl, and UnitTripControl.

Definition at line 21 of file THMControl.h.

21{}

Referenced by Simulation::controlDataIntegrityCheck().

◆ validParams()

InputParameters PIDControl::validParams ( )
static

Definition at line 15 of file PIDControl.C.

16{
18 params.addRequiredParam<std::string>("input", "The name of the control data that we read in.");
19 params.addRequiredParam<std::string>("set_point",
20 "The name of the control data with the set point.");
21 params.addRequiredParam<Real>("initial_value", "The initial value for the integral part.");
22 params.addRequiredParam<Real>("K_p", "The coefficient for the proportional term.");
23 params.addRequiredParam<Real>("K_i", "The coefficient for the integral term.");
24 params.addRequiredParam<Real>("K_d", "The coefficient for the derivative term.");
25 params.addClassDescription("Declares a control data named 'output' and uses Proportional "
26 "Integral Derivative logic on the 'value' control data to set it.");
27 return params;
28}
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
Definition THMControl.C:13
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

Member Data Documentation

◆ _control_data_depends_on

std::vector<std::string> THMControl::_control_data_depends_on
protectedinherited

A list of control data that are required to run before this control may run.

Definition at line 93 of file THMControl.h.

Referenced by THMControl::getControlDataByName(), and THMControl::getControlDataDependencies().

◆ _error

Real& PIDControl::_error
protected

The current value of the error.

Definition at line 47 of file PIDControl.h.

Referenced by execute().

◆ _error_old

const Real& PIDControl::_error_old
protected

The old value of the error.

Definition at line 49 of file PIDControl.h.

Referenced by execute().

◆ _initial_value

const Real& PIDControl::_initial_value
protected

Initial value.

Definition at line 41 of file PIDControl.h.

Referenced by PIDControl().

◆ _integral

Real& PIDControl::_integral
protected

The integral value accumulated over time.

Definition at line 43 of file PIDControl.h.

Referenced by execute(), and PIDControl().

◆ _integral_old

const Real& PIDControl::_integral_old
protected

The old value of _integral.

Definition at line 45 of file PIDControl.h.

Referenced by execute().

◆ _K_d

const Real& PIDControl::_K_d
protected

The coefficient for the derivative term.

Definition at line 37 of file PIDControl.h.

Referenced by execute().

◆ _K_i

const Real& PIDControl::_K_i
protected

The coefficient for the integral term.

Definition at line 35 of file PIDControl.h.

Referenced by execute().

◆ _K_p

const Real& PIDControl::_K_p
protected

The coefficient for the proportional term.

Definition at line 33 of file PIDControl.h.

Referenced by execute().

◆ _output

Real& PIDControl::_output
protected

The output computed by the PID controller.

Definition at line 39 of file PIDControl.h.

Referenced by execute().

◆ _set_point

const Real& PIDControl::_set_point
protected

set point

Definition at line 31 of file PIDControl.h.

Referenced by execute().

◆ _sim

THMProblem* THMControl::_sim
protectedinherited

◆ _value

const Real& PIDControl::_value
protected

input data

Definition at line 29 of file PIDControl.h.

Referenced by execute().


The documentation for this class was generated from the following files: