https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
11
12#include "metaphysicl/raw_type.h"
13
15
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");
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
42Real
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:
51 return raw_value(_h[_qp]) * (_neighbor_value[_qp] - _T_fluid[_qp]) * _test_neighbor[_i][_qp];
52
53 default:
54 return 0.0;
55 }
56}
57
58Real
60{
61 switch (type)
62 {
64 return _apply_element_jacobian ? raw_value(_h[_qp]) * _phi[_j][_qp] * _test[_i][_qp] : 0;
65
67 return raw_value(_h[_qp]) * _phi_neighbor[_j][_qp] * _test_neighbor[_i][_qp];
68
70 return _apply_element_jacobian ? raw_value(_h[_qp]) * -_phi[_j][_qp] * _test_neighbor[_i][_qp]
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}
registerMooseObject("HeatTransferApp", ConjugateHeatTransfer)
const std::string name
Definition Setup.h:21
InterfaceKernel for modeling conjugate heat transfer.
const bool _apply_element_jacobian
Element Jacobian is only applied if variable = T_fluid.
virtual Real computeQpResidual(Moose::DGResidualType type) override
ConjugateHeatTransfer(const InputParameters &parameters)
static InputParameters validParams()
const VariableValue & _T_fluid
Fluid temperature.
const ADMaterialProperty< Real > & _h
Convective heat transfer coefficient.
virtual Real computeQpJacobian(Moose::DGJacobianType type) override
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
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
auto raw_value(const Eigen::Map< T > &in)
DGResidualType
DGJacobianType
NeighborNeighbor
ElementElement
NeighborElement
ElementNeighbor