constant.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::constant
26 
27 Description
28  Constant heat transfer model. The heat transfer coefficient [W/m^2/K] (htc)
29  must be provided as a value in the coefficients dictionary or as a field in
30  constant.
31 
32 Usage
33  Example usage:
34  \verbatim
35  {
36  type constant;
37 
38  AoV 1e3;
39 
40  htc 1e5;
41  }
42  \endverbatim
43 
44 \*---------------------------------------------------------------------------*/
45 
46 #ifndef constant_H
47 #define constant_H
48 
49 #include "heatTransferModel.H"
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 namespace Foam
54 {
55 namespace fv
56 {
57 namespace heatTransferModels
58 {
59 
60 /*---------------------------------------------------------------------------*\
61  Class constant Declaration
62 \*---------------------------------------------------------------------------*/
63 
64 class constant
65 :
66  public heatTransferModel
67 {
68  // Private Data
69 
70  //- Heat transfer coefficient [W/m^2/K]
71  dimensionedScalar htc_;
72 
73  //- Heat transfer coefficient [W/m^2/K]
75 
76 
77  // Private Member Functions
78 
79  //- Non-virtual read
80  void readCoeffs();
81 
82 
83 public:
84 
85  //- Runtime type information
86  TypeName("constant");
87 
88 
89  // Constructors
90 
91  //- Construct from dictionary and mesh
92  constant(const dictionary& dict, const fvMesh& mesh);
93 
94  //- Construct from dictionary and model
95  constant(const dictionary& dict, const interRegionModel& model);
96 
97 
98  //- Destructor
99  virtual ~constant();
100 
101 
102  // Member Functions
103 
104  //- Get the heat transfer coefficient
105  virtual tmp<volScalarField> htc() const;
106 
107  //- Correct the heat transfer coefficient
108  virtual void correct();
109 
110  //- Read dictionary
111  virtual bool read(const dictionary& dict);
112 };
113 
114 
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 
117 } // End namespace heatTransferModels
118 } // End namespace fv
119 } // End namespace Foam
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 #endif
124 
125 // ************************************************************************* //
dictionary dict
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 void correct()
Correct the heat transfer coefficient.
Definition: constant.C:134
Base class for inter-region exchange.
labelList fv(nPoints)
constant(const dictionary &dict, const fvMesh &mesh)
Construct from dictionary and mesh.
Definition: constant.C:89
Constant heat transfer model. The heat transfer coefficient [W/m^2/K] (htc) must be provided as a val...
Definition: constant.H:63
TypeName("constant")
Runtime type information.
virtual bool read(const dictionary &dict)
Read dictionary.
Definition: constant.C:138
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
virtual ~constant()
Destructor.
Definition: constant.C:114
const fvMesh & mesh() const
Return reference to the mesh.
A class for managing temporary objects.
Definition: PtrList.H:53
virtual tmp< volScalarField > htc() const
Get the heat transfer coefficient.
Definition: constant.C:121
Namespace for OpenFOAM.