www.mooseframework.org
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
GapHeatTransfer Class Reference

Generic gap heat transfer model, with h_gap = h_conduction + h_contact + h_radiation. More...

#include <GapHeatTransfer.h>

Inheritance diagram for GapHeatTransfer:
[legend]

Public Member Functions

 GapHeatTransfer (const InputParameters &parameters)
 
virtual void initialSetup () override
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Member Functions

virtual Real computeQpResidual () override
 
virtual Real computeQpJacobian () override
 
virtual Real computeQpOffDiagJacobian (unsigned jvar) override
 
virtual Real gapLength () const
 
virtual Real dgapLength (Real normalComponent) const
 
virtual Real computeSlaveFluxContribution (Real grad_t)
 
virtual void computeGapValues ()
 

Protected Attributes

GapConductance::GAP_GEOMETRY_gap_geometry_type
 
const bool _quadrature
 
NumericVector< Number > * _slave_flux
 
const MaterialProperty< Real > & _gap_conductance
 
const MaterialProperty< Real > & _gap_conductance_dT
 
const Real _min_gap
 
const unsigned int _min_gap_order
 
const Real _max_gap
 
Real _gap_temp
 
Real _gap_distance
 
Real _radius
 
Real _r1
 
Real _r2
 
Real _edge_multiplier
 This is a factor that is used to gradually taper down the conductance if the contact point is off the face and tangential_tolerance is nonzero. More...
 
bool _has_info
 
std::vector< unsigned int > _disp_vars
 
const VariableValue & _gap_distance_value
 
const VariableValue & _gap_temp_value
 
PenetrationLocator * _penetration_locator
 
const bool _warnings
 
Point & _p1
 
Point & _p2
 

Detailed Description

Generic gap heat transfer model, with h_gap = h_conduction + h_contact + h_radiation.

Definition at line 24 of file GapHeatTransfer.h.

Constructor & Destructor Documentation

◆ GapHeatTransfer()

GapHeatTransfer::GapHeatTransfer ( const InputParameters &  parameters)

Definition at line 90 of file GapHeatTransfer.C.

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")),
103  _gap_temp(0),
104  _gap_distance(std::numeric_limits<Real>::max()),
105  _edge_multiplier(1.0),
106  _has_info(false),
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")),
111  !_quadrature ? NULL
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)))
119 {
120  if (isParamValid("displacements"))
121  {
122  // modern parameter scheme for displacements
123  for (unsigned int i = 0; i < coupledComponents("displacements"); ++i)
124  _disp_vars[i] = coupled("displacements", i);
125  }
126  else
127  {
128  // Legacy parameter scheme for displacements
129  if (isParamValid("disp_x"))
130  _disp_vars[0] = coupled("disp_x");
131  if (isParamValid("disp_y"))
132  _disp_vars[1] = coupled("disp_y");
133  if (isParamValid("disp_z"))
134  _disp_vars[2] = coupled("disp_z");
135 
136  // TODO: these are only used in one Bison test. Deprecate soon!
137  }
138 
139  if (_quadrature)
140  {
141  if (!parameters.isParamValid("paired_boundary"))
142  mooseError(std::string("No 'paired_boundary' provided for ") + _name);
143  }
144  else
145  {
146  if (!isCoupled("gap_distance"))
147  mooseError(std::string("No 'gap_distance' provided for ") + _name);
148 
149  if (!isCoupled("gap_temp"))
150  mooseError(std::string("No 'gap_temp' provided for ") + _name);
151  }
152 }

Member Function Documentation

◆ computeGapValues()

void GapHeatTransfer::computeGapValues ( )
protectedvirtual

Definition at line 288 of file GapHeatTransfer.C.

289 {
290  if (!_quadrature)
291  {
292  _has_info = true;
293  _gap_temp = _gap_temp_value[_qp];
295  }
296  else
297  {
298  Node * qnode = _mesh.getQuadratureNode(_current_elem, _current_side, _qp);
299  PenetrationInfo * pinfo = _penetration_locator->_penetration_info[qnode->id()];
300 
301  _gap_temp = 0.0;
302  _gap_distance = std::numeric_limits<Real>::max();
303  _has_info = false;
304  _edge_multiplier = 1.0;
305 
306  if (pinfo)
307  {
308  _gap_distance = pinfo->_distance;
309  _has_info = true;
310 
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);
314 
315  Real tangential_tolerance = _penetration_locator->getTangentialTolerance();
316  if (tangential_tolerance != 0.0)
317  {
318  _edge_multiplier = 1.0 - pinfo->_tangential_distance / tangential_tolerance;
319  if (_edge_multiplier < 0.0)
320  _edge_multiplier = 0.0;
321  }
322  }
323  else
324  {
325  if (_warnings)
326  mooseWarning("No gap value information found for node ",
327  qnode->id(),
328  " on processor ",
329  processor_id());
330  }
331  }
332 
334  _gap_geometry_type, _q_point[_qp], _p1, _p2, _gap_distance, _normals[_qp], _r1, _r2, _radius);
335 }

Referenced by computeQpJacobian(), computeQpOffDiagJacobian(), and computeQpResidual().

◆ computeQpJacobian()

Real GapHeatTransfer::computeQpJacobian ( )
overrideprotectedvirtual

Definition at line 194 of file GapHeatTransfer.C.

195 {
197 
198  if (!_has_info)
199  return 0.0;
200 
201  return _test[_i][_qp] *
202  ((_u[_qp] - _gap_temp) * _edge_multiplier * _gap_conductance_dT[_qp] +
204  _phi[_j][_qp];
205 }

◆ computeQpOffDiagJacobian()

Real GapHeatTransfer::computeQpOffDiagJacobian ( unsigned  jvar)
overrideprotectedvirtual

Definition at line 208 of file GapHeatTransfer.C.

209 {
211 
212  if (!_has_info)
213  return 0.0;
214 
215  unsigned int coupled_component;
216  bool active = false;
217  for (coupled_component = 0; coupled_component < _disp_vars.size(); ++coupled_component)
218  if (jvar == _disp_vars[coupled_component])
219  {
220  active = true;
221  break;
222  }
223 
224  Real dRdx = 0.0;
225  if (active)
226  {
227  // Compute dR/du_[xyz]
228  // Residual is based on
229  // h_gap = h_conduction() + h_contact() + h_radiation();
230  // grad_t = (_u[_qp] - _gap_temp) * h_gap;
231  // So we need
232  // (_u[_qp] - _gap_temp) * (dh_gap/du_[xyz]);
233  // Assuming dh_contact/du_[xyz] = dh_radiation/du_[xyz] = 0,
234  // we need dh_conduction/du_[xyz]
235  // Given
236  // h_conduction = gapK / gapLength, then
237  // dh_conduction/du_[xyz] = -gapK/gapLength^2 * dgapLength/du_[xyz]
238  // Given
239  // gapLength = ((u_x-m_x)^2+(u_y-m_y)^2+(u_z-m_z)^2)^1/2
240  // where m_[xyz] is the master coordinate, then
241  // dGapLength/du_[xyz] = 1/2*((u_x-m_x)^2+(u_y-m_y)^2+(u_z-m_z)^2)^(-1/2)*2*(u_[xyz]-m_[xyz])
242  // = (u_[xyz]-m_[xyz])/gapLength
243  // This is the normal vector.
244 
245  const Real gapL = gapLength();
246 
247  // THIS IS NOT THE NORMAL WE NEED.
248  // WE NEED THE NORMAL FROM THE CONSTRAINT, THE NORMAL FROM THE
249  // MASTER SURFACE. HOWEVER, THIS IS TRICKY SINCE THE NORMAL
250  // FROM THE MASTER SURFACE WAS COMPUTED FOR A POINT ASSOCIATED
251  // WITH A SLAVE NODE. NOW WE ARE AT A SLAVE INTEGRATION POINT.
252  //
253  // HOW DO WE GET THE NORMAL WE NEED?
254  //
255  // Until we have the normal we need,
256  // we'll hope that the one we have is close to the negative of the one we need.
257  const Point & normal(_normals[_qp]);
258 
259  const Real dgap = dgapLength(-normal(coupled_component));
260  dRdx = -(_u[_qp] - _gap_temp) * _edge_multiplier * _gap_conductance[_qp] *
262  }
263  return _test[_i][_qp] * dRdx * _phi[_j][_qp];
264 }

◆ computeQpResidual()

Real GapHeatTransfer::computeQpResidual ( )
overrideprotectedvirtual

Definition at line 166 of file GapHeatTransfer.C.

167 {
169 
170  if (!_has_info)
171  return 0.0;
172 
173  Real grad_t = (_u[_qp] - _gap_temp) * _edge_multiplier * _gap_conductance[_qp];
174 
175  // This is keeping track of this residual contribution so it can be used as the flux on the other
176  // side of the gap.
177  if (!_quadrature)
178  {
179  Threads::spin_mutex::scoped_lock lock(Threads::spin_mutex);
180  const Real slave_flux = computeSlaveFluxContribution(grad_t);
181  _slave_flux->add(_var.dofIndices()[_i], slave_flux);
182  }
183 
184  return _test[_i][_qp] * grad_t;
185 }

◆ computeSlaveFluxContribution()

Real GapHeatTransfer::computeSlaveFluxContribution ( Real  grad_t)
protectedvirtual

Definition at line 188 of file GapHeatTransfer.C.

189 {
190  return _coord[_qp] * _JxW[_qp] * _test[_i][_qp] * grad_t;
191 }

Referenced by computeQpResidual().

◆ dgapLength()

Real GapHeatTransfer::dgapLength ( Real  normalComponent) const
protectedvirtual

Definition at line 276 of file GapHeatTransfer.C.

277 {
278  const Real gap_L = gapLength();
279  Real dgap = 0.0;
280 
281  if (_min_gap <= gap_L && gap_L <= _max_gap)
282  dgap = normalComponent;
283 
284  return dgap;
285 }

Referenced by computeQpOffDiagJacobian().

◆ gapLength()

Real GapHeatTransfer::gapLength ( ) const
protectedvirtual

Definition at line 267 of file GapHeatTransfer.C.

268 {
269  if (_has_info)
271 
272  return 1.0;
273 }

Referenced by computeQpOffDiagJacobian(), and dgapLength().

◆ initialSetup()

void GapHeatTransfer::initialSetup ( )
overridevirtual

Definition at line 155 of file GapHeatTransfer.C.

156 {
158  _assembly.coordSystem(),
159  _fe_problem.getAxisymmetricRadialCoord(),
161  _p1,
162  _p2);
163 }

◆ validParams()

InputParameters GapHeatTransfer::validParams ( )
static

Definition at line 27 of file GapHeatTransfer.C.

28 {
29  InputParameters params = IntegratedBC::validParams();
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");
34 
35  // Common
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");
40 
41  // Deprecated parameter
42  MooseEnum coord_types("default XYZ cyl", "default");
43  params.addDeprecatedParam<MooseEnum>(
44  "coord_type",
45  coord_types,
46  "Gap calculation type (default or XYZ).",
47  "The functionality of this parameter is replaced by 'gap_geometry_type'.");
48 
49  MooseEnum gap_geom_types("PLATE CYLINDER SPHERE");
50  params.addParam<MooseEnum>("gap_geometry_type",
51  gap_geom_types,
52  "Gap calculation type. Choices are: " + gap_geom_types.getRawNames());
53 
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");
59 
60  // Quadrature based
61  params.addParam<bool>("quadrature",
62  false,
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");
68 
69  MooseEnum orders(AddVariableAction::getNonlinearVariableOrders());
70  params.addParam<MooseEnum>("order", orders, "The finite element order");
71 
72  params.addParam<bool>(
73  "warnings", false, "Whether to output warning messages concerning nodes not being found");
74 
75  params.addCoupledVar("disp_x", "The x displacement");
76  params.addCoupledVar("disp_y", "The y displacement");
77  params.addCoupledVar("disp_z", "The z displacement");
78 
79  params.addCoupledVar(
80  "displacements",
81  "The displacements appropriate for the simulation geometry and coordinate system");
82 
83  // Node based options
84  params.addCoupledVar("gap_distance", "Distance across the gap");
85  params.addCoupledVar("gap_temp", "Temperature on the other side of the gap");
86 
87  return params;
88 }

Member Data Documentation

◆ _disp_vars

std::vector<unsigned int> GapHeatTransfer::_disp_vars
protected

Definition at line 70 of file GapHeatTransfer.h.

Referenced by computeQpOffDiagJacobian(), and GapHeatTransfer().

◆ _edge_multiplier

Real GapHeatTransfer::_edge_multiplier
protected

This is a factor that is used to gradually taper down the conductance if the contact point is off the face and tangential_tolerance is nonzero.

Definition at line 66 of file GapHeatTransfer.h.

Referenced by computeGapValues(), computeQpJacobian(), computeQpOffDiagJacobian(), and computeQpResidual().

◆ _gap_conductance

const MaterialProperty<Real>& GapHeatTransfer::_gap_conductance
protected

◆ _gap_conductance_dT

const MaterialProperty<Real>& GapHeatTransfer::_gap_conductance_dT
protected

Definition at line 50 of file GapHeatTransfer.h.

Referenced by computeQpJacobian().

◆ _gap_distance

Real GapHeatTransfer::_gap_distance
protected

Definition at line 57 of file GapHeatTransfer.h.

Referenced by computeGapValues().

◆ _gap_distance_value

const VariableValue& GapHeatTransfer::_gap_distance_value
protected

Definition at line 72 of file GapHeatTransfer.h.

Referenced by computeGapValues().

◆ _gap_geometry_type

GapConductance::GAP_GEOMETRY& GapHeatTransfer::_gap_geometry_type
protected

Definition at line 43 of file GapHeatTransfer.h.

Referenced by computeGapValues(), gapLength(), and initialSetup().

◆ _gap_temp

Real GapHeatTransfer::_gap_temp
protected

◆ _gap_temp_value

const VariableValue& GapHeatTransfer::_gap_temp_value
protected

Definition at line 73 of file GapHeatTransfer.h.

Referenced by computeGapValues().

◆ _has_info

bool GapHeatTransfer::_has_info
protected

◆ _max_gap

const Real GapHeatTransfer::_max_gap
protected

Definition at line 54 of file GapHeatTransfer.h.

Referenced by dgapLength(), and gapLength().

◆ _min_gap

const Real GapHeatTransfer::_min_gap
protected

Definition at line 52 of file GapHeatTransfer.h.

Referenced by computeQpOffDiagJacobian(), and dgapLength().

◆ _min_gap_order

const unsigned int GapHeatTransfer::_min_gap_order
protected

Definition at line 53 of file GapHeatTransfer.h.

Referenced by computeQpOffDiagJacobian().

◆ _p1

Point& GapHeatTransfer::_p1
protected

Definition at line 78 of file GapHeatTransfer.h.

Referenced by computeGapValues(), and initialSetup().

◆ _p2

Point& GapHeatTransfer::_p2
protected

Definition at line 79 of file GapHeatTransfer.h.

Referenced by computeGapValues(), and initialSetup().

◆ _penetration_locator

PenetrationLocator* GapHeatTransfer::_penetration_locator
protected

Definition at line 75 of file GapHeatTransfer.h.

Referenced by computeGapValues().

◆ _quadrature

const bool GapHeatTransfer::_quadrature
protected

Definition at line 45 of file GapHeatTransfer.h.

Referenced by computeGapValues(), computeQpResidual(), and GapHeatTransfer().

◆ _r1

Real GapHeatTransfer::_r1
protected

Definition at line 59 of file GapHeatTransfer.h.

Referenced by computeGapValues(), and gapLength().

◆ _r2

Real GapHeatTransfer::_r2
protected

Definition at line 60 of file GapHeatTransfer.h.

Referenced by computeGapValues(), and gapLength().

◆ _radius

Real GapHeatTransfer::_radius
protected

Definition at line 58 of file GapHeatTransfer.h.

Referenced by computeGapValues(), and gapLength().

◆ _slave_flux

NumericVector<Number>* GapHeatTransfer::_slave_flux
protected

Definition at line 47 of file GapHeatTransfer.h.

Referenced by computeQpResidual().

◆ _warnings

const bool GapHeatTransfer::_warnings
protected

Definition at line 76 of file GapHeatTransfer.h.

Referenced by computeGapValues().


The documentation for this class was generated from the following files:
GapHeatTransfer::_quadrature
const bool _quadrature
Definition: GapHeatTransfer.h:45
GapHeatTransfer::_gap_conductance_dT
const MaterialProperty< Real > & _gap_conductance_dT
Definition: GapHeatTransfer.h:50
GapHeatTransfer::_has_info
bool _has_info
Definition: GapHeatTransfer.h:68
GapHeatTransfer::dgapLength
virtual Real dgapLength(Real normalComponent) const
Definition: GapHeatTransfer.C:276
GapHeatTransfer::_disp_vars
std::vector< unsigned int > _disp_vars
Definition: GapHeatTransfer.h:70
GapHeatTransfer::_min_gap
const Real _min_gap
Definition: GapHeatTransfer.h:52
GapHeatTransfer::_gap_geometry_type
GapConductance::GAP_GEOMETRY & _gap_geometry_type
Definition: GapHeatTransfer.h:43
GapConductance::gapAttenuation
static Real gapAttenuation(Real adjusted_length, Real min_gap, unsigned int min_gap_order)
Definition: GapConductance.C:287
GapHeatTransfer::_slave_flux
NumericVector< Number > * _slave_flux
Definition: GapHeatTransfer.h:47
GapConductance::gapLength
static Real gapLength(const GAP_GEOMETRY &gap_geom, Real radius, Real r1, Real r2, Real max_gap)
Definition: GapConductance.C:361
GapConductance::setGapGeometryParameters
static void setGapGeometryParameters(const InputParameters &params, const Moose::CoordinateSystemType coord_sys, unsigned int axisymmetric_radial_coord, GAP_GEOMETRY &gap_geometry_type, Point &p1, Point &p2)
Definition: GapConductance.C:183
GapHeatTransfer::_r1
Real _r1
Definition: GapHeatTransfer.h:59
GapHeatTransfer::_p1
Point & _p1
Definition: GapHeatTransfer.h:78
GapHeatTransfer::_gap_distance_value
const VariableValue & _gap_distance_value
Definition: GapHeatTransfer.h:72
GapHeatTransfer::_gap_temp
Real _gap_temp
Definition: GapHeatTransfer.h:56
GapHeatTransfer::_max_gap
const Real _max_gap
Definition: GapHeatTransfer.h:54
GapHeatTransfer::_radius
Real _radius
Definition: GapHeatTransfer.h:58
GapHeatTransfer::_r2
Real _r2
Definition: GapHeatTransfer.h:60
GapHeatTransfer::_p2
Point & _p2
Definition: GapHeatTransfer.h:79
validParams
InputParameters validParams()
GapHeatTransfer::_gap_temp_value
const VariableValue & _gap_temp_value
Definition: GapHeatTransfer.h:73
GapConductance::PLATE
Definition: GapConductance.h:22
GapHeatTransfer::_min_gap_order
const unsigned int _min_gap_order
Definition: GapHeatTransfer.h:53
GapHeatTransfer::_warnings
const bool _warnings
Definition: GapHeatTransfer.h:76
GapHeatTransfer::_gap_distance
Real _gap_distance
Definition: GapHeatTransfer.h:57
GapHeatTransfer::computeGapValues
virtual void computeGapValues()
Definition: GapHeatTransfer.C:288
GapHeatTransfer::_edge_multiplier
Real _edge_multiplier
This is a factor that is used to gradually taper down the conductance if the contact point is off the...
Definition: GapHeatTransfer.h:66
GapHeatTransfer::_gap_conductance
const MaterialProperty< Real > & _gap_conductance
Definition: GapHeatTransfer.h:49
GapHeatTransfer::gapLength
virtual Real gapLength() const
Definition: GapHeatTransfer.C:267
GapHeatTransfer::computeSlaveFluxContribution
virtual Real computeSlaveFluxContribution(Real grad_t)
Definition: GapHeatTransfer.C:188
GapConductance::computeGapRadii
static void computeGapRadii(const GAP_GEOMETRY gap_geometry_type, const Point &current_point, const Point &p1, const Point &p2, const Real &gap_distance, const Point &current_normal, Real &r1, Real &r2, Real &radius)
Definition: GapConductance.C:462
GapHeatTransfer::_penetration_locator
PenetrationLocator * _penetration_locator
Definition: GapHeatTransfer.h:75