https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
11#include "INSFVEnergyVariable.h"
12#include "NS.h"
13
15
18{
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
37{
38 const auto v = velocity();
39 const auto & limiter_time = _subproblem.isTransient()
40 ? Moose::StateArg(1, Moose::SolutionIterationType::Time)
41 : Moose::StateArg(1, Moose::SolutionIterationType::Nonlinear);
42 const auto adv_quant_face = _adv_quant(makeFace(*_face_info,
43 limiterType(_advected_interp_method),
45 false,
46 &limiter_time),
48 return _normal * v * adv_quant_face;
49}
DualNumber< Real, DNDerivativeType, true > ADReal
const double v
registerMooseObject("NavierStokesApp", INSFVEnergyAdvection)
RealVectorValue _normal
MooseVariableFV< Real > & _var
const FaceInfo * _face_info
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
An advection kernel that implements interpolation schemes specific to Navier-Stokes flow physics.
ADRealVectorValue velocity() const
Moose::FV::InterpMethod _advected_interp_method
The interpolation method to use for the advected quantity.
static InputParameters validParams()
An advection kernel that implements interpolation schemes specific to Navier-Stokes flow physics.
static InputParameters validParams()
INSFVEnergyAdvection(const InputParameters &params)
virtual ADReal computeQpResidual() override
const Moose::Functor< ADReal > & _adv_quant
The advected heat quantity.
void mooseError(Args &&... args) const
SubProblem & _subproblem
virtual bool isTransient() const=0
Moose::StateArg determineState() const
auto raw_value(const Eigen::Map< T > &in)
static const std::string enthalpy_density
Definition NS.h:71