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

Constructor & Destructor Documentation

◆ GapHeatTransfer()

GapHeatTransfer::GapHeatTransfer ( const InputParameters &  parameters)

Definition at line 89 of file GapHeatTransfer.C.

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

Member Function Documentation

◆ computeGapValues()

void GapHeatTransfer::computeGapValues ( )
protectedvirtual

Definition at line 287 of file GapHeatTransfer.C.

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

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

194 {
196 
197  if (!_has_info)
198  return 0.0;
199 
200  return _test[_i][_qp] *
201  ((_u[_qp] - _gap_temp) * _edge_multiplier * _gap_conductance_dT[_qp] +
203  _phi[_j][_qp];
204 }
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 207 of file GapHeatTransfer.C.

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

◆ computeQpResidual()

Real GapHeatTransfer::computeQpResidual ( )
overrideprotectedvirtual

Definition at line 165 of file GapHeatTransfer.C.

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

Referenced by computeQpResidual().

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

◆ dgapLength()

Real GapHeatTransfer::dgapLength ( Real  normalComponent) const
protectedvirtual

Definition at line 275 of file GapHeatTransfer.C.

Referenced by computeQpOffDiagJacobian().

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

◆ gapLength()

Real GapHeatTransfer::gapLength ( ) const
protectedvirtual

Definition at line 266 of file GapHeatTransfer.C.

Referenced by computeQpOffDiagJacobian(), and dgapLength().

267 {
268  if (_has_info)
270 
271  return 1.0;
272 }
GapConductance::GAP_GEOMETRY & _gap_geometry_type
const Real _max_gap
static Real gapLength(const GAP_GEOMETRY &gap_geom, Real radius, Real r1, Real r2, Real max_gap)

◆ initialSetup()

void GapHeatTransfer::initialSetup ( )
overridevirtual

Definition at line 154 of file GapHeatTransfer.C.

155 {
157  _assembly.coordSystem(),
158  _fe_problem.getAxisymmetricRadialCoord(),
160  _p1,
161  _p2);
162 }
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 69 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 65 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 56 of file GapHeatTransfer.h.

Referenced by computeGapValues().

◆ _gap_distance_value

const VariableValue& GapHeatTransfer::_gap_distance_value
protected

Definition at line 71 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 72 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 53 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 computeQpOffDiagJacobian(), and dgapLength().

◆ _min_gap_order

const unsigned int GapHeatTransfer::_min_gap_order
protected

Definition at line 52 of file GapHeatTransfer.h.

Referenced by computeQpOffDiagJacobian().

◆ _p1

Point& GapHeatTransfer::_p1
protected

Definition at line 77 of file GapHeatTransfer.h.

Referenced by computeGapValues(), and initialSetup().

◆ _p2

Point& GapHeatTransfer::_p2
protected

Definition at line 78 of file GapHeatTransfer.h.

Referenced by computeGapValues(), and initialSetup().

◆ _penetration_locator

PenetrationLocator* GapHeatTransfer::_penetration_locator
protected

Definition at line 74 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 58 of file GapHeatTransfer.h.

Referenced by computeGapValues(), and gapLength().

◆ _r2

Real GapHeatTransfer::_r2
protected

Definition at line 59 of file GapHeatTransfer.h.

Referenced by computeGapValues(), and gapLength().

◆ _radius

Real GapHeatTransfer::_radius
protected

Definition at line 57 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 75 of file GapHeatTransfer.h.

Referenced by computeGapValues().


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