LCOV - code coverage report
Current view: top level - src/materials - ConstantDensityThermalSolidPropertiesMaterial.C (source / functions) Hit Total Coverage
Test: idaholab/moose solid_properties: #31405 (292dce) with base fef103 Lines: 14 15 93.3 %
Date: 2025-09-04 07:57:33 Functions: 3 6 50.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 "ConstantDensityThermalSolidPropertiesMaterial.h"
      11             : #include "ThermalSolidProperties.h"
      12             : 
      13             : #include "metaphysicl/raw_type.h"
      14             : 
      15             : registerMooseObject("SolidPropertiesApp", ConstantDensityThermalSolidPropertiesMaterial);
      16             : registerMooseObject("SolidPropertiesApp", ADConstantDensityThermalSolidPropertiesMaterial);
      17             : 
      18             : template <bool is_ad>
      19             : InputParameters
      20          85 : ConstantDensityThermalSolidPropertiesMaterialTempl<is_ad>::validParams()
      21             : {
      22          85 :   InputParameters params = ThermalSolidPropertiesMaterialTempl<is_ad>::validParams();
      23             : 
      24         170 :   params.addRequiredParam<Real>("T_ref", "Reference temperature for constant density [K]");
      25             : 
      26          85 :   params.addClassDescription("Computes solid thermal properties as a function of temperature but "
      27             :                              "with a constant density.");
      28             : 
      29          85 :   return params;
      30           0 : }
      31             : 
      32             : template <bool is_ad>
      33          66 : ConstantDensityThermalSolidPropertiesMaterialTempl<
      34             :     is_ad>::ConstantDensityThermalSolidPropertiesMaterialTempl(const InputParameters & parameters)
      35             :   : ThermalSolidPropertiesMaterialTempl<is_ad>(parameters),
      36             : 
      37          66 :     _T_ref(this->template getParam<Real>("T_ref")),
      38         132 :     _rho_constant(MetaPhysicL::raw_value(_sp.rho_from_T(GenericReal<is_ad>(_T_ref))))
      39             : {
      40          66 : }
      41             : 
      42             : template <bool is_ad>
      43             : void
      44           9 : ConstantDensityThermalSolidPropertiesMaterialTempl<is_ad>::computeQpProperties()
      45             : {
      46           9 :   _cp[_qp] = _sp.cp_from_T(_temperature[_qp]);
      47           9 :   _k[_qp] = _sp.k_from_T(_temperature[_qp]);
      48           9 :   _rho[_qp] = _rho_constant;
      49           9 : }
      50             : 
      51             : template class ConstantDensityThermalSolidPropertiesMaterialTempl<false>;
      52             : template class ConstantDensityThermalSolidPropertiesMaterialTempl<true>;

Generated by: LCOV version 1.14