All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
heatTransfer.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) 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::heatTransfer
26 
27 Description
28  Model for heat exchange. Requires specification of an ambient temperature
29  with which to exchange heat, and a model for the heat transfer coefficient
30  (htc) and the area per unit volume (AoV). These are then used to apply the
31  following source to the energy equation:
32 
33  \f[
34  -htc*AoV*(T_a - T)
35  \f]
36 
37  If the semiImplicit option is set, then this becomes:
38 
39  \f[
40  -htc*AoV*(T_a - T) + htc*AoV/Cp*h - Sp(htc*AoV/Cp, h);
41  \f]
42 
43 Usage
44  Example usage:
45  \verbatim
46  heatTransfer
47  {
48  type heatTransfer;
49 
50  heatTransferCoeffs
51  {
52  selectionMode cellSet;
53  cellSet c0;
54 
55  semiImplicit no;
56 
57  Ta 300;
58 
59  type constant;
60 
61  AoV 200;
62  htc 10;
63  }
64  }
65  \endverbatim
66 
67 See also
68  fv::heatTransferModel
69 
70 SourceFiles
71  heatTransfer.C
72 
73 \*---------------------------------------------------------------------------*/
74 
75 #ifndef heatTransfer_H
76 #define heatTransfer_H
77 
78 #include "fvModel.H"
79 #include "fvCellSet.H"
80 #include "heatTransferModel.H"
81 
82 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
83 
84 namespace Foam
85 {
86 namespace fv
87 {
88 
89 /*---------------------------------------------------------------------------*\
90  Class heatTransfer Declaration
91 \*---------------------------------------------------------------------------*/
92 
93 class heatTransfer
94 :
95  public fvModel
96 {
97  // Private data
98 
99  //- The set of cells the model applies to
100  fvCellSet set_;
101 
102  //- Flag to activate semi-implicit coupling
103  bool semiImplicit_;
104 
105  //- Name of temperature field; default = "T"
106  word TName_;
107 
108  //- Ambient temperature
109  dimensionedScalar Ta_;
110 
111  //- The heat transfer model
112  autoPtr<heatTransferModel> heatTransferModel_;
113 
114 
115  // Private member functions
116 
117  //- Non-virtual read
118  void readCoeffs();
119 
120 
121 public:
122 
123  //- Runtime type information
124  TypeName("heatTransfer");
125 
126 
127  // Constructors
128 
129  //- Construct from dictionary
131  (
132  const word& name,
133  const word& modelType,
134  const dictionary& dict,
135  const fvMesh& mesh
136  );
137 
138 
139  //- Destructor
140  virtual ~heatTransfer();
141 
142 
143  // Member Functions
144 
145  // Checks
146 
147  //- Return the list of fields for which the fvModel adds source term
148  // to the transport equation
149  virtual wordList addSupFields() const;
150 
151 
152  // Sources
153 
154  //- Source term to energy equation
155  virtual void addSup
156  (
157  fvMatrix<scalar>& eqn,
158  const word& fieldName
159  ) const;
160 
161  //- Source term to compressible energy equation
162  virtual void addSup
163  (
164  const volScalarField& rho,
165  fvMatrix<scalar>& eqn,
166  const word& fieldName
167  ) const;
168 
169 
170  // Correction
171 
172  //- Correct the model
173  virtual void correct();
174 
175 
176  // IO
177 
178  //- Read dictionary
179  virtual bool read(const dictionary& dict);
180 };
181 
182 
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 
185 } // End namespace fv
186 } // End namespace Foam
187 
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 
190 #endif
191 
192 // ************************************************************************* //
heatTransfer(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from dictionary.
Definition: heatTransfer.C:68
dictionary dict
const word & name() const
Return const access to the source name.
Definition: fvModelI.H:28
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
Cell-set fvConstraint abstract base class. Provides a base set of controls regarding the location whe...
virtual bool read(const dictionary &dict)
Read dictionary.
Definition: heatTransfer.C:162
Finite volume model abstract base class.
Definition: fvModel.H:55
TypeName("heatTransfer")
Runtime type information.
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvModelI.H:34
A class for handling words, derived from string.
Definition: word.H:59
labelList fv(nPoints)
virtual ~heatTransfer()
Destructor.
Definition: heatTransfer.C:88
A special matrix type and solver, designed for finite volume solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.
Definition: fvPatchField.H:72
virtual void correct()
Correct the model.
Definition: heatTransfer.C:156
Model for heat exchange. Requires specification of an ambient temperature with which to exchange heat...
Definition: heatTransfer.H:92
virtual wordList addSupFields() const
Return the list of fields for which the fvModel adds source term.
Definition: heatTransfer.C:94
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 void addSup(fvMatrix< scalar > &eqn, const word &fieldName) const
Source term to energy equation.
Definition: heatTransfer.C:104
Namespace for OpenFOAM.