https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ADWallFrictionChengMaterial.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 "WallFrictionModels.h"
14#include "Numerics.h"
15
17
20{
22 params.addRequiredParam<MaterialPropertyName>("f_D", "Darcy friction factor material property");
23 params.addParam<MaterialPropertyName>(
24 "rho", FlowModelSinglePhase::DENSITY, "Density of the fluid");
25 params.addParam<MaterialPropertyName>("vel", FlowModelSinglePhase::VELOCITY, "Fluid velocity");
26 params.addParam<MaterialPropertyName>(
27 "D_h", FlowModelSinglePhase::HYDRAULIC_DIAMETER, "Hydraulic diameter");
28 params.addParam<MaterialPropertyName>(
29 "mu", FlowModelSinglePhase::DYNAMIC_VISCOSITY, "Dynamic viscosity of the fluid");
31 "PoD", "PoD>=1.0", "The Pitch-to-diameter ratio value being assigned into the property");
32 MooseEnum bundle_array("SQUARE HEXAGONAL");
34 "bundle_array", bundle_array, "The type of the rod bundle array");
35 MooseEnum subchannel_type("INTERIOR EDGE CORNER");
37 "subchannel_type", subchannel_type, "The type of subchannel to be considered");
38 params.addClassDescription("Computes wall friction factor using the Cheng-Todreas correlation "
39 "for interior, edge and corner channels.");
40 return params;
41}
42
44 : Material(parameters),
45 _f_D_name(getParam<MaterialPropertyName>("f_D")),
46 _f_D(declareADProperty<Real>(_f_D_name)),
47 _rho(getADMaterialProperty<Real>("rho")),
48 _vel(getADMaterialProperty<Real>("vel")),
49 _D_h(getADMaterialProperty<Real>("D_h")),
50 _mu(getADMaterialProperty<Real>("mu")),
51 _PoD(getParam<Real>("PoD")),
52 _bundle_array(getParam<MooseEnum>("bundle_array").getEnum<Bundle_array>()),
53 _subchannel_type(getParam<MooseEnum>("subchannel_type").getEnum<Subchannel_type>())
54
55{
56}
57
58void
60{
62 if (_PoD > 1.5)
63 {
64 mooseDoOnce(mooseWarning(
65 "The Cheng-Todreas correlation for the friction factor is valid when P/D is between 1.0 "
66 "and 1.5. Be aware that using values out of this range may lead to "
67 "significant errors in your results!"));
68 }
69 // The Pitch-to-Diameter ratio (PoD) cannot be smaller than 1.0.
70 switch (_subchannel_type)
71 {
73 {
74 switch (_bundle_array)
75 {
77 {
78 if (_PoD < 1.1)
79 {
80 if (Re <= 2100)
81 {
82 ADReal a = 26.37;
83 ADReal b = 374.2;
84 ADReal c = -493.9;
85 ADReal n = 1;
88 break;
89 }
90 else if (Re > 2100)
91 {
92 ADReal a = 0.09423;
93 ADReal b = 0.5806;
94 ADReal c = -1.239;
95 ADReal n = 0.18;
98 break;
99 }
100 }
101 else
102 {
103 if (Re <= 2100)
104 {
105 ADReal a = 35.55;
106 ADReal b = 263.7;
107 ADReal c = -190.2;
108 ADReal n = 1;
111 break;
112 }
113 else if (Re > 2100)
114 {
115 ADReal a = 0.1339;
116 ADReal b = 0.09059;
117 ADReal c = -0.09926;
118 ADReal n = 0.18;
121 break;
122 }
123 }
124 break;
125 }
127 {
128 if (_PoD < 1.1)
129 {
130 if (Re <= 2100)
131 {
132 ADReal a = 26;
133 ADReal b = 888.2;
134 ADReal c = -3334;
135 ADReal n = 1;
138 break;
139 }
140 else if (Re > 2100)
141 {
142 ADReal a = 0.09378;
143 ADReal b = 1.398;
144 ADReal c = -8.664;
145 ADReal n = 0.18;
148 break;
149 }
150 }
151 else
152 {
153 if (Re <= 2100)
154 {
155 ADReal a = 62.97;
156 ADReal b = 216.9;
157 ADReal c = -190.2;
158 ADReal n = 1;
161 break;
162 }
163 else if (Re > 2100)
164 {
165 ADReal a = 0.1458;
166 ADReal b = 0.03632;
167 ADReal c = -0.03333;
168 ADReal n = 0.18;
171 break;
172 }
173 }
174 break;
175 }
176 }
177 break;
178 }
179
181 {
182 switch (_bundle_array)
183 {
185 {
186 if (_PoD < 1.1)
187 {
188 if (Re <= 2100)
189 {
190 ADReal a = 26.18;
191 ADReal b = 554.5;
192 ADReal c = -1480;
193 ADReal n = 1;
196 break;
197 }
198 else if (Re > 2100)
199 {
200 ADReal a = 0.09377;
201 ADReal b = 0.8732;
202 ADReal c = -3.341;
203 ADReal n = 0.18;
206 break;
207 }
208 }
209 else
210 {
211 if (Re <= 2100)
212 {
213 ADReal a = 44.40;
214 ADReal b = 256.7;
215 ADReal c = -267.6;
216 ADReal n = 1;
219 break;
220 }
221 else if (Re > 2100)
222 {
223 ADReal a = 0.1430;
224 ADReal b = 0.04199;
225 ADReal c = -0.04428;
226 ADReal n = 0.18;
229 break;
230 }
231 }
232 break;
233 }
235 {
236 if (_PoD < 1.1)
237 {
238 if (Re <= 2100)
239 {
240 ADReal a = 26.18;
241 ADReal b = 554.5;
242 ADReal c = -1480;
243 ADReal n = 1;
246 break;
247 }
248 else if (Re > 2100)
249 {
250 ADReal a = 0.09377;
251 ADReal b = 0.8732;
252 ADReal c = -3.341;
253 ADReal n = 0.18;
256 break;
257 }
258 }
259 else
260 {
261 if (Re <= 2100)
262 {
263 ADReal a = 44.4;
264 ADReal b = 256.7;
265 ADReal c = -267.6;
266 ADReal n = 1;
269 break;
270 }
271 else if (Re > 2100)
272 {
273 ADReal a = 0.1430;
274 ADReal b = 0.04199;
275 ADReal c = -0.04428;
276 ADReal n = 0.18;
279 break;
280 }
281 }
282 break;
283 }
284 }
285 break;
286 }
287
289 {
290 switch (_bundle_array)
291 {
293 {
294 if (_PoD < 1.1)
295 {
296 if (Re <= 2100)
297 {
298 ADReal a = 28.62;
299 ADReal b = 715.9;
300 ADReal c = -2807;
301 ADReal n = 1;
304 break;
305 }
306 else if (Re > 2100)
307 {
308 ADReal a = 0.09755;
309 ADReal b = 1.127;
310 ADReal c = -6.304;
311 ADReal n = 0.18;
314 break;
315 }
316 }
317 else
318 {
319 if (Re <= 2100)
320 {
321 ADReal a = 58.83;
322 ADReal b = 160.7;
323 ADReal c = -203.5;
324 ADReal n = 1;
327 break;
328 }
329 else if (Re > 2100)
330 {
331 ADReal a = 0.1452;
332 ADReal b = 0.02681;
333 ADReal c = -0.03411;
334 ADReal n = 0.18;
337 break;
338 }
339 }
340 break;
341 }
343 {
344 if (_PoD < 1.1)
345 {
346 if (Re <= 2100)
347 {
348 ADReal a = 26.98;
349 ADReal b = 1636;
350 ADReal c = -10050;
351 ADReal n = 1;
354 break;
355 }
356 else if (Re > 2100)
357 {
358 ADReal a = 0.1004;
359 ADReal b = 1.625;
360 ADReal c = -11.85;
361 ADReal n = 0.18;
364 break;
365 }
366 }
367 else
368 {
369 if (Re <= 2100)
370 {
371 ADReal a = 87.26;
372 ADReal b = 38.59;
373 ADReal c = -55.15;
374 ADReal n = 1;
377 break;
378 }
379 else if (Re > 2100)
380 {
381 ADReal a = 0.1499;
382 ADReal b = 0.006706;
383 ADReal c = -0.009567;
384 ADReal n = 0.18;
387 break;
388 }
389 }
390 break;
391 }
392 default:
393 mooseError("Invalid 'bundle_array' parameter.");
394 }
395 break;
396 }
397 default:
398 {
399 break;
400 }
401 }
402}
DualNumber< Real, DNDerivativeType, true > ADReal
registerMooseObject("ThermalHydraulicsApp", ADWallFrictionChengMaterial)
const double Re
Computes drag coefficient using the Cheng-Todreas correlation for Fanning friction factor.
const ADMaterialProperty< Real > & _vel
Velocity.
const Subchannel_type _subchannel_type
Subchannel type.
const ADMaterialProperty< Real > & _rho
Density.
const Bundle_array _bundle_array
Rod bundle array type.
const Real & _PoD
Pitch-to-Diameter ratio.
ADWallFrictionChengMaterial(const InputParameters &parameters)
ADMaterialProperty< Real > & _f_D
const ADMaterialProperty< Real > & _D_h
Hydraulic diameter.
const ADMaterialProperty< Real > & _mu
Dynamic viscosity.
static const std::string DENSITY
static const std::string HYDRAULIC_DIAMETER
static const std::string VELOCITY
static const std::string DYNAMIC_VISCOSITY
void addRequiredRangeCheckedParam(const std::string &name, const std::string &parsed_function, const std::string &doc_string)
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 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
Real DarcyFrictionFactor(const Real &f_F)
Computes Darcy friction factor from Fanning friction factor.
auto FanningFrictionFactorCheng(const T1 &Re, const T2 &a, const T3 &b, const T4 &c, const T5 &n, const T6 &PoD)
Computes Fanning friction factor using Cheng-Todreas correlation.