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 39 : ConstantDensityThermalSolidPropertiesMaterialTempl<is_ad>::validParams() 21 : { 22 39 : InputParameters params = ThermalSolidPropertiesMaterialTempl<is_ad>::validParams(); 23 : 24 78 : params.addRequiredParam<Real>("T_ref", "Reference temperature for constant density [K]"); 25 : 26 39 : params.addClassDescription("Computes solid thermal properties as a function of temperature but " 27 : "with a constant density."); 28 : 29 39 : return params; 30 0 : } 31 : 32 : template <bool is_ad> 33 30 : ConstantDensityThermalSolidPropertiesMaterialTempl< 34 : is_ad>::ConstantDensityThermalSolidPropertiesMaterialTempl(const InputParameters & parameters) 35 : : ThermalSolidPropertiesMaterialTempl<is_ad>(parameters), 36 : 37 30 : _T_ref(this->template getParam<Real>("T_ref")), 38 60 : _rho_constant(MetaPhysicL::raw_value(_sp.rho_from_T(GenericReal<is_ad>(_T_ref)))) 39 : { 40 30 : } 41 : 42 : template <bool is_ad> 43 : void 44 6 : ConstantDensityThermalSolidPropertiesMaterialTempl<is_ad>::computeQpProperties() 45 : { 46 6 : _cp[_qp] = _sp.cp_from_T(_temperature[_qp]); 47 6 : _k[_qp] = _sp.k_from_T(_temperature[_qp]); 48 6 : _rho[_qp] = _rho_constant; 49 6 : } 50 : 51 : template class ConstantDensityThermalSolidPropertiesMaterialTempl<false>; 52 : template class ConstantDensityThermalSolidPropertiesMaterialTempl<true>;