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