https://mooseframework.inl.gov
ConjugateHeatTransfer.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 "ConjugateHeatTransfer.h"
11 
12 #include "metaphysicl/raw_type.h"
13 
15 
16 registerMooseObject("HeatTransferApp", ConjugateHeatTransfer);
17 
20 {
22  params.addRequiredParam<MaterialPropertyName>("htc", "heat transfer coefficient");
23  params.addRequiredCoupledVar("T_fluid",
24  "The fluid temperature. It is not always identical to neighbor_var, "
25  "e.g. when the fluid heat equation is solved for internal energy");
26  params.addClassDescription(
27  "This InterfaceKernel models conjugate heat transfer. Fluid side must "
28  "be primary side and solid side must be secondary side. T_fluid is provided in case that "
29  "variable "
30  "(== fluid energy variable) is not temperature but e.g. internal energy.");
31  return params;
32 }
33 
35  : InterfaceKernel(parameters),
36  _h(getADMaterialProperty<Real>("htc")),
37  _T_fluid(coupledValue("T_fluid")),
38  _apply_element_jacobian(_var.name() == getParam<std::vector<VariableName>>("T_fluid")[0])
39 {
40 }
41 
42 Real
44 {
45  switch (type)
46  {
47  case Moose::Element:
48  return raw_value(_h[_qp]) * (_T_fluid[_qp] - _neighbor_value[_qp]) * _test[_i][_qp];
49 
50  case Moose::Neighbor:
52 
53  default:
54  return 0.0;
55  }
56 }
57 
58 Real
60 {
61  switch (type)
62  {
64  return _apply_element_jacobian ? raw_value(_h[_qp]) * _phi[_j][_qp] * _test[_i][_qp] : 0;
65 
68 
71  : 0;
72 
74  return raw_value(_h[_qp]) * -_phi_neighbor[_j][_qp] * _test[_i][_qp];
75 
76  default:
77  return 0.0;
78  }
79 }
NeighborElement
const TemplateVariableValue & _neighbor_value
auto raw_value(const Eigen::Map< T > &in)
const bool _apply_element_jacobian
Element Jacobian is only applied if variable = T_fluid.
const TemplateVariablePhiValue & _phi
InterfaceKernel for modeling conjugate heat transfer.
DGResidualType
ElementElement
void addRequiredParam(const std::string &name, const std::string &doc_string)
ElementNeighbor
const std::string name
Definition: Setup.h:20
ConjugateHeatTransfer(const InputParameters &parameters)
const std::string & type() const
const TemplateVariableTestValue & _test
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
DGJacobianType
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static InputParameters validParams()
const VariableValue & _T_fluid
Fluid temperature.
virtual Real computeQpResidual(Moose::DGResidualType type) override
void addClassDescription(const std::string &doc_string)
const ADMaterialProperty< Real > & _h
Convective heat transfer coefficient.
virtual Real computeQpJacobian(Moose::DGJacobianType type) override
registerMooseObject("HeatTransferApp", ConjugateHeatTransfer)
const TemplateVariableTestValue & _test_neighbor
NeighborNeighbor
const TemplateVariablePhiValue & _phi_neighbor
static InputParameters validParams()