comfort.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2019 OpenFOAM Foundation
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  Foam::functionObjects::comfort
26 
27 Description
28  Calculates the thermal comfort quantities predicted mean vote (PMV) and
29  predicted percentage of dissatisfaction (PPD) based on DIN ISO EN 7730:2005.
30 
31 Usage
32  \table
33  Property | Description | Required | Default value
34  clothing | The insulation value of the cloth | no | 0
35  metabolicRate | The metabolic rate | no | 0.8
36  extWork | The external work | no | 0
37  Trad | Radiation temperature | no | -1
38  relHumidity | Relative humidity of the air | no | 50
39  pSat | Saturation pressure of water | no | -1
40  tolerance | Residual control for the cloth temperature | no | 1e-5
41  maxClothIter | Maximum number of iterations | no | 0
42  meanVelocity | Use a constant mean velocity in the whole domain | no |\
43  false
44  \endtable
45 
46  \table
47  Predicted Mean Vote (PMV) | evaluation
48  + 3 | hot
49  + 2 | warm
50  + 1 | slightly warm
51  + 0 | neutral
52  - 1 | slightly cool
53  - 2 | cool
54  - 3 | cold
55  \endtable
56 
57  \verbatim
58  comfortAnalysis
59  {
60  type comfort;
61  libs ("libfieldFunctionObjects.so");
62 
63  executeControl writeTime;
64  writeControl writeTime;
65  }
66  \endverbatim
67 
68 SourceFiles
69  comfort.C
70 
71 \*---------------------------------------------------------------------------*/
72 
73 #ifndef comfort_H
74 #define comfort_H
75 
76 #include "fvMeshFunctionObject.H"
77 #include "volFields.H"
78 
79 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
80 
81 namespace Foam
82 {
83 namespace functionObjects
84 {
85 
86 /*---------------------------------------------------------------------------*\
87  Class comfort Declaration
88 \*---------------------------------------------------------------------------*/
89 
90 class comfort
91 :
92  public fvMeshFunctionObject
93 {
94  // Private Data
95 
96  //- Clothing [-]
97  dimensionedScalar clothing_;
98 
99  //- Metabolic rate [kg/s^3]
100  dimensionedScalar metabolicRate_;
101 
102  //- External work [kg/s^3]
103  dimensionedScalar extWork_;
104 
105  //- Switch set to true if the radiation temperature is provided
106  Switch TradSet_;
107 
108  //- Mean radiation temperature [K]
109  dimensionedScalar Trad_;
110 
111  //- Relative humidity [percentage]
112  dimensionedScalar relHumidity_;
113 
114  //- Saturation pressure of water [Pa]
115  dimensionedScalar pSat_;
116 
117  //- Thermal insulation of clothing [W/m^2/K]
118  dimensionedScalar Icl_;
119 
120  //- Prefactor of cloth area [-]
121  dimensionedScalar fcl_;
122 
123  //- Tolerance criteria for iterative process to find Tcl
124  scalar tolerance_;
125 
126  //- Maximum number of correctors for cloth temperature
127  int maxClothIter_;
128 
129  //- Switch to use volume weighted velocity field for caluclation
130  Switch meanVelocity_;
131 
132 
133  // Private Member Functions
134 
135  // Calculate the magnitude of the velocity [m/s]
136  tmp<volScalarField> magU() const;
137 
138  // Calculate the radiation temperature in the domain using a simple
139  // approach [K]
140  dimensionedScalar Trad() const;
141 
142  // Calculate the saturation pressure based on 7730:2006
143  // Possible options: adding different calculation methods such as
144  // the formulation based on Magnus or others [Pa]
145  tmp<volScalarField> pSat() const;
146 
147  // Calculate and return the surface temperature of the cloth [K]
148  // and the heat transfer coefficient hc [W/m^2/K]
149  tmp<volScalarField> Tcloth
150  (
151  volScalarField& hc,
152  const dimensionedScalar& metabolicRateSI,
153  const dimensionedScalar& extWorkSI,
154  const volScalarField& TdegC,
155  const dimensionedScalar& Trad
156  );
157 
158  // Return true if the cloth temperature iteration has converged
159  bool converged(const volScalarField&) const;
160 
161 
162 public:
163 
164  //- Runtime type information
165  TypeName("comfort");
166 
167 
168  // Constructors
169 
170  //- Construct from Time and dictionary
171  comfort
172  (
173  const word& name,
174  const Time& runTime,
175  const dictionary& dict
176  );
177 
178 
179  //- Destructor
180  virtual ~comfort();
181 
182 
183  // Member Functions
184 
185  //- Read the data needed for the comfort calculation
186  virtual bool read(const dictionary&);
187 
188  //- Calculate the predicted mean vote (PMV)
189  // and predicted percentage dissatisfaction (PPD) fields
190  virtual bool execute();
191 
192  //- Write the PPD and PMV fields
193  virtual bool write();
194 };
195 
196 
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 
199 } // End namespace functionObjects
200 } // End namespace Foam
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 #endif
205 
206 // ************************************************************************* //
dictionary dict
const word & name() const
Return the name of this functionObject.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
engineTime & runTime
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
A class for handling words, derived from string.
Definition: word.H:59
comfort(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
Definition: comfort.C:230
virtual bool execute()
Calculate the predicted mean vote (PMV)
Definition: comfort.C:301
virtual bool read(const dictionary &)
Read the data needed for the comfort calculation.
Definition: comfort.C:262
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
virtual ~comfort()
Destructor.
Definition: comfort.C:256
virtual bool write()
Write the PPD and PMV fields.
Definition: comfort.C:424
TypeName("comfort")
Runtime type information.
Namespace for OpenFOAM.