LCOV - code coverage report
Current view: top level - src/postprocessors - ADHeatStructureEnergyBase.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #30301 (3b550b) with base 2ad78d Lines: 18 19 94.7 %
Date: 2025-07-30 13:02:48 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 "ADHeatStructureEnergyBase.h"
      11             : #include "HeatConductionModel.h"
      12             : 
      13             : InputParameters
      14        1740 : ADHeatStructureEnergyBase::validParams()
      15             : {
      16        1740 :   InputParameters params = ElementIntegralPostprocessor::validParams();
      17             : 
      18        1740 :   params.addClassDescription("Computes the total energy for a heat structure.");
      19             : 
      20        3480 :   params.addParam<Real>("n_units", 1., "Number of units of heat structure represents");
      21        3480 :   params.addParam<Real>("T_ref", 0, "Reference temperature");
      22             : 
      23        1740 :   return params;
      24           0 : }
      25             : 
      26         614 : ADHeatStructureEnergyBase::ADHeatStructureEnergyBase(const InputParameters & parameters)
      27             :   : ElementIntegralPostprocessor(parameters),
      28         614 :     _n_units(getParam<Real>("n_units")),
      29        1228 :     _T_ref(getParam<Real>("T_ref")),
      30        1228 :     _rho(getADMaterialPropertyByName<Real>(HeatConductionModel::DENSITY)),
      31         614 :     _cp(getADMaterialPropertyByName<Real>(HeatConductionModel::SPECIFIC_HEAT_CONSTANT_PRESSURE)),
      32         614 :     _T_var(&_fe_problem.getStandardVariable(_tid, HeatConductionModel::TEMPERATURE)),
      33        1228 :     _T(_T_var->sln())
      34             : {
      35         614 :   addMooseVariableDependency(_T_var);
      36         614 : }
      37             : 
      38             : Real
      39     1937408 : ADHeatStructureEnergyBase::computeQpIntegral()
      40             : {
      41     1937408 :   return MetaPhysicL::raw_value(_rho[_qp]) * MetaPhysicL::raw_value(_cp[_qp]) * (_T[_qp] - _T_ref) *
      42     1937408 :          _n_units;
      43             : }

Generated by: LCOV version 1.14