https://mooseframework.inl.gov
MachNumberAux.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 "MachNumberAux.h"
12 #include "Numerics.h"
13 
14 registerMooseObject("ThermalHydraulicsApp", MachNumberAux);
15 
18 {
20  params.addClassDescription("Computes Mach number.");
21  params.addRequiredCoupledVar("vel", "x-component of phase velocity");
22  params.addRequiredCoupledVar("v", "Specific volume");
23  params.addRequiredCoupledVar("e", "Specific internal energy");
24  params.addRequiredParam<UserObjectName>("fp", "The name of fluid properties object to use.");
25  return params;
26 }
27 
29  : AuxKernel(parameters),
30  _vel(coupledValue("vel")),
31  _v(coupledValue("v")),
32  _e(coupledValue("e")),
33  _fp(getUserObject<SinglePhaseFluidProperties>("fp"))
34 {
35 }
36 
37 Real
39 {
40  Real speed_of_sound = _fp.c_from_v_e(_v[_qp], _e[_qp]);
41  return _vel[_qp] / speed_of_sound;
42 }
const VariableValue & _e
Definition: MachNumberAux.h:29
Computes Mach number.
Definition: MachNumberAux.h:19
void addRequiredParam(const std::string &name, const std::string &doc_string)
registerMooseObject("ThermalHydraulicsApp", MachNumberAux)
const VariableValue & _v
Definition: MachNumberAux.h:28
const SinglePhaseFluidProperties & _fp
Definition: MachNumberAux.h:31
Common class for single phase fluid properties.
virtual Real computeValue()
Definition: MachNumberAux.C:38
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static InputParameters validParams()
Definition: MachNumberAux.C:17
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
MachNumberAux(const InputParameters &parameters)
Definition: MachNumberAux.C:28
const VariableValue & _vel
Definition: MachNumberAux.h:27