https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
24template <typename Derived>
26{
27 friend class FunctorIsotropicDragCoefficients<Derived>;
28
29public:
31
33
34protected:
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
55template <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
68template <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
78template <typename Derived>
79template <typename Space, typename Time>
82{
83 const auto Dh = computeHydraulicDiameter(r, t);
84 return 1 / (Dh * Dh);
85}
86
87template <typename Derived>
88template <typename Space, typename Time>
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
100template <typename Derived>
101template <typename Space, typename Time>
102ADReal
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}
DualNumber< Real, DNDerivativeType, true > ADReal
const Moose::Functor< T > & getFunctor(const std::string &name)
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.
const Moose::Functor< ADReal > & _eps
porosity
ADReal computeForchheimerPrefactor(const Space &r, const Time &t)
FunctorPebbleBedDragCoefficients(const InputParameters &parameters)
ADReal computeDarcyPrefactor(const Space &r, const Time &t)
const Moose::Functor< ADReal > & _rho
fluid density
ADReal computeHydraulicDiameter(const Space &r, const Time &t)
Compute hydraulic diameter in the bed.
void addRequiredRangeCheckedParam(const std::string &name, const std::string &parsed_function, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
const InputParameters & parameters() const
const T & getParam(const std::string &name) const
static const std::string density
Definition NS.h:34
static const std::string porosity
Definition NS.h:108
static const std::string pebble_diameter
Definition NS.h:26