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 "WallFrictionModels.h" 11 : #include "Numerics.h" 12 : #include "ADReal.h" 13 : 14 : namespace WallFriction 15 : { 16 : 17 : Real 18 123 : DarcyFrictionFactor(const Real & f_F) 19 : { 20 123 : return 4 * f_F; 21 : } 22 : 23 : ADReal 24 1888287 : DarcyFrictionFactor(const ADReal & f_F) 25 : { 26 1888287 : return 4 * f_F; 27 : } 28 : 29 : Real 30 124 : FanningFrictionFactorChurchill(Real Re, Real roughness, Real Dh) 31 : { 32 124 : Real Re_limit = std::max(Re, 10.0); 33 : 34 : Real a = 35 124 : std::pow(2.457 * std::log(1.0 / (std::pow(7.0 / Re_limit, 0.9) + 0.27 * roughness / Dh)), 16); 36 124 : Real b = std::pow(3.753e4 / Re_limit, 16); 37 124 : return 2.0 * std::pow(std::pow(8.0 / Re_limit, 12) + 1.0 / std::pow(a + b, 1.5), 1.0 / 12.0); 38 : } 39 : 40 : ADReal 41 1883782 : FanningFrictionFactorChurchill(ADReal Re, ADReal roughness, ADReal Dh) 42 : { 43 1883782 : ADReal Re_limit = std::max(Re, 10.0); 44 : 45 : ADReal a = 46 11302692 : std::pow(2.457 * std::log(1.0 / (std::pow(7.0 / Re_limit, 0.9) + 0.27 * roughness / Dh)), 16); 47 3767564 : ADReal b = std::pow(3.753e4 / Re_limit, 16); 48 11302692 : return 2.0 * std::pow(std::pow(8.0 / Re_limit, 12) + 1.0 / std::pow(a + b, 1.5), 1.0 / 12.0); 49 : } 50 : }