https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ChurchillChuHTCFunctorMaterial.C
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
11
14
15template <bool is_ad>
18{
20 params.addClassDescription("Computes a heat transfer coefficient using the Churchill-Chu "
21 "correlation for natural convection.");
22 params.addRequiredParam<MooseFunctorName>("Pr", "Fluid Prandtl number functor");
23 params.addRequiredParam<MooseFunctorName>("Gr", "Grashof number functor");
24 params.addRequiredParam<MooseFunctorName>("k_fluid",
25 "Fluid thermal conductivity functor [W/(m-K)]");
26 params.addRequiredParam<Real>("diameter", "Cylinder diameter [m]");
27 params.addRequiredParam<std::string>(
28 "htc_name", "Name to give the heat transfer coefficient functor material property");
29
30 return params;
31}
32
33template <bool is_ad>
35 const InputParameters & parameters)
36 : FunctorMaterial(parameters),
37 _Pr(getFunctor<GenericReal<is_ad>>("Pr")),
38 _Gr(getFunctor<GenericReal<is_ad>>("Gr")),
39 _k_fluid(getFunctor<GenericReal<is_ad>>("k_fluid")),
40 _diameter(getParam<Real>("diameter"))
41{
42 addFunctorProperty<GenericReal<is_ad>>(
43 getParam<std::string>("htc_name"),
44 [this](const auto & r, const auto & t) -> GenericReal<is_ad>
45 {
46 using std::pow;
47
48 const auto Pr = _Pr(r, t);
49 const auto Gr = _Gr(r, t);
50 const auto k_fluid = _k_fluid(r, t);
51 const auto Ra = Gr * Pr;
52 const auto numerator = 0.387 * pow(Ra, 1.0 / 6.0);
53 const auto denominator = pow(1 + pow(0.559 / Pr, 9.0 / 16.0), 8.0 / 27.0);
54 const auto root_Nu = 0.6 + numerator / denominator;
55 const auto Nu = Utility::pow<2>(root_Nu);
56
57 return Nu * k_fluid / _diameter;
58 });
59}
60
registerMooseObject("HeatTransferApp", ChurchillChuHTCFunctorMaterial)
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
Moose::GenericType< Real, is_ad > GenericReal
Computes a heat transfer coefficient using the Churchill-Chu correlation for natural convection.
ChurchillChuHTCFunctorMaterialTempl(const InputParameters &parameters)
const Moose::Functor< GenericReal< is_ad > > & _Gr
Grashof number.
const Moose::Functor< GenericReal< is_ad > > & _Pr
Fluid Prandtl number.
const Moose::Functor< GenericReal< is_ad > > & _k_fluid
Fluid thermal conductivity.
static InputParameters validParams()
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)