ThermalPhaseChangePhaseSystem.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) 2015-2023 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::ThermalPhaseChangePhaseSystem
26 
27 Description
28  Class to provide interfacial heat and mass transfer between a number of
29  phases according the interfacial temperature approximated by the saturation
30  temperature.
31 
32  Based on the implementation described in:
33 
34  \verbatim
35  Peltola, J., Pättikangas, T., Bainbridge, W., Lehnigk, R., Schlegel, F.
36  (2019).
37  On Development and validation of subcooled nucleate boiling models for
38  OpenFOAM Foundation Release.
39  NURETH-18 Conference Proceedings, Portland, Oregon, United States, 2019.
40  \endverbatim
41 
42  The present implementation includes simplified support for non-volatile
43  components in addition to a single volatile component in order to account
44  compressibility effects when non-volatile gas bubbles of non-volatile gas
45  filled pressure reservoirs are present.
46 
47  The phase change mass transfer calculation is still only dependent on the
48  interfacial temperature estimate and interfacial heat transfer models.
49  The mass diffusion effects in presence of non-volatile components at the
50  interface are neglected.
51 
52 
53 SourceFiles
54  ThermalPhaseChangePhaseSystem.C
55 
56 \*---------------------------------------------------------------------------*/
57 
58 #ifndef ThermalPhaseChangePhaseSystem_H
59 #define ThermalPhaseChangePhaseSystem_H
60 
61 #include "phaseSystem.H"
63 #include "Switch.H"
64 
65 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
66 
67 namespace Foam
68 {
69 
70 /*---------------------------------------------------------------------------*\
71  Class ThermalPhaseChangePhaseSystem Declaration
72 \*---------------------------------------------------------------------------*/
73 
74 template<class BasePhaseSystem>
76 :
77  public BasePhaseSystem
78 {
79  // Private typedefs
80 
81  typedef HashTable
82  <
87 
88  using latentHeatScheme = typename BasePhaseSystem::latentHeatScheme;
89 
90  using latentHeatTransfer = typename BasePhaseSystem::latentHeatTransfer;
91 
92 
93  // Private data
94 
95  //- Name of the volatile specie
96  word volatile_;
97 
98  //- Saturation models used to evaluate Tsat = Tf
99  saturationModelTable saturationModels_;
100 
101  //- Mass transfer rates
102  phaseSystem::dmdtfTable dmdtfs_;
103 
104  //- Mass transfer linearisation coeffs
105  phaseSystem::dmdtfTable d2mdtdpfs_;
106 
107  //- Interface temperatures
109 
110  //- Saturation temperatures
112 
113  //- Nucleate Mass transfer rates
114  phaseSystem::dmdtfTable nDmdtfs_;
115 
116  //- Nucleate thermal energy transfer rates
117  phaseSystem::dmdtfTable nDmdtLfs_;
118 
119  //- Previous continuity error update phase dmdts for the heat transfer
120  // function
121  PtrList<volScalarField> dmdt0s_;
122 
123  //- Switch to control whether or not mass transfer rates are linearised
124  // in the pressure equation
125  Switch pressureImplicit_;
126 
127  // Private Member Functions
128 
129  //- Sum the mass transfer rates for each phase into the given list
130  void addDmdts(PtrList<volScalarField>&) const;
131 
132 
133 public:
134 
135  // Constructors
136 
137  //- Construct from fvMesh
139 
140 
141  //- Destructor
143 
144 
145  // Member Functions
146 
147  //- Return the saturation temperature model for an interface
149  (
150  const phaseInterfaceKey& key
151  ) const;
152 
153  //- Return the mass transfer rate for an interface
154  virtual tmp<volScalarField> dmdtf(const phaseInterfaceKey& key) const;
155 
156  //- Return the mass transfer rates for each phase
157  virtual PtrList<volScalarField> dmdts() const;
158 
159  //- Return the mass transfer linearisation coeffs for each phase
160  virtual PtrList<volScalarField> d2mdtdps() const;
161 
162  //- Return the momentum transfer matrices for the cell-based algorithm
164 
165  //- Return the momentum transfer matrices for the face-based algorithm
167 
168  //- Return the heat transfer matrices
170 
171  //- Return the specie transfer matrices
173  specieTransfer() const;
174 
175  //- Store phase dmdts at the during the continuity error update
176  virtual void correctContinuityError();
177 
178  //- Correct the interface thermodynamics
179  virtual void correctInterfaceThermo();
180 
181  //- Read base phaseProperties dictionary
182  virtual bool read();
183 };
184 
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 } // End namespace Foam
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 #ifdef NoRepository
194 #endif
195 
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 
198 #endif
199 
200 // ************************************************************************* //
An STL-conforming hash table.
Definition: HashTable.H:127
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: PtrList.H:75
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:61
Class to provide interfacial heat and mass transfer between a number of phases according the interfac...
const interfaceSaturationTemperatureModel & saturation(const phaseInterfaceKey &key) const
Return the saturation temperature model for an interface.
virtual autoPtr< phaseSystem::momentumTransferTable > momentumTransfer()
Return the momentum transfer matrices for the cell-based algorithm.
virtual autoPtr< phaseSystem::heatTransferTable > heatTransfer() const
Return the heat transfer matrices.
virtual void correctInterfaceThermo()
Correct the interface thermodynamics.
virtual tmp< volScalarField > dmdtf(const phaseInterfaceKey &key) const
Return the mass transfer rate for an interface.
virtual autoPtr< phaseSystem::specieTransferTable > specieTransfer() const
Return the specie transfer matrices.
ThermalPhaseChangePhaseSystem(const fvMesh &)
Construct from fvMesh.
virtual PtrList< volScalarField > dmdts() const
Return the mass transfer rates for each phase.
virtual autoPtr< phaseSystem::momentumTransferTable > momentumTransferf()
Return the momentum transfer matrices for the face-based algorithm.
virtual PtrList< volScalarField > d2mdtdps() const
Return the mass transfer linearisation coeffs for each phase.
virtual bool read()
Read base phaseProperties dictionary.
virtual void correctContinuityError()
Store phase dmdts at the during the continuity error update.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:101
Wrapper around saturationTemperatureModel to facilitate convenient construction on interfaces.
Word-pair based class used for keying interface models in hash tables.
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.