https://mooseframework.inl.gov
VectorVelocityComponentAux.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 
11 
12 registerMooseObject("ThermalHydraulicsApp", VectorVelocityComponentAux);
13 
16 {
18  params.addRequiredCoupledVar("arhoA", "alpha*rho*A");
19  params.addRequiredCoupledVar("arhouA", "alpha*rho*u*A");
20  params.addRequiredParam<MaterialPropertyName>("direction",
21  "Directional vector of 1D elements in 3D space");
22  params.addRequiredParam<unsigned int>("component", "The vector component of interest");
23  params.addClassDescription("Computes the component of a vector-valued velocity field given by "
24  "its magnitude and direction.");
25  return params;
26 }
27 
29  : AuxKernel(parameters),
30  _arhoA(coupledValue("arhoA")),
31  _arhouA(coupledValue("arhouA")),
32  _dir(getMaterialProperty<RealVectorValue>("direction")),
33  _component(getParam<unsigned int>("component"))
34 {
35  if (isNodal())
36  mooseError(name(), ": Does not support nodal variables.");
37 }
38 
39 Real
41 {
42  mooseAssert(_arhoA[_qp] != 0, "alpha*rho*A is 0, unable to compute velocity");
43  return _dir[_qp](_component) * _arhouA[_qp] / _arhoA[_qp];
44 }
const VariableValue & _arhouA
Solution variable arhouA.
const unsigned int _component
Vector component to use.
registerMooseObject("ThermalHydraulicsApp", VectorVelocityComponentAux)
const MaterialProperty< RealVectorValue > & _dir
Direction.
virtual const std::string & name() const
void addRequiredParam(const std::string &name, const std::string &doc_string)
Computes the component of a vector (given by its magnitude and direction)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
VectorVelocityComponentAux(const InputParameters &parameters)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void mooseError(Args &&... args) const
static InputParameters validParams()
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
void ErrorVector unsigned int
const VariableValue & _arhoA
Solution variable arhoA.