heatTransferModel.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-2026 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::heatTransferModel
26 
27 Description
28  Model for heat transfer between phases
29 
30 SourceFiles
31  heatTransferModel.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef heatTransferModel_H
36 #define heatTransferModel_H
37 
38 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 
40 #include "volFields.H"
41 #include "dictionary.H"
42 #include "runTimeSelectionTables.H"
44 #include "SidedInterfacialModel.H"
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class heatTransferModel Declaration
51 \*---------------------------------------------------------------------------*/
52 
54 :
55  public regIOobject
56 {
57 protected:
58 
59  // Protected data
60 
61  //- Residual phase fraction
63 
64 
65 public:
66 
67  //- Runtime type information
68  TypeName("heatTransferModel");
69 
70 
71  // Declare runtime construction
72 
74  (
75  autoPtr,
77  dictionary,
78  (
79  const dictionary& dict,
80  const phaseInterface& interface,
81  const bool registerObject
82  ),
83  (dict, interface, registerObject)
84  );
85 
86 
87  // Static Data Members
88 
89  //- Coefficient dimensions
90  static const dimensionSet dimK;
91 
92 
93  // Constructors
94 
95  //- Construct from a dictionary and an interface
97  (
98  const dictionary& dict,
99  const phaseInterface& interface,
100  const bool registerObject
101  );
102 
103 
104  //- Destructor
105  virtual ~heatTransferModel();
106 
107 
108  // Selectors
109 
111  (
112  const dictionary& dict,
113  const phaseInterface& interface,
114  const bool registerObject = false
115  );
116 
118  (
119  const UPtrList<const dictionary>& subDicts,
120  const phaseInterface& interface
121  );
122 
123 
124  // Member Functions
125 
126  //- The heat transfer function K used in the enthalpy equation
127  // ddt(alpha1*rho1*ha) + ... = ... K*(Ta - Tb)
128  // ddt(alpha2*rho2*hb) + ... = ... K*(Tb - Ta)
129  tmp<volScalarField> K() const;
130 
131  //- The heat transfer function K used in the enthalpy equation
132  // ddt(alpha1*rho1*ha) + ... = ... K*(Ta - Tb)
133  // ddt(alpha2*rho2*hb) + ... = ... K*(Tb - Ta)
134  // with a specified residual volume fraction
135  virtual tmp<volScalarField> K(const scalar residualAlpha) const = 0;
136 
137  //- Dummy write for regIOobject
138  bool writeData(Ostream& os) const;
139 };
140 
141 
142 /*---------------------------------------------------------------------------*\
143  Class blendedHeatTransferModel Declaration
144 \*---------------------------------------------------------------------------*/
145 
147 :
148  public BlendedInterfacialModel<heatTransferModel>
149 {
150 public:
151 
152  // Constructors
153 
154  //- Inherit base class constructors
155  using
158 
159 
160  // Selectors
161 
163  (
164  const UPtrList<const dictionary>& subDicts,
165  const phaseInterface& interface,
166  const dictionary& blendingDict
167  )
168  {
170  (
172  );
173  }
174 
175 
176  // Member Functions
177 
178  //- Return the heat transfer coefficient
179  tmp<volScalarField> K() const;
180 
181  //- Return the heat transfer coefficient
182  tmp<volScalarField> K(const scalar residualAlpha) const;
183 };
184 
185 
186 /*---------------------------------------------------------------------------*\
187  Class sidedBlendedHeatTransferModel Declaration
188 \*---------------------------------------------------------------------------*/
189 
191 :
192  public SidedInterfacialModel<blendedHeatTransferModel>
193 {
194 public:
195 
196  // Constructors
197 
198  //- Inherit base class constructors
199  using
202 
203 
204  // Selectors
205 
207  (
208  const UPtrList<const dictionary>& subDicts,
209  const phaseInterface& interface,
210  const dictionary& blendingDict
211  )
212  {
214  (
216  (
217  subDicts,
218  interface,
220  )
221  );
222  }
223 };
224 
225 
226 /*---------------------------------------------------------------------------*\
227  Class sidedHeatTransferModel Declaration
228 \*---------------------------------------------------------------------------*/
229 
231 :
232  public SidedInterfacialModel<heatTransferModel>
233 {
234 public:
235 
236  // Constructors
237 
238  //- Inherit base class constructors
239  using
242 
243 
244  // Selectors
245 
247  (
248  const UPtrList<const dictionary>& subDicts,
250  )
251  {
253  (
254  new sidedHeatTransferModel(subDicts, interface)
255  );
256  }
257 
258 
259  // Member Functions
260 
261  //- Return the heat transfer coefficient
262  tmp<volScalarField> KinThe(const phaseModel& phase) const;
263 
264  //- Return the heat transfer coefficient
266  (
267  const phaseModel& phase,
268  const scalar residualAlpha
269  ) const;
270 };
271 
272 
273 /*---------------------------------------------------------------------------*\
274  Class blendedSidedHeatTransferModel Declaration
275 \*---------------------------------------------------------------------------*/
276 
278 :
279  public BlendedInterfacialModel<sidedHeatTransferModel>
280 {
281 public:
282 
283  // Constructors
284 
285  //- Inherit base class constructors
286  using
289 
290 
291  // Selectors
292 
294  (
295  const UPtrList<const dictionary>& subDicts,
296  const phaseInterface& interface,
297  const dictionary& blendingDict
298  )
299  {
301  (
303  (
304  subDicts,
305  interface,
307  )
308  );
309  }
310 
311 
312  // Member Functions
313 
314  //- Return the heat transfer coefficient
315  tmp<volScalarField> KinThe(const phaseModel& phase) const;
316 
317  //- Return the heat transfer coefficient
319  (
320  const phaseModel& phase,
321  const scalar residualAlpha
322  ) const;
323 };
324 
325 
326 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
327 
328 } // End namespace Foam
329 
330 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
331 
332 #endif
333 
334 // ************************************************************************* //
Wrapper class for interfacial models for which multiple instances of the model are used for different...
const phaseInterface & interface() const
Access the interface.
BlendedInterfacialModel(const UPtrList< const dictionary > &subDicts, const phaseInterface &interface, const dictionary &blendingDict, const Args &... args)
Construct from a dictionary, an interface and a blending dictionary.
bool & registerObject()
Register object created from this IOobject with registry if true.
Definition: IOobject.H:343
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
Wrapper class for interfacial models for which two instances of the model are used per interface; one...
const phaseInterface & interface() const
Access the interface.
SidedInterfacialModel(const UPtrList< const dictionary > &subDicts, const phaseInterface &interface, const Args &... args)
Construct from a dictionary and an interface.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: UPtrList.H:66
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
static autoPtr< blendedHeatTransferModel > New(const UPtrList< const dictionary > &subDicts, const phaseInterface &interface, const dictionary &blendingDict)
tmp< volScalarField > K() const
Return the heat transfer coefficient.
tmp< volScalarField > KinThe(const phaseModel &phase) const
Return the heat transfer coefficient.
static autoPtr< blendedSidedHeatTransferModel > New(const UPtrList< const dictionary > &subDicts, const phaseInterface &interface, const dictionary &blendingDict)
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Dimension set for the base types.
Definition: dimensionSet.H:125
Model for heat transfer between phases.
virtual ~heatTransferModel()
Destructor.
bool writeData(Ostream &os) const
Dummy write for regIOobject.
const dimensionedScalar residualAlpha_
Residual phase fraction.
declareRunTimeSelectionTable(autoPtr, heatTransferModel, dictionary,(const dictionary &dict, const phaseInterface &interface, const bool registerObject),(dict, interface, registerObject))
heatTransferModel(const dictionary &dict, const phaseInterface &interface, const bool registerObject)
Construct from a dictionary and an interface.
tmp< volScalarField > K() const
The heat transfer function K used in the enthalpy equation.
TypeName("heatTransferModel")
Runtime type information.
static autoPtr< heatTransferModel > New(const dictionary &dict, const phaseInterface &interface, const bool registerObject=false)
static const dimensionSet dimK
Coefficient dimensions.
Class to represent an interface between phases. Derivations can further specify the configuration of ...
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:55
static autoPtr< sidedBlendedHeatTransferModel > New(const UPtrList< const dictionary > &subDicts, const phaseInterface &interface, const dictionary &blendingDict)
static autoPtr< sidedHeatTransferModel > New(const UPtrList< const dictionary > &subDicts, const phaseInterface &interface)
tmp< volScalarField > KinThe(const phaseModel &phase) const
Return the heat transfer coefficient.
A class for managing temporary objects.
Definition: tmp.H:55
Namespace for OpenFOAM.
const dictionary & blendingDict(const phaseSystem &fluid, const dictionary &dict)
Macros to ease declaration of run-time selection tables.
dictionary dict