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-2021 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::heatTransferModels::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  type function1;
36 
37  AoV 1e3;
38 
39  htcFunc
40  {
41  type constant;
42  value 1e5;
43  }
44  }
45  \endverbatim
46 
47 \*---------------------------------------------------------------------------*/
48 
49 #ifndef function1_H
50 #define function1_H
51 
52 #include "heatTransferModel.H"
53 #include "Function1.H"
54 
55 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 
57 namespace Foam
58 {
59 namespace fv
60 {
61 namespace heatTransferModels
62 {
63 
64 /*---------------------------------------------------------------------------*\
65  Class function1 Declaration
66 \*---------------------------------------------------------------------------*/
67 
68 class function1
69 :
70  public heatTransferModel
71 {
72  // Private Data
73 
74  //- Name of velocity field; default = U
75  word UName_;
76 
77  //- Heat transfer coefficient [W/m^2/K]
78  autoPtr<Function1<scalar>> htcFunc_;
79 
80 
81  // Private Member Functions
82 
83  //- Non-virtual read
84  void readCoeffs();
85 
86 
87 public:
88 
89  //- Runtime type information
90  TypeName("function1");
91 
92 
93  // Constructors
94 
95  //- Construct from dictionary and mesh
96  function1(const dictionary& dict, const fvMesh& mesh);
97 
98  //- Construct from dictionary and model
99  function1(const dictionary& dict, const interRegionModel& model);
100 
101 
102  //- Destructor
103  virtual ~function1();
104 
105 
106  // Member Functions
107 
108  //- Get the heat transfer coefficient
109  virtual tmp<volScalarField> htc() const;
110 
111  //- Correct the heat transfer coefficient
112  virtual void correct();
113 
114  //- Read dictionary
115  virtual bool read(const dictionary& dict);
116 };
117 
118 
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 
121 } // End namespace heatTransferModels
122 } // End namespace fv
123 } // End namespace Foam
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 #endif
128 
129 // ************************************************************************* //
dictionary dict
function1(const dictionary &dict, const fvMesh &mesh)
Construct from dictionary and mesh.
Definition: function1.C:58
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
Base class for heat transfer coefficient modelling used in heat transfer fvModels. Area per unit volume [1/m] (AoV) must be provided as a value in the coefficients dictionary or as a field in constant.
virtual ~function1()
Destructor.
Definition: function1.C:83
TypeName("function1")
Runtime type information.
Base class for inter-region exchange.
A class for handling words, derived from string.
Definition: word.H:59
labelList fv(nPoints)
Function1 heat transfer model. The 1D function returns the heat transfer coefficient as a function of...
Definition: function1.H:67
virtual tmp< volScalarField > htc() const
Get the heat transfer coefficient.
Definition: function1.C:90
virtual void correct()
Correct the heat transfer coefficient.
Definition: function1.C:110
virtual bool read(const dictionary &dict)
Read dictionary.
Definition: function1.C:114
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:95
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
const fvMesh & mesh() const
Return reference to the mesh.
A class for managing temporary objects.
Definition: PtrList.H:53
Namespace for OpenFOAM.