www.mooseframework.org
NSEntropyError.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
8 // Navier-Stokes includes
9 #include "NSEntropyError.h"
10 #include "NS.h"
11 
12 // FluidProperties includes
14 
15 template <>
16 InputParameters
18 {
19  InputParameters params = validParams<ElementIntegralPostprocessor>();
20  params.addClassDescription("Computes entropy error.");
21  params.addRequiredParam<Real>("rho_infty", "Freestream density");
22  params.addRequiredParam<Real>("p_infty", "Freestream pressure");
23  params.addRequiredCoupledVar(NS::density, "density");
24  params.addRequiredCoupledVar(NS::pressure, "pressure");
25  params.addRequiredParam<UserObjectName>("fluid_properties",
26  "The name of the user object for fluid properties");
27  return params;
28 }
29 
30 NSEntropyError::NSEntropyError(const InputParameters & parameters)
31  : ElementIntegralPostprocessor(parameters),
32  _rho_infty(getParam<Real>("rho_infty")),
33  _p_infty(getParam<Real>("p_infty")),
34  _rho(coupledValue(NS::density)),
35  _pressure(coupledValue(NS::pressure)),
36  _fp(getUserObject<IdealGasFluidProperties>("fluid_properties"))
37 {
38 }
39 
40 Real
42 {
43  return std::sqrt(ElementIntegralPostprocessor::getValue());
44 }
45 
46 Real
48 {
49  Real integrand = (_pressure[_qp] / _p_infty) * std::pow(_rho_infty / _rho[_qp], _fp.gamma()) - 1.;
50  return integrand * integrand;
51 }
Definition: NS.h:13
virtual Real computeQpIntegral()
virtual Real getValue()
const std::string density
Definition: NS.h:15
InputParameters validParams< NSEntropyError >()
NSEntropyError(const InputParameters &parameters)
const VariableValue & _pressure
const VariableValue & _rho
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
virtual Real gamma(Real v=0., Real u=0.) const override
Compute the ratio of specific heats.
const IdealGasFluidProperties & _fp
const std::string pressure
Definition: NS.h:24
Ideal gas fluid properties.