https://mooseframework.inl.gov
PINSFVEnergyAmbientConvection.C
Go to the documentation of this file.
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 
11 #include "NS.h"
12 
14 
17 {
19  params.addClassDescription("Implements the solid-fluid ambient convection term in the porous "
20  "media Navier Stokes energy equation.");
21  params.addRequiredParam<MooseFunctorName>("h_solid_fluid",
22  "Name of the convective heat transfer coefficient.");
23  params.addRequiredParam<bool>("is_solid", "Whether this kernel acts on the solid temperature");
24  params.addRequiredParam<MooseFunctorName>(NS::T_fluid, "Fluid temperature");
25  params.addRequiredParam<MooseFunctorName>(NS::T_solid, "Solid temperature");
26  return params;
27 }
28 
30  : FVElementalKernel(parameters),
31  _h_solid_fluid(getFunctor<ADReal>("h_solid_fluid")),
32  _temp_fluid(getFunctor<ADReal>(NS::T_fluid)),
33  _temp_solid(getFunctor<ADReal>(NS::T_solid)),
34  _is_solid(getParam<bool>("is_solid"))
35 {
36 }
37 
38 ADReal
40 {
41  const auto & elem = makeElemArg(_current_elem);
42  const auto state = determineState();
43 
44  if (_is_solid)
45  return -_h_solid_fluid(elem, state) * (_temp_fluid(elem, state) - _temp_solid(elem, state));
46  else
47  return _h_solid_fluid(elem, state) * (_temp_fluid(elem, state) - _temp_solid(elem, state));
48 }
static const std::string T_solid
Definition: NS.h:107
const Moose::Functor< ADReal > & _h_solid_fluid
the convective heat transfer coefficient
Moose::StateArg determineState() const
An elemental kernel for transfering energy between the solid and fluid phases by convection.
PINSFVEnergyAmbientConvection(const InputParameters &parameters)
DualNumber< Real, DNDerivativeType, true > ADReal
void addRequiredParam(const std::string &name, const std::string &doc_string)
Moose::ElemArg makeElemArg(const Elem *elem, bool correct_skewnewss=false) const
static const std::string T_fluid
Definition: NS.h:106
const Elem *const & _current_elem
static InputParameters validParams()
const bool _is_solid
whether this kernel is being used for a solid or a fluid temperature
registerMooseObject("NavierStokesApp", PINSFVEnergyAmbientConvection)
const Moose::Functor< ADReal > & _temp_solid
solid temperature
void addClassDescription(const std::string &doc_string)
const Moose::Functor< ADReal > & _temp_fluid
fluid temperature