Line data Source code
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 "VectorVelocityComponentAux.h" 11 : 12 : registerMooseObject("ThermalHydraulicsApp", VectorVelocityComponentAux); 13 : 14 : InputParameters 15 0 : VectorVelocityComponentAux::validParams() 16 : { 17 0 : InputParameters params = AuxKernel::validParams(); 18 0 : params.addRequiredCoupledVar("arhoA", "alpha*rho*A"); 19 0 : params.addRequiredCoupledVar("arhouA", "alpha*rho*u*A"); 20 0 : params.addRequiredParam<MaterialPropertyName>("direction", 21 : "Directional vector of 1D elements in 3D space"); 22 0 : params.addRequiredParam<unsigned int>("component", "The vector component of interest"); 23 0 : params.addClassDescription("Computes the component of a vector-valued velocity field given by " 24 : "its magnitude and direction."); 25 0 : return params; 26 0 : } 27 : 28 0 : VectorVelocityComponentAux::VectorVelocityComponentAux(const InputParameters & parameters) 29 : : AuxKernel(parameters), 30 0 : _arhoA(coupledValue("arhoA")), 31 0 : _arhouA(coupledValue("arhouA")), 32 0 : _dir(getMaterialProperty<RealVectorValue>("direction")), 33 0 : _component(getParam<unsigned int>("component")) 34 : { 35 0 : if (isNodal()) 36 0 : mooseError(name(), ": Does not support nodal variables."); 37 0 : } 38 : 39 : Real 40 0 : VectorVelocityComponentAux::computeValue() 41 : { 42 : mooseAssert(_arhoA[_qp] != 0, "alpha*rho*A is 0, unable to compute velocity"); 43 0 : return _dir[_qp](_component) * _arhouA[_qp] / _arhoA[_qp]; 44 : }