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 "ReynoldsNumberAux.h" 11 : #include "SinglePhaseFluidProperties.h" 12 : #include "Numerics.h" 13 : 14 : registerMooseObject("ThermalHydraulicsApp", ReynoldsNumberAux); 15 : 16 : InputParameters 17 41 : ReynoldsNumberAux::validParams() 18 : { 19 41 : InputParameters params = AuxKernel::validParams(); 20 41 : params.addClassDescription("Computes the Reynolds number."); 21 82 : params.addCoupledVar("alpha", 1, "Volume fraction of the phase"); 22 82 : params.addRequiredCoupledVar("rho", "Density of the phase"); 23 82 : params.addRequiredCoupledVar("vel", "Component of phase velocity aligned with the flow"); 24 82 : params.addRequiredCoupledVar("D_h", "Hydraulic diameter"); 25 82 : params.addRequiredCoupledVar("v", "Specific volume"); 26 82 : params.addRequiredCoupledVar("e", "Specific internal energy"); 27 82 : params.addRequiredParam<UserObjectName>("fp", 28 : "The name of the user object with fluid properties"); 29 41 : return params; 30 0 : } 31 : 32 22 : ReynoldsNumberAux::ReynoldsNumberAux(const InputParameters & parameters) 33 : : AuxKernel(parameters), 34 22 : _alpha(coupledValue("alpha")), 35 22 : _rho(coupledValue("rho")), 36 22 : _vel(coupledValue("vel")), 37 22 : _D_h(coupledValue("D_h")), 38 22 : _v(coupledValue("v")), 39 22 : _e(coupledValue("e")), 40 44 : _fp(getUserObject<SinglePhaseFluidProperties>("fp")) 41 : { 42 22 : } 43 : 44 : Real 45 9 : ReynoldsNumberAux::computeValue() 46 : { 47 9 : Real visc = _fp.mu_from_v_e(_v[_qp], _e[_qp]); 48 9 : return THM::Reynolds(_alpha[_qp], _rho[_qp], _vel[_qp], _D_h[_qp], visc); 49 : }