https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
11
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
54Real
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
78Real
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
100 std::max(_thickness, libMesh::TOLERANCE)));
101 break;
102
105 std::max(_thickness, libMesh::TOLERANCE)));
106 break;
107 }
108
109 return jac;
110}
registerMooseObject("HeatTransferApp", ThinLayerHeatTransfer)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
const TemplateVariableValue & _u
const TemplateVariableValue & _neighbor_value
static InputParameters validParams()
const TemplateVariableTestValue & _test_neighbor
const TemplateVariablePhiValue & _phi
const TemplateVariableTestValue & _test
const TemplateVariablePhiValue & _phi_neighbor
const std::string & type() const
InterfaceKernel for modeling heat transfer across a thin layer.
const VariableValue & _u_dot
Time derivative of temperature variable.
virtual Real computeQpResidual(Moose::DGResidualType type) override
const MaterialProperty< Real > & _thermal_conductivity
The thermal conductivity material property of the thin layer.
static InputParameters validParams()
const MaterialProperty< Real > & _density
The density material property of the thin layer.
const MaterialProperty< Real > & _specific_heat
The specific heat material property of the thin layer.
ThinLayerHeatTransfer(const InputParameters &)
const VariableValue & _du_dot_du
Derivative of u_dot with respect to u.
const VariableValue & _u_dot_neighbor
Time derivative of neighbor temperature variable.
virtual Real computeQpJacobian(Moose::DGJacobianType type) override
const VariableValue & _du_dot_du_neighbor
Derivative of neighbor_value_dot with respect to u.
const MaterialProperty< Real > & _heat_source
The heat source material property of the thin layer.
DGResidualType
DGJacobianType
NeighborNeighbor
ElementElement
NeighborElement
ElementNeighbor
static constexpr Real TOLERANCE