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