LCOV - code coverage report
Current view: top level - src/fvkernels - FVFunctorHeatConductionTimeDerivative.C (source / functions) Hit Total Coverage
Test: idaholab/moose heat_transfer: #31405 (292dce) with base fef103 Lines: 16 17 94.1 %
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 "FVFunctorHeatConductionTimeDerivative.h"
      11             : 
      12             : registerMooseObject("HeatTransferApp", FVFunctorHeatConductionTimeDerivative);
      13             : 
      14             : InputParameters
      15          41 : FVFunctorHeatConductionTimeDerivative::validParams()
      16             : {
      17          41 :   InputParameters params = FVFunctorTimeKernel::validParams();
      18          41 :   params.addClassDescription(
      19             :       "AD Time derivative term $\\rho c_p \\frac{\\partial T}{\\partial t}$ of "
      20             :       "the heat equation for quasi-constant specific heat $c_p$ and the density $\\rho$.");
      21          82 :   params.addParam<MooseFunctorName>(
      22             :       "specific_heat", "specific_heat", "Property name of the specific heat at constant pressure");
      23          82 :   params.addParam<MooseFunctorName>("density", "density", "Property name of the density");
      24          41 :   return params;
      25           0 : }
      26             : 
      27          22 : FVFunctorHeatConductionTimeDerivative::FVFunctorHeatConductionTimeDerivative(
      28          22 :     const InputParameters & parameters)
      29             :   : FVFunctorTimeKernel(parameters),
      30          22 :     _specific_heat(getFunctor<ADReal>("specific_heat")),
      31          66 :     _density(getFunctor<ADReal>("density"))
      32             : {
      33          22 : }
      34             : 
      35             : ADReal
      36          50 : FVFunctorHeatConductionTimeDerivative::computeQpResidual()
      37             : {
      38             :   // FV kernels dont use the quadrature
      39             :   mooseAssert(_q_point.size() == 1, "Only 1 QP per element in FV");
      40          50 :   const Moose::ElemArg elem_arg = {_current_elem, /*correct_skewness=*/true};
      41          50 :   const auto & time_arg = determineState();
      42          50 :   return _specific_heat(elem_arg, time_arg) * _density(elem_arg, time_arg) *
      43         100 :          FVFunctorTimeKernel::computeQpResidual();
      44             : }

Generated by: LCOV version 1.14