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 : #pragma once 11 : 12 : #include "libmesh/libmesh_common.h" 13 : #include "ADReal.h" 14 : 15 : using namespace libMesh; 16 : 17 : namespace WallFriction 18 : { 19 : 20 : /** 21 : * Computes Darcy friction factor from Fanning friction factor 22 : * 23 : * @param[in] f_F Fanning friction factor 24 : */ 25 : Real DarcyFrictionFactor(const Real & f_F); 26 : ADReal DarcyFrictionFactor(const ADReal & f_F); 27 : 28 : /** 29 : * Computes Fanning friction factor using Churchill correlation 30 : * 31 : * @param Re Reynolds number 32 : * @param roughness The roughness of the surface 33 : * @param D_h Hydraulic diameter 34 : */ 35 : Real FanningFrictionFactorChurchill(Real Re, Real roughness, Real D_h); 36 : ADReal FanningFrictionFactorChurchill(ADReal Re, ADReal roughness, ADReal D_h); 37 : 38 : /** 39 : * Computes Fanning friction factor using Cheng-Todreas correlation 40 : * 41 : * @param Re Reynolds number 42 : * @param a Correlation constant 43 : * @param b Correlation constant 44 : * @param c Correlation constant 45 : * @param n Correlation constant 46 : * @param PoD Pitch-to-diameter ratio 47 : */ 48 : 49 : template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6> 50 : auto 51 4505 : FanningFrictionFactorCheng( 52 : const T1 & Re, const T2 & a, const T3 & b, const T4 & c, const T5 & n, const T6 & PoD) 53 : { 54 13515 : return (a + b * (PoD - 1) + c * std::pow(PoD - 1, 2)) / std::pow(std::max(Re, 10.0), n); 55 : } 56 : }