phaseSurfaceCondensation.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) 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::phaseSurfaceCondensation
26 
27 Description
28  Model for mass diffusion limited condensation on the surface of a
29  third (solid) phase.
30 
31  This model functions very similarly to the wall condensation model (see that
32  model for references). Compared to the wall condensation model, in this
33  model the predicted condensation rate is assumed to be proportional to
34  laminar diffusivity multiplied by a coefficient given by user selectable
35  diffusive mass transfer model.
36 
37 Usage
38  Example usage:
39  \verbatim
40  phaseSurfaceCondensation
41  {
42  type phaseSurfaceCondensation;
43  libs ("libmultiphaseEulerFvModels.so");
44 
45  // The (solid) phase
46  phase solid;
47 
48  // Note: Order is important. This model is one-way. It turns vapour
49  // into liquid. The phases should be specified in this order.
50  phases (steam water);
51 
52  // The specie that is condensing
53  specie H2O;
54 
55  energySemiImplicit yes;
56  specieSemiImplicit no;
57 
58  diffusiveMassTransfer
59  {
60  solid_dispersedIn_steam_inThe_steam
61  {
62  type Frossling;
63  Le 1;
64  }
65  }
66 
67  saturationPressure
68  {
69  type ArdenBuck;
70  }
71  }
72  \endverbatim
73 
74 See also
75  Foam::fv::wallCondensation
76  Foam::fv::massDiffusionLimitedPhaseChange
77 
78 SourceFiles
79  phaseSurfaceCondensation.C
80 
81 \*---------------------------------------------------------------------------*/
82 
83 #ifndef phaseSurfaceCondensation_H
84 #define phaseSurfaceCondensation_H
85 
86 #include "phaseChange.H"
87 #include "phaseSystem.H"
89 
90 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
91 
92 namespace Foam
93 {
94 
95 // Forward declaration of classes
96 namespace solvers
97 {
98  class multiphaseEuler;
99 }
100 
101 class saturationPressureModel;
102 
103 namespace fv
104 {
105 
106 /*---------------------------------------------------------------------------*\
107  Class phaseSurfaceCondensation Declaration
108 \*---------------------------------------------------------------------------*/
109 
111 :
112  public phaseChange
113 {
114  // Private Data
115 
116  //- Solver
117  const solvers::multiphaseEuler& solver_;
118 
119  //- Reference to the phase system
120  const phaseSystem& fluid_;
121 
122  //- Reference to the liquid phase
123  const phaseModel& liquid_;
124 
125  //- Reference to the vapour phase
126  const phaseModel& vapour_;
127 
128  //- Reference to the solid phase on which the boiling occurs
129  const phaseModel& solid_;
130 
131  //- The diffusive mass transfer model
133  diffusiveMassTransferModel_;
134 
135  //- The saturation curve
136  autoPtr<saturationPressureModel> saturationModelPtr_;
137 
138  //- Counter for the evaluations of the pressure equation sources
139  mutable label pressureEquationIndex_;
140 
141  //- Whether or not to linearise the specie source
142  bool specieSemiImplicit_;
143 
144  //- Heat transfer rate
145  mutable volScalarField::Internal q_;
146 
147  //- Mass transfer rate
148  mutable volScalarField::Internal mDot_;
149 
150  //- The derivative of mass transfer rate
151  mutable volScalarField::Internal mDotDy_;
152 
153 
154  // Private Member Functions
155 
156  //- Non-virtual read
157  void readCoeffs(const dictionary& dict);
158 
159  //- Correct the phase change rate
160  void correctMDot() const;
161 
162 
163 public:
164 
165  //- Runtime type information
166  TypeName("phaseSurfaceCondensation");
167 
168 
169  // Constructors
170 
171  //- Construct from explicit source name and mesh
172  //- Construct from components
174  (
175  const word& name,
176  const word& modelType,
177  const fvMesh& mesh,
178  const dictionary& dict
179  );
180 
181 
182  // Member Functions
183 
184  // Checks
185 
186  //- Return true if the fvModel adds a source term to the given
187  // field's transport equation
188  virtual bool addsSupToField(const word& fieldName) const;
189 
190 
191  // Access
192 
193  //- Access the liquid phase
194  inline const phaseModel& liquid() const;
195 
196  //- Access the vapour phase
197  inline const phaseModel& vapour() const;
198 
199  //- Access the solid phase on which the boiling occurs
200  inline const phaseModel& solid() const;
201 
202 
203  // Evaluation
204 
205  //- Return the fraction of the latent heat that is transferred into
206  // the second phase
208 
209 
210  // Sources
211 
212  //- Return the mass transfer rate
214 
215  //- Return the derivative of mass transfer rate
217 
218  //- Override the pressure equation to add the mass transfer rate
219  // linearised in the pressure
220  void addSup
221  (
222  const volScalarField& alpha,
223  const volScalarField& rho,
224  fvMatrix<scalar>& eqn
225  ) const;
226 
227  //- Override the phase and vapours's energy equations to add
228  // additional latent heat and quenching heat transfer terms,
229  // handle optional linearisation of specie source
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 
258 
259 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
260 
261 #endif
262 
263 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic GeometricField class.
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:98
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
static const word & fieldName()
Return the name of the field associated with a source term. Special.
Definition: fvModelI.H:49
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
Model for mass diffusion limited condensation on the surface of a third (solid) phase.
const phaseModel & vapour() const
Access the vapour phase.
virtual tmp< DimensionedField< scalar, fvMesh > > Lfraction() const
Return the fraction of the latent heat that is transferred into.
virtual void correct()
Correct the fvModel.
virtual tmp< DimensionedField< scalar, fvMesh > > mDotDy() const
Return the derivative of mass transfer rate.
virtual tmp< DimensionedField< scalar, fvMesh > > mDot() const
Return the mass transfer rate.
const phaseModel & liquid() const
Access the liquid phase.
virtual bool read(const dictionary &dict)
Read source dictionary.
TypeName("phaseSurfaceCondensation")
Runtime type information.
phaseSurfaceCondensation(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
const phaseModel & solid() const
Access the solid phase on which the boiling occurs.
void addSup(const volScalarField &alpha, const volScalarField &rho, fvMatrix< scalar > &eqn) const
Override the pressure equation to add the mass transfer rate.
virtual bool addsSupToField(const word &fieldName) const
Return true if the fvModel adds a source term to the given.
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:63
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