massDiffusionLimitedPhaseChange.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-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::fv::massDiffusionLimitedPhaseChange
26 
27 Description
28  Model for mass-diffusion rate limited phase change between two phases.
29 
30  One of the two phases is considered to be the limiting phase with respect
31  to the rate of mass-diffusion of a given specie. The transferring specie's
32  composition on the limiting phase's side of the interface is given by a
33  run-time selectable interface composition model. A diffusive mass transfer
34  model then provides a coefficient which when multiplied by the difference
35  in specie concentration between the interface and the bulk of the limiting
36  phase gives the rate of mass transfer.
37 
38  All the specie transfers are combined and the associated latent heat is is
39  equated to the rate of heat transfer from the two phases to the interface.
40  This relation is solved for the interface state and the rate of phase
41  change.
42 
43  This model requires at least one phase to be multi-component. A
44  two-resistance heat transfer model must also be in operation between the
45  two changing phases.
46 
47 Usage
48  Example usage:
49  \verbatim
50  phaseChange
51  {
52  type massDiffusionLimitedPhaseChange;
53  libs ("libmultiphaseEulerFvModels.so");
54 
55  phases (gas liquid);
56 
57  energySemiImplicit yes;
58 
59  interfaceComposition
60  {
61  gas_liquid_inThe_gas
62  {
63  type saturated;
64  species (H2O);
65  Le 1.0;
66  pSat ArdenBuck;
67  }
68  }
69 
70  diffusiveMassTransfer
71  {
72  blending heatAndDiffusiveMassTransfer;
73 
74  gas_dispersedIn_liquid_inThe_gas
75  {
76  type spherical;
77  }
78 
79  liquid_dispersedIn_gas_inThe_gas
80  {
81  type Frossling;
82  Le 1.0;
83  }
84  }
85  }
86  \endverbatim
87 
88 SourceFiles
89  massDiffusionLimitedPhaseChange.C
90 
91 \*---------------------------------------------------------------------------*/
92 
93 #ifndef massDiffusionLimitedPhaseChange_H
94 #define massDiffusionLimitedPhaseChange_H
95 
96 #include "phaseSystem.H"
97 #include "phaseChange.H"
100 
101 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
102 
103 namespace Foam
104 {
105 
106 // Forward declaration of classes
107 namespace solvers
108 {
109  class multiphaseEuler;
110 }
111 
112 namespace fv
113 {
114 
115 /*---------------------------------------------------------------------------*\
116  Class massDiffusionLimitedPhaseChange Declaration
117 \*---------------------------------------------------------------------------*/
118 
120 :
121  public phaseChange
122 {
123 private:
124 
125  // Private Data
126 
127  //- Solver
128  const solvers::multiphaseEuler& solver_;
129 
130  //- Phase system
131  const phaseSystem& fluid_;
132 
133  //- Phase 1
134  const phaseModel& phase1_;
135 
136  //- Phase 2
137  const phaseModel& phase2_;
138 
139  //- The interface composition model
140  autoPtr<sidedInterfaceCompositionModel> interfaceCompositionModel_;
141 
142  //- The diffusive mass transfer model
144  diffusiveMassTransferModel_;
145 
146  //- The number of correctors applied to the solution of the surface
147  // temperature (i.e., the interfacial heat and mass transfer balance)
148  label nIter_;
149 
150  //- The surface temperature
152 
153  //- Explicit coefficients for each side and each specie
155 
156  //- Implicit coefficients for each side and each specie
158 
159  //- Counter for the evaluations of the pressure equation sources
160  mutable label pressureEquationIndex_;
161 
162  //- The phase change rate
163  mutable volScalarField::Internal mDot_;
164 
165 
166  // Private Member Functions
167 
168  //- Non-virtual read
169  void readCoeffs(const dictionary& dict);
170 
171  //- Combine the lists of species from the interface composition models
172  wordList getSpecies() const;
173 
174  //- Correct the phase change rate
175  void correctMDot() const;
176 
177 
178 public:
179 
180  //- Runtime type information
181  TypeName("massDiffusionLimitedPhaseChange");
182 
183 
184  // Constructors
185 
186  //- Construct from explicit source name and mesh
188  (
189  const word& name,
190  const word& modelType,
191  const fvMesh& mesh,
192  const dictionary& dict
193  );
194 
195 
196  // Member Functions
197 
198  // Evaluation
199 
200  //- Return the temperature at which the phases are considered to be
201  // changing
203 
204  //- Return the fraction of the latent heat that is transferred into
205  // the second phase
207 
208 
209  // Sources
210 
211  //- Return the mass transfer rate
213 
214  //- Return the mass transfer rate of a specie
216  (
217  const label mDoti
218  ) const;
219 
220  //- Override the pressure equation to trigger correction of the
221  // phase change rate
222  void addSup
223  (
224  const volScalarField& alpha,
225  const volScalarField& rho,
226  fvMatrix<scalar>& eqn
227  ) const;
228 
229  //- Override the species equations to linearise in the mass fraction
230  void addSup
231  (
232  const volScalarField& alpha,
233  const volScalarField& rho,
234  const volScalarField& heOrYi,
235  fvMatrix<scalar>& eqn
236  ) const;
237 
238 
239  //- Correct the fvModel
240  virtual void correct();
241 
242 
243  // IO
244 
245  //- Read source dictionary
246  virtual bool read(const dictionary& dict);
247 };
248 
249 
250 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
251 
252 } // End namespace fv
253 } // End namespace Foam
254 
255 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
256 
257 #endif
258 
259 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic GeometricField class.
An ordered pair of two objects of type <Type> with first() and second() elements.
Definition: Pair.H:66
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
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:96
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 mass-diffusion rate limited phase change between two phases.
virtual tmp< DimensionedField< scalar, volMesh > > Lfraction() const
Return the fraction of the latent heat that is transferred into.
virtual tmp< DimensionedField< scalar, volMesh > > mDot() const
Return the mass transfer rate.
virtual bool read(const dictionary &dict)
Read source dictionary.
void addSup(const volScalarField &alpha, const volScalarField &rho, fvMatrix< scalar > &eqn) const
Override the pressure equation to trigger correction of the.
TypeName("massDiffusionLimitedPhaseChange")
Runtime type information.
virtual tmp< DimensionedField< scalar, volMesh > > Tchange() const
Return the temperature at which the phases are considered to be.
massDiffusionLimitedPhaseChange(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from explicit source name and mesh.
tmp< volScalarField::Internal > rho(const label i) const
Return the density.
Definition: massTransfer.C:92
Base class for phase change models.
Definition: phaseChange.H:61
Class to represent a system of phases.
Definition: phaseSystem.H:74
Solver module for a system of any number of compressible fluid phases with a common pressure,...
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
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