https://mooseframework.inl.gov
INSFVEnergyAdvection.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 
10 #include "INSFVEnergyAdvection.h"
11 #include "INSFVEnergyVariable.h"
12 #include "NS.h"
13 
14 registerMooseObject("NavierStokesApp", INSFVEnergyAdvection);
15 
18 {
19  auto params = INSFVAdvectionKernel::validParams();
20  params.addClassDescription("Advects energy, e.g. rho*cp*T. A user may still override what "
21  "quantity is advected, but the default is rho*cp*T");
22  params.addParam<MooseFunctorName>(
23  "advected_quantity", NS::enthalpy_density, "The heat quantity to advect.");
24  return params;
25 }
26 
28  : INSFVAdvectionKernel(params), _adv_quant(getFunctor<ADReal>("advected_quantity"))
29 {
30  if (!dynamic_cast<INSFVEnergyVariable *>(&_var))
31  mooseError("PINSFVEnergyAdvection may only be used with a fluid temperature variable, "
32  "of variable type INSFVEnergyVariable.");
33 }
34 
35 ADReal
37 {
38  const auto v = velocity();
39  const auto & limiter_time = _subproblem.isTransient()
42  const auto adv_quant_face = _adv_quant(makeFace(*_face_info,
45  false,
46  &limiter_time),
47  determineState());
48  return _normal * v * adv_quant_face;
49 }
Moose::FV::InterpMethod _advected_interp_method
The interpolation method to use for the advected quantity.
const Moose::Functor< ADReal > & _adv_quant
The advected heat quantity.
const FaceInfo * _face_info
Moose::StateArg determineState() const
auto raw_value(const Eigen::Map< T > &in)
RealVectorValue _normal
DualNumber< Real, DNDerivativeType, true > ADReal
INSFVEnergyAdvection(const InputParameters &params)
virtual ADReal computeQpResidual() override
LimiterType limiterType(InterpMethod interp_method)
SubProblem & _subproblem
virtual bool isTransient() const=0
static const std::string enthalpy_density
Definition: NS.h:70
registerMooseObject("NavierStokesApp", INSFVEnergyAdvection)
static InputParameters validParams()
static const std::string v
Definition: NS.h:84
An advection kernel that implements interpolation schemes specific to Navier-Stokes flow physics...
An advection kernel that implements interpolation schemes specific to Navier-Stokes flow physics...
void mooseError(Args &&... args) const
ADRealVectorValue velocity() const
MooseVariableFV< Real > & _var
static InputParameters validParams()
Moose::FaceArg makeFace(const FaceInfo &fi, const Moose::FV::LimiterType limiter_type, const bool elem_is_upwind, const bool correct_skewness=false, const Moose::StateArg *state_limiter=nullptr) const