https://mooseframework.inl.gov
INSElementIntegralEnergyAdvection.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 
13 #include "metaphysicl/raw_type.h"
14 
17 
18 template <bool is_ad>
21 {
23  params.addClassDescription(
24  "Computes the net volumetric balance of energy transported by advection");
25  params.addRequiredParam<MaterialPropertyName>(NS::cp,
26  "The constant-pressure specific heat capacity");
27  params.addRequiredParam<MaterialPropertyName>(NS::density, "The density");
28  params.addRequiredCoupledVar(NS::temperature, "The temperature");
29  params.addRequiredCoupledVar(NS::velocity, "The velocity");
30  return params;
31 }
32 
33 template <bool is_ad>
35  const InputParameters & parameters)
36  : ElementIntegralPostprocessor(parameters),
37  _cp(getGenericMaterialProperty<Real, is_ad>(NS::cp)),
38  _rho(getGenericMaterialProperty<Real, is_ad>(NS::density)),
39  _grad_T(coupledGradient(NS::temperature)),
40  _velocity(coupledVectorValue(NS::velocity))
41 {
42 }
43 
44 template <bool is_ad>
45 Real
47 {
48  return MetaPhysicL::raw_value(_cp[_qp]) * MetaPhysicL::raw_value(_rho[_qp]) *
49  (_grad_T[_qp] * _velocity[_qp]);
50 }
51 
registerMooseObject("NavierStokesApp", INSElementIntegralEnergyAdvection)
Template class for computing the global energy loss/gain due to advection.
static const std::string density
Definition: NS.h:33
auto raw_value(const Eigen::Map< T > &in)
static const std::string temperature
Definition: NS.h:59
void addRequiredParam(const std::string &name, const std::string &doc_string)
static const std::string cp
Definition: NS.h:121
static InputParameters validParams()
INSElementIntegralEnergyAdvectionTempl(const InputParameters &parameters)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
static const std::string velocity
Definition: NS.h:45