LCOV - code coverage report
Current view: top level - src/kernels - AnisoHomogenizedHeatConduction.C (source / functions) Hit Total Coverage
Test: idaholab/moose heat_transfer: #31405 (292dce) with base fef103 Lines: 15 17 88.2 %
Date: 2025-09-04 07:53:51 Functions: 3 3 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 "AnisoHomogenizedHeatConduction.h"
      11             : 
      12             : registerMooseObject("HeatTransferApp", AnisoHomogenizedHeatConduction);
      13             : 
      14             : InputParameters
      15         164 : AnisoHomogenizedHeatConduction::validParams()
      16             : {
      17         164 :   InputParameters params = Kernel::validParams();
      18         164 :   params.addClassDescription("Kernel for asymptotic expansion homogenization for thermal "
      19             :                              "conductivity when anisotropic thermal conductivities are used");
      20         328 :   params.addParam<MaterialPropertyName>("diffusion_coefficient",
      21             :                                         "thermal_conductivity",
      22             :                                         "The diffusion coefficient for the temperature gradient");
      23         328 :   params.addRequiredParam<unsigned int>(
      24             :       "component",
      25             :       "An integer corresponding to the direction the variable this "
      26             :       "kernel acts in. (0 for x, 1 for y, 2 for z)");
      27         164 :   return params;
      28           0 : }
      29             : 
      30          88 : AnisoHomogenizedHeatConduction::AnisoHomogenizedHeatConduction(const InputParameters & parameters)
      31             :   : Kernel(parameters),
      32          88 :     _diffusion_coefficient(getMaterialProperty<RankTwoTensor>("diffusion_coefficient")),
      33         264 :     _component(getParam<unsigned int>("component"))
      34             : {
      35          88 :   if (_component >= _mesh.dimension())
      36           0 :     paramError("Value is too large for the mesh dimension: 0, 1, 2 for 1D, 2D, 3D.");
      37          88 : }
      38             : 
      39             : Real
      40      414720 : AnisoHomogenizedHeatConduction::computeQpResidual()
      41             : {
      42             :   // This is the matrix-vector product of the diffusion coefficient tensor with
      43             :   // the j-th unit vector
      44             :   RealVectorValue d_times_ej(0, 0, 0);
      45     1244160 :   for (unsigned int j = 0; j < _mesh.dimension(); ++j)
      46      829440 :     d_times_ej(j) = _diffusion_coefficient[_qp](j, _component);
      47      414720 :   return d_times_ej * _grad_test[_i][_qp];
      48             : }

Generated by: LCOV version 1.14