Line data Source code
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 : #include "ADWallHTCGnielinskiAnnularMaterial.h"
11 : #include "SinglePhaseFluidProperties.h"
12 : #include "FlowModelSinglePhase.h"
13 : #include "Numerics.h"
14 :
15 : registerMooseObject("ThermalHydraulicsApp", ADWallHTCGnielinskiAnnularMaterial);
16 :
17 : InputParameters
18 255 : ADWallHTCGnielinskiAnnularMaterial::validParams()
19 : {
20 255 : InputParameters params = Material::validParams();
21 510 : params.addParam<MaterialPropertyName>(
22 : "htc_wall",
23 : FlowModelSinglePhase::HEAT_TRANSFER_COEFFICIENT_WALL,
24 : "Name to give the heat transfer coefficient material property");
25 510 : params.addParam<MaterialPropertyName>(
26 : "rho", FlowModelSinglePhase::DENSITY, "Fluid density material property");
27 510 : params.addParam<MaterialPropertyName>(
28 : "vel", FlowModelSinglePhase::VELOCITY, "Fluid velocity material property");
29 510 : params.addParam<MaterialPropertyName>("cp",
30 : FlowModelSinglePhase::SPECIFIC_HEAT_CONSTANT_PRESSURE,
31 : "Fluid isobaric specific heat capacity material property");
32 510 : params.addParam<MaterialPropertyName>(
33 : "mu", FlowModelSinglePhase::DYNAMIC_VISCOSITY, "Fluid dynamic viscosity material property");
34 510 : params.addParam<MaterialPropertyName>("k",
35 : FlowModelSinglePhase::THERMAL_CONDUCTIVITY,
36 : "Fluid thermal conductivity material property");
37 510 : params.addParam<MaterialPropertyName>(
38 : "p", FlowModelSinglePhase::PRESSURE, "Fluid pressure material property");
39 510 : params.addParam<MaterialPropertyName>(
40 : "T", FlowModelSinglePhase::TEMPERATURE, "Fluid temperature material property");
41 510 : params.addParam<MaterialPropertyName>(
42 : "T_wall", FlowModel::TEMPERATURE_WALL, "Wall temperature material property");
43 510 : params.addRequiredParam<Real>("D_inner", "Inner diameter of the annulus [m]");
44 510 : params.addRequiredParam<Real>("D_outer", "Outer diameter of the annulus [m]");
45 510 : params.addRequiredParam<Real>("channel_length", "Channel length [m]");
46 510 : params.addRequiredParam<bool>("at_inner_wall", "True if heat transfer is at inner wall");
47 510 : params.addRequiredParam<bool>("fluid_is_gas", "True if the fluid is a gas");
48 510 : params.addParam<Real>("gas_heating_correction_exponent",
49 510 : 0,
50 : "Exponent for the ratio of bulk fluid temperature to wall temperature for "
51 : "the Nusselt number correction factor when heating a gas");
52 510 : params.addRequiredParam<UserObjectName>("fluid_properties", "Fluid properties object");
53 :
54 255 : params.addClassDescription("Computes wall heat transfer coefficient for gases and water in an "
55 : "annular flow channel using the Gnielinski correlation");
56 :
57 255 : return params;
58 0 : }
59 :
60 198 : ADWallHTCGnielinskiAnnularMaterial::ADWallHTCGnielinskiAnnularMaterial(
61 198 : const InputParameters & parameters)
62 : : Material(parameters),
63 198 : _htc_wall(declareADProperty<Real>("htc_wall")),
64 396 : _rho(getADMaterialProperty<Real>("rho")),
65 396 : _vel(getADMaterialProperty<Real>("vel")),
66 396 : _k(getADMaterialProperty<Real>("k")),
67 396 : _mu(getADMaterialProperty<Real>("mu")),
68 396 : _cp(getADMaterialProperty<Real>("cp")),
69 396 : _p(getADMaterialProperty<Real>("p")),
70 396 : _T(getADMaterialProperty<Real>("T")),
71 396 : _T_wall(getADMaterialProperty<Real>("T_wall")),
72 396 : _D_inner(getParam<Real>("D_inner")),
73 396 : _D_outer(getParam<Real>("D_outer")),
74 198 : _D_h(_D_outer - _D_inner),
75 198 : _a(_D_inner / _D_outer),
76 396 : _L(getParam<Real>("channel_length")),
77 396 : _at_inner_wall(getParam<bool>("at_inner_wall")),
78 396 : _fluid_is_gas(getParam<bool>("fluid_is_gas")),
79 396 : _n(getParam<Real>("gas_heating_correction_exponent")),
80 396 : _provided_gas_heating_correction_exponent(isParamSetByUser("gas_heating_correction_exponent")),
81 396 : _fp(getUserObject<SinglePhaseFluidProperties>("fluid_properties"))
82 : {
83 198 : }
84 :
85 : void
86 27 : ADWallHTCGnielinskiAnnularMaterial::computeQpProperties()
87 : {
88 27 : const ADReal Pr = THM::Prandtl(_cp[_qp], _mu[_qp], _k[_qp]);
89 :
90 : ADReal K;
91 27 : if (_fluid_is_gas)
92 : {
93 18 : if (_T_wall[_qp] > _T[_qp] && !_provided_gas_heating_correction_exponent)
94 0 : mooseError(
95 : "If wall temperature ever exceeds the fluid temperature, even in iteration, and the "
96 : "fluid is a gas, then the parameter 'gas_heating_correction_exponent' must be provided.");
97 36 : K = std::pow(_T[_qp] / _T_wall[_qp], _n);
98 : }
99 : else
100 : {
101 9 : const ADReal cp_wall = _fp.cp_from_p_T(_p[_qp], _T_wall[_qp]);
102 9 : const ADReal mu_wall = _fp.mu_from_p_T(_p[_qp], _T_wall[_qp]);
103 9 : const ADReal k_wall = _fp.k_from_p_T(_p[_qp], _T_wall[_qp]);
104 : const ADReal Pr_wall = THM::Prandtl(cp_wall, mu_wall, k_wall);
105 18 : K = std::pow(Pr / Pr_wall, 0.11);
106 : }
107 :
108 27 : ADReal Re = THM::Reynolds(1.0, _rho[_qp], _vel[_qp], _D_h, _mu[_qp]);
109 27 : if (Re < 1e4)
110 : {
111 0 : mooseDoOnce(
112 : mooseWarning("This material uses a correlation that is valid for Re > 1e4, but the "
113 : "material was evaluated with an Re = " +
114 : Moose::stringify(MetaPhysicL::raw_value(Re)) +
115 : ". This and all subsequent evaluations will be given a lower bound of 1e4."));
116 0 : Re = 1e4;
117 : }
118 : const ADReal Re_star =
119 27 : Re * ((1 + _a * _a) * std::log(_a) + (1 - _a * _a)) / (std::pow(1 - _a, 2) * std::log(_a));
120 :
121 54 : const ADReal f_ann = std::pow(1.8 * std::log10(Re_star) - 1.5, -2.0);
122 162 : const ADReal k1 = 1.07 + 900.0 / Re - 0.63 / (1.0 + 10.0 * Pr);
123 :
124 : ADReal F_ann;
125 27 : if (_at_inner_wall)
126 18 : F_ann = 0.75 * std::pow(_a, -0.17);
127 : else
128 9 : F_ann = 0.9 - 0.15 * std::pow(_a, 0.6);
129 :
130 27 : const ADReal Nu = f_ann / 8.0 * Re * Pr /
131 54 : (k1 + 12.7 * std::sqrt(f_ann / 8.0) * (std::pow(Pr, 2.0 / 3.0) - 1.0)) *
132 27 : (1.0 + std::pow(_D_h / _L, 2.0 / 3.0)) * F_ann * K;
133 :
134 27 : _htc_wall[_qp] = THM::wallHeatTransferCoefficient(Nu, _k[_qp], _D_h);
135 27 : }
|