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-2022 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  // Mesh changes
177 
178  //- Update for mesh motion
179  virtual bool movePoints();
180 
181  //- Update topology using the given map
182  virtual void topoChange(const polyTopoChangeMap&);
183 
184  //- Update from another mesh using the given map
185  virtual void mapMesh(const polyMeshMap&);
186 
187  //- Redistribute or update using the given distribution map
188  virtual void distribute(const polyDistributionMap&);
189 
190 
191  // IO
192 
193  //- Read dictionary
194  virtual bool read(const dictionary& dict);
195 };
196 
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
200 } // End namespace fv
201 } // End namespace Foam
202 
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 
205 #endif
206 
207 // ************************************************************************* //
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
Definition: heatTransfer.C:181
heatTransfer(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)
Construct from dictionary.
Definition: heatTransfer.C:68
dictionary dict
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
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:187
Finite volume model abstract base class.
Definition: fvModel.H:57
TypeName("heatTransfer")
Runtime type information.
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvModelI.H:34
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
Definition: heatTransfer.C:169
A class for handling words, derived from string.
Definition: word.H:59
labelList fv(nPoints)
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
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
virtual bool movePoints()
Update for mesh motion.
Definition: heatTransfer.C:162
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
Definition: heatTransfer.C:175
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:95
virtual void addSup(fvMatrix< scalar > &eqn, const word &fieldName) const
Source term to energy equation.
Definition: heatTransfer.C:104
Class containing mesh-to-mesh mapping information.
Definition: polyMeshMap.H:50
Namespace for OpenFOAM.