https://mooseframework.inl.gov
HSBoundarySpecifiedTemperature.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 
11 #include "HeatConductionModel.h"
12 
14 
17 {
19 
20  params.addRequiredParam<FunctionName>("T", "Prescribed temperature [K]");
21 
22  params.declareControllable("T");
23 
24  params.addClassDescription("Applies Dirichlet boundary conditions on a heat structure");
25 
26  return params;
27 }
28 
30  : HSBoundary(params),
31 
32  _T_func(getParam<FunctionName>("T"))
33 {
34 }
35 
36 void
38 {
39  {
40  std::string class_name = "ADFunctionDirichletBC";
41  InputParameters pars = _factory.getValidParams(class_name);
42  pars.set<NonlinearVariableName>("variable") = HeatConductionModel::TEMPERATURE;
43  pars.set<std::vector<BoundaryName>>("boundary") = _boundary;
44  pars.set<FunctionName>("function") = _T_func;
45  getTHMProblem().addBoundaryCondition(class_name, genName(name(), "bc"), pars);
47  }
48 }
std::string genName(const std::string &prefix, unsigned int id, const std::string &suffix="") const
Build a name from a prefix, number and possible suffix.
registerMooseObject("ThermalHydraulicsApp", HSBoundarySpecifiedTemperature)
THMProblem & getTHMProblem() const
Gets the THM problem.
Definition: Component.C:135
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Boundary condition to set a specified value of temperature in a heat structure.
void makeFunctionControllableIfConstant(const FunctionName &fn_name, const std::string &control_name, const std::string &param="value") const
Makes a function controllable if it is constant.
Definition: Component.C:141
HSBoundarySpecifiedTemperature(const InputParameters &params)
virtual const std::string & name() const
void addRequiredParam(const std::string &name, const std::string &doc_string)
virtual void addBoundaryCondition(const std::string &bc_name, const std::string &name, InputParameters &parameters)
const std::vector< BoundaryName > & _boundary
Boundary names for which the boundary component applies.
Definition: HSBoundary.h:56
static const std::string TEMPERATURE
static InputParameters validParams()
Definition: HSBoundary.C:15
Factory & _factory
The Factory associated with the MooseApp.
Definition: Component.h:446
void addClassDescription(const std::string &doc_string)
const FunctionName & _T_func
The function prescribing the temperature at the boundary.
void declareControllable(const std::string &name, std::set< ExecFlagType > execute_flags={})
Base class for heat structure boundary components.
Definition: HSBoundary.h:18