Line data Source code
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 356 : TimeFunctionComponentControl::validParams() 17 : { 18 356 : InputParameters params = THMControl::validParams(); 19 712 : params.addRequiredParam<std::string>("component", 20 : "The name of the component we will be controlling."); 21 712 : params.addRequiredParam<std::string>( 22 : "parameter", "The name of the parameter in the component we will be controlling"); 23 712 : params.addRequiredParam<FunctionName>("function", 24 : "The name of the function prescribing the value."); 25 356 : params.addClassDescription("Controls a parameter in a Component using a function"); 26 356 : return params; 27 0 : } 28 : 29 174 : TimeFunctionComponentControl::TimeFunctionComponentControl(const InputParameters & parameters) 30 : : THMControl(parameters), 31 174 : _component_name(getParam<std::string>("component")), 32 348 : _param_name(getParam<std::string>("parameter")), 33 348 : _ctrl_param_name("component", _component_name, _param_name), 34 348 : _function(getFunction("function")) 35 : { 36 174 : } 37 : 38 : void 39 1736 : TimeFunctionComponentControl::execute() 40 : { 41 1736 : Real value = _function.value(_t, Point()); 42 1736 : setControllableValueByName<Real>(_ctrl_param_name, value); 43 1736 : }