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 "ADVectorVelocityComponentAux.h" 11 : 12 : registerMooseObject("ThermalHydraulicsApp", ADVectorVelocityComponentAux); 13 : 14 : InputParameters 15 20157 : ADVectorVelocityComponentAux::validParams() 16 : { 17 20157 : InputParameters params = AuxKernel::validParams(); 18 40314 : params.addRequiredCoupledVar("arhoA", "alpha*rho*A"); 19 40314 : params.addRequiredCoupledVar("arhouA", "alpha*rho*u*A"); 20 40314 : params.addRequiredParam<MaterialPropertyName>("direction", 21 : "Directional vector of 1D elements in 3D space"); 22 40314 : params.addRequiredParam<unsigned int>("component", "The vector component of interest"); 23 20157 : params.addClassDescription("Computes the velocity from the 1D phase-fraction and area weighted " 24 : "momentum and density variables."); 25 20157 : return params; 26 0 : } 27 : 28 11016 : ADVectorVelocityComponentAux::ADVectorVelocityComponentAux(const InputParameters & parameters) 29 : : AuxKernel(parameters), 30 11016 : _arhoA(coupledValue("arhoA")), 31 11016 : _arhouA(coupledValue("arhouA")), 32 11016 : _dir(getMaterialProperty<RealVectorValue>("direction")), 33 33048 : _component(getParam<unsigned int>("component")) 34 : { 35 11016 : if (isNodal()) 36 0 : mooseError(name(), ": Does not support nodal variables."); 37 11016 : } 38 : 39 : Real 40 1028334 : ADVectorVelocityComponentAux::computeValue() 41 : { 42 1028334 : return _dir[_qp](_component) * _arhouA[_qp] / _arhoA[_qp]; 43 : }