https://mooseframework.inl.gov
Loading...
Searching...
No Matches
StagnationTemperatureAux.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
12
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
37Real
39{
40 // static properties
41 const Real v = _specific_volume[_qp];
42 const Real e = _specific_internal_energy[_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}
const Real p
const double v
registerMooseObject("FluidPropertiesApp", StagnationTemperatureAux)
static InputParameters validParams()
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
Common class for single phase fluid properties.
Compute stagnation temperature from specific volume, specific internal energy, and velocity.
const VariableValue & _specific_volume
const SinglePhaseFluidProperties & _fp
const VariableValue & _specific_internal_energy
StagnationTemperatureAux(const InputParameters &parameters)
virtual Real computeValue() override
static InputParameters validParams()