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 "ADWallFrictionChurchillMaterial.h" 11 : #include "WallFrictionModels.h" 12 : #include "Numerics.h" 13 : 14 : registerMooseObject("ThermalHydraulicsApp", ADWallFrictionChurchillMaterial); 15 : 16 : InputParameters 17 343 : ADWallFrictionChurchillMaterial::validParams() 18 : { 19 343 : InputParameters params = Material::validParams(); 20 343 : params.addClassDescription("Computes the Darcy friction factor using the Churchill correlation."); 21 686 : params.addRequiredParam<MaterialPropertyName>("rho", "Density"); 22 686 : params.addRequiredParam<MaterialPropertyName>("vel", "x-component of the velocity"); 23 686 : params.addRequiredParam<MaterialPropertyName>("D_h", "hydraulic diameter"); 24 : 25 686 : params.addRequiredParam<MaterialPropertyName>("f_D", "Darcy friction factor material property"); 26 686 : params.addRequiredParam<MaterialPropertyName>("mu", "Dynamic viscosity material property"); 27 : 28 686 : params.addParam<Real>("roughness", 0, "Surface roughness"); 29 686 : params.declareControllable("roughness"); 30 343 : return params; 31 0 : } 32 : 33 264 : ADWallFrictionChurchillMaterial::ADWallFrictionChurchillMaterial(const InputParameters & parameters) 34 : : Material(parameters), 35 528 : _f_D_name(getParam<MaterialPropertyName>("f_D")), 36 264 : _f_D(declareADProperty<Real>(_f_D_name)), 37 : 38 528 : _mu(getADMaterialProperty<Real>("mu")), 39 528 : _rho(getADMaterialProperty<Real>("rho")), 40 528 : _vel(getADMaterialProperty<Real>("vel")), 41 528 : _D_h(getADMaterialProperty<Real>("D_h")), 42 792 : _roughness(getParam<Real>("roughness")) 43 : { 44 264 : } 45 : 46 : void 47 21844 : ADWallFrictionChurchillMaterial::computeQpProperties() 48 : { 49 21844 : ADReal Re = THM::Reynolds(1, _rho[_qp], _vel[_qp], _D_h[_qp], _mu[_qp]); 50 : 51 21844 : const ADReal f_F = WallFriction::FanningFrictionFactorChurchill(Re, _roughness, _D_h[_qp]); 52 : 53 21844 : _f_D[_qp] = WallFriction::DarcyFrictionFactor(f_F); 54 21844 : }