www.mooseframework.org
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
 

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 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 25 of file GapHeatTransfer.h.

Constructor & Destructor Documentation

◆ GapHeatTransfer()

GapHeatTransfer::GapHeatTransfer ( const InputParameters &  parameters)

Definition at line 87 of file GapHeatTransfer.C.

88  : IntegratedBC(parameters),
89  _gap_geometry_type(declareRestartableData<GapConductance::GAP_GEOMETRY>("gap_geometry_type",
91  _quadrature(getParam<bool>("quadrature")),
92  _slave_flux(!_quadrature ? &_sys.getVector("slave_flux") : NULL),
93  _gap_conductance(getMaterialProperty<Real>("gap_conductance" +
94  getParam<std::string>("appended_property_name"))),
95  _gap_conductance_dT(getMaterialProperty<Real>(
96  "gap_conductance" + getParam<std::string>("appended_property_name") + "_dT")),
97  _min_gap(getParam<Real>("min_gap")),
98  _max_gap(getParam<Real>("max_gap")),
99  _gap_temp(0),
100  _gap_distance(std::numeric_limits<Real>::max()),
101  _edge_multiplier(1.0),
102  _has_info(false),
103  _disp_vars(3, libMesh::invalid_uint),
104  _gap_distance_value(_quadrature ? _zero : coupledValue("gap_distance")),
105  _gap_temp_value(_quadrature ? _zero : coupledValue("gap_temp")),
107  !_quadrature ? NULL
108  : &getQuadraturePenetrationLocator(
109  parameters.get<BoundaryName>("paired_boundary"),
110  getParam<std::vector<BoundaryName>>("boundary")[0],
111  Utility::string_to_enum<Order>(parameters.get<MooseEnum>("order")))),
112  _warnings(getParam<bool>("warnings")),
113  _p1(declareRestartableData<Point>("cylinder_axis_point_1", Point(0, 1, 0))),
114  _p2(declareRestartableData<Point>("cylinder_axis_point_2", Point(0, 0, 0)))
115 {
116  if (isParamValid("displacements"))
117  {
118  // modern parameter scheme for displacements
119  for (unsigned int i = 0; i < coupledComponents("displacements"); ++i)
120  _disp_vars[i] = coupled("displacements", i);
121  }
122  else
123  {
124  // Legacy parameter scheme for displacements
125  if (isParamValid("disp_x"))
126  _disp_vars[0] = coupled("disp_x");
127  if (isParamValid("disp_y"))
128  _disp_vars[1] = coupled("disp_y");
129  if (isParamValid("disp_z"))
130  _disp_vars[2] = coupled("disp_z");
131 
132  // TODO: these are only used in one Bison test. Deprecate soon!
133  }
134 
135  if (_quadrature)
136  {
137  if (!parameters.isParamValid("paired_boundary"))
138  mooseError(std::string("No 'paired_boundary' provided for ") + _name);
139  }
140  else
141  {
142  if (!isCoupled("gap_distance"))
143  mooseError(std::string("No 'gap_distance' provided for ") + _name);
144 
145  if (!isCoupled("gap_temp"))
146  mooseError(std::string("No 'gap_temp' provided for ") + _name);
147  }
148 }
GapConductance::GAP_GEOMETRY & _gap_geometry_type
const MaterialProperty< Real > & _gap_conductance_dT
Real _edge_multiplier
This is a factor that is used to gradually taper down the conductance if the contact point is off the...
const bool _quadrature
const MaterialProperty< Real > & _gap_conductance
const Real _min_gap
const Real _max_gap
std::vector< unsigned int > _disp_vars
const bool _warnings
PenetrationLocator * _penetration_locator
const VariableValue & _gap_temp_value
const VariableValue & _gap_distance_value
NumericVector< Number > * _slave_flux

Member Function Documentation

◆ computeGapValues()

void GapHeatTransfer::computeGapValues ( )
protectedvirtual

Definition at line 282 of file GapHeatTransfer.C.

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

283 {
284  if (!_quadrature)
285  {
286  _has_info = true;
287  _gap_temp = _gap_temp_value[_qp];
289  }
290  else
291  {
292  Node * qnode = _mesh.getQuadratureNode(_current_elem, _current_side, _qp);
293  PenetrationInfo * pinfo = _penetration_locator->_penetration_info[qnode->id()];
294 
295  _gap_temp = 0.0;
296  _gap_distance = std::numeric_limits<Real>::max();
297  _has_info = false;
298  _edge_multiplier = 1.0;
299 
300  if (pinfo)
301  {
302  _gap_distance = pinfo->_distance;
303  _has_info = true;
304 
305  const Elem * slave_side = pinfo->_side;
306  std::vector<std::vector<Real>> & slave_side_phi = pinfo->_side_phi;
307  _gap_temp = _variable->getValue(slave_side, slave_side_phi);
308 
309  Real tangential_tolerance = _penetration_locator->getTangentialTolerance();
310  if (tangential_tolerance != 0.0)
311  {
312  _edge_multiplier = 1.0 - pinfo->_tangential_distance / tangential_tolerance;
313  if (_edge_multiplier < 0.0)
314  _edge_multiplier = 0.0;
315  }
316  }
317  else
318  {
319  if (_warnings)
320  mooseWarning("No gap value information found for node ",
321  qnode->id(),
322  " on processor ",
323  processor_id());
324  }
325  }
326 
328  _gap_geometry_type, _q_point[_qp], _p1, _p2, _gap_distance, _normals[_qp], _r1, _r2, _radius);
329 }
GapConductance::GAP_GEOMETRY & _gap_geometry_type
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)
Real _edge_multiplier
This is a factor that is used to gradually taper down the conductance if the contact point is off the...
const bool _quadrature
const bool _warnings
PenetrationLocator * _penetration_locator
const VariableValue & _gap_temp_value
const VariableValue & _gap_distance_value

◆ computeQpJacobian()

Real GapHeatTransfer::computeQpJacobian ( )
overrideprotectedvirtual

Definition at line 190 of file GapHeatTransfer.C.

191 {
193 
194  if (!_has_info)
195  return 0.0;
196 
197  return _test[_i][_qp] * ((_u[_qp] - _gap_temp) * _edge_multiplier * _gap_conductance_dT[_qp] +
199  _phi[_j][_qp];
200 }
virtual void computeGapValues()
const MaterialProperty< Real > & _gap_conductance_dT
Real _edge_multiplier
This is a factor that is used to gradually taper down the conductance if the contact point is off the...
const MaterialProperty< Real > & _gap_conductance

◆ computeQpOffDiagJacobian()

Real GapHeatTransfer::computeQpOffDiagJacobian ( unsigned  jvar)
overrideprotectedvirtual

Definition at line 203 of file GapHeatTransfer.C.

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

◆ computeQpResidual()

Real GapHeatTransfer::computeQpResidual ( )
overrideprotectedvirtual

Definition at line 162 of file GapHeatTransfer.C.

163 {
165 
166  if (!_has_info)
167  return 0.0;
168 
169  Real grad_t = (_u[_qp] - _gap_temp) * _edge_multiplier * _gap_conductance[_qp];
170 
171  // This is keeping track of this residual contribution so it can be used as the flux on the other
172  // side of the gap.
173  if (!_quadrature)
174  {
175  Threads::spin_mutex::scoped_lock lock(Threads::spin_mutex);
176  const Real slave_flux = computeSlaveFluxContribution(grad_t);
177  _slave_flux->add(_var.dofIndices()[_i], slave_flux);
178  }
179 
180  return _test[_i][_qp] * grad_t;
181 }
virtual void computeGapValues()
Real _edge_multiplier
This is a factor that is used to gradually taper down the conductance if the contact point is off the...
const bool _quadrature
const MaterialProperty< Real > & _gap_conductance
virtual Real computeSlaveFluxContribution(Real grad_t)
NumericVector< Number > * _slave_flux

◆ computeSlaveFluxContribution()

Real GapHeatTransfer::computeSlaveFluxContribution ( Real  grad_t)
protectedvirtual

Definition at line 184 of file GapHeatTransfer.C.

Referenced by computeQpResidual().

185 {
186  return _coord[_qp] * _JxW[_qp] * _test[_i][_qp] * grad_t;
187 }

◆ dgapLength()

Real GapHeatTransfer::dgapLength ( Real  normalComponent) const
protectedvirtual

Definition at line 270 of file GapHeatTransfer.C.

Referenced by computeQpOffDiagJacobian().

271 {
272  const Real gap_L = gapLength();
273  Real dgap = 0.0;
274 
275  if (_min_gap <= gap_L && gap_L <= _max_gap)
276  dgap = normalComponent;
277 
278  return dgap;
279 }
const Real _min_gap
const Real _max_gap
virtual Real gapLength() const

◆ gapLength()

Real GapHeatTransfer::gapLength ( ) const
protectedvirtual

Definition at line 261 of file GapHeatTransfer.C.

Referenced by computeQpOffDiagJacobian(), and dgapLength().

262 {
263  if (_has_info)
265 
266  return 1.0;
267 }
GapConductance::GAP_GEOMETRY & _gap_geometry_type
static Real gapLength(const GAP_GEOMETRY &gap_geom, Real radius, Real r1, Real r2, Real min_gap, Real max_gap)
const Real _min_gap
const Real _max_gap

◆ initialSetup()

void GapHeatTransfer::initialSetup ( )
overridevirtual

Definition at line 151 of file GapHeatTransfer.C.

152 {
154  _assembly.coordSystem(),
155  _fe_problem.getAxisymmetricRadialCoord(),
157  _p1,
158  _p2);
159 }
GapConductance::GAP_GEOMETRY & _gap_geometry_type
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)

Member Data Documentation

◆ _disp_vars

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

Definition at line 68 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 64 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 49 of file GapHeatTransfer.h.

Referenced by computeQpJacobian().

◆ _gap_distance

Real GapHeatTransfer::_gap_distance
protected

Definition at line 55 of file GapHeatTransfer.h.

Referenced by computeGapValues().

◆ _gap_distance_value

const VariableValue& GapHeatTransfer::_gap_distance_value
protected

Definition at line 70 of file GapHeatTransfer.h.

Referenced by computeGapValues().

◆ _gap_geometry_type

GapConductance::GAP_GEOMETRY& GapHeatTransfer::_gap_geometry_type
protected

Definition at line 42 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 71 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 52 of file GapHeatTransfer.h.

Referenced by dgapLength(), and gapLength().

◆ _min_gap

const Real GapHeatTransfer::_min_gap
protected

Definition at line 51 of file GapHeatTransfer.h.

Referenced by dgapLength(), and gapLength().

◆ _p1

Point& GapHeatTransfer::_p1
protected

Definition at line 76 of file GapHeatTransfer.h.

Referenced by computeGapValues(), and initialSetup().

◆ _p2

Point& GapHeatTransfer::_p2
protected

Definition at line 77 of file GapHeatTransfer.h.

Referenced by computeGapValues(), and initialSetup().

◆ _penetration_locator

PenetrationLocator* GapHeatTransfer::_penetration_locator
protected

Definition at line 73 of file GapHeatTransfer.h.

Referenced by computeGapValues().

◆ _quadrature

const bool GapHeatTransfer::_quadrature
protected

Definition at line 44 of file GapHeatTransfer.h.

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

◆ _r1

Real GapHeatTransfer::_r1
protected

Definition at line 57 of file GapHeatTransfer.h.

Referenced by computeGapValues(), and gapLength().

◆ _r2

Real GapHeatTransfer::_r2
protected

Definition at line 58 of file GapHeatTransfer.h.

Referenced by computeGapValues(), and gapLength().

◆ _radius

Real GapHeatTransfer::_radius
protected

Definition at line 56 of file GapHeatTransfer.h.

Referenced by computeGapValues(), and gapLength().

◆ _slave_flux

NumericVector<Number>* GapHeatTransfer::_slave_flux
protected

Definition at line 46 of file GapHeatTransfer.h.

Referenced by computeQpResidual().

◆ _warnings

const bool GapHeatTransfer::_warnings
protected

Definition at line 74 of file GapHeatTransfer.h.

Referenced by computeGapValues().


The documentation for this class was generated from the following files: