https://mooseframework.inl.gov
Loading...
Searching...
No Matches
SCMHTCClosureBase.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
10#include "SCMHTCClosureBase.h"
11#include "SCM.h"
12#include "SubChannelApp.h"
13
14#include <cmath>
15
22
30
33{
34 NusseltPreInfo info;
35 info.Re = nusselt_args.Re;
36 info.Pr = nusselt_args.Pr;
37
38 const auto pitch = _subchannel_mesh.getPitch();
39 Real D;
40 const bool is_duct = (nusselt_args.i_pin == std::numeric_limits<unsigned int>::max());
41 if (!is_duct)
42 {
43 if (_Dpin_soln)
44 {
45 const auto * pin_node = _subchannel_mesh.getPinNode(nusselt_args.i_pin, nusselt_args.iz);
46 if ((*_Dpin_soln)(pin_node) > 0)
47 D = (*_Dpin_soln)(pin_node);
48 else
50 "The diameter of the pin is equal or smaller than zero, "
51 "please initialize the auxiliary variable Dpin.");
52 }
53 else
55 }
56 else
58
59 info.poD = pitch / D;
60 info.subch_type = _subchannel_mesh.getSubchannelType(nusselt_args.i_ch);
61
62 info.laminar_Nu = (info.subch_type == EChannelType::CENTER)
63 ? 3.73
64 : (info.subch_type == EChannelType::EDGE ? 3.59 : 3.52);
66 info.ReL = 320 * std::pow(10.0, (info.poD - 1.0));
67 info.ReT = 1e4 * std::pow(10.0, 0.7 * (info.poD - 1.0));
68
69 return info;
70}
71
72Real
74 const NusseltStruct & nusselt_args,
75 const Real k) const
76{
77 // Compute HTC
78 auto Nu = computeNusseltNumber(friction_args, nusselt_args);
79 auto Dh_i = 4.0 * friction_args.S / friction_args.w_perim;
80 const auto htc = Nu * k / Dh_i;
81 if (!std::isfinite(htc) || htc < 0.0)
82 mooseError(name(), ": The heat transfer coefficient must be non-negative and finite.");
83 return htc;
84}
85
86Real
88{
89 if (info.Re > info.ReL && info.Re < info.ReT)
90 return info.ReT;
91
92 return info.Re;
93}
94
95Real
97 const Real turbulent_nusselt) const
98{
99 if (info.Re <= info.ReL)
100 return info.laminar_Nu;
101
102 if (info.Re >= info.ReT)
103 return turbulent_nusselt;
104
105 const Real weight = (info.Re - info.ReL) / (info.ReT - info.ReL);
106 return weight * turbulent_nusselt + (1.0 - weight) * info.laminar_Nu;
107}
const std::string & name() const
void mooseError(Args &&... args) const
Base class for SCM closures.
static InputParameters validParams()
const SubChannelMesh & _subchannel_mesh
Reference to the subchannel mesh.
Real blendTurbulentNusseltNumber(const NusseltPreInfo &nusselt_info, const Real turbulent_nusselt) const
Blends turbulent Nusselt number through the transition range using the base laminar value.
Real computeHTC(const FrictionStruct &friction_info, const NusseltStruct &nusselt_info, const Real conduction_k) const
Computes the convective heat transfer coefficient for the local conditions.
std::unique_ptr< SolutionHandle > _Dpin_soln
Real turbulentReynoldsNumber(const NusseltPreInfo &nusselt_info) const
Reynolds number used to evaluate the turbulent endpoint for transition-region blending.
virtual Real computeNusseltNumber(const FrictionStruct &friction_info, const NusseltStruct &nusselt_info) const =0
Computes the nusselt number for the local conditions.
static InputParameters validParams()
SCMHTCClosureBase(const InputParameters &parameters)
NusseltPreInfo computeNusseltNumberPreInfo(const NusseltStruct &nusselt_info) const
Computes all the data needed before computing the nusselt number. It's used by all closure models.
static const std::string PIN_DIAMETER
virtual const Real & getPitch() const
Return the undeformed pitch between 2 subchannels.
virtual EChannelType getSubchannelType(unsigned int index) const =0
Return the type of the subchannel for given subchannel index.
virtual const Real & getPinDiameter() const
Return undeformed Pin diameter.
virtual Node * getPinNode(unsigned int i_pin, unsigned int iz) const =0
Get the pin mesh node for a given pin index and elevation index.
virtual const MooseVariableFieldBase & getVariable(const THREAD_ID tid, const std::string &var_name, Moose::VarKindType expected_var_type=Moose::VarKindType::VAR_ANY, Moose::VarFieldType expected_var_field_type=Moose::VarFieldType::VAR_FIELD_ANY) const=0
virtual bool hasVariable(const std::string &var_name) const=0
structure that holds the needed data to calculate intermediate data needed to calculate the Nusselt n...
structure with the needed information to compute the friction factor at a specific subchannel cell
structure with the needed information to compute the Nusselt number at a specific subchannel cell and...