www.mooseframework.org
ThermalContactBCsAction.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 
10 #include "Factory.h"
11 #include "FEProblem.h"
12 #include "MooseApp.h"
13 #include "Conversion.h"
14 #include "AddVariableAction.h"
15 #include "GapConductance.h"
16 
17 template <>
18 InputParameters
20 {
21  InputParameters params = validParams<Action>();
22  params.addParam<std::string>(
23  "appended_property_name", "", "Name appended to material properties to make them unique");
24  params.addRequiredParam<std::string>(
25  "type",
26  "A string representing the Moose object that will be used for heat conduction over the gap");
27  params.addRequiredParam<NonlinearVariableName>("variable", "The variable for thermal contact");
28  params.addRequiredParam<BoundaryName>("master", "The master surface");
29  params.addRequiredParam<BoundaryName>("slave", "The slave surface");
30 
31  // TODO: these are only used in one Bison test. Deprecate soon!
32  params.addParam<std::vector<VariableName>>("disp_x", "The x displacement");
33  params.addParam<std::vector<VariableName>>("disp_y", "The y displacement");
34  params.addParam<std::vector<VariableName>>("disp_z", "The z displacement");
35 
36  params.addParam<std::vector<NonlinearVariableName>>(
37  "displacements",
38  "The displacements appropriate for the simulation geometry and coordinate system");
39 
40  MooseEnum orders(AddVariableAction::getNonlinearVariableOrders());
41  params.addParam<MooseEnum>("order", orders, "The finite element order");
42 
43  params.addParam<bool>(
44  "warnings", false, "Whether to output warning messages concerning nodes not being found");
45  params.addParam<std::vector<AuxVariableName>>(
46  "save_in", "The Auxiliary Variable to (optionally) save the boundary flux in");
47  params.addParam<bool>(
48  "quadrature", false, "Whether or not to use quadrature point based gap heat transfer");
50 
51  return params;
52 }
53 
54 ThermalContactBCsAction::ThermalContactBCsAction(const InputParameters & params) : Action(params) {}
55 
56 void
58 {
59  const bool quadrature = getParam<bool>("quadrature");
60 
61  InputParameters params = _factory.getValidParams(getParam<std::string>("type"));
62  params.applyParameters(parameters());
63 
64  if (!quadrature)
65  {
66  params.set<std::vector<VariableName>>("gap_distance") = {"penetration"};
67  params.set<std::vector<VariableName>>("gap_temp") = {
69  }
70  else
71  {
72  params.set<bool>("quadrature") = true;
73  params.set<BoundaryName>("paired_boundary") = getParam<BoundaryName>("master");
74  params.set<bool>("use_displaced_mesh") = true;
75  }
76 
77  params.set<std::vector<BoundaryName>>("boundary") = {getParam<BoundaryName>("slave")};
78  _problem->addBoundaryCondition(getParam<std::string>("type"), "gap_bc_" + name(), params);
79 
80  if (quadrature)
81  {
82  // Swap master and slave for this one
83  params.set<std::vector<BoundaryName>>("boundary") = {getParam<BoundaryName>("master")};
84  params.set<BoundaryName>("paired_boundary") = getParam<BoundaryName>("slave");
85 
86  _problem->addBoundaryCondition(
87  getParam<std::string>("type"), "gap_bc_master_" + name(), params);
88  }
89 }
static InputParameters actionParameters()
static std::string getGapValueName(const InputParameters &param)
ThermalContactBCsAction(const InputParameters &params)
InputParameters validParams< ThermalContactBCsAction >()