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-2016 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 
95 
96  Example usage:
97 
98  On the fluid side
99  \verbatim
100  myInterfacePatchName
101  {
102  type thermalHumidityCoupledMixed;
103  kappaMethod fluidThermo;
104  kappa none;
105 
106  // Modes of operation: inert, condensation, vaporization, condEvap
107  mode condEvap;
108 
109  // Carrier species name
110  specieName H2O;
111 
112  // Carrier molecular weight
113  carrierMolWeight 28.9;
114 
115  // Characteristic length of the wall
116  L 0.1;
117 
118  // Vaporisation temperature
119  Tvap 273;
120 
121  // Liquid properties for the condensed mass
122  liquid
123  {
124  H2O
125  {
126  defaultCoeffs yes;
127  }
128  }
129 
130  // thickness, density and cp required for inert and condensation
131  // modes
132 
133  //thickness uniform 0;
134  //cp uniform 0;
135  //rho uniform 0;
136 
137  value $internalField;
138  }
139  \endverbatim
140 
141  On the solid side:
142  \verbatim
143  myInterfacePatchName
144  {
145  type thermalInertiaMassTransferCoupledMixed;
146  kappaMethod solidThermo;
147  kappa none;
148  value uniform 260;
149  }
150  \endverbatim
151 
152 
153 SourceFiles
154  humidityTemperatureCoupledMixedFvPatchScalarField.C
155 
156 \*---------------------------------------------------------------------------*/
157 
158 #ifndef humidityTemperatureCoupledMixedFvPatchScalarField_H
159 #define humidityTemperatureCoupledMixedFvPatchScalarField_H
160 
161 #include "mixedFvPatchFields.H"
162 #include "temperatureCoupledBase.H"
163 #include "liquidProperties.H"
164 #include "autoPtr.H"
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 namespace Foam
169 {
170 
171 /*---------------------------------------------------------------------------*\
172  Class humidityTemperatureCoupledMixedFvPatchScalarField Declaration
173 \*---------------------------------------------------------------------------*/
174 
176 :
177  public mixedFvPatchScalarField,
178  public temperatureCoupledBase
179 {
180 public:
181 
182  // Public enumeration
183 
184  //- Modes of mass transfer
185  enum massTransferMode
186  {
191  };
192 
193 
194 private:
195 
196  // Private data
197 
198  static const Enum<massTransferMode> massModeTypeNames_;
199 
200  //- Operating mode
201  massTransferMode mode_;
202 
203 
204  // Field names
205 
206  //- Name of the pressure field
207  const word pName_;
208 
209  //- Name of the velocity field
210  const word UName_;
211 
212  //- Name of the density field
213  const word rhoName_;
214 
215  //- Name of the dynamic viscosity field
216  const word muName_;
217 
218  //- Name of temperature field on the neighbour region
219  const word TnbrName_;
220 
221  //- Name of the radiative heat flux in the neighbour region
222  const word qrNbrName_;
223 
224  //- Name of the radiative heat flux field
225  const word qrName_;
226 
227  //- Name of the species on which the mass transferred (default H2O)
228  const word specieName_;
229 
230 
231  //- Liquid properties
233 
234  //- Liquid dictionary
235  dictionary liquidDict_;
236 
237  //- Mass accumulated on faces
238  scalarField mass_;
239 
240  //- Vaporization temperature
241  scalar Tvap_;
242 
243  //- Cache myDelta
244  scalarField myKDelta_;
245 
246  //- Phase change energy
247  scalarField dmHfg_;
248 
249  //- Thermal inertia
250  scalarField mpCpTp_;
251 
252  //- Average molecular weight for the carrier mixture in the gas phase
253  scalar Mcomp_;
254 
255  //- Characteristic length scale
256  scalar L_;
257 
258  //- Fluid side
259  bool fluid_;
260 
261  //- Cp field for inert mode
262  scalarField cp_;
263 
264  //- Thickness field for inert mode
265  scalarField thickness_;
266 
267  //- Density field for inert mode
268  scalarField rho_;
269 
270 
271  // Private members
272 
273  //- Calculation of Sh
274  scalar Sh(const scalar Re, const scalar Sc) const;
275 
276  //- Calculation of htc from the condensed surface
277  scalar htcCondensation(const scalar TSat, const scalar Re) const;
278 
279  //- Lookup (or create) thickness field for output
280  volScalarField& thicknessField(const word&, const fvMesh&);
281 
282 
283 public:
284 
285  //- Runtime type information
286  TypeName("humidityTemperatureCoupledMixed");
287 
288 
289  // Constructors
290 
291  //- Construct from patch and internal field
293  (
294  const fvPatch&,
296  );
297 
298  //- Construct from patch, internal field and dictionary
300  (
301  const fvPatch&,
303  const dictionary&
304  );
305 
306  //- Construct by mapping given
307  // turbulentTemperatureCoupledBaffleMixedFvPatchScalarField onto a
308  // new patch
310  (
311  const
313  const fvPatch&,
315  const fvPatchFieldMapper&
316  );
317 
318  //- Construct and return a clone
319  virtual tmp<fvPatchScalarField> clone() const
320  {
322  (
324  (
325  *this
326  )
327  );
328  }
329 
330  //- Construct as copy setting internal field reference
332  (
335  );
336 
337  //- Construct and return a clone setting internal field reference
339  (
341  ) const
342  {
344  (
346  (
347  *this,
348  iF
349  )
350  );
351  }
352 
353 
354  // Member functions
355 
356  // Mapping functions
357 
358  //- Map (and resize as needed) from self given a mapping object
359  virtual void autoMap
360  (
361  const fvPatchFieldMapper&
362  );
363 
364  //- Reverse map the given fvPatchField onto this fvPatchField
365  virtual void rmap
366  (
367  const fvPatchScalarField&,
368  const labelList&
369  );
370 
371 
372  //- Return myKDelta
373  const scalarField myKDelta() const
374  {
375  return myKDelta_;
376  }
377 
378  //- Return mpCpTp
379  const scalarField mpCpTp() const
380  {
381  return mpCpTp_;
382  }
383 
384  //- Return dmHfg
385  const scalarField dmHfg() const
386  {
387  return dmHfg_;
388  }
389 
390  //- Update the coefficients associated with the patch field
391  virtual void updateCoeffs();
392 
393  //- Write
394  virtual void write(Ostream&) const;
395 };
396 
397 
398 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
399 
400 } // End namespace Foam
401 
402 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
403 
404 #endif
405 
406 // ************************************************************************* //
Foam::fvPatchField< scalar >
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::mpCpTp
const scalarField mpCpTp() const
Return mpCpTp.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:396
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:62
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::mtCondensationAndEvaporation
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:207
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:367
Foam::temperatureCoupledBase
Common functions used in temperature coupled boundaries.
Definition: temperatureCoupledBase.H:110
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::write
virtual void write(Ostream &) const
Write.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.C:728
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::mtEvaporation
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:206
Foam::Field< scalar >
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::dmHfg
const scalarField dmHfg() const
Return dmHfg.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:402
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::humidityTemperatureCoupledMixedFvPatchScalarField
humidityTemperatureCoupledMixedFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.C:127
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:413
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:121
temperatureCoupledBase.H
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:83
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:387
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::mtConstantMass
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:204
Foam::List< label >
Foam::Re
scalarField Re(const UList< complex > &cf)
Extract real component.
Definition: complexField.C:159
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::mtCondensation
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:205
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:336
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::massTransferMode
massTransferMode
Modes of mass transfer.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:202
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::humidityTemperatureCoupledMixedFvPatchScalarField
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:192
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::myKDelta
const scalarField myKDelta() const
Return myKDelta.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:390
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