https://mooseframework.inl.gov
Loading...
Searching...
No Matches
navier_stokes
src
postprocessors
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
10
#include "
INSElementIntegralEnergyAdvection.h
"
11
#include "
NS.h
"
12
13
#include "metaphysicl/raw_type.h"
14
15
registerMooseObject
(
"NavierStokesApp"
,
INSElementIntegralEnergyAdvection
);
16
registerMooseObject
(
"NavierStokesApp"
,
INSADElementIntegralEnergyAdvection
);
17
18
template
<
bool
is_ad>
19
InputParameters
20
INSElementIntegralEnergyAdvectionTempl<is_ad>::validParams
()
21
{
22
InputParameters
params =
ElementIntegralPostprocessor::validParams
();
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>
34
INSElementIntegralEnergyAdvectionTempl<is_ad>::INSElementIntegralEnergyAdvectionTempl
(
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
46
INSElementIntegralEnergyAdvectionTempl<is_ad>::computeQpIntegral
()
47
{
48
return
MetaPhysicL::raw_value
(_cp[_qp]) *
MetaPhysicL::raw_value
(_rho[_qp]) *
49
(_grad_T[_qp] * _velocity[_qp]);
50
}
51
52
template
class
INSElementIntegralEnergyAdvectionTempl<false>
;
53
template
class
INSElementIntegralEnergyAdvectionTempl<true>
;
registerMooseObject
registerMooseObject("NavierStokesApp", INSElementIntegralEnergyAdvection)
INSElementIntegralEnergyAdvection.h
NS.h
ElementIntegralPostprocessor
ElementIntegralPostprocessor::validParams
static InputParameters validParams()
INSElementIntegralEnergyAdvectionTempl
Template class for computing the global energy loss/gain due to advection.
Definition
INSElementIntegralEnergyAdvection.h:19
INSElementIntegralEnergyAdvectionTempl::validParams
static InputParameters validParams()
Definition
INSElementIntegralEnergyAdvection.C:20
INSElementIntegralEnergyAdvectionTempl::INSElementIntegralEnergyAdvectionTempl
INSElementIntegralEnergyAdvectionTempl(const InputParameters ¶meters)
Definition
INSElementIntegralEnergyAdvection.C:34
INSElementIntegralEnergyAdvectionTempl::computeQpIntegral
Real computeQpIntegral() override
Definition
INSElementIntegralEnergyAdvection.C:46
InputParameters::addRequiredCoupledVar
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
InputParameters::addRequiredParam
void addRequiredParam(const std::string &name, const std::string &doc_string)
InputParameters::addClassDescription
void addClassDescription(const std::string &doc_string)
MetaPhysicL::raw_value
auto raw_value(const Eigen::Map< T > &in)
NS
Definition
NavierStokesMethods.h:21
NS::density
static const std::string density
Definition
NS.h:34
NS::cp
static const std::string cp
Definition
NS.h:125
NS::temperature
static const std::string temperature
Definition
NS.h:60
NS::velocity
static const std::string velocity
Definition
NS.h:46
InputParameters
Generated on Fri Aug 21 2026 13:41:15 for https://mooseframework.inl.gov by
1.9.8