13 #include "AddVariableAction.h"
15 #include "MooseMesh.h"
16 #include "MooseVariable.h"
17 #include "PenetrationLocator.h"
18 #include "SystemBase.h"
20 #include "libmesh/string_to_enum.h"
30 params.addClassDescription(
"Transfers heat across a gap between two "
31 "surfaces dependent on the gap geometry specified.");
32 params.addParam<std::string>(
33 "appended_property_name",
"",
"Name appended to material properties to make them unique");
36 params.addParam<Real>(
"min_gap", 1.0e-6,
"A minimum gap size");
37 params.addParam<Real>(
"max_gap", 1.0e6,
"A maximum gap size");
38 params.addRangeCheckedParam<
unsigned int>(
39 "min_gap_order", 0,
"min_gap_order<=1",
"Order of the Taylor expansion below min_gap");
42 MooseEnum coord_types(
"default XYZ cyl",
"default");
43 params.addDeprecatedParam<MooseEnum>(
46 "Gap calculation type (default or XYZ).",
47 "The functionality of this parameter is replaced by 'gap_geometry_type'.");
49 MooseEnum gap_geom_types(
"PLATE CYLINDER SPHERE");
50 params.addParam<MooseEnum>(
"gap_geometry_type",
52 "Gap calculation type. Choices are: " + gap_geom_types.getRawNames());
54 params.addParam<RealVectorValue>(
"cylinder_axis_point_1",
55 "Start point for line defining cylindrical axis");
56 params.addParam<RealVectorValue>(
"cylinder_axis_point_2",
57 "End point for line defining cylindrical axis");
58 params.addParam<RealVectorValue>(
"sphere_origin",
"Origin for sphere geometry");
61 params.addParam<
bool>(
"quadrature",
63 "Whether or not to do Quadrature point based gap heat "
64 "transfer. If this is true then gap_distance and "
65 "gap_temp should NOT be provided (and will be "
66 "ignored) however paired_boundary IS then required.");
67 params.addParam<BoundaryName>(
"paired_boundary",
"The boundary to be penetrated");
69 MooseEnum orders(AddVariableAction::getNonlinearVariableOrders());
70 params.addParam<MooseEnum>(
"order", orders,
"The finite element order");
72 params.addParam<
bool>(
73 "warnings",
false,
"Whether to output warning messages concerning nodes not being found");
75 params.addCoupledVar(
"disp_x",
"The x displacement");
76 params.addCoupledVar(
"disp_y",
"The y displacement");
77 params.addCoupledVar(
"disp_z",
"The z displacement");
81 "The displacements appropriate for the simulation geometry and coordinate system");
84 params.addCoupledVar(
"gap_distance",
"Distance across the gap");
85 params.addCoupledVar(
"gap_temp",
"Temperature on the other side of the gap");
91 : IntegratedBC(parameters),
92 _gap_geometry_type(declareRestartableData<
GapConductance::GAP_GEOMETRY>(
"gap_geometry_type",
94 _quadrature(getParam<bool>(
"quadrature")),
95 _slave_flux(!_quadrature ? &_sys.getVector(
"slave_flux") : NULL),
96 _gap_conductance(getMaterialProperty<Real>(
"gap_conductance" +
97 getParam<std::string>(
"appended_property_name"))),
98 _gap_conductance_dT(getMaterialProperty<Real>(
99 "gap_conductance" + getParam<std::string>(
"appended_property_name") +
"_dT")),
100 _min_gap(getParam<Real>(
"min_gap")),
101 _min_gap_order(getParam<unsigned int>(
"min_gap_order")),
102 _max_gap(getParam<Real>(
"max_gap")),
104 _gap_distance(std::numeric_limits<Real>::max()),
105 _edge_multiplier(1.0),
107 _disp_vars(3,
libMesh::invalid_uint),
108 _gap_distance_value(_quadrature ? _zero : coupledValue(
"gap_distance")),
109 _gap_temp_value(_quadrature ? _zero : coupledValue(
"gap_temp")),
110 _penetration_locator(
112 : &getQuadraturePenetrationLocator(
113 parameters.get<BoundaryName>(
"paired_boundary"),
114 getParam<std::vector<BoundaryName>>(
"boundary")[0],
115 Utility::string_to_enum<Order>(parameters.get<MooseEnum>(
"order")))),
116 _warnings(getParam<bool>(
"warnings")),
117 _p1(declareRestartableData<Point>(
"cylinder_axis_point_1", Point(0, 1, 0))),
118 _p2(declareRestartableData<Point>(
"cylinder_axis_point_2", Point(0, 0, 0)))
120 if (isParamValid(
"displacements"))
123 for (
unsigned int i = 0; i < coupledComponents(
"displacements"); ++i)
129 if (isParamValid(
"disp_x"))
131 if (isParamValid(
"disp_y"))
133 if (isParamValid(
"disp_z"))
141 if (!parameters.isParamValid(
"paired_boundary"))
142 mooseError(std::string(
"No 'paired_boundary' provided for ") + _name);
146 if (!isCoupled(
"gap_distance"))
147 mooseError(std::string(
"No 'gap_distance' provided for ") + _name);
149 if (!isCoupled(
"gap_temp"))
150 mooseError(std::string(
"No 'gap_temp' provided for ") + _name);
158 _assembly.coordSystem(),
159 _fe_problem.getAxisymmetricRadialCoord(),
179 Threads::spin_mutex::scoped_lock lock(Threads::spin_mutex);
181 _slave_flux->add(_var.dofIndices()[_i], slave_flux);
184 return _test[_i][_qp] * grad_t;
190 return _coord[_qp] * _JxW[_qp] * _test[_i][_qp] * grad_t;
201 return _test[_i][_qp] *
215 unsigned int coupled_component;
217 for (coupled_component = 0; coupled_component <
_disp_vars.size(); ++coupled_component)
257 const Point & normal(_normals[_qp]);
259 const Real dgap =
dgapLength(-normal(coupled_component));
263 return _test[_i][_qp] * dRdx * _phi[_j][_qp];
282 dgap = normalComponent;
298 Node * qnode = _mesh.getQuadratureNode(_current_elem, _current_side, _qp);
311 const Elem * slave_side = pinfo->_side;
312 std::vector<std::vector<Real>> & slave_side_phi = pinfo->_side_phi;
313 _gap_temp = _variable->getValue(slave_side, slave_side_phi);
316 if (tangential_tolerance != 0.0)
318 _edge_multiplier = 1.0 - pinfo->_tangential_distance / tangential_tolerance;
326 mooseWarning(
"No gap value information found for node ",