ReynoldsAnalogy.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2017-2022 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::heatTransferCoeffModels::ReynoldsAnalogy
28 
29 Description
30  Heat transfer coefficient calculation based on Reynolds Analogy, which is
31  used to relate turbulent momentum and heat transfer.
32 
33  The heat transfer coefficient is derived from the skin friction coefficient:
34 
35  \f[
36  C_f = \frac{\tau_w}{0.5 \rho_{ref} |U|^2}
37  \f]
38 
39  as:
40 
41  \f[
42  h = 0.5 \rho_{ref} c_{p,ref} |U_{ref}| C_f
43  \f]
44 
45  where
46  \vartable
47  h | Heat transfer coefficient [W/m^2/K]
48  \rho_{ref} | Reference fluid density [kg/m^3]
49  c_{p,ref} | Reference specific heat capacity at constant pressure [J/kg/K]
50  U_{ref} | Reference velocity [m/s]
51  C_f | Skin friction coefficient [-]
52  \tau_w | Wall shear stress [m^2/s^2]
53  \endvartable
54 
55 Usage
56  Minimal example by using \c system/controlDict.functions:
57  \verbatim
58  heatTransferCoeffFO
59  {
60  // Inherited entries
61  ...
62 
63  // Mandatory entries
64  htcModel ReynoldsAnalogy;
65  UInf <vector>;
66 
67  // Optional entries
68  U <word>;
69  Cp <word>;
70  rho <word>;
71 
72  // Conditional mandatory entries
73 
74  // when Cp == CpInf
75  CpInf <scalar>;
76 
77  // when rho == rhoInf
78  rhoInf <scalar>;
79  }
80  \endverbatim
81 
82  where the entries mean:
83  \table
84  Property | Description | Type | Reqd | Deflt
85  type | Model name: ReynoldsAnalogy | word | yes | -
86  UInf | Reference velocity | vector | yes | -
87  U | Name of velocity field | word | no | U
88  Cp | Name of reference specific heat capacity | word | no | Cp
89  CpInf | Reference specific heat capacity value | scalar | choice | -
90  rho | Name of fluid density field | word | no | rho
91  rhoInf | Reference fluid density value | scalar | choice | -
92  \endtable
93 
94 Note
95  - In order to use a reference \c Cp, set \c Cp to \c CpInf.
96  - In order to use a reference \c rho, set \c rho to \c rhoInf.
97 
98 SourceFiles
99  ReynoldsAnalogy.C
100 
101 \*---------------------------------------------------------------------------*/
102 
103 #ifndef heatTransferCoeffModels_ReynoldsAnalogy_H
104 #define heatTransferCoeffModels_ReynoldsAnalogy_H
105 
106 #include "heatTransferCoeffModel.H"
107 
108 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
109 
110 namespace Foam
111 {
112 namespace heatTransferCoeffModels
113 {
114 
115 /*---------------------------------------------------------------------------*\
116  Class ReynoldsAnalogy Declaration
117 \*---------------------------------------------------------------------------*/
118 
119 class ReynoldsAnalogy
120 :
121  public heatTransferCoeffModel
122 {
123 protected:
124 
125  // Protected Data
126 
127  //- Name of velocity field
128  word UName_;
129 
130  //- Reference velocity
131  vector URef_;
132 
133  //- Name of fluid density field
134  word rhoName_;
135 
136  //- Reference fluid density
137  scalar rhoRef_;
138 
139  //- Name of specific heat capacity field
140  word CpName_;
141 
142  //- Reference specific heat capacity
143  scalar CpRef_;
144 
145 
146  // Protected Member Functions
147 
148  //- Return fluid density field [kg/m^3]
149  virtual tmp<scalarField> rho(const label patchi) const;
150 
151  //- Return heat capacity at constant pressure [J/kg/K]
152  virtual tmp<scalarField> Cp(const label patchi) const;
153 
154  //- Return the effective stress tensor including the laminar stress
155  virtual tmp<volSymmTensorField> devReff() const;
156 
157  //- Return skin friction coefficient field [-]
158  tmp<FieldField<Field, scalar>> Cf() const;
159 
160  //- Set the heat transfer coefficient
161  virtual void htc
162  (
164  const FieldField<Field, scalar>& q
165  );
166 
167 
168 public:
169 
170  //- Runtime type information
171  TypeName("ReynoldsAnalogy");
172 
173 
174  // Constructors
175 
176  //- Construct from components
178  (
179  const dictionary& dict,
180  const fvMesh& mesh,
181  const word& TName
182  );
183 
184  //- No copy construct
185  ReynoldsAnalogy(const ReynoldsAnalogy&) = delete;
187  //- No copy assignment
188  void operator=(const ReynoldsAnalogy&) = delete;
189 
190 
191  //- Destructor
192  virtual ~ReynoldsAnalogy() = default;
193 
194 
195  // Member Functions
196 
197  //- Read the function-object dictionary
198  virtual bool read(const dictionary& dict);
199 };
200 
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 } // End namespace heatTransferCoeffModels
205 } // End namespace Foam
206 
207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 
209 #endif
210 
211 // ************************************************************************* //
virtual tmp< volSymmTensorField > devReff() const
Return the effective stress tensor including the laminar stress.
ReynoldsAnalogy(const dictionary &dict, const fvMesh &mesh, const word &TName)
Construct from components.
dictionary dict
virtual ~ReynoldsAnalogy()=default
Destructor.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:130
scalar rhoRef_
Reference fluid density.
const word & TName() const noexcept
Return const reference to name of temperature field.
virtual tmp< scalarField > Cp(const label patchi) const
Return heat capacity at constant pressure [J/kg/K].
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:72
virtual tmp< scalarField > rho(const label patchi) const
Return fluid density field [kg/m^3].
word rhoName_
Name of fluid density field.
TypeName("ReynoldsAnalogy")
Runtime type information.
tmp< FieldField< Field, scalar > > Cf() const
Return skin friction coefficient field [-].
virtual void htc(volScalarField &htc, const FieldField< Field, scalar > &q)
Set the heat transfer coefficient.
Heat transfer coefficient calculation based on Reynolds Analogy, which is used to relate turbulent mo...
Vector< scalar > vector
Definition: vector.H:57
const fvMesh & mesh() const noexcept
Return const reference to the mesh.
word CpName_
Name of specific heat capacity field.
void operator=(const ReynoldsAnalogy &)=delete
No copy assignment.
scalar CpRef_
Reference specific heat capacity.
tmp< FieldField< Field, scalar > > q() const
Return boundary fields of heat-flux field.
virtual bool read(const dictionary &dict)
Read the function-object dictionary.
Namespace for OpenFOAM.