https://mooseframework.inl.gov
FunctorPebbleBedDragCoefficients.h
Go to the documentation of this file.
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 
13 #include "NS.h"
14 
24 template <typename Derived>
26 {
27  friend class FunctorIsotropicDragCoefficients<Derived>;
28 
29 public:
31 
33 
34 protected:
35  template <typename Space, typename Time>
36  ADReal computeDarcyPrefactor(const Space & r, const Time & t);
37 
38  template <typename Space, typename Time>
39  ADReal computeForchheimerPrefactor(const Space & r, const Time & t);
40 
42  template <typename Space, typename Time>
43  ADReal computeHydraulicDiameter(const Space & r, const Time & t);
44 
47 
50 
52  const Real & _d_pebble;
53 };
54 
55 template <typename Derived>
58 {
61  NS::pebble_diameter, NS::pebble_diameter + " > 0.0", "Pebble diameter");
62  params.addRequiredParam<MooseFunctorName>(NS::porosity, "Porosity");
63 
64  params.addParam<MooseFunctorName>(NS::density, NS::density, "Density");
65  return params;
66 }
67 
68 template <typename Derived>
72  _eps(this->template getFunctor<ADReal>(NS::porosity)),
73  _rho(this->template getFunctor<ADReal>(NS::density)),
74  _d_pebble(this->template getParam<Real>(NS::pebble_diameter))
75 {
76 }
77 
78 template <typename Derived>
79 template <typename Space, typename Time>
80 ADReal
82 {
83  const auto Dh = computeHydraulicDiameter(r, t);
84  return 1 / (Dh * Dh);
85 }
86 
87 template <typename Derived>
88 template <typename Space, typename Time>
89 ADReal
91  const Time & t)
92 {
93  // Why the factor of 2? Because we multiply by a factor of 1/2 in the friction kernel to be
94  // consistent with the formulation of Forchheimer in
95  // https://holzmann-cfd.com/community/blog-and-tools/darcy-forchheimer and
96  // https://www.simscale.com/knowledge-base/predict-darcy-and-forchheimer-coefficients-for-perforated-plates-using-analytical-approach/
97  return 2 / computeHydraulicDiameter(r, t);
98 }
99 
100 template <typename Derived>
101 template <typename Space, typename Time>
102 ADReal
104 {
105  mooseAssert(1.0 - _eps(r, t).value() > 1e-8,
106  "Bed hydraulic diameter is ill-defined at porosity of 1.");
107  return _eps(r, t) * _d_pebble / (1.0 - _eps(r, t));
108 }
void addRequiredRangeCheckedParam(const std::string &name, const std::string &parsed_function, const std::string &doc_string)
const Moose::Functor< ADReal > & _eps
porosity
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
ADReal computeDarcyPrefactor(const Space &r, const Time &t)
static const std::string density
Definition: NS.h:33
DualNumber< Real, DNDerivativeType, true > ADReal
void addRequiredParam(const std::string &name, const std::string &doc_string)
static const std::string porosity
Definition: NS.h:104
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
FunctorPebbleBedDragCoefficients(const InputParameters &parameters)
ADReal computeForchheimerPrefactor(const Space &r, const Time &t)
const T & getParam(const std::string &name) const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Moose::Functor< T > & getFunctor(const std::string &name)
const InputParameters & parameters() const
ADReal computeHydraulicDiameter(const Space &r, const Time &t)
Compute hydraulic diameter in the bed.
const Moose::Functor< ADReal > & _rho
fluid density
Abstract base class to compute isotropic drag coefficients, where and are independent of direction...
Abstract base class to compute isotropic drag coefficients in a pebble bed.
static const std::string pebble_diameter
Definition: NS.h:25