www.mooseframework.org
CNSFVIdealGasTotalEnthalpyL2Error.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 total "
17  "enthalpy 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_x_velocity",
25  "Infinity velocity component in x-direction");
26 
27  params.addParam<Real>("infinity_y_velocity", 0., "Infinity velocity component in y-direction");
28 
29  params.addParam<Real>("infinity_z_velocity", 0., "Infinity velocity component in z-direction");
30 
31  params.addRequiredParam<Real>("infinity_pressure", "Infinity pressure");
32 
33  return params;
34 }
35 
37  const InputParameters & parameters)
38  : ElementIntegralPostprocessor(parameters),
39  _fp(getUserObject<SinglePhaseFluidProperties>("fluid_properties")),
40  _inf_rho(getParam<Real>("infinity_density")),
41  _inf_uadv(getParam<Real>("infinity_x_velocity")),
42  _inf_vadv(getParam<Real>("infinity_y_velocity")),
43  _inf_wadv(getParam<Real>("infinity_z_velocity")),
44  _inf_pres(getParam<Real>("infinity_pressure")),
45  _rho(getMaterialProperty<Real>("rho")),
46  _enth(getMaterialProperty<Real>("enthalpy")),
47  _gamma(getMaterialProperty<Real>("gamma"))
48 {
49 }
50 
51 Real
53 {
54  return std::sqrt(ElementIntegralPostprocessor::getValue());
55 }
56 
57 Real
59 {
60  Real diff =
61  _rho[_qp] * _enth[_qp] - _gamma[_qp] / (_gamma[_qp] - 1.) * _inf_pres -
63 
64  return diff * diff;
65 }
Common class for single phase fluid properties.
CNSFVIdealGasTotalEnthalpyL2Error(const InputParameters &parameters)
virtual Real getValue()
Get the ideal gas total enthalpy L2 error.
InputParameters validParams< CNSFVIdealGasTotalEnthalpyL2Error >()