LCOV - code coverage report
Current view: top level - src/interfacekernels - ConjugateHeatTransfer.C (source / functions) Hit Total Coverage
Test: idaholab/moose heat_transfer: #32971 (54bef8) with base c6cf66 Lines: 27 28 96.4 %
Date: 2026-05-29 20:37:03 Functions: 4 4 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       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             : 
      14             : using MetaPhysicL::raw_value;
      15             : 
      16             : registerMooseObject("HeatTransferApp", ConjugateHeatTransfer);
      17             : 
      18             : InputParameters
      19          38 : ConjugateHeatTransfer::validParams()
      20             : {
      21          38 :   InputParameters params = InterfaceKernel::validParams();
      22          76 :   params.addRequiredParam<MaterialPropertyName>("htc", "heat transfer coefficient");
      23          76 :   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          38 :   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          38 :   return params;
      32           0 : }
      33             : 
      34          20 : ConjugateHeatTransfer::ConjugateHeatTransfer(const InputParameters & parameters)
      35             :   : InterfaceKernel(parameters),
      36          20 :     _h(getADMaterialProperty<Real>("htc")),
      37          20 :     _T_fluid(coupledValue("T_fluid")),
      38          60 :     _apply_element_jacobian(_var.name() == getParam<std::vector<VariableName>>("T_fluid")[0])
      39             : {
      40          20 : }
      41             : 
      42             : Real
      43       13440 : ConjugateHeatTransfer::computeQpResidual(Moose::DGResidualType type)
      44             : {
      45       13440 :   switch (type)
      46             :   {
      47        6720 :     case Moose::Element:
      48        6720 :       return raw_value(_h[_qp]) * (_T_fluid[_qp] - _neighbor_value[_qp]) * _test[_i][_qp];
      49             : 
      50        6720 :     case Moose::Neighbor:
      51        6720 :       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             : 
      58             : Real
      59       30720 : ConjugateHeatTransfer::computeQpJacobian(Moose::DGJacobianType type)
      60             : {
      61       30720 :   switch (type)
      62             :   {
      63        7680 :     case Moose::ElementElement:
      64        7680 :       return _apply_element_jacobian ? raw_value(_h[_qp]) * _phi[_j][_qp] * _test[_i][_qp] : 0;
      65             : 
      66        7680 :     case Moose::NeighborNeighbor:
      67        7680 :       return raw_value(_h[_qp]) * _phi_neighbor[_j][_qp] * _test_neighbor[_i][_qp];
      68             : 
      69        7680 :     case Moose::NeighborElement:
      70        7680 :       return _apply_element_jacobian ? raw_value(_h[_qp]) * -_phi[_j][_qp] * _test_neighbor[_i][_qp]
      71             :                                      : 0;
      72             : 
      73        7680 :     case Moose::ElementNeighbor:
      74        7680 :       return raw_value(_h[_qp]) * -_phi_neighbor[_j][_qp] * _test[_i][_qp];
      75             : 
      76             :     default:
      77             :       return 0.0;
      78             :   }
      79             : }

Generated by: LCOV version 1.14