www.mooseframework.org
NSMachAux.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 
8 // Navier-Stokes includes
9 #include "NSMachAux.h"
10 #include "NS.h"
11 
12 // FluidProperties includes
14 
15 // MOOSE includes
16 #include "MooseMesh.h"
17 
18 template <>
19 InputParameters
21 {
22  InputParameters params = validParams<AuxKernel>();
23 
24  params.addClassDescription(
25  "Auxiliary kernel for computing the Mach number assuming an ideal gas.");
26  params.addRequiredCoupledVar(NS::velocity_x, "x-velocity");
27  params.addCoupledVar(NS::velocity_y, "y-velocity"); // Only required in >= 2D
28  params.addCoupledVar(NS::velocity_z, "z-velocity"); // Only required in 3D...
29  params.addRequiredCoupledVar(NS::specific_volume, "specific volume");
30  params.addRequiredCoupledVar(NS::internal_energy, "internal energy");
31  params.addRequiredParam<UserObjectName>("fluid_properties",
32  "The name of the user object for fluid properties");
33 
34  return params;
35 }
36 
37 NSMachAux::NSMachAux(const InputParameters & parameters)
38  : AuxKernel(parameters),
39  _u_vel(coupledValue(NS::velocity_x)),
40  _v_vel(_mesh.dimension() >= 2 ? coupledValue(NS::velocity_y) : _zero),
41  _w_vel(_mesh.dimension() == 3 ? coupledValue(NS::velocity_z) : _zero),
42  _specific_volume(coupledValue(NS::specific_volume)),
43  _internal_energy(coupledValue(NS::internal_energy)),
44  _fp(getUserObject<IdealGasFluidProperties>("fluid_properties"))
45 {
46 }
47 
48 Real
50 {
51  return RealVectorValue(_u_vel[_qp], _v_vel[_qp], _w_vel[_qp]).norm() /
53 }
Definition: NS.h:13
const VariableValue & _w_vel
Definition: NSMachAux.h:35
const IdealGasFluidProperties & _fp
Definition: NSMachAux.h:40
const std::string velocity_z
Definition: NS.h:23
const std::string velocity_x
Definition: NS.h:21
InputParameters validParams< NSMachAux >()
Definition: NSMachAux.C:20
const VariableValue & _v_vel
Definition: NSMachAux.h:34
const std::string specific_volume
Definition: NS.h:29
virtual Real c(Real v, Real u) const override
Sound speed.
const std::string velocity_y
Definition: NS.h:22
const VariableValue & _internal_energy
Definition: NSMachAux.h:37
const VariableValue & _u_vel
Definition: NSMachAux.h:33
NSMachAux(const InputParameters &parameters)
Definition: NSMachAux.C:37
const std::string internal_energy
Definition: NS.h:28
Ideal gas fluid properties.
const VariableValue & _specific_volume
Definition: NSMachAux.h:36
virtual Real computeValue()
Definition: NSMachAux.C:49