20 #include "libmesh/string_to_enum.h" 29 "surfaces dependent on the gap geometry specified.");
31 "appended_property_name",
"",
"Name appended to material properties to make them unique");
34 params.
addParam<
Real>(
"min_gap", 1.0e-6,
"A minimum gap size");
35 params.
addParam<
Real>(
"max_gap", 1.0e6,
"A maximum gap size");
37 "min_gap_order", 0,
"min_gap_order<=1",
"Order of the Taylor expansion below min_gap");
40 MooseEnum coord_types(
"default XYZ cyl",
"default");
44 "Gap calculation type (default or XYZ).",
45 "The functionality of this parameter is replaced by 'gap_geometry_type'.");
47 MooseEnum gap_geom_types(
"PLATE CYLINDER SPHERE");
50 "Gap calculation type. Choices are: " + gap_geom_types.
getRawNames());
53 "Start point for line defining cylindrical axis");
55 "End point for line defining cylindrical axis");
61 "Whether or not to do Quadrature point based gap heat " 62 "transfer. If this is true then gap_distance and " 63 "gap_temp should NOT be provided (and will be " 64 "ignored) however paired_boundary IS then required.");
65 params.
addParam<BoundaryName>(
"paired_boundary",
"The boundary to be penetrated");
71 "warnings",
false,
"Whether to output warning messages concerning nodes not being found");
75 "The displacements appropriate for the simulation geometry and coordinate system");
78 params.
addCoupledVar(
"gap_distance",
"Distance across the gap");
79 params.
addCoupledVar(
"gap_temp",
"Temperature on the other side of the gap");
86 _gap_geometry_type(declareRestartableData<
GapConductance::GAP_GEOMETRY>(
"gap_geometry_type",
88 _quadrature(getParam<bool>(
"quadrature")),
89 _secondary_flux(!_quadrature ? &_sys.getVector(
"secondary_flux") : NULL),
90 _gap_conductance(getMaterialProperty<
Real>(
"gap_conductance" +
91 getParam<
std::string>(
"appended_property_name"))),
92 _gap_conductance_dT(getMaterialProperty<
Real>(
93 "gap_conductance" + getParam<
std::string>(
"appended_property_name") +
"_dT")),
94 _min_gap(getParam<
Real>(
"min_gap")),
95 _min_gap_order(getParam<unsigned
int>(
"min_gap_order")),
96 _max_gap(getParam<
Real>(
"max_gap")),
98 _gap_distance(
std::numeric_limits<
Real>::
max()),
99 _edge_multiplier(1.0),
102 _gap_distance_value(_quadrature ? _zero : coupledValue(
"gap_distance")),
103 _gap_temp_value(_quadrature ? _zero : coupledValue(
"gap_temp")),
104 _penetration_locator(
106 : &getQuadraturePenetrationLocator(
107 parameters.
get<BoundaryName>(
"paired_boundary"),
108 getParam<
std::vector<BoundaryName>>(
"boundary")[0],
110 _warnings(getParam<bool>(
"warnings")),
111 _p1(declareRestartableData<Point>(
"cylinder_axis_point_1", Point(0, 1, 0))),
112 _p2(declareRestartableData<Point>(
"cylinder_axis_point_2", Point(0, 0, 0))),
114 _secondary_side_phi(nullptr),
115 _secondary_side(nullptr),
143 std::set<SubdomainID> subdomain_ids;
147 Elem * elem = bnd_elem->_elem;
148 subdomain_ids.insert(elem->subdomain_id());
151 if (subdomain_ids.empty())
156 for (
auto sid : subdomain_ids)
158 mooseError(
"The GapHeatTransfer model requires all boundary elements to have the same " 159 "coordinate system.");
179 Threads::spin_mutex::scoped_lock lock(Threads::spin_mutex);
210 std::vector<dof_id_type> secondary_side_dof_indices;
218 "The number of shapes does not match the number of dof indices on the secondary elem");
222 _secondary_j < static_cast<unsigned int>(secondary_side_dof_indices.size());
229 secondary_side_dof_indices,
240 for (
unsigned int i = 0; i < rows; i++)
243 Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
262 auto phi_size = jvar.dofIndices().size();
270 for (
_j = 0;
_j < phi_size;
_j++)
276 std::vector<dof_id_type> secondary_side_dof_indices;
284 "The number of shapes does not match the number of dof indices on the secondary elem");
288 _secondary_j < static_cast<unsigned int>(secondary_side_dof_indices.size());
296 secondary_side_dof_indices,
331 unsigned int coupled_component;
333 for (coupled_component = 0; coupled_component <
_disp_vars.size(); ++coupled_component)
389 unsigned int coupled_component;
391 for (coupled_component = 0; coupled_component <
_disp_vars.size(); ++coupled_component)
430 dgap = normalComponent;
464 if (tangential_tolerance != 0.0)
474 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
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 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
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
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
virtual Assembly & assembly(const THREAD_ID tid, const unsigned int nl_sys_num)=0
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)