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-2021 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 & T > 295 & T < 373 \\
56  255510 & T > 373 &
57  \f}
58 
59  Reference:
60  - T. Bergam, A.Lavine, F. Incropera and D. Dewitt. Heat and Mass Transfer.
61  7th Edition. Chapter 10.
62 
63  The mass transfer correlation used is:
64 
65  \f[ h_m = D_{ab} \frac{Sh}{L} \f]
66 
67  where:
68  \vartable
69  D_{ab} | mass vapour difussivity
70  L | characteristic length
71  Sh | Sherwood number
72  \endvartable
73 
74  The Sherwood number is calculated using:
75 
76  \f{eqnarray*}{
77  0.664 Re^\frac{1}{2} Sc^\frac{1}{3} & Re < 5.0E+05 \\
78  0.037 Re^\frac{4}{5} Sc^\frac{1}{3} & Re > 5.0E+05
79  \f}
80  where:
81  \vartable
82  Re | Reynolds number
83  Sc | Schmidt number
84  \endvartable
85 
86  NOTE:
87  - The correlation used to calculate Tdew is for water vapour.
88  - A scalar transport equation for the carrier specie is required, e.g.
89  supplied via a function object or in the main solver. This specie
90  transports the vapour phase in the main ragion.
91  - The boundary condition of this specie on the coupled wall must be
92  fixedGradient in order to allow condensation or evaporation of the
93  vapour in or out of this wall
94  - Addition of extra layers in possible using thicknessLayers and
95  kappaLayers
96 
97 
98  Example usage:
99 
100  On the fluid side
101  \verbatim
102  myInterfacePatchName
103  {
104  type thermalHumidityCoupledMixed;
105  kappaMethod fluidThermo;
106  kappa none;
107 
108  // Modes of operation: inert, condensation, vaporization, condEvap
109  mode condEvap;
110 
111  // Carrier species name
112  specieName H2O;
113 
114  // Carrier molecular weight
115  carrierMolWeight 28.9;
116 
117  // Characteristic length of the wall
118  L 0.1;
119 
120  // Vaporisation temperature
121  Tvap 273;
122 
123  // Liquid properties for the condensed mass
124  liquid
125  {
126  H2O
127  {
128  defaultCoeffs yes;
129  }
130  }
131 
132  thicknessLayers (0.1 0.2 0.3 0.4);
133  kappaLayers (1 2 3 4);
134 
135  // thickness, density and cp required for inert and condensation
136  // modes
137 
138  //thickness uniform 0;
139  //cp uniform 0;
140  //rho uniform 0;
141 
142  value $internalField;
143  }
144  \endverbatim
145 
146  On the solid side:
147  \verbatim
148  myInterfacePatchName
149  {
150  type thermalInertiaMassTransferCoupledMixed;
151  kappaMethod solidThermo;
152  kappa none;
153  value uniform 260;
154  }
155  \endverbatim
156 
157 
158 SourceFiles
159  humidityTemperatureCoupledMixedFvPatchScalarField.C
160 
161 \*---------------------------------------------------------------------------*/
162 
163 #ifndef humidityTemperatureCoupledMixedFvPatchScalarField_H
164 #define humidityTemperatureCoupledMixedFvPatchScalarField_H
165 
166 #include "mixedFvPatchFields.H"
167 #include "temperatureCoupledBase.H"
168 #include "liquidProperties.H"
169 #include "autoPtr.H"
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 namespace Foam
174 {
175 
176 /*---------------------------------------------------------------------------*\
177  Class humidityTemperatureCoupledMixedFvPatchScalarField Declaration
178 \*---------------------------------------------------------------------------*/
179 
181 :
182  public mixedFvPatchScalarField,
183  public temperatureCoupledBase
184 {
185 public:
186 
187  // Public enumeration
188 
189  //- Modes of mass transfer
190  enum massTransferMode
191  {
196  };
197 
198 
199 private:
200 
201  // Private data
202 
203  static const Enum<massTransferMode> massModeTypeNames_;
204 
205  //- Operating mode
206  massTransferMode mode_;
207 
208 
209  // Field names
210 
211  //- Name of the pressure field
212  const word pName_;
213 
214  //- Name of the velocity field
215  const word UName_;
216 
217  //- Name of the density field
218  const word rhoName_;
219 
220  //- Name of the dynamic viscosity field
221  const word muName_;
222 
223  //- Name of temperature field on the neighbour region
224  const word TnbrName_;
225 
226  //- Name of the radiative heat flux in the neighbour region
227  const word qrNbrName_;
228 
229  //- Name of the radiative heat flux field
230  const word qrName_;
231 
232  //- Name of the species on which the mass transferred (default H2O)
233  const word specieName_;
234 
235 
236  //- Liquid properties
238 
239  //- Liquid dictionary
240  dictionary liquidDict_;
241 
242  //- Mass accumulated on faces
243  scalarField mass_;
244 
245  //- Vaporization temperature
246  scalar Tvap_;
247 
248  //- Cache myDelta
249  scalarField myKDelta_;
250 
251  //- Phase change energy
252  scalarField dmHfg_;
253 
254  //- Thermal inertia
255  scalarField mpCpTp_;
256 
257  //- Average molecular weight for the carrier mixture in the gas phase
258  scalar Mcomp_;
259 
260  //- Characteristic length scale
261  scalar L_;
262 
263  //- Fluid side
264  bool fluid_;
265 
266  //- Cp field for inert mode
267  scalarField cp_;
268 
269  //- Thickness field for inert mode
270  scalarField thickness_;
271 
272  //- Density field for inert mode
273  scalarField rho_;
274 
275  //- Thickness of layers
276  scalarList thicknessLayers_;
277 
278  //- Conductivity of layers
279  scalarList kappaLayers_;
280 
281 
282  // Private members
283 
284  //- Calculation of Sh
285  scalar Sh(const scalar Re, const scalar Sc) const;
286 
287  //- Calculation of htc from the condensed surface
288  scalar htcCondensation(const scalar TSat, const scalar Re) const;
289 
290  //- Lookup (or create) thickness field for output
291  volScalarField& thicknessField(const word&, const fvMesh&);
292 
293 
294 public:
295 
296  //- Runtime type information
297  TypeName("humidityTemperatureCoupledMixed");
298 
299 
300  // Constructors
301 
302  //- Construct from patch and internal field
304  (
305  const fvPatch&,
307  );
308 
309  //- Construct from patch, internal field and dictionary
311  (
312  const fvPatch&,
314  const dictionary&
315  );
316 
317  //- Construct by mapping given
318  // turbulentTemperatureCoupledBaffleMixedFvPatchScalarField onto a
319  // new patch
321  (
322  const
324  const fvPatch&,
326  const fvPatchFieldMapper&
327  );
328 
329  //- Construct and return a clone
330  virtual tmp<fvPatchScalarField> clone() const
331  {
333  (
335  (
336  *this
337  )
338  );
339  }
340 
341  //- Construct as copy setting internal field reference
343  (
346  );
347 
348  //- Construct and return a clone setting internal field reference
350  (
352  ) const
353  {
355  (
357  (
358  *this,
359  iF
360  )
361  );
362  }
363 
364 
365  // Member functions
366 
367  // Mapping functions
368 
369  //- Map (and resize as needed) from self given a mapping object
370  virtual void autoMap
371  (
372  const fvPatchFieldMapper&
373  );
374 
375  //- Reverse map the given fvPatchField onto this fvPatchField
376  virtual void rmap
377  (
378  const fvPatchScalarField&,
379  const labelList&
380  );
381 
382 
383  //- Return myKDelta
384  const scalarField myKDelta() const
385  {
386  return myKDelta_;
387  }
388 
389  //- Return mpCpTp
390  const scalarField mpCpTp() const
391  {
392  return mpCpTp_;
393  }
394 
395  //- Return dmHfg
396  const scalarField dmHfg() const
397  {
398  return dmHfg_;
399  }
400 
401  //- Update the coefficients associated with the patch field
402  virtual void updateCoeffs();
403 
404  //- Write
405  virtual void write(Ostream&) const;
406 };
407 
408 
409 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
410 
411 } // End namespace Foam
412 
413 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
414 
415 #endif
416 
417 // ************************************************************************* //
Foam::fvPatchField< scalar >
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::mpCpTp
const scalarField mpCpTp() const
Return mpCpTp.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:407
Foam::scalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Definition: primitiveFieldsFwd.H:52
Foam::Enum< massTransferMode >
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::mtCondensationAndEvaporation
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:212
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::TypeName
TypeName("humidityTemperatureCoupledMixed")
Runtime type information.
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.C:381
Foam::temperatureCoupledBase
Common functions used in temperature coupled boundaries.
Definition: temperatureCoupledBase.H:135
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::write
virtual void write(Ostream &) const
Write.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.C:777
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::mtEvaporation
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:211
Foam::Field< scalar >
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::dmHfg
const scalarField dmHfg() const
Return dmHfg.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:413
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::humidityTemperatureCoupledMixedFvPatchScalarField
humidityTemperatureCoupledMixedFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.C:128
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.C:429
humidityTemperatureCoupledMixedFvPatchScalarField
Mixed boundary condition for temperature to be used at the coupling interface between fluid solid reg...
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
temperatureCoupledBase.H
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
mixedFvPatchFields.H
liquidProperties.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::rmap
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.C:402
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::mtConstantMass
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:209
Foam::List< scalar >
Foam::Re
scalarField Re(const UList< complex > &cf)
Extract real component.
Definition: complexField.C:159
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::mtCondensation
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:210
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::clone
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:347
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::massTransferMode
massTransferMode
Modes of mass transfer.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:207
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::humidityTemperatureCoupledMixedFvPatchScalarField
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:197
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::myKDelta
const scalarField myKDelta() const
Return myKDelta.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:401
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54
autoPtr.H