21#include "libmesh/string_to_enum.h"
30 "surfaces dependent on the gap geometry specified.");
32 "appended_property_name",
"",
"Name appended to material properties to make them unique");
35 params.
addParam<Real>(
"min_gap", 1.0e-6,
"A minimum gap size");
36 params.
addParam<Real>(
"max_gap", 1.0e6,
"A maximum gap size");
38 "min_gap_order", 0,
"min_gap_order<=1",
"Order of the Taylor expansion below min_gap");
41 MooseEnum coord_types(
"default XYZ cyl",
"default");
45 "Gap calculation type (default or XYZ).",
46 "The functionality of this parameter is replaced by 'gap_geometry_type'.");
48 MooseEnum gap_geom_types(
"PLATE CYLINDER SPHERE");
51 "Gap calculation type. Choices are: " + gap_geom_types.getRawNames());
53 params.
addParam<RealVectorValue>(
"cylinder_axis_point_1",
54 "Start point for line defining cylindrical axis");
55 params.
addParam<RealVectorValue>(
"cylinder_axis_point_2",
56 "End point for line defining cylindrical axis");
57 params.
addParam<RealVectorValue>(
"sphere_origin",
"Origin for sphere geometry");
62 "Whether or not to do Quadrature point based gap heat "
63 "transfer. If this is true then gap_distance and "
64 "gap_temp should NOT be provided (and will be "
65 "ignored) however paired_boundary IS then required.");
66 params.
addParam<BoundaryName>(
"paired_boundary",
"The boundary to be penetrated");
72 "warnings",
false,
"Whether to output warning messages concerning nodes not being found");
76 "The displacements appropriate for the simulation geometry and coordinate system");
79 params.
addCoupledVar(
"gap_distance",
"Distance across the gap");
80 params.
addCoupledVar(
"gap_temp",
"Temperature on the other side of the gap");
84 Moose::RelationshipManagerType::GEOMETRIC,
87 auto & boundary = rm_params.
set<std::vector<BoundaryName>>(
"boundary");
88 boundary = obj_params.
get<std::vector<BoundaryName>>(
"boundary");
89 boundary.push_back(obj_params.
get<BoundaryName>(
"paired_boundary"));
97 _gap_geometry_type(declareRestartableData<
GapConductance::GAP_GEOMETRY>(
"gap_geometry_type",
99 _quadrature(getParam<bool>(
"quadrature")),
100 _secondary_flux(!_quadrature ? &_sys.getVector(
"secondary_flux") : NULL),
101 _gap_conductance(getMaterialProperty<Real>(
"gap_conductance" +
102 getParam<
std::string>(
"appended_property_name"))),
103 _gap_conductance_dT(getMaterialProperty<Real>(
104 "gap_conductance" + getParam<
std::string>(
"appended_property_name") +
"_dT")),
105 _min_gap(getParam<Real>(
"min_gap")),
106 _min_gap_order(getParam<unsigned
int>(
"min_gap_order")),
107 _max_gap(getParam<Real>(
"max_gap")),
109 _gap_distance(
std::numeric_limits<Real>::max()),
110 _edge_multiplier(1.0),
112 _disp_vars(3,
libMesh::invalid_uint),
113 _gap_distance_value(_quadrature ? _zero : coupledValue(
"gap_distance")),
114 _gap_temp_value(_quadrature ? _zero : coupledValue(
"gap_temp")),
115 _penetration_locator(
117 : &getQuadraturePenetrationLocator(
118 parameters.get<BoundaryName>(
"paired_boundary"),
119 getParam<
std::vector<BoundaryName>>(
"boundary")[0],
120 Utility::string_to_enum<Order>(parameters.get<
MooseEnum>(
"order")))),
121 _warnings(getParam<bool>(
"warnings")),
122 _p1(declareRestartableData<Point>(
"cylinder_axis_point_1", Point(0, 1, 0))),
123 _p2(declareRestartableData<Point>(
"cylinder_axis_point_2", Point(0, 0, 0))),
125 _secondary_side_phi(nullptr),
126 _secondary_side(nullptr),
154 std::set<SubdomainID> subdomain_ids;
158 Elem * elem = bnd_elem->_elem;
159 subdomain_ids.insert(elem->subdomain_id());
162 if (subdomain_ids.empty())
167 for (
auto sid : subdomain_ids)
169 mooseError(
"The GapHeatTransfer model requires all boundary elements to have the same "
170 "coordinate system.");
190 Threads::spin_mutex::scoped_lock lock(Threads::spin_mutex);
221 std::vector<dof_id_type> secondary_side_dof_indices;
225 DenseMatrix<Number> K_secondary(
_var.
dofIndices().size(), secondary_side_dof_indices.size());
229 "The number of shapes does not match the number of dof indices on the secondary elem");
233 _secondary_j < static_cast<unsigned int>(secondary_side_dof_indices.size());
240 secondary_side_dof_indices,
250 DenseVector<Number> diag(rows);
251 for (
unsigned int i = 0; i < rows; i++)
254 Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
273 auto phi_size = jvar.dofIndices().size();
281 for (
_j = 0;
_j < phi_size;
_j++)
287 std::vector<dof_id_type> secondary_side_dof_indices;
291 DenseMatrix<Number> K_secondary(
_var.
dofIndices().size(), secondary_side_dof_indices.size());
295 "The number of shapes does not match the number of dof indices on the secondary elem");
299 _secondary_j < static_cast<unsigned int>(secondary_side_dof_indices.size());
307 secondary_side_dof_indices,
342 unsigned int coupled_component;
344 for (coupled_component = 0; coupled_component <
_disp_vars.size(); ++coupled_component)
387 const Real dgap =
dgapLength(-normal(coupled_component));
400 unsigned int coupled_component;
402 for (coupled_component = 0; coupled_component <
_disp_vars.size(); ++coupled_component)
416 const Real dgap =
dgapLength(-normal(coupled_component));
441 dgap = normalComponent;
476 if (tangential_tolerance != 0.0)
487 mooseWarning(
"No gap value information found for node ",
registerMooseObject("HeatTransferApp", GapHeatTransfer)
void ErrorVector unsigned int
static MooseEnum getNonlinearVariableOrders()
unsigned int coupledComponents(const std::string &var_name) const
virtual unsigned int coupled(const std::string &var_name, unsigned int comp=0) const
virtual bool isCoupled(const std::string &var_name, unsigned int i=0) const
Generic gap heat transfer model, with h_gap = h_conduction + h_contact + h_radiation.
static void computeGapRadii(const GAP_GEOMETRY gap_geometry_type, const Point ¤t_point, const Point &p1, const Point &p2, const Real &gap_distance, const Point ¤t_normal, Real &r1, Real &r2, Real &radius)
Compute current gap radii for surface integration of gas conductance.
static void setGapGeometryParameters(const InputParameters ¶ms, const Moose::CoordinateSystemType coord_sys, unsigned int axisymmetric_radial_coord, GAP_GEOMETRY &gap_geometry_type, Point &p1, Point &p2)
static Real gapLength(const GAP_GEOMETRY &gap_geom, const Real radius, const Real r1, const Real r2, const Real max_gap)
static Real gapAttenuation(Real adjusted_length, Real min_gap, unsigned int min_gap_order)
Generic gap heat transfer model, with h_gap = h_conduction + h_contact + h_radiation.
const PenetrationInfo * _pinfo
The current PenetratationInfo.
unsigned int _secondary_j
The secondary side shape index.
virtual Real computeQpOffDiagJacobian(unsigned jvar) override
Real _edge_multiplier
This is a factor that is used to gradually taper down the conductance if the contact point is off the...
virtual Real computeQpJacobian() override
virtual Real computeQpResidual() override
Real computeSecondaryQpOffDiagJacobian(unsigned int jvar)
compute the displacement Jacobian contributions from the secondary side degrees of freedom
const MaterialProperty< Real > & _gap_conductance_dT
const unsigned int _min_gap_order
void computeOffDiagJacobian(unsigned int jvar) override
static InputParameters validParams()
virtual Real gapLength() const
const VariableValue & _gap_distance_value
virtual Real computeSecondaryFluxContribution(Real grad_t)
const Elem * _secondary_side
The secondary side element (this really is a side element, e.g.
Real computeSecondaryQpJacobian()
compute the Jacobian contributions from the secondary side degrees of freedom
GapConductance::GAP_GEOMETRY & _gap_geometry_type
const std::vector< std::vector< Real > > * _secondary_side_phi
The phi values on the secondary side.
PenetrationLocator * _penetration_locator
virtual void computeGapValues()
NumericVector< Number > * _secondary_flux
void computeJacobian() override
virtual Real dgapLength(Real normalComponent) const
const MaterialProperty< Real > & _gap_conductance
GapHeatTransfer(const InputParameters ¶meters)
std::vector< unsigned int > _disp_vars
virtual void initialSetup() override
const VariableValue & _gap_temp_value
const unsigned int & _current_side
const QBase *const & _qrule
const MooseArray< Real > & _JxW
const Elem *const & _current_elem
std::vector< MooseVariableFEBase * > _diag_save_in
const MooseArray< Real > & _coord
const MooseArray< Point > & _q_point
static InputParameters validParams()
const VariablePhiValue & _phi
const MooseArray< Point > & _normals
const VariableTestValue & _test
const InputParameters & parameters() const
void mooseError(Args &&... args) const
void mooseWarning(Args &&... args) const
const InputParameters & _pars
const std::string & _name
bool isParamValid(const std::string &name) const
Node * getQuadratureNode(const Elem *elem, const unsigned short int side, const unsigned int qp)
libMesh::StoredRange< MooseMesh::const_bnd_elem_iterator, const BndElement * > * getBoundaryElementRange()
void scalingFactor(const std::vector< Real > &factor)
unsigned int number() const
OutputType getValue(const Elem *elem, const std::vector< std::vector< OutputShape > > &phi) const
const std::vector< dof_id_type > & dofIndices() const final
MooseVariableFE< Real > * _variable
std::vector< std::vector< Real > > _side_phi
Real _tangential_distance
Real getTangentialTolerance()
std::map< dof_id_type, PenetrationInfo * > & _penetration_info
const MooseVariableFieldBase & getVariable(unsigned int jvar_num) const
FEProblemBase & _fe_problem
unsigned int getAxisymmetricRadialCoord() const
virtual Assembly & assembly(const THREAD_ID tid, const unsigned int sys_num)=0
Moose::CoordinateSystemType getCoordSystem(SubdomainID sid) const
unsigned int number() const
virtual libMesh::DofMap & dofMap()
DenseMatrix< Number > _local_ke
void accumulateTaggedLocalMatrix()
void prepareMatrixTag(Assembly &assembly, unsigned int ivar, unsigned int jvar)
void addJacobian(Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
virtual void add(const numeric_index_type i, const T value)=0
processor_id_type processor_id() const
The following methods are specializations for using the Parallel::packed_range_* routines for a vecto...