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