function2.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::fv::heatTransferCoefficientModels::function2
26 
27 Description
28  Function2 heat transfer model. The 2D function returns the heat transfer
29  coefficient as a function of the local and neighbouring velocity
30  magnitudes.
31 
32 Usage
33  Example usage:
34  \verbatim
35  {
36  heatTransferCoefficientModel function2;
37 
38  htcFunc
39  {
40  type constant;
41  value 1e5;
42  }
43  }
44  \endverbatim
45 
46 \*---------------------------------------------------------------------------*/
47 
48 #ifndef function2_H
49 #define function2_H
50 
52 #include "Function2.H"
53 
54 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55 
56 namespace Foam
57 {
58 namespace fv
59 {
60 namespace heatTransferCoefficientModels
61 {
62 
63 /*---------------------------------------------------------------------------*\
64  Class function2 Declaration
65 \*---------------------------------------------------------------------------*/
66 
67 class function2
68 :
70 {
71  // Private Data
72 
73  //- Reference to the inter region model
74  const interRegionModel& model_;
75 
76  //- Name of velocity field; default = U
77  word UName_;
78 
79  //- Name of neighbour velocity field; default = U
80  word UNbrName_;
81 
82  //- Heat transfer coefficient function ptr
83  autoPtr<Function2<scalar>> htcFunc_;
84 
85  //- Heat transfer coefficient [W/m^2/K]
86  volScalarField htc_;
87 
88 
89  // Private Member Functions
90 
91  //- Non-virtual read
92  void readCoeffs(const dictionary& dict);
93 
94 
95 public:
96 
97  //- Runtime type information
98  TypeName("function2");
99 
100 
101  // Constructors
102 
103  //- Construct from dictionary and model
104  function2(const dictionary& dict, const interRegionModel& model);
105 
106 
107  //- Destructor
108  virtual ~function2();
109 
110 
111  // Member Functions
112 
113  //- Get the heat transfer coefficient
114  virtual tmp<volScalarField> htc() const
115  {
116  return htc_;
117  }
118 
119  //- Correct the heat transfer coefficient
120  virtual void correct();
121 
122  //- Read dictionary
123  virtual bool read(const dictionary& dict);
124 };
125 
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 } // End namespace heatTransferCoefficientModels
130 } // End namespace fv
131 } // End namespace Foam
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 #endif
136 
137 // ************************************************************************* //
Generic GeometricField class.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Base class for heat transfer coefficient modelling used in heat transfer fvModels.
Function2 heat transfer model. The 2D function returns the heat transfer coefficient as a function of...
Definition: function2.H:69
virtual void correct()
Correct the heat transfer coefficient.
Definition: function2.C:99
TypeName("function2")
Runtime type information.
virtual bool read(const dictionary &dict)
Read dictionary.
Definition: function2.C:129
function2(const dictionary &dict, const interRegionModel &model)
Construct from dictionary and model.
Definition: function2.C:62
virtual tmp< volScalarField > htc() const
Get the heat transfer coefficient.
Definition: function2.H:113
Base class for inter-region exchange.
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
labelList fv(nPoints)
dictionary dict