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 "WallFrictionChurchillMaterial.h" 11 : #include "WallFrictionModels.h" 12 : #include "Numerics.h" 13 : 14 : registerMooseObject("ThermalHydraulicsApp", WallFrictionChurchillMaterial); 15 : 16 : InputParameters 17 39 : WallFrictionChurchillMaterial::validParams() 18 : { 19 39 : InputParameters params = Material::validParams(); 20 39 : params.addClassDescription("Computes the Darcy friction factor using the Churchill correlation."); 21 78 : params.addRequiredCoupledVar("rhoA", "Mass equation variable: rho*A"); 22 78 : params.addRequiredCoupledVar("rhouA", "Momentum equation variable: rho*u*A"); 23 78 : params.addRequiredCoupledVar("rhoEA", "Total energy equation variable: rho*E*A"); 24 78 : params.addRequiredParam<MaterialPropertyName>("rho", "Density"); 25 78 : params.addRequiredParam<MaterialPropertyName>("vel", "x-component of the velocity"); 26 78 : params.addRequiredParam<MaterialPropertyName>("D_h", "hydraulic diameter"); 27 : 28 78 : params.addRequiredParam<MaterialPropertyName>("f_D", "Darcy friction factor material property"); 29 78 : params.addRequiredParam<MaterialPropertyName>("mu", "Dynamic viscosity material property"); 30 : 31 78 : params.addRequiredParam<Real>("roughness", "Surface roughness"); 32 78 : params.declareControllable("roughness"); 33 39 : return params; 34 0 : } 35 : 36 30 : WallFrictionChurchillMaterial::WallFrictionChurchillMaterial(const InputParameters & parameters) 37 : : DerivativeMaterialInterfaceTHM<Material>(parameters), 38 60 : _f_D_name(getParam<MaterialPropertyName>("f_D")), 39 30 : _f_D(declareProperty<Real>(_f_D_name)), 40 30 : _df_D_drhoA(declarePropertyDerivativeTHM<Real>(_f_D_name, "rhoA")), 41 30 : _df_D_drhouA(declarePropertyDerivativeTHM<Real>(_f_D_name, "rhouA")), 42 30 : _df_D_drhoEA(declarePropertyDerivativeTHM<Real>(_f_D_name, "rhoEA")), 43 : 44 60 : _mu(getMaterialProperty<Real>("mu")), 45 60 : _rho(getMaterialProperty<Real>("rho")), 46 60 : _vel(getMaterialProperty<Real>("vel")), 47 60 : _D_h(getMaterialProperty<Real>("D_h")), 48 90 : _roughness(getParam<Real>("roughness")) 49 : { 50 30 : } 51 : 52 : void 53 54 : WallFrictionChurchillMaterial::computeQpProperties() 54 : { 55 54 : Real Re = THM::Reynolds(1., _rho[_qp], _vel[_qp], _D_h[_qp], _mu[_qp]); 56 : 57 54 : const Real f_F = WallFriction::FanningFrictionFactorChurchill(Re, _roughness, _D_h[_qp]); 58 : 59 54 : _f_D[_qp] = WallFriction::DarcyFrictionFactor(f_F); 60 54 : _df_D_drhoA[_qp] = 0; 61 54 : _df_D_drhouA[_qp] = 0; 62 54 : _df_D_drhoEA[_qp] = 0; 63 54 : }