comfort.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) 2019-2021 OpenFOAM Foundation
9  Copyright (C) 2021 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::functionObjects::comfort
29 
30 Description
31  Calculates the thermal comfort quantities predicted mean vote (PMV),
32  predicted percentage of dissatisfaction (PPD) and the draught rate (DR)
33  based on DIN ISO EN 7730:2005.
34 
35  The draught rate is defined for velocities between 0 m/s and 0.5 m/s. Values
36  larger than 0.5 m/s will be set to 0.5 m/s. Furthermore, the draught rate is
37  defined between 20 degC and 26 degC. A temperature limitation is not
38  implemented. The draught rate is mainly used for HVAC analysis in rooms.
39 
40 Usage
41  Minimal example by using \c system/controlDict.functions:
42  \verbatim
43  comfort1
44  {
45  // Mandatory entries
46  type comfort;
47  libs (fieldFunctionObjects);
48 
49  // Optional entries
50  clothing <scalar>;
51  metabolicRate <scalar>;
52  extWork <scalar>;
53  Trad <scalar>;
54  relHumidity <scalar>;
55  pSat <scalar>;
56  tolerance <scalar>;
57  maxClothIter <int>;
58  meanVelocity <bool>;
59 
60  // Inherited entries
61  ...
62  }
63  \endverbatim
64 
65  where the entries mean:
66  \table
67  Property | Description | Type | Reqd | Deflt
68  type | Type name: comfort | word | yes | -
69  libs | Library name: fieldFunctionObjects | word | yes | -
70  clothing | The insulation value of the cloth | scalar | no | 0
71  metabolicRate | The metabolic rate | scalar | no | 0.8
72  extWork | The external work | scalar | no | 0
73  Trad | Radiation temperature | scalar | no | 0
74  relHumidity | Relative humidity of the air | scalar | no | 0.5
75  pSat | Saturation pressure of water | scalar | no | -1
76  tolerance | Residual control for the cloth temperature <!--
77  --> | scalar | no | 1e-4
78  maxClothIter | Maximum number of iterations | int | no | 100
79  meanVelocity | Flag to use a constant mean velocity <!--
80  --> in the whole domain | bool | no | false
81  \endtable
82 
83  The inherited entries are elaborated in:
84  - \link functionObject.H \endlink
85 
86  \table
87  Predicted Mean Vote (PMV) | evaluation
88  + 3 | hot
89  + 2 | warm
90  + 1 | slightly warm
91  + 0 | neutral
92  - 1 | slightly cool
93  - 2 | cool
94  - 3 | cold
95  \endtable
96 
97  \table
98  Draught rate based on 7730 | category
99  0 - 10 | I - fine
100  10 - 20 | II - okay
101  20 - 30 | III - intermedian
102  > 30 | bad - commonly too high
103  \endtable
104 
105 See also
106  - Foam::functionObjects::age
107 
108 SourceFiles
109  comfort.C
110 
111 \*---------------------------------------------------------------------------*/
112 
113 #ifndef comfort_H
114 #define comfort_H
115 
116 #include "fvMeshFunctionObject.H"
117 #include "volFields.H"
118 
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 
121 namespace Foam
122 {
123 namespace functionObjects
124 {
125 
126 /*---------------------------------------------------------------------------*\
127  Class comfort Declaration
128 \*---------------------------------------------------------------------------*/
129 
130 class comfort
131 :
132  public fvMeshFunctionObject
133 {
134  // Private Data
135 
136  //- Clothing [-]
137  dimensionedScalar clothing_;
138 
139  //- Metabolic rate [kg/s^3]
140  dimensionedScalar metabolicRate_;
141 
142  //- External work [kg/s^3]
143  dimensionedScalar extWork_;
144 
145  //- Mean radiation temperature [K]
146  dimensionedScalar Trad_;
147 
148  //- Relative humidity [percentage]
149  dimensionedScalar relHumidity_;
150 
151  //- Saturation pressure of water [Pa]
152  dimensionedScalar pSat_;
153 
154  //- Thermal insulation of clothing [W/m^2/K]
155  dimensionedScalar Icl_;
156 
157  //- Prefactor of cloth area [-]
158  dimensionedScalar fcl_;
159 
160  //- Tolerance criteria for iterative process to find Tcl
161  scalar tolerance_;
162 
163  //- Maximum number of correctors for cloth temperature
164  int maxClothIter_;
165 
166  //- Flag to set to true if the radiation temperature is provided
167  bool TradSet_;
168 
169  //- Flag to use volume weighted velocity field for caluclation
170  bool meanVelocity_;
171 
172 
173  // Private Member Functions
174 
175  //- Calculate the magnitude of the velocity [m/s]
176  tmp<volScalarField> magU() const;
177 
178  //- Calculate the radiation temperature in the domain using a simple
179  //- approach [K]
180  dimensionedScalar Trad() const;
181 
182  //- Calculate the saturation pressure based on 7730:2005
183  //- Possible options: adding different calculation methods such as
184  //- the formulation based on Magnus or others [Pa]
185  tmp<volScalarField> pSat() const;
186 
187  //- Calculate and return the surface temperature of the cloth [K]
188  //- and the heat transfer coefficient hc [W/m^2/K]
189  tmp<volScalarField> Tcloth
190  (
191  volScalarField& hc,
192  const dimensionedScalar& metabolicRateSI,
193  const dimensionedScalar& extWorkSI,
194  const volScalarField& TdegC,
195  const dimensionedScalar& Trad
196  );
197 
198  //- Return true if the cloth temperature iteration has converged
199  bool converged(const volScalarField&) const;
200 
201 
202 public:
203 
204  //- Runtime type information
205  TypeName("comfort");
206 
207 
208  // Constructors
209 
210  //- Construct from Time and dictionary
211  comfort
212  (
213  const word& name,
214  const Time& runTime,
215  const dictionary& dict
216  );
217 
218 
219  //- Destructor
220  virtual ~comfort() = default;
221 
222 
223  // Member Functions
224 
225  //- Read the data needed for the comfort calculation
226  virtual bool read(const dictionary&);
227 
228  //- Calculate the predicted mean vote (PMV)
229  //- and predicted percentage dissatisfaction (PPD) fields
230  virtual bool execute();
231 
232  //- Write the PPD and PMV fields
233  virtual bool write();
234 };
235 
236 
237 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
238 
239 } // End namespace functionObjects
240 } // End namespace Foam
241 
242 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
243 
244 #endif
245 
246 // ************************************************************************* //
volFields.H
runTime
engineTime & runTime
Definition: createEngineTime.H:13
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
fvMeshFunctionObject.H
Foam::functionObjects::comfort::TypeName
TypeName("comfort")
Runtime type information.
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::functionObjects::fvMeshFunctionObject
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
Definition: fvMeshFunctionObject.H:64
Foam::functionObjects::comfort::execute
virtual bool execute()
Definition: comfort.C:306
Foam::functionObjects::comfort::read
virtual bool read(const dictionary &)
Read the data needed for the comfort calculation.
Definition: comfort.C:266
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:42
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::dimensioned< scalar >
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::functionObjects::comfort::comfort
comfort(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
Definition: comfort.C:240
Foam::functionObject::name
const word & name() const noexcept
Return the name of this functionObject.
Definition: functionObject.C:143
Foam::functionObjects::comfort::write
virtual bool write()
Write the PPD and PMV fields.
Definition: comfort.C:469
Foam::functionObjects::comfort
Calculates the thermal comfort quantities predicted mean vote (PMV), predicted percentage of dissatis...
Definition: comfort.H:244
Foam::functionObjects::comfort::~comfort
virtual ~comfort()=default
Destructor.
Foam::GeometricField< scalar, fvPatchField, volMesh >