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 "ConvectionHeatFluxFunctorMaterial.h" 11 : 12 : registerMooseObject("HeatTransferApp", ConvectionHeatFluxFunctorMaterial); 13 : registerMooseObject("HeatTransferApp", ADConvectionHeatFluxFunctorMaterial); 14 : 15 : template <bool is_ad> 16 : InputParameters 17 19 : ConvectionHeatFluxFunctorMaterialTempl<is_ad>::validParams() 18 : { 19 19 : InputParameters params = FunctorMaterial::validParams(); 20 19 : params.addClassDescription("Computes a convection heat flux from a solid surface to a fluid."); 21 38 : params.addRequiredParam<MooseFunctorName>("htc", "Heat transfer coefficient functor"); 22 38 : params.addRequiredParam<MooseFunctorName>("T_solid", "Solid temperature functor"); 23 38 : params.addRequiredParam<MooseFunctorName>("T_fluid", "Fluid temperature functor"); 24 38 : params.addRequiredParam<std::string>("heat_flux_name", 25 : "Name to give the heat flux functor material property"); 26 19 : return params; 27 0 : } 28 : 29 : template <bool is_ad> 30 10 : ConvectionHeatFluxFunctorMaterialTempl<is_ad>::ConvectionHeatFluxFunctorMaterialTempl( 31 : const InputParameters & parameters) 32 : : FunctorMaterial(parameters), 33 10 : _htc(getFunctor<GenericReal<is_ad>>("htc")), 34 20 : _T_solid(getFunctor<GenericReal<is_ad>>("T_solid")), 35 30 : _T_fluid(getFunctor<GenericReal<is_ad>>("T_fluid")) 36 : { 37 40 : addFunctorProperty<GenericReal<is_ad>>( 38 20 : getParam<std::string>("heat_flux_name"), 39 12 : [this](const auto & r, const auto & t) -> GenericReal<is_ad> 40 : { 41 12 : const auto htc = _htc(r, t); 42 12 : const auto T_solid = _T_solid(r, t); 43 12 : const auto T_fluid = _T_fluid(r, t); 44 12 : return htc * (T_solid - T_fluid); 45 : }); 46 20 : } 47 : 48 : template class ConvectionHeatFluxFunctorMaterialTempl<false>; 49 : template class ConvectionHeatFluxFunctorMaterialTempl<true>;