www.mooseframework.org
StagnationTemperatureAux.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 
12 
13 registerMooseObject("FluidPropertiesApp", StagnationTemperatureAux);
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("Computes stagnation temperature from specific volume, specific "
24  "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 properties
50  const Real h0 = e + p * v + 0.5 * u * u;
51  const Real p0 = _fp.p_from_h_s(h0, s);
52  const Real rho0 = _fp.rho_from_p_s(p0, s);
53  const Real e0 = _fp.e_from_p_rho(p0, rho0);
54 
55  return _fp.T_from_v_e(1.0 / rho0, e0);
56 }
static InputParameters validParams()
void addRequiredParam(const std::string &name, const std::string &doc_string)
StagnationTemperatureAux(const InputParameters &parameters)
const VariableValue & _specific_volume
const SinglePhaseFluidProperties & _fp
Common class for single phase fluid properties.
const VariableValue & _specific_internal_energy
virtual Real computeValue() override
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
registerMooseObject("FluidPropertiesApp", StagnationTemperatureAux)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::string v
Definition: NS.h:82
const VariableValue & _velocity
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
Compute stagnation temperature from specific volume, specific internal energy, and velocity...