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