https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
18template <bool is_ad>
21{
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
33template <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
44template <bool is_ad>
45Real
47{
48 return MetaPhysicL::raw_value(_cp[_qp]) * MetaPhysicL::raw_value(_rho[_qp]) *
49 (_grad_T[_qp] * _velocity[_qp]);
50}
51
registerMooseObject("NavierStokesApp", INSElementIntegralEnergyAdvection)
static InputParameters validParams()
Template class for computing the global energy loss/gain due to advection.
INSElementIntegralEnergyAdvectionTempl(const InputParameters &parameters)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
auto raw_value(const Eigen::Map< T > &in)
static const std::string density
Definition NS.h:34
static const std::string cp
Definition NS.h:125
static const std::string temperature
Definition NS.h:60
static const std::string velocity
Definition NS.h:46