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 "PINSFVEnergyAmbientConvection.h" 11 : #include "NS.h" 12 : 13 : registerMooseObject("NavierStokesApp", PINSFVEnergyAmbientConvection); 14 : 15 : InputParameters 16 1550 : PINSFVEnergyAmbientConvection::validParams() 17 : { 18 1550 : InputParameters params = FVElementalKernel::validParams(); 19 1550 : params.addClassDescription("Implements the solid-fluid ambient convection term in the porous " 20 : "media Navier Stokes energy equation."); 21 3100 : params.addRequiredParam<MooseFunctorName>("h_solid_fluid", 22 : "Name of the convective heat transfer coefficient."); 23 3100 : params.addRequiredParam<bool>("is_solid", "Whether this kernel acts on the solid temperature"); 24 1550 : params.addRequiredParam<MooseFunctorName>(NS::T_fluid, "Fluid temperature"); 25 1550 : params.addRequiredParam<MooseFunctorName>(NS::T_solid, "Solid temperature"); 26 1550 : return params; 27 0 : } 28 : 29 840 : PINSFVEnergyAmbientConvection::PINSFVEnergyAmbientConvection(const InputParameters & parameters) 30 : : FVElementalKernel(parameters), 31 840 : _h_solid_fluid(getFunctor<ADReal>("h_solid_fluid")), 32 840 : _temp_fluid(getFunctor<ADReal>(NS::T_fluid)), 33 840 : _temp_solid(getFunctor<ADReal>(NS::T_solid)), 34 2520 : _is_solid(getParam<bool>("is_solid")) 35 : { 36 840 : } 37 : 38 : ADReal 39 4628218 : PINSFVEnergyAmbientConvection::computeQpResidual() 40 : { 41 4628218 : const auto & elem = makeElemArg(_current_elem); 42 4628218 : const auto state = determineState(); 43 : 44 4628218 : if (_is_solid) 45 4159380 : return -_h_solid_fluid(elem, state) * (_temp_fluid(elem, state) - _temp_solid(elem, state)); 46 : else 47 9725274 : return _h_solid_fluid(elem, state) * (_temp_fluid(elem, state) - _temp_solid(elem, state)); 48 : }