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());
54 "Start point for line defining cylindrical axis");
56 "End point for line defining cylindrical axis");
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");
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),
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],
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;
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,
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;
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)
400 unsigned int coupled_component;
402 for (coupled_component = 0; coupled_component <
_disp_vars.size(); ++coupled_component)
441 dgap = normalComponent;
475 if (tangential_tolerance != 0.0)
485 mooseWarning(
"No gap value information found for node ",
const VariableTestValue & _test
unsigned int getAxisymmetricRadialCoord() const
virtual bool isCoupled(const std::string &var_name, unsigned int i=0) const
GapConductance::GAP_GEOMETRY & _gap_geometry_type
virtual void computeGapValues()
virtual unsigned int coupled(const std::string &var_name, unsigned int comp=0) const
virtual Real computeSecondaryFluxContribution(Real grad_t)
std::vector< MooseVariableFEBase *> _diag_save_in
const unsigned int invalid_uint
const MooseArray< Point > & _normals
void computeJacobian() override
Real getValue(const Elem *elem, const std::vector< std::vector< OutputShape >> &phi) const
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
unsigned int number() const
const Elem *const & _current_elem
Real computeSecondaryQpJacobian()
compute the Jacobian contributions from the secondary side degrees of freedom
Real getTangentialTolerance()
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 InputParameters validParams()
static Real gapLength(const GAP_GEOMETRY &gap_geom, const Real radius, const Real r1, const Real r2, const Real max_gap)
Generic gap heat transfer model, with h_gap = h_conduction + h_contact + h_radiation.
static Real gapAttenuation(Real adjusted_length, Real min_gap, unsigned int min_gap_order)
The following methods are specializations for using the Parallel::packed_range_* routines for a vecto...
std::vector< std::vector< Real > > _side_phi
const MaterialProperty< Real > & _gap_conductance_dT
std::string getRawNames() const
std::map< dof_id_type, PenetrationInfo *> & _penetration_info
const VariablePhiValue & _phi
DenseMatrix< Number > _local_ke
const MooseVariableFieldBase & getVariable(unsigned int jvar_num) const
void mooseWarning(Args &&... args) const
Real _edge_multiplier
This is a factor that is used to gradually taper down the conductance if the contact point is off the...
auto max(const L &left, const R &right)
bool isParamValid(const std::string &name) const
virtual Real computeQpJacobian() override
const MooseArray< Point > & _q_point
void addJacobian(Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
Real computeSecondaryQpOffDiagJacobian(unsigned int jvar)
compute the displacement Jacobian contributions from the secondary side degrees of freedom ...
virtual libMesh::DofMap & dofMap()
const MaterialProperty< Real > & _gap_conductance
const std::vector< std::vector< Real > > * _secondary_side_phi
The phi values on the secondary side.
static MooseEnum getNonlinearVariableOrders()
const std::vector< dof_id_type > & dofIndices() const final
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)
T string_to_enum(const std::string &s)
virtual Real dgapLength(Real normalComponent) const
FEProblemBase & _fe_problem
Generic gap heat transfer model, with h_gap = h_conduction + h_contact + h_radiation.
const Elem * _secondary_side
The secondary side element (this really is a side element, e.g.
virtual Real gapLength() const
std::vector< unsigned int > _disp_vars
unsigned int number() const
MooseVariableFE< Real > * _variable
const PenetrationInfo * _pinfo
The current PenetratationInfo.
void accumulateTaggedLocalMatrix()
const MooseArray< Real > & _coord
NumericVector< Number > * _secondary_flux
Node * getQuadratureNode(const Elem *elem, const unsigned short int side, const unsigned int qp)
void computeOffDiagJacobian(unsigned int jvar) override
PenetrationLocator * _penetration_locator
const VariableValue & _gap_temp_value
unsigned int coupledComponents(const std::string &var_name) const
const QBase *const & _qrule
Real _tangential_distance
const unsigned int & _current_side
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
GapHeatTransfer(const InputParameters ¶meters)
virtual Real computeQpResidual() override
const VariableValue & _gap_distance_value
virtual Assembly & assembly(const THREAD_ID tid, const unsigned int sys_num)=0
registerMooseObject("HeatTransferApp", GapHeatTransfer)
void mooseError(Args &&... args) const
const InputParameters & _pars
const unsigned int _min_gap_order
const InputParameters & parameters() const
Moose::CoordinateSystemType getCoordSystem(SubdomainID sid) const
libMesh::StoredRange< MooseMesh::const_bnd_elem_iterator, const BndElement *> * getBoundaryElementRange()
void prepareMatrixTag(Assembly &assembly, unsigned int ivar, unsigned int jvar)
virtual void add(const numeric_index_type i, const Number value)=0
processor_id_type processor_id() const
virtual Real computeQpOffDiagJacobian(unsigned jvar) override
static InputParameters validParams()
virtual void initialSetup() override
void ErrorVector unsigned int
const Elem & get(const ElemType type_in)
unsigned int _secondary_j
The secondary side shape index.
const MooseArray< Real > & _JxW
void scalingFactor(const std::vector< Real > &factor)