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-2019 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
31 
32  The heat transfer coefficient is derived from the skin friction
33  coefficient:
34 
35  \f[
36  C_f = \frac{\tau_w}{0.5 \rho_\infty |U|^2}
37  \f]
38 
39  as:
40 
41  \f[
42  h = 0.5 \rho_\infty C_{p,\infty} |U_{\infty}| C_f
43  \f]
44 
45 Usage
46  Example of function object specification:
47  \verbatim
48  type heatTransferCoeff;
49  libs ("libfieldFunctionObjects.so");
50  ...
51  htcModel ReynoldsAnalogy;
52  UInf (20 0 0);
53  Cp CpInf;
54  CpInf 1005;
55  ...
56  \endverbatim
57 
58  Where the entries comprise:
59  \table
60  Property | Description | Required | Default value
61  type | type name: heatTransferCoeff | yes |
62  htcModel | selected htc model | yes |
63  UInf | reference velocity | yes |
64  Cp | specific heat capacity field name | no |
65  rho | density field name | no |
66  \endtable
67 
68  Note:
69  - to use a reference \c Cp, set \c Cp to \c CpInf
70  - to use a reference \c rho, set \c rho to \c rhoInf
71 
72 SourceFiles
73  ReynoldsAnalogy.C
74 
75 SeeAlso
76  Foam::heatTransferCoeffModel
77 
78 \*---------------------------------------------------------------------------*/
79 
80 #ifndef heatTransferCoeffModels_ReynoldsAnalogy_H
81 #define heatTransferCoeffModels_ReynoldsAnalogy_H
82 
83 #include "heatTransferCoeffModel.H"
84 
85 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
86 
87 namespace Foam
88 {
89 namespace heatTransferCoeffModels
90 {
91 
92 /*---------------------------------------------------------------------------*\
93  Class ReynoldsAnalogy Declaration
94 \*---------------------------------------------------------------------------*/
95 
96 class ReynoldsAnalogy
97 :
98  public heatTransferCoeffModel
99 {
100  // Private Member Functions
101 
102  //- No copy construct
103  ReynoldsAnalogy(const ReynoldsAnalogy&) = delete;
104 
105  //- No copy assignment
106  void operator=(const ReynoldsAnalogy&) = delete;
107 
108 
109 protected:
110 
111  // Protected data
112 
113  //- Name of velocity field
114  word UName_;
115 
116  //- Reference velocity
117  vector URef_;
118 
119  //- Name of density field
120  word rhoName_;
121 
122  //- Reference density
123  scalar rhoRef_;
124 
125  //- Name of specific heat capacity field
126  word CpName_;
127 
128  //- Reference specific heat capacity
129  scalar CpRef_;
130 
131 
132  // Protected Member Functions
133 
134  virtual tmp<Field<scalar>> rho(const label patchi) const;
135 
136  virtual tmp<Field<scalar>> Cp(const label patchi) const;
137 
138  virtual tmp<volSymmTensorField> devReff() const;
139 
141 
142  //- Set the heat transfer coefficient
143  virtual void htc(volScalarField& htc);
144 
145 
146 public:
147 
148  //- Runtime type information
149  TypeName("ReynoldsAnalogy");
150 
151 
152  // Constructors
153 
154  //- Construct from components
156  (
157  const dictionary& dict,
158  const fvMesh& mesh,
159  const word& TName
160  );
161 
162 
163  //- Destructor
164  virtual ~ReynoldsAnalogy() = default;
165 
166 
167  // Member Functions
168 
169  //- Read from dictionary
170  virtual bool read(const dictionary& dict);
171 };
172 
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 } // End namespace heatTransferCoeffModels
177 } // End namespace Foam
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 #endif
182 
183 // ************************************************************************* //
Foam::heatTransferCoeffModels::ReynoldsAnalogy::devReff
virtual tmp< volSymmTensorField > devReff() const
Definition: ReynoldsAnalogy.C:104
Foam::heatTransferCoeffModels::ReynoldsAnalogy::rhoRef_
scalar rhoRef_
Reference density.
Definition: ReynoldsAnalogy.H:152
Foam::heatTransferCoeffModel
An abstract base class for heat transfer coeffcient models.
Definition: heatTransferCoeffModel.H:63
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::heatTransferCoeffModels::ReynoldsAnalogy::CpRef_
scalar CpRef_
Reference specific heat capacity.
Definition: ReynoldsAnalogy.H:158
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:59
Foam::heatTransferCoeffModels::ReynoldsAnalogy::htc
virtual void htc(volScalarField &htc)
Set the heat transfer coefficient.
Definition: ReynoldsAnalogy.C:248
Foam::heatTransferCoeffModels::ReynoldsAnalogy::Cf
tmp< FieldField< Field, scalar > > Cf() const
Definition: ReynoldsAnalogy.C:164
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:62
Foam::heatTransferCoeffModels::ReynoldsAnalogy::UName_
word UName_
Name of velocity field.
Definition: ReynoldsAnalogy.H:143
Foam::heatTransferCoeffModels::ReynoldsAnalogy::Cp
virtual tmp< Field< scalar > > Cp(const label patchi) const
Definition: ReynoldsAnalogy.C:77
Foam::heatTransferCoeffModels::ReynoldsAnalogy::rho
virtual tmp< Field< scalar > > rho(const label patchi) const
Definition: ReynoldsAnalogy.C:54
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::heatTransferCoeffModels::ReynoldsAnalogy::rhoName_
word rhoName_
Name of density field.
Definition: ReynoldsAnalogy.H:149
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:84
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::vector
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:51
heatTransferCoeffModel.H
Foam::heatTransferCoeffModels::ReynoldsAnalogy::read
virtual bool read(const dictionary &dict)
Read from dictionary.
Definition: ReynoldsAnalogy.C:221
Foam::Vector< scalar >
Foam::heatTransferCoeffModels::ReynoldsAnalogy::TypeName
TypeName("ReynoldsAnalogy")
Runtime type information.
Foam::heatTransferCoeffModels::ReynoldsAnalogy::URef_
vector URef_
Reference velocity.
Definition: ReynoldsAnalogy.H:146
Foam::heatTransferCoeffModels::ReynoldsAnalogy
Heat transfer coefficient calculation based on Reynolds Analogy.
Definition: ReynoldsAnalogy.H:125
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::heatTransferCoeffModels::ReynoldsAnalogy::CpName_
word CpName_
Name of specific heat capacity field.
Definition: ReynoldsAnalogy.H:155
Foam::heatTransferCoeffModels::ReynoldsAnalogy::~ReynoldsAnalogy
virtual ~ReynoldsAnalogy()=default
Destructor.