https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
14registerMooseObject("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
37Real
39{
40 Real speed_of_sound = _fp.c_from_v_e(_v[_qp], _e[_qp]);
41 return _vel[_qp] / speed_of_sound;
42}
registerMooseObject("ThermalHydraulicsApp", MachNumberAux)
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)
Computes Mach number.
const VariableValue & _v
static InputParameters validParams()
virtual Real computeValue()
const VariableValue & _vel
MachNumberAux(const InputParameters &parameters)
const SinglePhaseFluidProperties & _fp
const VariableValue & _e
Common class for single phase fluid properties.