https://mooseframework.inl.gov
navier_stokes
src
postprocessors
NSEntropyError.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
// Navier-Stokes includes
11
#include "
NSEntropyError.h
"
12
#include "
NS.h
"
13
14
// FluidProperties includes
15
#include "
IdealGasFluidProperties.h
"
16
17
registerMooseObject
(
"NavierStokesApp"
,
NSEntropyError
);
18
19
InputParameters
20
NSEntropyError::validParams
()
21
{
22
InputParameters
params =
ElementIntegralPostprocessor::validParams
();
23
params.
addClassDescription
(
"Computes entropy error."
);
24
params.
addRequiredParam
<
Real
>(
"rho_infty"
,
"Freestream density"
);
25
params.
addRequiredParam
<
Real
>(
"p_infty"
,
"Freestream pressure"
);
26
params.
addRequiredCoupledVar
(
"rho"
,
"density"
);
27
params.
addRequiredCoupledVar
(
NS::pressure
,
"pressure"
);
28
params.
addRequiredParam
<UserObjectName>(
"fluid_properties"
,
29
"The name of the user object for fluid properties"
);
30
return
params;
31
}
32
33
NSEntropyError::NSEntropyError
(
const
InputParameters
& parameters)
34
:
ElementIntegralPostprocessor
(parameters),
35
_rho_infty(getParam<
Real
>(
"rho_infty"
)),
36
_p_infty(getParam<
Real
>(
"p_infty"
)),
37
_rho(coupledValue(
"rho"
)),
38
_pressure(coupledValue(
NS
::
pressure
)),
39
_fp(getUserObject<
IdealGasFluidProperties
>(
"fluid_properties"
))
40
{
41
}
42
43
Real
44
NSEntropyError::getValue
()
const
45
{
46
return
std::sqrt(
ElementIntegralPostprocessor::getValue
());
47
}
48
49
Real
50
NSEntropyError::computeQpIntegral
()
51
{
52
Real
integrand
= (
_pressure
[
_qp
] /
_p_infty
) *
std::pow
(
_rho_infty
/
_rho
[
_qp
],
_fp
.
gamma
()) - 1.;
53
return
integrand
*
integrand
;
54
}
NS
Definition:
NavierStokesMethods.h:20
ElementIntegralPostprocessor
registerMooseObject
registerMooseObject("NavierStokesApp", NSEntropyError)
IdealGasFluidProperties.h
NSEntropyError::_p_infty
Real _p_infty
Definition:
NSEntropyError.h:29
NSEntropyError::getValue
virtual Real getValue() const override
Definition:
NSEntropyError.C:44
ElementIntegralPostprocessor::_qp
unsigned int _qp
IdealGasFluidProperties::gamma
virtual Real gamma() const
Definition:
IdealGasFluidProperties.h:148
NSEntropyError::computeQpIntegral
virtual Real computeQpIntegral() override
Definition:
NSEntropyError.C:50
NSEntropyError::NSEntropyError
NSEntropyError(const InputParameters ¶meters)
Definition:
NSEntropyError.C:33
InputParameters::addRequiredParam
void addRequiredParam(const std::string &name, const std::string &doc_string)
integrand
Real integrand(const Point &p)
InputParameters
NSEntropyError.h
ElementIntegralPostprocessor::validParams
static InputParameters validParams()
NSEntropyError::_pressure
const VariableValue & _pressure
Definition:
NSEntropyError.h:32
NSEntropyError::_rho
const VariableValue & _rho
Definition:
NSEntropyError.h:31
ElementIntegralPostprocessor::getValue
virtual Real getValue() const override
NSEntropyError::validParams
static InputParameters validParams()
Definition:
NSEntropyError.C:20
NSEntropyError
Definition:
NSEntropyError.h:17
InputParameters::addRequiredCoupledVar
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
NS.h
NSEntropyError::_rho_infty
Real _rho_infty
Definition:
NSEntropyError.h:28
Real
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
NSEntropyError::_fp
const IdealGasFluidProperties & _fp
Definition:
NSEntropyError.h:35
NS::pressure
static const std::string pressure
Definition:
NS.h:56
InputParameters::addClassDescription
void addClassDescription(const std::string &doc_string)
IdealGasFluidProperties
Ideal gas fluid properties Default parameters are for air at atmospheric pressure and temperature...
Definition:
IdealGasFluidProperties.h:22
std::pow
MooseUnits pow(const MooseUnits &, int)
Generated on Thu Jul 17 2025 01:44:06 for https://mooseframework.inl.gov by
1.8.14