22 "Computes the Darcy friction factor using the Colebrook-White correlation.");
24 params.
addRequiredParam<MaterialPropertyName>(
"vel",
"x-component of the velocity");
27 params.
addRequiredParam<MaterialPropertyName>(
"f_D",
"Darcy friction factor material property");
28 params.
addRequiredParam<MaterialPropertyName>(
"mu",
"Dynamic viscosity material property");
30 params.
addParam<
Real>(
"roughness", 0,
"Surface roughness");
33 params.
addParam<
Real>(
"rtol", 1e-14,
"Relative tolerance for implicit solve.");
34 params.
addParam<
unsigned int>(
"max_iterations", 20,
"Max iterations for iterative solve.");
35 MooseEnum max_its_behavior{
"error warn accept",
"error"};
38 "Whether to error, warn or accept when max iterations is reached");
45 _f_D_name(getParam<MaterialPropertyName>(
"f_D")),
46 _f_D(declareADProperty<
Real>(_f_D_name)),
48 _mu(getADMaterialProperty<
Real>(
"mu")),
49 _rho(getADMaterialProperty<
Real>(
"rho")),
50 _vel(getADMaterialProperty<
Real>(
"vel")),
51 _D_h(getADMaterialProperty<
Real>(
"D_h")),
52 _roughness(getParam<
Real>(
"roughness")),
53 _max_its(getParam<unsigned
int>(
"max_iterations")),
54 _max_its_behavior(getParam<
MooseEnum>(
"max_iterations_behavior")),
55 _tol(getParam<
Real>(
"rtol"))
57 if (_tol < 0. || _tol >= 1.)
58 mooseError(
"Colebrook-White friction factor relative tolerance must be between 0 and 1");
67 mooseDoOnce(
mooseWarning(
"Calculated Reynolds number below 4000 (",
69 "), consider using different friction factor"));
82 if (
abs(f_D - f_D_old) / f_D <
_tol)
89 mooseError(
"Colebrook-White friction factor maximum iterations reached: ",
_max_its,
".");
92 "Colebrook-White friction factor maximum iterations reached: ",
_max_its,
"."));
MetaPhysicL::DualNumber< V, D, asd > abs(const MetaPhysicL::DualNumber< V, D, asd > &a)
const ADMaterialProperty< Real > & _rho
Density of the phase.
const unsigned int _max_its
max iterations for iterative solve
const Real & _roughness
Roughness of the surface.
virtual void computeQpProperties()
const ADMaterialProperty< Real > & _D_h
Hydraulic diameter.
auto Reynolds(const T1 &volume_fraction, const T2 &rho, const T3 &vel, const T4 &D_h, const T5 &mu)
Compute Reynolds number.
Computes drag coefficient using the Colebrook-White formula for the Darcy friction factor...
ADMaterialProperty< Real > & _f_D
const ADMaterialProperty< Real > & _mu
Dynamic viscosity.
static InputParameters validParams()
static InputParameters validParams()
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template * sqrt(_arg)) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(tanh
ADWallFrictionColebrookWhiteMaterial(const InputParameters ¶meters)
const ADMaterialProperty< Real > & _vel
Velocity (x-component)
void mooseWarning(Args &&... args) const
const Real _tol
Tolerance for implicit solve.
MooseEnum _max_its_behavior
Whether to error, warn or accept on reaching max its.
void mooseError(Args &&... args) const
registerMooseObject("ThermalHydraulicsApp", ADWallFrictionColebrookWhiteMaterial)
void ErrorVector unsigned int