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 : #pragma once 11 : 12 : #include "FunctorIsotropicEffectiveFluidThermalConductivity.h" 13 : 14 : /** 15 : * Template for the fluid effective thermal conductivity based on a 16 : * volume-average of the thermal conductivity as $\kappa_f=\epsilon k_f$. In other 17 : * words, no additional effects of thermal dispersion are considered here. 18 : */ 19 : template <typename Derived> 20 : class FunctorKappaFluidTempl : public FunctorIsotropicEffectiveFluidThermalConductivity<Derived> 21 : { 22 : friend class FunctorIsotropicEffectiveFluidThermalConductivity<Derived>; 23 : 24 : public: 25 : FunctorKappaFluidTempl(const InputParameters & parameters); 26 : 27 : static InputParameters validParams(); 28 : 29 : protected: 30 : template <typename Space, typename Time> 31 : ADReal computeEffectiveConductivity(const Space & r, const Time & t) const; 32 : 33 : /// Fluid thermal conductivity 34 : const Moose::Functor<ADReal> & _k; 35 : }; 36 : 37 : template <typename Derived> 38 : template <typename Space, typename Time> 39 : ADReal 40 : FunctorKappaFluidTempl<Derived>::computeEffectiveConductivity(const Space & r, const Time & t) const 41 : { 42 0 : return _k(r, t); 43 : } 44 : 45 : /** 46 : * Instantiation of the template for the fluid effective thermal conductivity based on a 47 : * volume-average of the thermal conductivity as $\kappa_f=\epsilon k_f$. In other 48 : * words, no additional effects of thermal dispersion are considered here. 49 : * NOTE: Do not inherit this class, inherit FunctorKappaFluidTempl for the sake of the CRTP 50 : * static polymorphism 51 : */ 52 : class FunctorKappaFluid final : public FunctorKappaFluidTempl<FunctorKappaFluid> 53 : { 54 : public: 55 : FunctorKappaFluid(const InputParameters & parameters); 56 : }; 57 : 58 : template <typename Derived> 59 22 : FunctorKappaFluidTempl<Derived>::FunctorKappaFluidTempl(const InputParameters & parameters) 60 : : FunctorIsotropicEffectiveFluidThermalConductivity<Derived>(parameters), 61 22 : _k(FunctorMaterial::getFunctor<ADReal>(NS::k)) 62 : { 63 22 : } 64 : 65 : template <typename Derived> 66 : InputParameters 67 41 : FunctorKappaFluidTempl<Derived>::validParams() 68 : { 69 : auto params = FunctorIsotropicEffectiveFluidThermalConductivity<Derived>::validParams(); 70 41 : params.addClassDescription("Zero-thermal dispersion conductivity"); 71 41 : return params; 72 0 : }