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 "NSFVEnergyAmbientConvection.h" 11 : #include "NS.h" 12 : 13 : registerMooseObject("NavierStokesApp", NSFVEnergyAmbientConvection); 14 : 15 : InputParameters 16 124 : NSFVEnergyAmbientConvection::validParams() 17 : { 18 124 : InputParameters params = FVElementalKernel::validParams(); 19 124 : params.addClassDescription( 20 : "Implements a solid-fluid ambient convection volumetric term " 21 : "proportional to the difference between the fluid and ambient temperatures : " 22 : "$q''' = \\alpha (T_{fluid} - T_{ambient})$."); 23 124 : params.addRequiredParam<MaterialPropertyName>(NS::alpha, 24 : "Name of the convective heat transfer coefficient"); 25 248 : params.addRequiredParam<MooseFunctorName>("T_ambient", "The ambient temperature"); 26 124 : return params; 27 0 : } 28 : 29 68 : NSFVEnergyAmbientConvection::NSFVEnergyAmbientConvection(const InputParameters & parameters) 30 : : FVElementalKernel(parameters), 31 136 : _alpha(getFunctor<ADReal>(NS::alpha)), 32 136 : _temp_ambient(getFunctor<ADReal>("T_ambient")) 33 : { 34 68 : } 35 : 36 : ADReal 37 408636 : NSFVEnergyAmbientConvection::computeQpResidual() 38 : { 39 408636 : auto elem_arg = makeElemArg(_current_elem); 40 408636 : const auto state = determineState(); 41 817272 : return _alpha(elem_arg, state) * (_var(elem_arg, state) - _temp_ambient(elem_arg, state)); 42 : }