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-2025 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 outer=true,
115  const bool registerObject=true
116  );
117 
118 
119  // Member Functions
120 
121  //- The heat transfer function K used in the enthalpy equation
122  // ddt(alpha1*rho1*ha) + ... = ... K*(Ta - Tb)
123  // ddt(alpha2*rho2*hb) + ... = ... K*(Tb - Ta)
124  tmp<volScalarField> K() const;
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  // with a specified residual volume fraction
130  virtual tmp<volScalarField> K(const scalar residualAlpha) const = 0;
131 
132  //- Dummy write for regIOobject
133  bool writeData(Ostream& os) const;
134 };
135 
136 
137 /*---------------------------------------------------------------------------*\
138  Class blendedHeatTransferModel Declaration
139 \*---------------------------------------------------------------------------*/
140 
142 :
143  public BlendedInterfacialModel<heatTransferModel>
144 {
145 public:
146 
147  // Constructors
148 
149  //- Inherit base class constructors
150  using
153 
154 
155  // Selectors
156 
158  (
159  const dictionary& dict,
160  const phaseInterface& interface,
161  const dictionary& blendingDict
162  )
163  {
165  (
167  );
168  }
169 
170 
171  // Member Functions
172 
173  //- Return the heat transfer coefficient
174  tmp<volScalarField> K() const;
175 
176  //- Return the heat transfer coefficient
177  tmp<volScalarField> K(const scalar residualAlpha) const;
178 };
179 
180 
181 /*---------------------------------------------------------------------------*\
182  Class sidedBlendedHeatTransferModel Declaration
183 \*---------------------------------------------------------------------------*/
184 
186 :
187  public SidedInterfacialModel<blendedHeatTransferModel>
188 {
189 public:
190 
191  // Constructors
192 
193  //- Inherit base class constructors
194  using
197 
198 
199  // Selectors
200 
202  (
203  const dictionary& dict,
204  const phaseInterface& interface,
205  const dictionary& blendingDict
206  )
207  {
209  (
211  );
212  }
213 };
214 
215 
216 /*---------------------------------------------------------------------------*\
217  Class sidedHeatTransferModel Declaration
218 \*---------------------------------------------------------------------------*/
219 
221 :
222  public SidedInterfacialModel<heatTransferModel>
223 {
224 public:
225 
226  // Constructors
227 
228  //- Inherit base class constructors
229  using
232 
233 
234  // Selectors
235 
237  (
238  const dictionary& dict,
240  )
241  {
243  (
245  );
246  }
247 
248 
249  // Member Functions
250 
251  //- Return the heat transfer coefficient
252  tmp<volScalarField> KinThe(const phaseModel& phase) const;
253 
254  //- Return the heat transfer coefficient
256  (
257  const phaseModel& phase,
258  const scalar residualAlpha
259  ) const;
260 };
261 
262 
263 /*---------------------------------------------------------------------------*\
264  Class blendedSidedHeatTransferModel Declaration
265 \*---------------------------------------------------------------------------*/
266 
268 :
269  public BlendedInterfacialModel<sidedHeatTransferModel>
270 {
271 public:
272 
273  // Constructors
274 
275  //- Inherit base class constructors
276  using
279 
280 
281  // Selectors
282 
284  (
285  const dictionary& dict,
286  const phaseInterface& interface,
287  const dictionary& blendingDict
288  )
289  {
291  (
293  );
294  }
295 
296 
297  // Member Functions
298 
299  //- Return the heat transfer coefficient
300  tmp<volScalarField> KinThe(const phaseModel& phase) const;
301 
302  //- Return the heat transfer coefficient
304  (
305  const phaseModel& phase,
306  const scalar residualAlpha
307  ) const;
308 };
309 
310 
311 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
312 
313 } // End namespace Foam
314 
315 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
316 
317 #endif
318 
319 // ************************************************************************* //
Wrapper class for interfacial models for which multiple instances of the model are used for different...
BlendedInterfacialModel(const dictionary &dict, const phaseInterface &interface, const dictionary &blendingDict, const Args &... args)
Construct from a dictionary, an interface and a blending dictionary.
const phaseInterface & interface() const
Access the interface.
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 dictionary &dict, const phaseInterface &interface, const Args &... args)
Construct from a dictionary and an interface.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
tmp< volScalarField > K() const
Return the heat transfer coefficient.
static autoPtr< blendedHeatTransferModel > New(const dictionary &dict, const phaseInterface &interface, const dictionary &blendingDict)
static autoPtr< blendedSidedHeatTransferModel > New(const dictionary &dict, const phaseInterface &interface, const dictionary &blendingDict)
tmp< volScalarField > KinThe(const phaseModel &phase) const
Return the heat transfer coefficient.
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 const dimensionSet dimK
Coefficient dimensions.
static autoPtr< heatTransferModel > New(const dictionary &dict, const phaseInterface &interface, const bool outer=true, const bool registerObject=true)
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 dictionary &dict, const phaseInterface &interface, const dictionary &blendingDict)
tmp< volScalarField > KinThe(const phaseModel &phase) const
Return the heat transfer coefficient.
static autoPtr< sidedHeatTransferModel > New(const dictionary &dict, const phaseInterface &interface)
A class for managing temporary objects.
Definition: tmp.H:55
Namespace for OpenFOAM.
void outer(LagrangianPatchField< typename outerProduct< Type1, Type2 >::type > &f, const LagrangianPatchField< Type1 > &f1, const LagrangianPatchField< Type2 > &f2)
const dictionary & blendingDict(const phaseSystem &fluid, const dictionary &dict)
Macros to ease declaration of run-time selection tables.
dictionary dict