www.mooseframework.org
ThermalContactMaterialsAction.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
9 #include "Factory.h"
10 #include "FEProblem.h"
11 #include "MooseApp.h"
12 #include "Conversion.h"
13 #include "AddVariableAction.h"
14 #include "GapConductance.h"
15 
16 template <>
17 InputParameters
19 {
20  InputParameters params = validParams<Action>();
21  params.addRequiredParam<std::string>(
22  "type",
23  "A string representing the Moose object that will be used for heat conduction over the gap");
24 
25  params.addRequiredParam<NonlinearVariableName>("variable", "The variable for thermal contact");
26  params.addRequiredParam<BoundaryName>("master", "The master surface");
27  params.addRequiredParam<BoundaryName>("slave", "The slave surface");
28  params.addParam<Real>("gap_conductivity", 1.0, "The thermal conductivity of the gap material");
29  params.addParam<FunctionName>(
30  "gap_conductivity_function",
31  "Thermal conductivity of the gap material as a function. Multiplied by gap_conductivity.");
32  params.addParam<std::vector<VariableName>>(
33  "gap_conductivity_function_variable",
34  "Variable to be used in gap_conductivity_function in place of time");
35 
36  params.addParam<bool>(
37  "quadrature", false, "Whether or not to use quadrature point based gap heat transfer");
38 
39  params.addParam<std::string>("conductivity_name",
40  "thermal_conductivity",
41  "The name of the MaterialProperty associated with conductivity "
42  "(\"thermal_conductivity\" in the case of heat conduction)");
43  params.addParam<std::string>("conductivity_master_name",
44  "thermal_conductivity",
45  "The name of the MaterialProperty associated with conductivity "
46  "(\"thermal_conductivity\" in the case of heat conduction)");
47 
49  return params;
50 }
51 
53  : Action(params)
54 {
55 }
56 
57 void
59 {
60  if (getParam<std::string>("type") != "GapHeatTransfer")
61  return;
62 
63  const std::string type = "GapConductance";
64 
65  InputParameters params = _factory.getValidParams(type);
66  params.applyParameters(parameters(), {"variable"});
67 
68  params.set<std::vector<VariableName>>("variable") = {getParam<NonlinearVariableName>("variable")};
69 
70  const bool quadrature = getParam<bool>("quadrature");
71  if (!quadrature)
72  {
73  params.set<std::vector<VariableName>>("gap_temp") = {
75  params.set<std::vector<VariableName>>("gap_distance") = {"penetration"};
76  }
77  else
78  {
79  params.set<bool>("quadrature") = true;
80  params.set<BoundaryName>("paired_boundary") = getParam<BoundaryName>("master");
81  }
82 
83  params.set<std::vector<BoundaryName>>("boundary") = {getParam<BoundaryName>("slave")};
84 
85  std::string material_name = name() + "_" + "gap_value";
86  _problem->addMaterial(type, material_name, params);
87 
88  if (quadrature)
89  {
90  params.set<BoundaryName>("paired_boundary") = getParam<BoundaryName>("slave");
91  params.set<std::vector<BoundaryName>>("boundary") = {getParam<BoundaryName>("master")};
92  params.set<std::string>("conductivity_name") =
93  getParam<std::string>("conductivity_master_name");
94 
95  std::string master_name;
96  master_name += name() + "_" + "gap_value_master";
97  _problem->addMaterial(type, master_name, params);
98  }
99 }
static InputParameters actionParameters()
static std::string getGapValueName(const InputParameters &param)
InputParameters validParams< ThermalContactMaterialsAction >()
ThermalContactMaterialsAction(const InputParameters &params)