function1.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::function1
26 
27 Description
28  Function1 heat transfer model. The 1D function returns the heat transfer
29  coefficient as a function of the local velocity magnitude.
30 
31 Usage
32  Example usage:
33  \verbatim
34  {
35  heatTransferCoefficientModel function1;
36 
37  htcFunc
38  {
39  type constant;
40  value 1e5;
41  }
42  }
43  \endverbatim
44 
45 \*---------------------------------------------------------------------------*/
46 
47 #ifndef function1_H
48 #define function1_H
49 
51 #include "Function1.H"
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 namespace Foam
56 {
57 namespace fv
58 {
59 namespace heatTransferCoefficientModels
60 {
61 
62 /*---------------------------------------------------------------------------*\
63  Class function1 Declaration
64 \*---------------------------------------------------------------------------*/
65 
66 class function1
67 :
69 {
70  // Private Data
71 
72  //- Name of velocity field; default = U
73  word UName_;
74 
75  //- Heat transfer coefficient [W/m^2/K]
76  autoPtr<Function1<scalar>> htcFunc_;
77 
78 
79  // Private Member Functions
80 
81  //- Non-virtual read
82  void readCoeffs(const dictionary& dict);
83 
84 
85 public:
86 
87  //- Runtime type information
88  TypeName("function1");
89 
90 
91  // Constructors
92 
93  //- Construct from dictionary and mesh
94  function1(const dictionary& dict, const fvMesh& mesh);
95 
96  //- Construct from dictionary and model
97  function1(const dictionary& dict, const interRegionModel& model);
98 
99 
100  //- Destructor
101  virtual ~function1();
102 
103 
104  // Member Functions
105 
106  //- Get the heat transfer coefficient
107  virtual tmp<volScalarField> htc() const;
108 
109  //- Correct the heat transfer coefficient
110  virtual void correct();
111 
112  //- Read dictionary
113  virtual bool read(const dictionary& dict);
114 };
115 
116 
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 
119 } // End namespace heatTransferCoefficientModels
120 } // End namespace fv
121 } // End namespace Foam
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 #endif
126 
127 // ************************************************************************* //
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
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:101
Base class for heat transfer coefficient modelling used in heat transfer fvModels.
Function1 heat transfer model. The 1D function returns the heat transfer coefficient as a function of...
Definition: function1.H:68
TypeName("function1")
Runtime type information.
virtual void correct()
Correct the heat transfer coefficient.
Definition: function1.C:113
function1(const dictionary &dict, const fvMesh &mesh)
Construct from dictionary and mesh.
Definition: function1.C:61
virtual bool read(const dictionary &dict)
Read dictionary.
Definition: function1.C:118
virtual tmp< volScalarField > htc() const
Get the heat transfer coefficient.
Definition: function1.C:93
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