https://mooseframework.inl.gov
INSFVEnergyTimeDerivative.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 "INSFVEnergyVariable.h"
12 
13 #include "NS.h"
14 
16 
19 {
21  params.addClassDescription(
22  "Adds the time derivative term to the incompressible Navier-Stokes energy equation.");
23  params.addRequiredParam<MooseFunctorName>(NS::density, "Density");
24  params.addParam<MooseFunctorName>(NS::time_deriv(NS::specific_enthalpy),
26  "The time derivative of the specific enthalpy");
27  return params;
28 }
29 
31  : FVFunctorTimeKernel(params),
32  _rho(getFunctor<ADReal>(NS::density)),
33  _h_dot(getFunctor<ADReal>(NS::time_deriv(NS::specific_enthalpy)))
34 {
35  if (!dynamic_cast<INSFVEnergyVariable *>(&_var))
36  paramError("variable", "The supplied variable should be of INSFVEnergyVariable type.");
37 }
38 
39 ADReal
41 {
42  const auto elem_arg = makeElemArg(_current_elem);
43  const auto state = determineState();
44  return _rho(elem_arg, state) * _h_dot(elem_arg, state);
45 }
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
Moose::StateArg determineState() const
registerMooseObject("NavierStokesApp", INSFVEnergyTimeDerivative)
static const std::string density
Definition: NS.h:33
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 InputParameters validParams()
static InputParameters validParams()
const Elem *const & _current_elem
INSFVEnergyTimeDerivative(const InputParameters &params)
void paramError(const std::string &param, Args... args) const
const Moose::Functor< ADReal > & _rho
the density
void addClassDescription(const std::string &doc_string)
const Moose::Functor< ADReal > & _h_dot
The time derivative of the specific enthalpy.
MooseVariableFV< Real > & _var
std::string time_deriv(const std::string &var)
Definition: NS.h:97
static const std::string specific_enthalpy
Definition: NS.h:68