oneResistanceHeatTransfer.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::oneResistanceHeatTransfer
26 
27 Description
28  Model for heat transfer between two phases. One heat transfer coefficient
29  is used to calculate the heat flux from the temperature difference between
30  two phases.
31 
32 Usage
33  Example usage:
34  \verbatim
35  heatTransfer
36  {
37  type oneResistanceHeatTransfer;
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
50  {
51  type RanzMarshall;
52  residualAlpha 1e-4;
53  }
54  water_dispersedIn_air
55  {
56  type RanzMarshall;
57  residualAlpha 1e-4;
58  }
59  }
60  \endverbatim
61 
62 SourceFiles
63  oneResistanceHeatTransfer.C
64 
65 \*---------------------------------------------------------------------------*/
66 
67 #ifndef oneResistanceHeatTransfer_H
68 #define oneResistanceHeatTransfer_H
69 
70 #include "phaseSystem.H"
71 #include "heatTransferModel.H"
72 
73 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
74 
75 namespace Foam
76 {
77 namespace fv
78 {
79 
80 /*---------------------------------------------------------------------------*\
81  Class oneResistanceHeatTransfer Declaration
82 \*---------------------------------------------------------------------------*/
83 
85 :
86  public fvModel
87 {
88 private:
89 
90  // Private Type Definitions
91 
92  //- Table of heat transfer models
93  typedef
95  <
99  > modelsTable;
100 
101  //- Table of heat transfer coefficients
102  typedef
103  HashTable
104  <
108  > KsTable;
109 
110 
111  // Private Data
112 
113  //- Phase system
114  const phaseSystem& fluid_;
115 
116  //- Blended heat transfer coefficient models
117  modelsTable models_;
118 
119  //- Names of the affected energy fields
120  wordList heNames_;
121 
122  //- Counter for the evaluations of the energy equation sources
123  mutable label energyEquationIndex_;
124 
125  //- Cached heat transfer coefficients
126  mutable KsTable Ks_;
127 
128 
129  // Private Member Functions
130 
131  //- Non-virtual read
132  void readCoeffs(const dictionary& dict);
133 
134  //- Get the heat transfer coefficients
135  const KsTable& Ks() const;
136 
137 
138 public:
139 
140  //- Runtime type information
141  TypeName("oneResistanceHeatTransfer");
142 
143 
144  // Constructors
145 
146  //- Construct from explicit source name and mesh
148  (
149  const word& name,
150  const word& modelType,
151  const fvMesh& mesh,
152  const dictionary& dict
153  );
154 
155 
156  // Member Functions
157 
158  // Access
159 
160  //- Return the heat transfer coefficient between a pair of phases
162  (
163  const phaseModel& phase1,
164  const phaseModel& phase2
165  ) const;
166 
167 
168  // Checks
169 
170  //- Return the list of fields for which the fvModel adds source term
171  // to the transport equation
172  virtual wordList addSupFields() const;
173 
174 
175  // Sources
176 
177  //- Add a source term to the phase-compressible energy equation
178  void addSup
179  (
180  const volScalarField& alpha,
181  const volScalarField& rho,
182  const volScalarField& he,
183  fvMatrix<scalar>& eqn
184  ) const;
185 
186 
187  // Mesh changes
188 
189  //- Update for mesh motion
190  virtual bool movePoints();
191 
192  //- Update topology using the given map
193  virtual void topoChange(const polyTopoChangeMap&);
194 
195  //- Update from another mesh using the given map
196  virtual void mapMesh(const polyMeshMap&);
197 
198  //- Redistribute or update using the given distribution map
199  virtual void distribute(const polyDistributionMap&);
200 
201 
202  //- Correct the fvModel
203  virtual void correct();
204 
205 
206  // IO
207 
208  //- Read source dictionary
209  virtual bool read(const dictionary& dict);
210 };
211 
212 
213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214 
215 } // End namespace fv
216 } // End namespace Foam
217 
218 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
219 
220 #endif
221 
222 // ************************************************************************* //
Generic GeometricField class.
A HashTable specialisation for hashing pointers.
Definition: HashPtrTable.H:68
An STL-conforming hash table.
Definition: HashTable.H:127
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. One heat transfer coefficient is used to calculate the he...
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.
tmp< volScalarField > K(const phaseModel &phase1, const phaseModel &phase2) const
Return the heat transfer coefficient between a pair of phases.
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.
oneResistanceHeatTransfer(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from explicit source name and mesh.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
TypeName("oneResistanceHeatTransfer")
Runtime type information.
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 managing temporary objects.
Definition: tmp.H:55
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