https://mooseframework.inl.gov
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 
15 template <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 
33 template <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  const auto Pr = _Pr(r, t);
47  const auto Gr = _Gr(r, t);
48  const auto k_fluid = _k_fluid(r, t);
49  const auto Ra = Gr * Pr;
50  const auto numerator = 0.387 * std::pow(Ra, 1.0 / 6.0);
51  const auto denominator = std::pow(1 + std::pow(0.559 / Pr, 9.0 / 16.0), 8.0 / 27.0);
52  const auto root_Nu = 0.6 + numerator / denominator;
53  const auto Nu = Utility::pow<2>(root_Nu);
54 
55  return Nu * k_fluid / _diameter;
56  });
57 }
58 
const Moose::Functor< GenericReal< is_ad > > & _k_fluid
Fluid thermal conductivity.
Moose::GenericType< Real, is_ad > GenericReal
static InputParameters validParams()
void addRequiredParam(const std::string &name, const std::string &doc_string)
registerMooseObject("HeatTransferApp", ChurchillChuHTCFunctorMaterial)
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.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
const Moose::Functor< GenericReal< is_ad > > & _Pr
Fluid Prandtl number.
MooseUnits pow(const MooseUnits &, int)