https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ADWallHeatTransferCoefficientWeismanMaterial.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
13#include "Numerics.h"
14
16
19{
21 params.addParam<MaterialPropertyName>("Hw",
23 "Heat transfer coefficient material property");
24 params.addParam<MaterialPropertyName>(
25 "rho", FlowModelSinglePhase::DENSITY, "Density of the fluid");
26 params.addParam<MaterialPropertyName>("vel", FlowModelSinglePhase::VELOCITY, "Fluid velocity");
27 params.addParam<MaterialPropertyName>(
28 "D_h", FlowModelSinglePhase::HYDRAULIC_DIAMETER, "Hydraulic diameter");
29 params.addParam<MaterialPropertyName>(
30 "cp", FlowModelSinglePhase::SPECIFIC_HEAT_CONSTANT_PRESSURE, "Specific heat of the fluid");
31 params.addParam<MaterialPropertyName>(
32 "mu", FlowModelSinglePhase::DYNAMIC_VISCOSITY, "Dynamic viscosity of the fluid");
33 params.addParam<MaterialPropertyName>(
34 "k", FlowModelSinglePhase::THERMAL_CONDUCTIVITY, "Heat conductivity of the fluid");
35 params.addParam<MaterialPropertyName>(
36 "T", FlowModelSinglePhase::TEMPERATURE, "Fluid temperature");
37 params.addParam<MaterialPropertyName>("T_wall", FlowModel::TEMPERATURE_WALL, "Wall temperature");
38 params.addRequiredParam<Real>(
39 "PoD", "The Pitch-to-diameter ratio value being assigned into the property");
40 MooseEnum bundle_array("SQUARE TRIANGULAR", "SQUARE");
41 params.addParam<MooseEnum>("bundle_array", bundle_array, "The type of the rod bundle array");
43 "Computes wall heat transfer coefficient for water using the Weisman correlation");
44 return params;
45}
46
48 const InputParameters & parameters)
49 : Material(parameters),
50 _Hw(declareADProperty<Real>("Hw")),
51 _rho(getADMaterialProperty<Real>("rho")),
52 _vel(getADMaterialProperty<Real>("vel")),
53 _D_h(getADMaterialProperty<Real>("D_h")),
54 _k(getADMaterialProperty<Real>("k")),
55 _mu(getADMaterialProperty<Real>("mu")),
56 _cp(getADMaterialProperty<Real>("cp")),
57 _T(getADMaterialProperty<Real>("T")),
58 _T_wall(getADMaterialProperty<Real>("T_wall")),
59 _PoD(getParam<Real>("PoD")),
60 _bundle_array(getParam<MooseEnum>("bundle_array").getEnum<Bundle_array>())
61{
62}
63
64void
66{
67 using std::max, std::pow;
68
69 switch (_bundle_array)
70 {
72 {
73 if (_PoD > 1.3 || _PoD < 1.1)
74 mooseDoOnce(mooseWarning(
75 "The Weisman correlation for square arrays is valid when P/D is between 1.1 "
76 "and 1.3. Be aware that using values out of this range may lead to "
77 "significant errors in your results!"));
79 ADReal Re = max(1.0, THM::Reynolds(1., _rho[_qp], _vel[_qp], _D_h[_qp], _mu[_qp]));
80 ADReal n = (_T[_qp] < _T_wall[_qp]) ? 0.4 : 0.3;
81 ADReal Nu = 0.023 * pow(Re, 4. / 5.) * pow(Pr, n) * (1.826 * _PoD - 1.0430);
82 _Hw[_qp] = THM::wallHeatTransferCoefficient(Nu, _k[_qp], _D_h[_qp]);
83 break;
84 }
86 {
87 if (_PoD > 1.5 || _PoD < 1.1)
88 mooseDoOnce(mooseWarning(
89 "The Weisman correlation for triangular arrays is valid when P/D is between 1.1 "
90 "and 1.5. Be aware that using values out of this range may lead to "
91 "significant errors in your results!"));
93 ADReal Re = max(1.0, THM::Reynolds(1., _rho[_qp], _vel[_qp], _D_h[_qp], _mu[_qp]));
94 ADReal n = (_T[_qp] < _T_wall[_qp]) ? 0.4 : 0.3;
95 ADReal Nu = 0.023 * pow(Re, 4. / 5.) * pow(Pr, n) * (1.130 * _PoD - 0.2609);
96 _Hw[_qp] = THM::wallHeatTransferCoefficient(Nu, _k[_qp], _D_h[_qp]);
97 break;
98 }
99 default:
100 mooseError("Invalid 'bundle_array' parameter.");
101 }
102}
DualNumber< Real, DNDerivativeType, true > ADReal
registerMooseObject("ThermalHydraulicsApp", ADWallHeatTransferCoefficientWeismanMaterial)
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const double Re
Computes wall heat transfer coefficient for liquid sodium using Schad-modified correlation.
const ADMaterialProperty< Real > & _cp
Specific heat capacity.
ADMaterialProperty< Real > & _Hw
Wall heat transfer coefficient.
const ADMaterialProperty< Real > & _T
Fluid temperature.
const ADMaterialProperty< Real > & _k
Thermal conductivity.
const ADMaterialProperty< Real > & _D_h
Hydraulic diameter.
const ADMaterialProperty< Real > & _mu
Dynamic viscosity.
const ADMaterialProperty< Real > & _T_wall
Wall temperature.
static const std::string DENSITY
static const std::string HYDRAULIC_DIAMETER
static const std::string VELOCITY
static const std::string HEAT_TRANSFER_COEFFICIENT_WALL
static const std::string DYNAMIC_VISCOSITY
static const std::string SPECIFIC_HEAT_CONSTANT_PRESSURE
static const std::string THERMAL_CONDUCTIVITY
static const std::string TEMPERATURE
static const std::string TEMPERATURE_WALL
Definition FlowModel.h:108
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)
void addClassDescription(const std::string &doc_string)
unsigned int _qp
static InputParameters validParams()
void mooseError(Args &&... args) const
void mooseWarning(Args &&... args) const
auto Prandtl(const T1 &cp, const T2 &mu, const T3 &k)
Compute Prandtl number.
Definition Numerics.h:133
auto Reynolds(const T1 &volume_fraction, const T2 &rho, const T3 &vel, const T4 &D_h, const T5 &mu)
Compute Reynolds number.
Definition Numerics.h:118