www.mooseframework.org
StagnationPressureAux.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 
10 
11 template <>
12 InputParameters
14 {
15  InputParameters params = validParams<AuxKernel>();
16  params.addRequiredCoupledVar("e", "Specific internal energy");
17  params.addRequiredCoupledVar("v", "Specific volume");
18  params.addRequiredCoupledVar("vel", "Velocity");
19  params.addRequiredParam<UserObjectName>("fp", "The name of the user object for fluid properties");
20  params.addClassDescription(
21  "Computes stagnation pressure from specific volume, specific internal energy, and velocity");
22  return params;
23 }
24 
25 StagnationPressureAux::StagnationPressureAux(const InputParameters & parameters)
26  : AuxKernel(parameters),
27  _specific_volume(coupledValue("v")),
28  _specific_internal_energy(coupledValue("e")),
29  _velocity(coupledValue("vel")),
30  _fp(getUserObject<SinglePhaseFluidProperties>("fp"))
31 {
32 }
33 
34 Real
36 {
37  // static properties
38  const Real v = _specific_volume[_qp];
39  const Real e = _specific_internal_energy[_qp];
40  const Real u = _velocity[_qp];
41  const Real p = _fp.pressure(v, e);
42 
43  // static entropy is equal to stagnation entropy by definition of the stagnation state
44  const Real s = _fp.s(v, e);
45 
46  // stagnation enthalpy
47  const Real h0 = e + p * v + 0.5 * u * u;
48 
49  return _fp.p_from_h_s(h0, s);
50 }
virtual Real s(Real v, Real u) const =0
Specific entropy [ J / kg K ].
Common class for single phase fluid properties.
virtual Real p_from_h_s(Real h, Real s) const =0
Pressure as a function of specific enthalpy and specific entropy.
StagnationPressureAux(const InputParameters &parameters)
const VariableValue & _velocity
const VariableValue & _specific_volume
virtual Real computeValue() override
const SinglePhaseFluidProperties & _fp
virtual Real pressure(Real v, Real u) const =0
Pressure as a function of specific internal energy and specific volume.
InputParameters validParams< StagnationPressureAux >()
const VariableValue & _specific_internal_energy