www.mooseframework.org
StagnationPressureAux.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 #include "StagnationPressureAux.h"
12 
13 registerMooseObject("FluidPropertiesApp", StagnationPressureAux);
14 
15 template <>
16 InputParameters
18 {
19  InputParameters params = validParams<AuxKernel>();
20  params.addRequiredCoupledVar("e", "Specific internal energy");
21  params.addRequiredCoupledVar("v", "Specific volume");
22  params.addRequiredCoupledVar("vel", "Velocity");
23  params.addRequiredParam<UserObjectName>("fp", "The name of the user object for fluid properties");
24  params.addClassDescription(
25  "Computes stagnation pressure from specific volume, specific internal energy, and velocity");
26  return params;
27 }
28 
29 StagnationPressureAux::StagnationPressureAux(const InputParameters & parameters)
30  : AuxKernel(parameters),
31  _specific_volume(coupledValue("v")),
32  _specific_internal_energy(coupledValue("e")),
33  _velocity(coupledValue("vel")),
34  _fp(getUserObject<SinglePhaseFluidProperties>("fp"))
35 {
36 }
37 
38 Real
40 {
41  // static properties
42  const Real v = _specific_volume[_qp];
43  const Real e = _specific_internal_energy[_qp];
44  const Real u = _velocity[_qp];
45  const Real p = _fp.p_from_v_e(v, e);
46 
47  // static entropy is equal to stagnation entropy by definition of the stagnation state
48  const Real s = _fp.s_from_v_e(v, e);
49 
50  // stagnation enthalpy
51  const Real h0 = e + p * v + 0.5 * u * u;
52 
53  return _fp.p_from_h_s(h0, s);
54 }
StagnationPressureAux.h
StagnationPressureAux::_specific_internal_energy
const VariableValue & _specific_internal_energy
Definition: StagnationPressureAux.h:32
SinglePhaseFluidProperties
Common class for single phase fluid properties.
Definition: SinglePhaseFluidProperties.h:89
StagnationPressureAux::_velocity
const VariableValue & _velocity
Definition: StagnationPressureAux.h:33
registerMooseObject
registerMooseObject("FluidPropertiesApp", StagnationPressureAux)
SinglePhaseFluidProperties.h
validParams< StagnationPressureAux >
InputParameters validParams< StagnationPressureAux >()
Definition: StagnationPressureAux.C:17
StagnationPressureAux::_fp
const SinglePhaseFluidProperties & _fp
Definition: StagnationPressureAux.h:35
StagnationPressureAux::_specific_volume
const VariableValue & _specific_volume
Definition: StagnationPressureAux.h:31
StagnationPressureAux
Compute stagnation pressure from specific volume, specific internal energy, and velocity.
Definition: StagnationPressureAux.h:23
StagnationPressureAux::StagnationPressureAux
StagnationPressureAux(const InputParameters &parameters)
Definition: StagnationPressureAux.C:29
StagnationPressureAux::computeValue
virtual Real computeValue() override
Definition: StagnationPressureAux.C:39