https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
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}
DualNumber< Real, DNDerivativeType, true > ADReal
registerMooseObject("NavierStokesApp", PINSFVEnergyAmbientConvection)
static InputParameters validParams()
const Elem *const & _current_elem
Moose::ElemArg makeElemArg(const Elem *elem, bool correct_skewnewss=false) const
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
An elemental kernel for transfering energy between the solid and fluid phases by convection.
const Moose::Functor< ADReal > & _temp_solid
solid temperature
const Moose::Functor< ADReal > & _h_solid_fluid
the convective heat transfer coefficient
const bool _is_solid
whether this kernel is being used for a solid or a fluid temperature
const Moose::Functor< ADReal > & _temp_fluid
fluid temperature
PINSFVEnergyAmbientConvection(const InputParameters &parameters)
Moose::StateArg determineState() const
static const std::string T_fluid
Definition NS.h:110
static const std::string T_solid
Definition NS.h:111