https://mooseframework.inl.gov
ThinLayerHeatTransfer.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "ThinLayerHeatTransfer.h"
11 
12 registerMooseObject("HeatTransferApp", ThinLayerHeatTransfer);
13 
16 {
18  params.addClassDescription("Model heat transfer across a thin domain with an interface.");
19  params.addParam<MaterialPropertyName>(
20  "specific_heat", "Property name of the specific heat material property of the thin layer");
21 
22  params.addParam<MaterialPropertyName>(
23  "density", "Property name of the density material property of the thin layer");
24 
25  params.addParam<MaterialPropertyName>(
26  "heat_source", "Property name of the heat source material property of the thin layer");
27 
28  params.addParam<MaterialPropertyName>(
29  "thermal_conductivity", "thermal_conductivity", "Property name of the thermal conductivity");
30 
31  params.addRequiredParam<Real>("thickness", "The thin layer thickness");
32  return params;
33 }
34 
36  : InterfaceKernel(parameters),
37  _specific_heat(parameters.isParamValid("specific_heat")
38  ? getMaterialProperty<Real>("specific_heat")
39  : getGenericZeroMaterialProperty<Real, false>()),
40  _density(parameters.isParamValid("density") ? getMaterialProperty<Real>("density")
41  : getGenericZeroMaterialProperty<Real, false>()),
42  _heat_source(parameters.isParamValid("heat_source")
43  ? getMaterialProperty<Real>("heat_source")
44  : getGenericZeroMaterialProperty<Real, false>()),
45  _thermal_conductivity(getMaterialProperty<Real>("thermal_conductivity")),
46  _thickness(getParam<Real>("thickness")),
47  _u_dot(_var.uDot()),
48  _du_dot_du(_var.duDotDu()),
49  _u_dot_neighbor(_var.uDotNeighbor()),
50  _du_dot_du_neighbor(_var.duDotDuNeighbor())
51 {
52 }
53 
54 Real
56 {
57  Real r = 0;
58 
59  switch (type)
60  {
61  case Moose::Element:
62  r = -_test[_i][_qp] * (0.5 * _thickness * _heat_source[_qp] -
65  std::max(_thickness, libMesh::TOLERANCE)));
66  break;
67  case Moose::Neighbor:
68  r = -_test_neighbor[_i][_qp] *
69  (0.5 * _thickness * _heat_source[_qp] -
72  (std::max(_thickness, libMesh::TOLERANCE))));
73  break;
74  }
75  return r;
76 }
77 
78 Real
80 {
81  Real jac = 0;
82 
83  switch (type)
84  {
86  jac = -_test[_i][_qp] * (-_density[_qp] * _specific_heat[_qp] * 0.5 * _thickness *
87  _du_dot_du[_qp] * _phi[_j][_qp] -
89  std::max(_thickness, libMesh::TOLERANCE)));
90  break;
92  jac = -_test_neighbor[_i][_qp] * (-_density[_qp] * _specific_heat[_qp] * 0.5 * _thickness *
95  std::max(_thickness, libMesh::TOLERANCE)));
96  break;
97 
99  jac = -_test_neighbor[_i][_qp] * (-(-_thermal_conductivity[_qp] * _phi[_j][_qp] /
100  std::max(_thickness, libMesh::TOLERANCE)));
101  break;
102 
104  jac = -_test[_i][_qp] * (-(-_thermal_conductivity[_qp] * _phi_neighbor[_j][_qp] /
105  std::max(_thickness, libMesh::TOLERANCE)));
106  break;
107  }
108 
109  return jac;
110 }
ThinLayerHeatTransfer(const InputParameters &)
registerMooseObject("HeatTransferApp", ThinLayerHeatTransfer)
NeighborElement
const TemplateVariableValue & _neighbor_value
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
const TemplateVariableValue & _u
static constexpr Real TOLERANCE
const VariableValue & _u_dot_neighbor
Time derivative of neighbor temperature variable.
static InputParameters validParams()
const TemplateVariablePhiValue & _phi
DGResidualType
const MaterialProperty< Real > & _specific_heat
The specific heat material property of the thin layer.
ElementElement
void addRequiredParam(const std::string &name, const std::string &doc_string)
const VariableValue & _du_dot_du
Derivative of u_dot with respect to u.
virtual Real computeQpJacobian(Moose::DGJacobianType type) override
ElementNeighbor
const MaterialProperty< Real > & _thermal_conductivity
The thermal conductivity material property of the thin layer.
const std::string & type() const
const TemplateVariableTestValue & _test
const VariableValue & _du_dot_du_neighbor
Derivative of neighbor_value_dot with respect to u.
DGJacobianType
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const MaterialProperty< Real > & _heat_source
The heat source material property of the thin layer.
virtual Real computeQpResidual(Moose::DGResidualType type) override
InterfaceKernel for modeling heat transfer across a thin layer.
void addClassDescription(const std::string &doc_string)
const VariableValue & _u_dot
Time derivative of temperature variable.
const TemplateVariableTestValue & _test_neighbor
const MaterialProperty< Real > & _density
The density material property of the thin layer.
NeighborNeighbor
const TemplateVariablePhiValue & _phi_neighbor
static InputParameters validParams()