https://mooseframework.inl.gov
Loading...
Searching...
No Matches
thermal_hydraulics
src
controllogic
TimeFunctionComponentControl.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 "
TimeFunctionComponentControl.h
"
11
#include "
Function.h
"
12
13
registerMooseObject
(
"ThermalHydraulicsApp"
,
TimeFunctionComponentControl
);
14
15
InputParameters
16
TimeFunctionComponentControl::validParams
()
17
{
18
InputParameters
params =
THMControl::validParams
();
19
params.
addRequiredParam
<std::string>(
"component"
,
20
"The name of the component we will be controlling."
);
21
params.
addRequiredParam
<std::string>(
22
"parameter"
,
"The name of the parameter in the component we will be controlling"
);
23
params.
addRequiredParam
<FunctionName>(
"function"
,
24
"The name of the function prescribing the value."
);
25
params.
addClassDescription
(
"Controls a parameter in a Component using a function"
);
26
return
params;
27
}
28
29
TimeFunctionComponentControl::TimeFunctionComponentControl
(
const
InputParameters
& parameters)
30
:
THMControl
(parameters),
31
_component_name(getParam<
std
::string>(
"component"
)),
32
_param_name(getParam<
std
::string>(
"parameter"
)),
33
_ctrl_param_name(
"component"
, _component_name, _param_name),
34
_function(getFunction(
"function"
))
35
{
36
}
37
38
void
39
TimeFunctionComponentControl::execute
()
40
{
41
Real value =
_function
.
value
(
_t
, Point());
42
setControllableValueByName<Real>(
_ctrl_param_name
, value);
43
}
Function.h
registerMooseObject
registerMooseObject("ThermalHydraulicsApp", TimeFunctionComponentControl)
TimeFunctionComponentControl.h
Function::value
virtual Real value(Real t, const Point &p) const
InputParameters::addRequiredParam
void addRequiredParam(const std::string &name, const std::string &doc_string)
InputParameters::addClassDescription
void addClassDescription(const std::string &doc_string)
THMControl
Definition
THMControl.h:17
THMControl::validParams
static InputParameters validParams()
Definition
THMControl.C:13
TimeFunctionComponentControl
Definition
TimeFunctionComponentControl.h:17
TimeFunctionComponentControl::execute
virtual void execute()
Definition
TimeFunctionComponentControl.C:39
TimeFunctionComponentControl::validParams
static InputParameters validParams()
Definition
TimeFunctionComponentControl.C:16
TimeFunctionComponentControl::_function
const Function & _function
Definition
TimeFunctionComponentControl.h:27
TimeFunctionComponentControl::TimeFunctionComponentControl
TimeFunctionComponentControl(const InputParameters ¶meters)
Definition
TimeFunctionComponentControl.C:29
TimeFunctionComponentControl::_ctrl_param_name
MooseObjectParameterName _ctrl_param_name
Definition
TimeFunctionComponentControl.h:26
Control::_t
Real & _t
std
InputParameters
Generated on Fri Aug 21 2026 13:41:58 for https://mooseframework.inl.gov by
1.9.8