https://mooseframework.inl.gov
ConjugateHTNumbersFunctorMaterial.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 #include "HeatTransferUtils.h"
13 #include "PhysicalConstants.h"
14 
17 
18 template <bool is_ad>
21 {
23 
24  params.addClassDescription(
25  "Computes several non-dimensional numbers for conjugate heat transfer.");
26 
27  params.addRequiredParam<MooseFunctorName>("p_fluid", "Fluid pressure functor");
28  params.addRequiredParam<MooseFunctorName>("T_fluid", "Fluid temperature functor");
29  params.addRequiredParam<MooseFunctorName>("T_solid", "Solid temperature functor");
30  params.addRequiredParam<Real>("length", "Characteristic length [m]");
31  params.addRequiredParam<std::string>("Pr_name",
32  "Name to give the Prandtl number functor material property");
33  params.addRequiredParam<std::string>("Gr_name",
34  "Name to give the Grashof number functor material property");
35  params.addRequiredParam<UserObjectName>("fluid_properties",
36  "The SinglePhaseFluidProperties object for the fluid");
37 
38  return params;
39 }
40 
41 template <bool is_ad>
43  const InputParameters & parameters)
44  : FunctorMaterial(parameters),
45  _p_fluid(getFunctor<GenericReal<is_ad>>("p_fluid")),
46  _T_fluid(getFunctor<GenericReal<is_ad>>("T_fluid")),
47  _T_solid(getFunctor<GenericReal<is_ad>>("T_solid")),
48  _length(getParam<Real>("length")),
49  _fp(getUserObject<SinglePhaseFluidProperties>("fluid_properties"))
50 {
51  addFunctorProperty<GenericReal<is_ad>>(
52  getParam<std::string>("Pr_name"),
53  [this](const auto & r, const auto & t) -> GenericReal<is_ad>
54  {
55  const auto p = _p_fluid(r, t);
56  const auto T = _T_fluid(r, t);
57  const auto cp = _fp.cp_from_p_T(p, T);
58  const auto mu = _fp.mu_from_p_T(p, T);
59  const auto k = _fp.k_from_p_T(p, T);
60 
62  });
63 
64  addFunctorProperty<GenericReal<is_ad>>(
65  getParam<std::string>("Gr_name"),
66  [this](const auto & r, const auto & t) -> GenericReal<is_ad>
67  {
68  const auto p_fluid = _p_fluid(r, t);
69  const auto T_fluid = _T_fluid(r, t);
70  const auto T_solid = _T_solid(r, t);
71  const auto beta_fluid = _fp.beta_from_p_T(p_fluid, T_fluid);
72  const auto rho_fluid = _fp.rho_from_p_T(p_fluid, T_fluid);
73  const auto mu_fluid = _fp.mu_from_p_T(p_fluid, T_fluid);
74 
75  return HeatTransferUtils::grashof(beta_fluid,
76  T_solid,
77  T_fluid,
78  _length,
79  rho_fluid,
80  mu_fluid,
82  });
83 }
84 
ConjugateHTNumbersFunctorMaterialTempl(const InputParameters &parameters)
const auto acceleration_of_gravity
Moose::GenericType< Real, is_ad > GenericReal
static InputParameters validParams()
registerMooseObject("ThermalHydraulicsApp", ConjugateHTNumbersFunctorMaterial)
static const std::string T_solid
Definition: NS.h:107
void addRequiredParam(const std::string &name, const std::string &doc_string)
auto grashof(const T1 &beta, const T2 &T_s, const T3 &T_bulk, const T4 &L, const T5 &rho, const T6 &mu, Real gravity_magnitude)
Compute Grashof number.
static const std::string cp
Definition: NS.h:121
const SinglePhaseFluidProperties & _fp
Fluid properties.
const Moose::Functor< GenericReal< is_ad > > & _p_fluid
Fluid pressure.
static const std::string T_fluid
Definition: NS.h:106
static const std::string mu
Definition: NS.h:123
Computes several non-dimensional numbers for conjugate heat transfer.
Common class for single phase fluid properties.
const Moose::Functor< GenericReal< is_ad > > & _T_solid
Solid temperature.
auto prandtl(const T1 &cp, const T2 &mu, const T3 &k)
Compute Prandtl 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 > > & _T_fluid
Fluid temperature.
static const std::string k
Definition: NS.h:130