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 "ADReynoldsNumberMaterial.h" 11 : #include "SinglePhaseFluidProperties.h" 12 : #include "Numerics.h" 13 : #include "FlowModelSinglePhase.h" 14 : #include "MathUtils.h" 15 : 16 : registerMooseObject("ThermalHydraulicsApp", ADReynoldsNumberMaterial); 17 : 18 : InputParameters 19 85 : ADReynoldsNumberMaterial::validParams() 20 : { 21 85 : InputParameters params = Material::validParams(); 22 : 23 170 : params.addParam<MaterialPropertyName>( 24 : "Re", FlowModelSinglePhase::REYNOLDS_NUMBER, "Reynolds number property name"); 25 170 : params.addParam<MaterialPropertyName>( 26 : "rho", FlowModelSinglePhase::DENSITY, "Density of the phase"); 27 170 : params.addParam<MaterialPropertyName>( 28 : "vel", FlowModelSinglePhase::VELOCITY, "Velocity of the phase"); 29 170 : params.addParam<MaterialPropertyName>( 30 : "D_h", FlowModelSinglePhase::HYDRAULIC_DIAMETER, "Hydraulic diameter"); 31 170 : params.addParam<MaterialPropertyName>( 32 : "mu", FlowModelSinglePhase::DYNAMIC_VISCOSITY, "Dynamic viscosity of the phase"); 33 : 34 85 : params.addClassDescription("Computes Reynolds number as a material property"); 35 : 36 85 : return params; 37 0 : } 38 : 39 66 : ADReynoldsNumberMaterial::ADReynoldsNumberMaterial(const InputParameters & parameters) 40 : : Material(parameters), 41 : 42 66 : _Re_name(getParam<MaterialPropertyName>("Re")), 43 : 44 132 : _rho(getADMaterialProperty<Real>("rho")), 45 : 46 132 : _vel(getADMaterialProperty<Real>("vel")), 47 : 48 132 : _D_h(getADMaterialProperty<Real>("D_h")), 49 : 50 132 : _mu(getADMaterialProperty<Real>("mu")), 51 : 52 132 : _Re(declareADProperty<Real>(_Re_name)) 53 : 54 : { 55 66 : } 56 : 57 : void 58 9 : ADReynoldsNumberMaterial::computeQpProperties() 59 : { 60 9 : _Re[_qp] = THM::Reynolds(1., _rho[_qp], _vel[_qp], _D_h[_qp], _mu[_qp]); 61 9 : }