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 
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("Computes stagnation temperature from specific volume, specific "
25  "internal energy, and velocity");
26  return params;
27 }
28 
29 StagnationTemperatureAux::StagnationTemperatureAux(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 properties
51  const Real h0 = e + p * v + 0.5 * u * u;
52  const Real p0 = _fp.p_from_h_s(h0, s);
53  const Real rho0 = _fp.rho_from_p_s(p0, s);
54  const Real e0 = _fp.e_from_p_rho(p0, rho0);
55 
56  return _fp.T_from_v_e(1.0 / rho0, e0);
57 }
StagnationTemperatureAux::StagnationTemperatureAux
StagnationTemperatureAux(const InputParameters &parameters)
Definition: StagnationTemperatureAux.C:29
registerMooseObject
registerMooseObject("FluidPropertiesApp", StagnationTemperatureAux)
SinglePhaseFluidProperties
Common class for single phase fluid properties.
Definition: SinglePhaseFluidProperties.h:89
StagnationTemperatureAux::_fp
const SinglePhaseFluidProperties & _fp
Definition: StagnationTemperatureAux.h:35
SinglePhaseFluidProperties.h
StagnationTemperatureAux::computeValue
virtual Real computeValue() override
Definition: StagnationTemperatureAux.C:39
StagnationTemperatureAux::_specific_internal_energy
const VariableValue & _specific_internal_energy
Definition: StagnationTemperatureAux.h:32
validParams< StagnationTemperatureAux >
InputParameters validParams< StagnationTemperatureAux >()
Definition: StagnationTemperatureAux.C:17
StagnationTemperatureAux
Compute stagnation temperature from specific volume, specific internal energy, and velocity.
Definition: StagnationTemperatureAux.h:23
StagnationTemperatureAux.h
StagnationTemperatureAux::_specific_volume
const VariableValue & _specific_volume
Definition: StagnationTemperatureAux.h:31
StagnationTemperatureAux::_velocity
const VariableValue & _velocity
Definition: StagnationTemperatureAux.h:33