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-2022 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 implemnetaion 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"
62 #include "saturationModel.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  //- Nucleate Mass transfer rates
111  phaseSystem::dmdtfTable nDmdtfs_;
112 
113  //- Nucleate thermal energy transfer rates
114  phaseSystem::dmdtfTable nDmdtLfs_;
115 
116  //- Previous continuity error update phase dmdts for the heat transfer
117  // function
118  PtrList<volScalarField> dmdt0s_;
119 
120  //- Switch to control whether or not mass transfer rates are linearised
121  // in the pressure equation
122  Switch pressureImplicit_;
123 
124  // Private Member Functions
125 
126  //- Sum the mass transfer rates for each phase into the given list
127  void addDmdts(PtrList<volScalarField>&) const;
128 
129 
130 public:
131 
132  // Constructors
133 
134  //- Construct from fvMesh
136 
137 
138  //- Destructor
140 
141 
142  // Member Functions
143 
144  //- Return the saturationModel
145  const saturationModel& saturation(const phaseInterfaceKey& key) const;
146 
147  //- Return the mass transfer rate for an interface
148  virtual tmp<volScalarField> dmdtf(const phaseInterfaceKey& key) const;
149 
150  //- Return the mass transfer rates for each phase
151  virtual PtrList<volScalarField> dmdts() const;
152 
153  //- Return the mass transfer linearisation coeffs for each phase
154  virtual PtrList<volScalarField> d2mdtdps() const;
155 
156  //- Return the momentum transfer matrices for the cell-based algorithm
158 
159  //- Return the momentum transfer matrices for the face-based algorithm
161 
162  //- Return the heat transfer matrices
164 
165  //- Return the specie transfer matrices
167  specieTransfer() const;
168 
169  //- Store phase dmdts at the during the continuity error update
170  virtual void correctContinuityError();
171 
172  //- Correct the interface thermodynamics
173  virtual void correctInterfaceThermo();
174 
175  //- Read base phaseProperties dictionary
176  virtual bool read();
177 };
178 
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 } // End namespace Foam
183 
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 
186 #ifdef NoRepository
188 #endif
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 #endif
193 
194 // ************************************************************************* //
virtual PtrList< volScalarField > dmdts() const
Return the mass transfer rates for each phase.
ThermalPhaseChangePhaseSystem(const fvMesh &)
Construct from fvMesh.
virtual autoPtr< phaseSystem::specieTransferTable > specieTransfer() const
Return the specie transfer matrices.
Word-pair based class used for keying interface models in hash tables.
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none/any.
Definition: Switch.H:60
Class to provide interfacial heat and mass transfer between a number of phases according the interfac...
virtual PtrList< volScalarField > d2mdtdps() const
Return the mass transfer linearisation coeffs for each phase.
virtual void correctInterfaceThermo()
Correct the interface thermodynamics.
A class for handling words, derived from string.
Definition: word.H:59
virtual autoPtr< phaseSystem::heatTransferTable > heatTransfer() const
Return the heat transfer matrices.
virtual autoPtr< phaseSystem::momentumTransferTable > momentumTransferf()
Return the momentum transfer matrices for the face-based algorithm.
An STL-conforming hash table.
Definition: HashTable.H:61
virtual bool read()
Read base phaseProperties dictionary.
Model to describe the dependence of saturation pressure on temperature, and vice versa.
virtual ~ThermalPhaseChangePhaseSystem()
Destructor.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:70
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:95
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: PtrList.H:52
A class for managing temporary objects.
Definition: PtrList.H:53
virtual tmp< volScalarField > dmdtf(const phaseInterfaceKey &key) const
Return the mass transfer rate for an interface.
virtual autoPtr< phaseSystem::momentumTransferTable > momentumTransfer()
Return the momentum transfer matrices for the cell-based algorithm.
Namespace for OpenFOAM.
const saturationModel & saturation(const phaseInterfaceKey &key) const
Return the saturationModel.