humidityTemperatureCoupledMixedFvPatchScalarField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2015-2022 OpenCFD Ltd.
9  Copyright (C) 2026 Keysight Technologies
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::
29  compressible::
30  humidityTemperatureCoupledMixedFvPatchScalarField
31 
32 Description
33  Mixed boundary condition for temperature to be used at the coupling
34  interface between fluid solid regions.
35 
36  This boundary condition can operate in four modes:
37  - \c constantMass: thermal inertia only
38  - requires \c rho, \c thickness and \c cp
39  - \c condensation: condensation only
40  - when the wall temperature (Tw) is below the dew temperature (Tdew)
41  condesation takes place and the resulting condensed mass is stored
42  on the wall
43  - \c evaporation: evaporation only
44  - initial mass is vaporized when Tw is above the input vaporization
45  temperature (Tvap).
46  - \c condensationAndEvaporation : condensation and evaporation take place
47  simultaneously.
48 
49  There is no mass flow on the wall, i.e. the mass condensed on a face
50  remains on that face. It uses a 'lumped mass' model to include thermal
51  inertia effects.
52 
53  It assumes a drop-wise type of condensation, whereby its heat transfer
54  Nusselt number is calculated using:
55  \f{eqnarray*}{
56  51104 + 2044 (T - 273.15) & T > 295 & T < 373 \\
57  255510 & T > 373 &
58  \f}
59 
60  References:
61  \verbatim
62  Standard models (tag:BLID):
63  Bergman, T. L., Lavine, A. S.,
64  Incropera, F. P., & Dewitt, D. P. (2011).
65  Fundamentals of heat and mass transfer.
66  John Wiley & Sons. 7th Edition. Chapter 10.
67  ISBN:9780470501979
68  \endverbatim
69 
70  The mass transfer correlation used is:
71 
72  \f[ h_m = D_{ab} \frac{Sh}{L} \f]
73 
74  where:
75  \vartable
76  D_{ab} | mass vapour difussivity
77  L | characteristic length
78  Sh | Sherwood number
79  \endvartable
80 
81  The Sherwood number is calculated using:
82 
83  \f{eqnarray*}{
84  0.664 Re^\frac{1}{2} Sc^\frac{1}{3} & Re < 5.0E+05 \\
85  0.037 Re^\frac{4}{5} Sc^\frac{1}{3} & Re > 5.0E+05
86  \f}
87  where:
88  \vartable
89  Re | Reynolds number
90  Sc | Schmidt number
91  \endvartable
92 
93  NOTE:
94  - The correlation used to calculate Tdew is for water vapour.
95  - A scalar transport equation for the carrier specie is required, e.g.
96  supplied via a function object or in the main solver. This specie
97  transports the vapour phase in the main ragion.
98  - The boundary condition of this specie on the coupled wall must be
99  fixedGradient in order to allow condensation or evaporation of the
100  vapour in or out of this wall
101  - Addition of extra layers in possible using thicknessLayers and
102  kappaLayers
103 
104 
105  Example usage:
106 
107  On the fluid side
108  \verbatim
109  myInterfacePatchName
110  {
111  type thermalHumidityCoupledMixed;
112  kappaMethod fluidThermo;
113  kappa none;
114 
115  // Modes of operation: inert, condensation, vaporization, condEvap
116  mode condEvap;
117 
118  // Carrier species name
119  specieName H2O;
120 
121  // Carrier molecular weight
122  carrierMolWeight 28.9;
123 
124  // Characteristic length of the wall
125  L 0.1;
126 
127  // Vaporisation temperature
128  Tvap 273;
129 
130  // Liquid properties for the condensed mass
131  liquid
132  {
133  H2O
134  {
135  defaultCoeffs yes;
136  }
137  }
138 
139  thicknessLayers (0.1 0.2 0.3 0.4);
140  kappaLayers (1 2 3 4);
141 
142  // thickness, density and cp required for inert and condensation
143  // modes
144 
145  //thickness uniform 0;
146  //cp uniform 0;
147  //rho uniform 0;
148 
149  value $internalField;
150  }
151  \endverbatim
152 
153  On the solid side:
154  \verbatim
155  myInterfacePatchName
156  {
157  type thermalInertiaMassTransferCoupledMixed;
158  kappaMethod solidThermo;
159  kappa none;
160  value uniform 260;
161  }
162  \endverbatim
163 
164 
165 SourceFiles
166  humidityTemperatureCoupledMixedFvPatchScalarField.C
167 
168 \*---------------------------------------------------------------------------*/
169 
170 #ifndef humidityTemperatureCoupledMixedFvPatchScalarField_H
171 #define humidityTemperatureCoupledMixedFvPatchScalarField_H
172 
173 #include "mixedFvPatchFields.H"
174 #include "temperatureCoupledBase.H"
175 #include "liquidProperties.H"
176 #include "autoPtr.H"
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 namespace Foam
181 {
182 
183 /*---------------------------------------------------------------------------*\
184  Class humidityTemperatureCoupledMixedFvPatchScalarField Declaration
185 \*---------------------------------------------------------------------------*/
186 
187 class humidityTemperatureCoupledMixedFvPatchScalarField
188 :
189  public mixedFvPatchScalarField,
190  public temperatureCoupledBase
191 {
193  typedef mixedFvPatchScalarField parent_bctype;
194 
195 public:
196 
197  // Public enumeration
198 
199  //- Modes of mass transfer
201  {
206  };
207 
208 
209 private:
210 
211  // Private data
212 
213  static const Enum<massTransferMode> massModeTypeNames_;
214 
215  //- Operating mode
216  massTransferMode mode_;
219  // Field names
221  //- Name of the pressure field
222  const word pName_;
223 
224  //- Name of the velocity field
225  const word UName_;
226 
227  //- Name of the density field
228  const word rhoName_;
229 
230  //- Name of the dynamic viscosity field
231  const word muName_;
232 
233  //- Name of temperature field on the neighbour region
234  const word TnbrName_;
235 
236  //- Name of the radiative heat flux in the neighbour region
237  const word qrNbrName_;
238 
239  //- Name of the radiative heat flux field
240  const word qrName_;
241 
242  //- Name of the species on which the mass transferred (default H2O)
243  const word specieName_;
244 
245 
246  //- Liquid properties
248 
249  //- Liquid dictionary
250  dictionary liquidDict_;
251 
252  //- Mass accumulated on faces
253  scalarField mass_;
254 
255  //- Vaporization temperature
256  scalar Tvap_;
257 
258  //- Cache myDelta
259  scalarField myKDelta_;
260 
261  //- Phase change energy
262  scalarField dmHfg_;
263 
264  //- Thermal inertia
265  scalarField mpCpTp_;
266 
267  //- Average molecular weight for the carrier mixture in the gas phase
268  scalar Mcomp_;
269 
270  //- Characteristic length scale
271  scalar L_;
272 
273  //- Fluid side
274  bool fluid_;
275 
276  //- Cp field for inert mode
277  scalarField cp_;
278 
279  //- Thickness field for inert mode
280  scalarField thickness_;
281 
282  //- Density field for inert mode
283  scalarField rho_;
284 
285  //- Thickness of layers
286  scalarList thicknessLayers_;
287 
288  //- Conductivity of layers
289  scalarList kappaLayers_;
290 
291 
292  // Private members
293 
294  //- Calculation of Sh
295  scalar Sh(const scalar Re, const scalar Sc) const;
296 
297  //- Calculation of htc from the condensed surface
298  scalar htcCondensation(const scalar TSat, const scalar Re) const;
299 
300  //- Lookup (or create) thickness field for output
301  volScalarField& thicknessField
302  (
303  const word& fieldName,
304  const fvMesh& mesh,
305  const dimensionSet& dims = dimless
306  );
307 
308 
309 public:
310 
311  //- Runtime type information
312  TypeName("humidityTemperatureCoupledMixed");
313 
314 
315  // Constructors
316 
317  //- Construct from patch and internal field
319  (
320  const fvPatch&,
322  );
323 
324  //- Construct from patch, internal field and dictionary
326  (
327  const fvPatch&,
329  const dictionary&
330  );
331 
332  //- Construct by mapping onto a new patch
334  (
335  const this_bctype&,
336  const fvPatch&,
338  const fvPatchFieldMapper&
339  );
340 
341  //- Construct as copy setting internal field reference
343  (
344  const this_bctype&,
346  );
347 
348  //- No copy without an internal field
350  (
351  const this_bctype&
352  ) = delete;
353 
354  //- Clone with an internal field reference
356  (
358  ) const
359  {
360  return fvPatchField<scalar>::Clone(*this, iF);
361  }
362 
363 
364  // Member functions
365 
366  // Mapping functions
367 
368  //- Map (and resize as needed) from self given a mapping object
369  virtual void autoMap
370  (
371  const fvPatchFieldMapper&
372  );
373 
374  //- Reverse map the given fvPatchField onto this fvPatchField
375  virtual void rmap
376  (
377  const fvPatchScalarField&,
378  const labelList&
379  );
380 
381 
382  //- Return myKDelta
383  const scalarField myKDelta() const
384  {
385  return myKDelta_;
386  }
387 
388  //- Return mpCpTp
389  const scalarField mpCpTp() const
390  {
391  return mpCpTp_;
392  }
393 
394  //- Return dmHfg
395  const scalarField dmHfg() const
396  {
397  return dmHfg_;
398  }
399 
400  //- Update the coefficients associated with the patch field
401  virtual void updateCoeffs();
402 
403  //- Write
404  virtual void write(Ostream&) const;
405 
406 
407  // Member Operators
408 
409  //- Inherit assignment
410  using parent_bctype::operator=;
411 };
412 
413 
414 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
415 
416 } // End namespace Foam
417 
418 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
419 
420 #endif
421 
422 // ************************************************************************* //
TypeName("humidityTemperatureCoupledMixed")
Runtime type information.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:130
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual tmp< fvPatchField< scalar > > clone(const DimensionedField< scalar, volMesh > &iF) const
Clone with an internal field reference.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
const dimensionSet dimless
Dimensionless.
humidityTemperatureCoupledMixedFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
Definition: fvPatchField.H:635
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
Definition: dimensionSet.H:105
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
dynamicFvMesh & mesh
A class for handling words, derived from Foam::string.
Definition: word.H:63
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
A FieldMapper for finite-volume patch fields.
scalarField Re(const UList< complex > &cmplx)
Extract real component.
Definition: complexField.C:207
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
A class for managing temporary objects.
Definition: HashPtrTable.H:50
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Namespace for OpenFOAM.