www.mooseframework.org
CNSFVIdealGasEntropyL2Error.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 
9 
10 template <>
11 InputParameters
13 {
14  InputParameters params = validParams<ElementIntegralPostprocessor>();
15 
16  params.addClassDescription("A PostProcessor object to calculate the L2 error of ideal gas "
17  "entropy production for the CNS equations.");
18 
19  params.addRequiredParam<UserObjectName>("fluid_properties",
20  "Name for fluid properties user object");
21 
22  params.addRequiredParam<Real>("infinity_density", "Infinity density");
23 
24  params.addRequiredParam<Real>("infinity_pressure", "Infinity pressure");
25 
26  return params;
27 }
28 
30  : ElementIntegralPostprocessor(parameters),
31  _fp(getUserObject<SinglePhaseFluidProperties>("fluid_properties")),
32  _inf_rho(getParam<Real>("infinity_density")),
33  _inf_pres(getParam<Real>("infinity_pressure")),
34  _rho(getMaterialProperty<Real>("rho")),
35  _pres(getMaterialProperty<Real>("pressure")),
36  _gamma(getMaterialProperty<Real>("gamma"))
37 {
38 }
39 
40 Real
42 {
43  return std::sqrt(ElementIntegralPostprocessor::getValue());
44 }
45 
46 Real
48 {
49  Real diff = (_pres[_qp] / _inf_pres) * std::pow(_inf_rho / _rho[_qp], _gamma[_qp]) - 1.;
50 
51  return diff * diff;
52 }
const MaterialProperty< Real > & _pres
InputParameters validParams< CNSFVIdealGasEntropyL2Error >()
const MaterialProperty< Real > & _gamma
CNSFVIdealGasEntropyL2Error(const InputParameters &parameters)
Common class for single phase fluid properties.
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
virtual Real getValue()
Get the ideal gas entropy L2 error.
const MaterialProperty< Real > & _rho