www.mooseframework.org
ThermalContactAuxBCsAction.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 "Conversion.h"
12 #include "AddVariableAction.h"
13 
14 template <>
15 InputParameters
17 {
18  InputParameters params = validParams<Action>();
19  params.addParam<std::string>(
20  "gap_aux_type",
21  "GapValueAux",
22  "A string representing the Moose object that will be used for computing the gap size");
23  params.addRequiredParam<NonlinearVariableName>("variable", "The variable for thermal contact");
24  params.addRequiredParam<BoundaryName>("master", "The master surface");
25  params.addRequiredParam<BoundaryName>("slave", "The slave surface");
26  params.addParam<Real>("tangential_tolerance",
27  "Tangential distance to extend edges of contact surfaces");
28  params.addParam<Real>(
29  "normal_smoothing_distance",
30  "Distance from edge in parametric coordinates over which to smooth contact normal");
31  params.addParam<std::string>("normal_smoothing_method",
32  "Method to use to smooth normals (edge_based|nodal_normal_based)");
33 
34  MooseEnum orders(AddVariableAction::getNonlinearVariableOrders());
35  params.addParam<MooseEnum>("order", orders, "The finite element order");
36 
37  params.addParam<bool>(
38  "warnings", false, "Whether to output warning messages concerning nodes not being found");
39  params.addParam<bool>(
40  "quadrature", false, "Whether or not to use quadrature point based gap heat transfer");
41  return params;
42 }
43 
45  : Action(params)
46 {
47 }
48 
49 void
51 {
52  bool quadrature = getParam<bool>("quadrature");
53 
54  InputParameters params = _factory.getValidParams(getParam<std::string>("gap_aux_type"));
55  params.applyParameters(parameters(), {"variable"});
56  params.set<AuxVariableName>("variable") = ThermalContactAuxVarsAction::getGapValueName(_pars);
57 
58  MultiMooseEnum execute_options = SetupInterface::getExecuteOptions();
59  execute_options = "initial linear";
60  params.set<MultiMooseEnum>("execute_on") = execute_options;
61 
62  params.set<std::vector<BoundaryName>>("boundary") = {getParam<BoundaryName>("slave")};
63  params.set<BoundaryName>("paired_boundary") = getParam<BoundaryName>("master");
64  params.set<VariableName>("paired_variable") = getParam<NonlinearVariableName>("variable");
65  _problem->addAuxKernel(getParam<std::string>("gap_aux_type"), "gap_value_" + name(), params);
66 
67  if (quadrature)
68  {
69  params.set<std::vector<BoundaryName>>("boundary") = {getParam<BoundaryName>("master")};
70  params.set<BoundaryName>("paired_boundary") = getParam<BoundaryName>("slave");
71  _problem->addAuxKernel(
72  getParam<std::string>("gap_aux_type"), "gap_value_master_" + name(), params);
73  }
74 
75  params = _factory.getValidParams("PenetrationAux");
76  params.applyParameters(parameters(), {"variable"});
77  std::string penetration_var_name = quadrature ? "qpoint_penetration" : "penetration";
78  params.set<AuxVariableName>("variable") = penetration_var_name;
79 
80  params.set<MultiMooseEnum>("execute_on") = execute_options;
81 
82  params.set<std::vector<BoundaryName>>("boundary") = {getParam<BoundaryName>("slave")};
83  params.set<BoundaryName>("paired_boundary") = getParam<BoundaryName>("master");
84 
85  _problem->addAuxKernel("PenetrationAux", "penetration_" + name(), params);
86 }
static std::string getGapValueName(const InputParameters &param)
ThermalContactAuxBCsAction(const InputParameters &params)
InputParameters validParams< ThermalContactAuxBCsAction >()