wallBoiling.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::wallBoiling
26 
27 Description
28  Model for nucleate wall boiling between two phases on the surface of a
29  number of wall patches.
30 
31  This model implements a version of the well-known RPI wall boiling model
32  (Kurul & Podowski, 1991). The model is based on an implementation described
33  in Peltola et al. (2019) and is similar to the model described by Peltola &
34  Pättikangas (2012).
35 
36  References:
37  \verbatim
38  Kurul, N., & Podowski, M.Z. (1991).
39  On the modeling of multidimensional effects in boiling channels.
40  ANS. Proc. National Heat Transfer Con. Minneapolis, Minnesota, USA,
41  1991.
42  ISBN: 0-89448-162-1, pp. 30-40.
43  \endverbatim
44 
45  \verbatim
46  Peltola, J., Pättikangas, T., Bainbridge, W., Lehnigk, R., Schlegel, F.
47  (2019).
48  On Development and validation of subcooled nucleate boiling models for
49  OpenFOAM Foundation Release.
50  NURETH-18 Conference Proceedings, Portland, Oregon, United States, 2019.
51  \endverbatim
52 
53  \verbatim
54  Peltola, J., & Pättikangas, T.J.H. (2012).
55  Development and validation of a boiling model for OpenFOAM multiphase
56  solver.
57  CFD4NRS-4 Conference Proceedings, Daejeon, Korea, 2012.
58  paper 59.
59  \endverbatim
60 
61 Usage
62  Example usage:
63  \verbatim
64  wallBoiling
65  {
66  type wallBoiling;
67  libs ("libmultiphaseEulerFvModels.so");
68 
69  // Note: Order is important. This model is one-way. It turns liquid
70  // into vapour. The phases should be specified in this order.
71  phases (water steam);
72 
73  energySemiImplicit no;
74 
75  saturationTemperature
76  {
77  type constant;
78  value 372.76;
79  }
80 
81  partitioningModel
82  {
83  type Lavieville;
84  alphaCrit 0.2;
85  }
86 
87  nucleationSiteModel
88  {
89  type LemmertChawla;
90  Cn 1;
91  NRef 30000000;
92  deltaTRef 10;
93  }
94 
95  departureDiameterModel
96  {
97  type TolubinskiKostanchuk;
98  dRef 0.00024;
99  dMax 0.0014;
100  dMin 1e-06;
101  }
102 
103  departureFrequencyModel
104  {
105  type KocamustafaogullariIshii;
106  Cf 1.18;
107  }
108  }
109  \endverbatim
110 
111  In addition to the above fvModel specification, wall patches on which
112  boiling is to be calculated should have an alphatPhaseChangeWallFunction
113  boundary condition applied to the turbulent thermal diffusivity field.
114 
115 See also
116  Foam::alphatPhaseChangeWallFunctionFvPatchScalarField
117 
118 SourceFiles
119  wallBoiling.C
120 
121 \*---------------------------------------------------------------------------*/
122 
123 #ifndef wallBoiling_H
124 #define wallBoiling_H
125 
126 #include "wallPhaseChange.H"
127 #include "nucleation.H"
128 #include "phaseSystem.H"
129 
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131 
132 namespace Foam
133 {
134 
135 // Forward declaration of classes
136 class saturationTemperatureModel;
137 
138 namespace wallBoilingModels
139 {
140  class partitioningModel;
141  class nucleationSiteModel;
142  class departureDiameterModel;
143  class departureFrequencyModel;
144 }
145 
146 class wallBoilingPhaseChangeRateFvPatchScalarField;
147 
148 namespace fv
149 {
150 
151 /*---------------------------------------------------------------------------*\
152  Class wallBoiling Declaration
153 \*---------------------------------------------------------------------------*/
154 
155 class wallBoiling
156 :
157  public wallPhaseChange,
158  public nucleation
159 {
160 private:
161 
162  // Private classes
163 
164  //- Struct to hold properties that are held constant during the
165  // iterative solution procedure
166  struct laggedProperties;
167 
168 
169  // Private Data
170 
171  //- Reference to the liquid phase
172  const phaseModel& liquid_;
173 
174  //- Reference to the vapour phase
175  const phaseModel& vapour_;
176 
177  //- Reference to the liquid turbulent thermal diffusivity
178  const volScalarField& alphatLiquid_;
179 
180  //- Reference to the vapour turbulent thermal diffusivity
181  const volScalarField& alphatVapour_;
182 
183  //- Reference to the field associated with the pressure equation
184  const volScalarField& p_rgh_;
185 
186  //- Solution tolerance
187  scalar tolerance_;
188 
189  //- Estimate liquid temperature using logarithmic wall function?
190  bool liquidTemperatureWallFunction_;
191 
192  //- Turbulent Prandtl number
193  scalar Prt_;
194 
195  //- Bubble waiting time ratio
196  scalar bubbleWaitingTimeRatio_;
197 
198  //- The saturation curve
199  autoPtr<saturationTemperatureModel> saturationModelPtr_;
200 
201  //- Run-time selected heat flux partitioning model
203 
204  //- Run-time selected nucleation site density model
206 
207  //- Run-time selected bubble departure diameter model
209  departureDiameterModel_;
210 
211  //- Run-time selected bubble departure frequency model
213  departureFrequencyModel_;
214 
215  //- Counter for the evaluations of the pressure equation sources
216  mutable label pressureEquationIndex_;
217 
218  //- The phase change rate
219  mutable volScalarField mDot_;
220 
221 
222  // Private Member Functions
223 
224  //- Non-virtual read
225  void readCoeffs(const dictionary& dict);
226 
227  //- Get the liquid temperature patch field and the parameters
228  // associated with its boundary condition that are necessary for
229  // approximately evaluating the boundary condition's heat flux at
230  // a given wall temperature.
231  const fvPatchScalarField& getLiquidTemperaturePatchField
232  (
233  const laggedProperties& lagProps,
234  scalarField& isFixed,
235  scalarField& h,
236  scalarField& hTaPlusQa
237  ) const;
238 
239  //- Calculate the boiling for the given wall temperature. Return
240  // the total sum of all heat fluxes. Set the properties passed by
241  // non-const reference. Used by the functions below.
242  tmp<scalarField> calcBoiling
243  (
244  const laggedProperties& lagProps,
245  const scalarField& TLiquid,
246  const scalarField& wetFraction,
247  scalarField& dDeparture,
248  scalarField& fDeparture,
249  scalarField& nucleationSiteDensity,
250  scalarField& qQuenching,
251  scalarField& qEvaporative,
253  ) const;
254 
255  //- Calculate the boiling for the given wall temperature. Return
256  // the total sum of all heat fluxes. Use this to solve the balance
257  // between the heat fluxes specified by the boiling models and the
258  // temperature boundary condition without changing the stored
259  // boiling state.
260  tmp<scalarField> calcBoiling
261  (
263  const laggedProperties& lagProps,
264  const scalarField& TLiquid
265  ) const;
266 
267  //- Calculate the boiling for the given wall temperature. Return
268  // the total sum of all heat fluxes. Also set the stored boiling
269  // state. Use this after solving with the final wall temperature
270  // to set the boiling state.
271  tmp<scalarField> evaluateBoiling
272  (
274  const laggedProperties& lagProps,
275  const scalarField& TLiquid
276  ) const;
277 
278  //- Correct the phase change rate
279  void correctMDot() const;
280 
281 
282 public:
283 
284  //- Runtime type information
285  TypeName("wallBoiling");
286 
287 
288  // Constructors
289 
290  //- Construct from explicit source name and mesh
292  (
293  const word& name,
294  const word& modelType,
295  const fvMesh& mesh,
296  const dictionary& dict
297  );
298 
299 
300  // Member Functions
301 
302  // Access
303 
304  //- Return a mask indicating whether phase change is occurring
305  virtual const scalarField& active(const label) const;
306 
307  //- Access the turbulent thermal diffusivities for a patch
308  virtual Pair<const scalarField&> alphats(const label) const;
309 
310 
311  // Evaluation
312 
313  //- Return the fraction of the latent heat that is transferred into
314  // the second phase
316 
317  //- Return the diameter of nuclei
318  virtual tmp<DimensionedField<scalar, fvMesh>> d() const;
319 
320  //- Return the number rate at which nuclei are generated
322 
323  //- Return the nucleation time scale
324  virtual tmp<DimensionedField<scalar, fvMesh>> tau() const;
325 
326 
327  // Sources
328 
329  //- Return the mass transfer rate
331 
332  //- Return the mass transfer rate for the given patch
334  (
335  const label patchi
336  ) const;
337 
338  //- Return the mass transfer rate for the given patch
340  (
341  const label patchi
342  ) const;
343 
344  //- Use phaseChange's source functions
345  using phaseChange::addSup;
346 
347  //- Override the pressure equation to add the mass transfer rate
348  // linearised in the pressure
349  void addSup
350  (
351  const volScalarField& alpha,
352  const volScalarField& rho,
353  fvMatrix<scalar>& eqn
354  ) const;
355 
356 
357  //- Correct the fvModel
358  virtual void correct();
359 
360 
361  // IO
362 
363  //- Read source dictionary
364  virtual bool read(const dictionary& dict);
365 };
366 
367 
368 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
369 
370 } // End namespace fv
371 } // End namespace Foam
372 
373 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
374 
375 #endif
376 
377 // ************************************************************************* //
Generic GeometricField class.
An ordered pair of two objects of type <Type> with first() and second() elements.
Definition: Pair.H:67
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
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:90
tmp< volScalarField::Internal > rho(const label i) const
Return the density.
Definition: massTransfer.C:92
Mix-in interface for nucleation models. Provides access to properties of the nucleation process,...
Definition: nucleation.H:53
void addSup(const volScalarField &alpha, const volScalarField &rho, const volScalarField &heOrYi, fvMatrix< scalar > &eqn) const
Override the energy equation to add the phase change heat, or.
Definition: phaseChange.C:529
Model for nucleate wall boiling between two phases on the surface of a number of wall patches.
Definition: wallBoiling.H:158
TypeName("wallBoiling")
Runtime type information.
virtual tmp< DimensionedField< scalar, fvMesh > > Lfraction() const
Return the fraction of the latent heat that is transferred into.
Definition: wallBoiling.C:781
virtual void correct()
Correct the fvModel.
Definition: wallBoiling.C:940
wallBoiling(const word &name, const word &modelType, const fvMesh &mesh, const dictionary &dict)
Construct from explicit source name and mesh.
Definition: wallBoiling.C:699
virtual tmp< DimensionedField< scalar, fvMesh > > mDot() const
Return the mass transfer rate.
Definition: wallBoiling.C:872
virtual const scalarField & active(const label) const
Return a mask indicating whether phase change is occurring.
Definition: wallBoiling.C:758
virtual bool read(const dictionary &dict)
Read source dictionary.
Definition: wallBoiling.C:950
const wallBoilingPhaseChangeRateFvPatchScalarField & mDotPf(const label patchi) const
Return the mass transfer rate for the given patch.
Definition: wallBoiling.C:879
void addSup(const volScalarField &alpha, const volScalarField &rho, const volScalarField &heOrYi, fvMatrix< scalar > &eqn) const
Use phaseChange's source functions.
Definition: phaseChange.C:529
virtual tmp< DimensionedField< scalar, fvMesh > > d() const
Return the diameter of nuclei.
Definition: wallBoiling.C:795
virtual tmp< DimensionedField< scalar, fvMesh > > tau() const
Return the nucleation time scale.
Definition: wallBoiling.C:864
wallBoilingPhaseChangeRateFvPatchScalarField & mDotPfRef(const label patchi) const
Return the mass transfer rate for the given patch.
Definition: wallBoiling.C:897
virtual tmp< DimensionedField< scalar, fvMesh > > nDot() const
Return the number rate at which nuclei are generated.
Definition: wallBoiling.C:832
Base class for fvModels that represent phase change at a wall.
const Pair< const volScalarField & > & alphats() const
Access the turbulent thermal diffusivities.
A class for managing temporary objects.
Definition: tmp.H:55
This boundary condition is used for the phase change rate field of the wall boiling fvModel....
A class for handling words, derived from string.
Definition: word.H:63
label patchi
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
const dimensionedScalar h
Planck constant.
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