www.mooseframework.org
StagnationTemperatureAux.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("Computes stagnation temperature from specific volume, specific "
21  "internal energy, and velocity");
22  return params;
23 }
24 
25 StagnationTemperatureAux::StagnationTemperatureAux(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 properties
47  const Real h0 = e + p * v + 0.5 * u * u;
48  const Real p0 = _fp.p_from_h_s(h0, s);
49  Real rho0, e0;
50  _fp.rho_e_ps(p0, s, rho0, e0);
51 
52  return _fp.temperature(1.0 / rho0, e0);
53 }
virtual Real s(Real v, Real u) const =0
Specific entropy [ J / kg K ].
InputParameters validParams< StagnationTemperatureAux >()
virtual Real temperature(Real v, Real u) const =0
Temperature as a function of specific internal energy and specific volume.
StagnationTemperatureAux(const InputParameters &parameters)
const VariableValue & _specific_volume
virtual void rho_e_ps(Real pressure, Real entropy, Real &rho, Real &e) const =0
Compute internal energy and density from specific entropy and pressure.
const SinglePhaseFluidProperties & _fp
Common class for single phase fluid properties.
const VariableValue & _specific_internal_energy
virtual Real computeValue() override
virtual Real p_from_h_s(Real h, Real s) const =0
Pressure as a function of specific enthalpy and specific entropy.
const VariableValue & _velocity
virtual Real pressure(Real v, Real u) const =0
Pressure as a function of specific internal energy and specific volume.