twoResistanceHeatTransfer.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) 2024-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::fv::twoResistanceHeatTransfer
26 
27 Description
28  Model for heat transfer between two phases. Two heat transfer coefficients
29  are used to calculate the heat fluxes that result from the temperature
30  differences between two phases and their shared interface.
31 
32 Usage
33  Example usage:
34  \verbatim
35  heatTransfer
36  {
37  type twoResistanceHeatTransfer;
38  libs ("libmultiphaseEulerFvModels.so");
39 
40  blending
41  {
42  type linear;
43  minPartlyContinuousAlpha.air 0;
44  minFullyContinuousAlpha.air 1;
45  minPartlyContinuousAlpha.water 0;
46  minFullyContinuousAlpha.water 1;
47  }
48 
49  air_dispersedIn_water_inThe_air
50  {
51  type spherical;
52  residualAlpha 1e-4;
53  }
54  air_dispersedIn_water_inThe_water
55  {
56  type RanzMarshall;
57  residualAlpha 1e-4;
58  }
59  water_dispersedIn_air_inThe_air
60  {
61  type RanzMarshall;
62  residualAlpha 1e-4;
63  }
64  water_dispersedIn_air_inThe_water
65  {
66  type spherical;
67  residualAlpha 1e-4;
68  }
69  }
70  \endverbatim
71 
72 SourceFiles
73  twoResistanceHeatTransfer.C
74 
75 \*---------------------------------------------------------------------------*/
76 
77 #ifndef twoResistanceHeatTransfer_H
78 #define twoResistanceHeatTransfer_H
79 
80 #include "phaseSystem.H"
81 #include "heatTransferModel.H"
82 
83 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
84 
85 namespace Foam
86 {
87 namespace fv
88 {
89 
90 /*---------------------------------------------------------------------------*\
91  Class twoResistanceHeatTransfer Declaration
92 \*---------------------------------------------------------------------------*/
93 
95 :
96  public fvModel
97 {
98 private:
99 
100  // Private Type Definitions
101 
102  //- Table of heat transfer models
103  typedef
105  <
109  > modelsTable;
110 
111  //- Table of heat transfer coefficients
112  typedef
113  HashTable
114  <
118  > KsTable;
119 
120 
121  // Private Data
122 
123  //- Phase system
124  const phaseSystem& fluid_;
125 
126  //- Blended-sided heat transfer coefficient models
127  modelsTable models_;
128 
129  //- Names of the affected energy fields
130  wordList heNames_;
131 
132  //- Counter for the evaluations of the energy equation sources
133  mutable label energyEquationIndex_;
134 
135  //- Cached heat transfer coefficients
136  mutable KsTable Ks_;
137 
138 
139  // Private Member Functions
140 
141  //- Non-virtual read
142  void readCoeffs(const dictionary& dict);
143 
144  //- Get the heat transfer coefficients
145  const KsTable& Ks() const;
146 
147 
148 public:
149 
150  //- Runtime type information
151  TypeName("twoResistanceHeatTransfer");
152 
153 
154  // Constructors
155 
156  //- Construct from explicit source name and mesh
158  (
159  const word& name,
160  const word& modelType,
161  const fvMesh& mesh,
162  const dictionary& dict
163  );
164 
165 
166  // Member Functions
167 
168  // Access
169 
170  //- Return the heat transfer coefficients between a pair of phases
172  (
173  const phaseModel& phase1,
174  const phaseModel& phase2
175  ) const;
176 
177  //- Return the heat transfer coefficients between a pair of phases
178  // with a specified residual volume fraction
180  (
181  const phaseModel& phase1,
182  const phaseModel& phase2,
183  const scalar residualAlpha
184  ) const;
185 
186 
187  // Checks
188 
189  //- Return the list of fields for which the fvModel adds source term
190  // to the transport equation
191  virtual wordList addSupFields() const;
192 
193 
194  // Sources
195 
196  //- Add a source term to the phase-compressible energy equation
197  void addSup
198  (
199  const volScalarField& alpha,
200  const volScalarField& rho,
201  const volScalarField& he,
202  fvMatrix<scalar>& eqn
203  ) const;
204 
205 
206  // Mesh changes
207 
208  //- Update for mesh motion
209  virtual bool movePoints();
210 
211  //- Update topology using the given map
212  virtual void topoChange(const polyTopoChangeMap&);
213 
214  //- Update from another mesh using the given map
215  virtual void mapMesh(const polyMeshMap&);
216 
217  //- Redistribute or update using the given distribution map
218  virtual void distribute(const polyDistributionMap&);
219 
220 
221  //- Correct the fvModel
222  virtual void correct();
223 
224 
225  // IO
226 
227  //- Read source dictionary
228  virtual bool read(const dictionary& dict);
229 };
230 
231 
232 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
233 
234 } // End namespace fv
235 } // End namespace Foam
236 
237 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
238 
239 #endif
240 
241 // ************************************************************************* //
Generic GeometricField class.
A HashTable specialisation for hashing pointers.
Definition: HashPtrTable.H:68
An STL-conforming hash table.
Definition: HashTable.H:127
An ordered pair of two objects of type <Type> with first() and second() elements.
Definition: Pair.H:67
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvMatrix.H:118
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:98
Finite volume model abstract base class.
Definition: fvModel.H:60
const fvMesh & mesh() const
Return const access to the mesh database.
Definition: fvModelI.H:69
const word & name() const
Return const access to the source name.
Definition: fvModelI.H:57
Model for heat transfer between two phases. Two heat transfer coefficients are used to calculate the ...
virtual bool movePoints()
Update for mesh motion.
virtual wordList addSupFields() const
Return the list of fields for which the fvModel adds source term.
void addSup(const volScalarField &alpha, const volScalarField &rho, const volScalarField &he, fvMatrix< scalar > &eqn) const
Add a source term to the phase-compressible energy equation.
virtual void correct()
Correct the fvModel.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
virtual bool read(const dictionary &dict)
Read source dictionary.
TypeName("twoResistanceHeatTransfer")
Runtime type information.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
twoResistanceHeatTransfer(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from explicit source name and mesh.
Word-pair based class used for keying interface models in hash tables.
Class to represent a system of phases.
Definition: phaseSystem.H:74
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Definition: polyMeshMap.H:51
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
A class for handling words, derived from string.
Definition: word.H:63
rho
Definition: pEqn.H:1
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
labelList fv(nPoints)
dictionary dict