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