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 | Copyright (C) 2015 OpenCFD Ltd.
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 
26  Foam::
27  compressible::
28  humidityTemperatureCoupledMixedFvPatchScalarField
29 
30 Description
31  Mixed boundary condition for temperature to be used at the coupling
32  interface between fluid solid regions.
33 
34  This boundary condition can operate in four modes:
35  - \c constantMass: thermal inertia only
36  - requires \c rho, \c thickness and \cp
37  - \c condensation: condensation only
38  - when the wall temperature (Tw) is below the dew temperature (Tdew)
39  condesation takes place and the resulting condensed mass is stored
40  on the wall
41  - \c evaporation: evaporation only
42  - initial mass is vaporized when Tw is above the input vaporization
43  temperature (Tvap).
44  - \c condensationAndEvaporation : condensation and evaporation take place
45  simultaneously.
46 
47  There is no mass flow on the wall, i.e. the mass condensed on a face
48  remains on that face. It uses a 'lumped mass' model to include thermal
49  inertia effects.
50 
51  It assumes a drop-wise type of condensation, whereby its heat transfer
52  Nusselt number is calculated using:
53  \f{eqnarray*}{
54  51104 + 2044 T & T > 295 & T < 373 \\
55  255510 & T > 373 &
56  \f}
57 
58  Reference:
59  - T. Bergam, A.Lavine, F. Incropera and D. Dewitt. Heat and Mass Transfer.
60  7th Edition. Chapter 10.
61 
62  The mass transfer correlation used is:
63 
64  \f[ h_m = D_{ab} \frac{Sc}{L} \f]
65 
66  where:
67  \vartable
68  D_{ab} | mass vapour difussivity
69  L | characteristic length
70  Sc | Schmidt number
71  \endvartable
72 
73  The Schmidt number is calculated using:
74 
75  \f{eqnarray*}{
76  0.664 Re^\frac{1}{2} Sc^\frac{1}{3} & Re < 5.0E+05 \\
77  0.037 Re^\frac{4}{5} Sc^\frac{1}{3} & Re > 5.0E+05
78  \f}
79 
80  NOTE:
81  - The correlation used to calculate Tdew is for water vapour.
82  - A scalar transport equation for the carrier specie is required, e.g.
83  supplied via a function object or in the main solver. This specie
84  transports the vapour phase in the main ragion.
85  - The boundary condition of this specie on the coupled wall must be
86  fixedGradient in order to allow condensation or evaporation of the
87  vapour in or out of this wall
88 
89 
90  Example usage:
91 
92  On the fluid side
93  \verbatim
94  myInterfacePatchName
95  {
96  type thermalHumidityCoupledMixed;
97  kappa fluidThermo;
98  kappaName none;
99 
100  // Modes of operation: inert, condensation, vaporization, condEvap
101  mode condEvap;
102 
103  // Carrier species name
104  specieName H2O;
105 
106  // Carrier molecular weight
107  carrierMolWeight 28.9;
108 
109  // Characteristic lenght of the wall
110  L 0.1;
111 
112  // Vaporasation temperature
113  Tvap 273;
114 
115  // Liquid properties for the condensed mass
116  liquid
117  {
118  H2O
119  {
120  defaultCoeffs yes;
121  }
122  }
123 
124  // thickness, density and cp required for inert and condensation
125  // modes
126 
127  //thickness uniform 0;
128  //cp uniform 0;
129  //rho uniform 0;
130 
131  value $internalField;
132  }
133  \endverbatim
134 
135  On the solid side:
136  \verbatim
137  myInterfacePatchName
138  {
139  type thermalInertiaMassTransferCoupledMixed;
140  kappa solidThermo;
141  kappaName none;
142  value uniform 260;
143  }
144  \endverbatim
145 
146 
147 SourceFiles
148  humidityTemperatureCoupledMixedFvPatchScalarField.C
149 
150 \*---------------------------------------------------------------------------*/
151 
152 #ifndef humidityTemperatureCoupledMixedFvPatchScalarField_H
153 #define humidityTemperatureCoupledMixedFvPatchScalarField_H
154 
155 #include "mixedFvPatchFields.H"
156 #include "temperatureCoupledBase.H"
157 #include "liquidProperties.H"
158 #include "autoPtr.H"
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 namespace Foam
163 {
164 
165 /*---------------------------------------------------------------------------*\
166  Class humidityTemperatureCoupledMixedFvPatchScalarField Declaration
167 \*---------------------------------------------------------------------------*/
168 
169 class humidityTemperatureCoupledMixedFvPatchScalarField
170 :
171  public mixedFvPatchScalarField,
172  public temperatureCoupledBase
173 {
174 public:
175 
176  // Public enumeration
177 
178  //- Modes of mass transfer
179  enum massTransferMode
180  {
185  };
186 
187 
188 private:
189 
190  // Private data
191 
193 
194  //- Operating mode
196 
197 
198  // Field names
199 
200  //- Name of the pressure field
201  const word pName_;
202 
203  //- Name of the velocity field
204  const word UName_;
205 
206  //- Name of the density field
207  const word rhoName_;
208 
209  //- Name of the dynamic viscosity field
210  const word muName_;
211 
212  //- Name of temperature field on the neighbour region
213  const word TnbrName_;
214 
215  //- Name of the radiative heat flux in the neighbout region
216  const word QrNbrName_;
217 
218  //- Name of the radiative heat flux field
219  const word QrName_;
220 
221  //- Name of the species on which the mass transfered (default H2O)
222  const word specieName_;
223 
224 
225  //- Liquid properties
227 
228  //- Liquid dictionary
230 
231  //- Mass accumulated on faces
233 
234  //- Vaporization temperature
235  scalar Tvap_;
236 
237  //- Cache myDelta
239 
240  //- Phase change energy
242 
243  //- Thermal inertia
245 
246  //- Average molecular weight for the carrier mixture in the gas phase
247  scalar Mcomp_;
248 
249  //- Characteristic length scale
250  scalar L_;
251 
252  //- Fluid side
253  bool fluid_;
254 
255  //- Cp field for inert mode
257 
258  //- Thickness field for inert mode
260 
261  //- Density field for inert mode
263 
264 
265  // Private members
266 
267  //- Calculation of Sh
268  scalar Sh(const scalar Re, const scalar Sc) const;
269 
270  //- Calculation of htc from the condensed surface
271  scalar htcCondensation(const scalar TSat, const scalar Re) const;
272 
273  //- Lookup (or create) thickness field for output
274  volScalarField& thicknessField(const word&, const fvMesh&);
275 
276 
277 public:
278 
279  //- Runtime type information
280  TypeName("humidityTemperatureCoupledMixed");
281 
282 
283  // Constructors
284 
285  //- Construct from patch and internal field
287  (
288  const fvPatch&,
290  );
291 
292  //- Construct from patch, internal field and dictionary
294  (
295  const fvPatch&,
297  const dictionary&
298  );
299 
300  //- Construct by mapping given
301  // turbulentTemperatureCoupledBaffleMixedFvPatchScalarField onto a
302  // new patch
304  (
305  const
307  const fvPatch&,
309  const fvPatchFieldMapper&
310  );
311 
312  //- Construct and return a clone
313  virtual tmp<fvPatchScalarField> clone() const
314  {
316  (
318  (
319  *this
320  )
321  );
322  }
323 
324  //- Construct as copy setting internal field reference
326  (
329  );
330 
331  //- Construct and return a clone setting internal field reference
333  (
335  ) const
336  {
338  (
340  (
341  *this,
342  iF
343  )
344  );
345  }
346 
347 
348  // Member functions
349 
350  // Mapping functions
351 
352  //- Map (and resize as needed) from self given a mapping object
353  virtual void autoMap
354  (
355  const fvPatchFieldMapper&
356  );
357 
358  //- Reverse map the given fvPatchField onto this fvPatchField
359  virtual void rmap
360  (
361  const fvPatchScalarField&,
362  const labelList&
363  );
364 
365 
366  //- Return myKDelta
367  const scalarField myKDelta() const
368  {
369  return myKDelta_;
370  }
371 
372  //- Return mpCpTp
373  const scalarField mpCpTp() const
374  {
375  return mpCpTp_;
376  }
377 
378  //- Return dmHfg
379  const scalarField dmHfg() const
380  {
381  return dmHfg_;
382  }
383 
384  //- Update the coefficients associated with the patch field
385  virtual void updateCoeffs();
386 
387  //- Write
388  virtual void write(Ostream&) const;
389 };
390 
391 
392 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
393 
394 } // End namespace Foam
395 
396 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
397 
398 #endif
399 
400 // ************************************************************************* //
Foam::fvPatchField
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:65
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::fluid_
bool fluid_
Fluid side.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:264
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::mpCpTp
const scalarField mpCpTp() const
Return mpCpTp.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:384
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::mass_
scalarField mass_
Mass accumulated on faces.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:243
Foam::scalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Definition: primitiveFieldsFwd.H:48
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::massModeTypeNames_
static const NamedEnum< massTransferMode, 4 > massModeTypeNames_
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:203
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::QrName_
const word QrName_
Name of the radiative heat flux field.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:230
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::cp_
scalarField cp_
Cp field for inert mode.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:267
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::pName_
const word pName_
Name of the pressure field.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:212
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::myKDelta_
scalarField myKDelta_
Cache myDelta.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:249
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::mtCondensationAndEvaporation
@ mtCondensationAndEvaporation
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:195
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::thicknessField
volScalarField & thicknessField(const word &, const fvMesh &)
Lookup (or create) thickness field for output.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.C:100
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::TypeName
TypeName("humidityTemperatureCoupledMixed")
Runtime type information.
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::Sh
scalar Sh(const scalar Re, const scalar Sc) const
Calculation of Sh.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.C:64
Foam::Re
scalarField Re(const UList< complex > &cf)
Definition: complexFields.C:97
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.C:373
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::thickness_
scalarField thickness_
Thickness field for inert mode.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:270
Foam::temperatureCoupledBase
Common functions for use in temperature coupled boundaries.
Definition: temperatureCoupledBase.H:104
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::UName_
const word UName_
Name of the velocity field.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:215
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::Mcomp_
scalar Mcomp_
Average molecular weight for the carrier mixture in the gas phase.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:258
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::write
virtual void write(Ostream &) const
Write.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.C:734
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::mpCpTp_
scalarField mpCpTp_
Thermal inertia.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:255
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::dmHfg_
scalarField dmHfg_
Phase change energy.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:252
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::mtEvaporation
@ mtEvaporation
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:194
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::rhoName_
const word rhoName_
Name of the density field.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:218
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::dmHfg
const scalarField dmHfg() const
Return dmHfg.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:390
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::humidityTemperatureCoupledMixedFvPatchScalarField
humidityTemperatureCoupledMixedFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.C:139
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.C:419
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::QrNbrName_
const word QrNbrName_
Name of the radiative heat flux in the neighbout region.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:227
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
temperatureCoupledBase.H
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
mixedFvPatchFields.H
liquidProperties.H
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::Tvap_
scalar Tvap_
Vaporization temperature.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:246
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::muName_
const word muName_
Name of the dynamic viscosity field.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:221
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::specieName_
const word specieName_
Name of the species on which the mass transfered (default H2O)
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:233
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::rmap
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.C:393
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::mtConstantMass
@ mtConstantMass
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:192
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::L_
scalar L_
Characteristic length scale.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:261
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::rho_
scalarField rho_
Density field for inert mode.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:273
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::mode_
massTransferMode mode_
Operating mode.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:206
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::TnbrName_
const word TnbrName_
Name of temperature field on the neighbour region.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:224
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::mtCondensation
@ mtCondensation
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:193
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::clone
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:324
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::massTransferMode
massTransferMode
Modes of mass transfer.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:190
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::liquid_
autoPtr< liquidProperties > liquid_
Liquid properties.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:237
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
Foam::humidityTemperatureCoupledMixedFvPatchScalarField
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:180
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::htcCondensation
scalar htcCondensation(const scalar TSat, const scalar Re) const
Calculation of htc from the condensed surface.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.C:82
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::myKDelta
const scalarField myKDelta() const
Return myKDelta.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:378
Foam::humidityTemperatureCoupledMixedFvPatchScalarField::liquidDict_
dictionary liquidDict_
Liquid dictionary.
Definition: humidityTemperatureCoupledMixedFvPatchScalarField.H:240
Foam::NamedEnum< massTransferMode, 4 >
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51
autoPtr.H