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.addClassDescription("Applies Dirichlet boundary conditions on a heat structure");
23 
24  return params;
25 }
26 
28  : HSBoundary(params),
29 
30  _T_func(getParam<FunctionName>("T"))
31 {
32 }
33 
34 void
36 {
37  {
38  std::string class_name = "ADFunctionDirichletBC";
39  InputParameters pars = _factory.getValidParams(class_name);
40  pars.set<NonlinearVariableName>("variable") = HeatConductionModel::TEMPERATURE;
41  pars.set<std::vector<BoundaryName>>("boundary") = _boundary;
42  pars.set<FunctionName>("function") = _T_func;
43  getTHMProblem().addBoundaryCondition(class_name, genName(name(), "bc"), pars);
44  }
45 }
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.
HSBoundarySpecifiedTemperature(const InputParameters &params)
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::string & name() const
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:497
void addClassDescription(const std::string &doc_string)
const FunctionName & _T_func
The function prescribing the temperature at the boundary.
Base class for heat structure boundary components.
Definition: HSBoundary.h:18