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

Constructor & Destructor Documentation

GapHeatTransfer::GapHeatTransfer ( const InputParameters &  parameters)

Definition at line 82 of file GapHeatTransfer.C.

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

void GapHeatTransfer::computeGapValues ( )
protectedvirtual

Definition at line 273 of file GapHeatTransfer.C.

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

274 {
275  if (!_quadrature)
276  {
277  _has_info = true;
278  _gap_temp = _gap_temp_value[_qp];
280  }
281  else
282  {
283  Node * qnode = _mesh.getQuadratureNode(_current_elem, _current_side, _qp);
284  PenetrationInfo * pinfo = _penetration_locator->_penetration_info[qnode->id()];
285 
286  _gap_temp = 0.0;
287  _gap_distance = std::numeric_limits<Real>::max();
288  _has_info = false;
289  _edge_multiplier = 1.0;
290 
291  if (pinfo)
292  {
293  _gap_distance = pinfo->_distance;
294  _has_info = true;
295 
296  const Elem * slave_side = pinfo->_side;
297  std::vector<std::vector<Real>> & slave_side_phi = pinfo->_side_phi;
298  _gap_temp = _variable->getValue(slave_side, slave_side_phi);
299 
300  Real tangential_tolerance = _penetration_locator->getTangentialTolerance();
301  if (tangential_tolerance != 0.0)
302  {
303  _edge_multiplier = 1.0 - pinfo->_tangential_distance / tangential_tolerance;
304  if (_edge_multiplier < 0.0)
305  _edge_multiplier = 0.0;
306  }
307  }
308  else
309  {
310  if (_warnings)
311  mooseWarning("No gap value information found for node ",
312  qnode->id(),
313  " on processor ",
314  processor_id());
315  }
316  }
317 
319  _gap_geometry_type, _q_point[_qp], _p1, _p2, _gap_distance, _normals[_qp], _r1, _r2, _radius);
320 }
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
Real GapHeatTransfer::computeQpJacobian ( )
overrideprotectedvirtual

Definition at line 181 of file GapHeatTransfer.C.

182 {
184 
185  if (!_has_info)
186  return 0.0;
187 
188  return _test[_i][_qp] * ((_u[_qp] - _gap_temp) * _edge_multiplier * _gap_conductance_dT[_qp] +
190  _phi[_j][_qp];
191 }
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
Real GapHeatTransfer::computeQpOffDiagJacobian ( unsigned  jvar)
overrideprotectedvirtual

Definition at line 194 of file GapHeatTransfer.C.

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

Definition at line 153 of file GapHeatTransfer.C.

154 {
156 
157  if (!_has_info)
158  return 0.0;
159 
160  Real grad_t = (_u[_qp] - _gap_temp) * _edge_multiplier * _gap_conductance[_qp];
161 
162  // This is keeping track of this residual contribution so it can be used as the flux on the other
163  // side of the gap.
164  if (!_quadrature)
165  {
166  Threads::spin_mutex::scoped_lock lock(Threads::spin_mutex);
167  const Real slave_flux = computeSlaveFluxContribution(grad_t);
168  _slave_flux->add(_var.dofIndices()[_i], slave_flux);
169  }
170 
171  return _test[_i][_qp] * grad_t;
172 }
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
Real GapHeatTransfer::computeSlaveFluxContribution ( Real  grad_t)
protectedvirtual

Definition at line 175 of file GapHeatTransfer.C.

Referenced by computeQpResidual().

176 {
177  return _coord[_qp] * _JxW[_qp] * _test[_i][_qp] * grad_t;
178 }
Real GapHeatTransfer::dgapLength ( Real  normalComponent) const
protectedvirtual

Definition at line 261 of file GapHeatTransfer.C.

Referenced by computeQpOffDiagJacobian().

262 {
263  const Real gap_L = gapLength();
264  Real dgap = 0.0;
265 
266  if (_min_gap <= gap_L && gap_L <= _max_gap)
267  dgap = normalComponent;
268 
269  return dgap;
270 }
virtual Real gapLength() const
const Real _min_gap
const Real _max_gap
Real GapHeatTransfer::gapLength ( ) const
protectedvirtual

Definition at line 252 of file GapHeatTransfer.C.

Referenced by computeQpOffDiagJacobian(), and dgapLength().

253 {
254  if (_has_info)
256 
257  return 1.0;
258 }
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
void GapHeatTransfer::initialSetup ( )
overridevirtual

Definition at line 146 of file GapHeatTransfer.C.

147 {
149  _pars, _assembly.coordSystem(), _gap_geometry_type, _p1, _p2);
150 }
GapConductance::GAP_GEOMETRY & _gap_geometry_type
static void setGapGeometryParameters(const InputParameters &params, const Moose::CoordinateSystemType coord_sys, GAP_GEOMETRY &gap_geometry_type, Point &p1, Point &p2)

Member Data Documentation

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

Definition at line 65 of file GapHeatTransfer.h.

Referenced by computeQpOffDiagJacobian(), and GapHeatTransfer().

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

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

const MaterialProperty<Real>& GapHeatTransfer::_gap_conductance
protected
const MaterialProperty<Real>& GapHeatTransfer::_gap_conductance_dT
protected

Definition at line 46 of file GapHeatTransfer.h.

Referenced by computeQpJacobian().

Real GapHeatTransfer::_gap_distance
protected

Definition at line 52 of file GapHeatTransfer.h.

Referenced by computeGapValues().

const VariableValue& GapHeatTransfer::_gap_distance_value
protected

Definition at line 67 of file GapHeatTransfer.h.

Referenced by computeGapValues().

GapConductance::GAP_GEOMETRY& GapHeatTransfer::_gap_geometry_type
protected

Definition at line 39 of file GapHeatTransfer.h.

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

Real GapHeatTransfer::_gap_temp
protected
const VariableValue& GapHeatTransfer::_gap_temp_value
protected

Definition at line 68 of file GapHeatTransfer.h.

Referenced by computeGapValues().

bool GapHeatTransfer::_has_info
protected
const Real GapHeatTransfer::_max_gap
protected

Definition at line 49 of file GapHeatTransfer.h.

Referenced by dgapLength(), and gapLength().

const Real GapHeatTransfer::_min_gap
protected

Definition at line 48 of file GapHeatTransfer.h.

Referenced by dgapLength(), and gapLength().

Point& GapHeatTransfer::_p1
protected

Definition at line 73 of file GapHeatTransfer.h.

Referenced by computeGapValues(), and initialSetup().

Point& GapHeatTransfer::_p2
protected

Definition at line 74 of file GapHeatTransfer.h.

Referenced by computeGapValues(), and initialSetup().

PenetrationLocator* GapHeatTransfer::_penetration_locator
protected

Definition at line 70 of file GapHeatTransfer.h.

Referenced by computeGapValues().

const bool GapHeatTransfer::_quadrature
protected

Definition at line 41 of file GapHeatTransfer.h.

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

Real GapHeatTransfer::_r1
protected

Definition at line 54 of file GapHeatTransfer.h.

Referenced by computeGapValues(), and gapLength().

Real GapHeatTransfer::_r2
protected

Definition at line 55 of file GapHeatTransfer.h.

Referenced by computeGapValues(), and gapLength().

Real GapHeatTransfer::_radius
protected

Definition at line 53 of file GapHeatTransfer.h.

Referenced by computeGapValues(), and gapLength().

NumericVector<Number>* GapHeatTransfer::_slave_flux
protected

Definition at line 43 of file GapHeatTransfer.h.

Referenced by computeQpResidual().

const bool GapHeatTransfer::_warnings
protected

Definition at line 71 of file GapHeatTransfer.h.

Referenced by computeGapValues().


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