Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::functionObjects::comfort
29
30Description
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
40Usage
41 Minimal example by using \c system/controlDict.functions:
42 \verbatim
43 comfortFO
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
105See also
106 - Foam::functionObjects::age
107
108SourceFiles
109 comfort.C
110
111\*---------------------------------------------------------------------------*/
112
113#ifndef Foam_functionObjects_comfort_H
114#define Foam_functionObjects_comfort_H
115
116#include "fvMeshFunctionObject.H"
117#include "volFields.H"
118
119// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120
121namespace Foam
122{
123namespace functionObjects
124{
125
126/*---------------------------------------------------------------------------*\
127 Class comfort Declaration
128\*---------------------------------------------------------------------------*/
129
130class comfort
131:
133{
134 // Private Data
135
136 //- Wall patch IDs
137 mutable labelList wallPatchIDs_;
138
139 //- Clothing [-]
140 dimensionedScalar clothing_;
141
142 //- Metabolic rate [kg/s^3]
143 dimensionedScalar metabolicRate_;
144
145 //- External work [kg/s^3]
146 dimensionedScalar extWork_;
147
148 //- Mean radiation temperature [K]
149 dimensionedScalar Trad_;
150
151 //- Relative humidity [percentage]
152 dimensionedScalar relHumidity_;
153
154 //- Saturation pressure of water [Pa]
155 dimensionedScalar pSat_;
156
157 //- Thermal insulation of clothing [W/m^2/K]
159
160 //- Prefactor of cloth area [-]
162
163 //- Tolerance criteria for iterative process to find Tcl
164 scalar tolerance_;
165
166 //- Global sum of wall area [m^2]
167 mutable scalar wallArea_;
168
169 //- Maximum number of correctors for cloth temperature
170 int maxClothIter_;
171
172 //- Flag to indicate if wall info has been initialized
173 mutable bool wallInfoInit_;
174
175 //- Flag to set to true if the radiation temperature is provided
176 bool TradSet_;
177
178 //- Flag to use volume weighted velocity field for caluclation
179 bool meanVelocity_;
180
181
182 // Private Member Functions
183
184 //- Calculate the magnitude of the velocity [m/s]
185 tmp<volScalarField> magU() const;
186
187 //- Initialize wall caches for Trad() (ids + global area)
188 void initWallInfo() const;
189
190 //- Calculate the radiation temperature in the domain using a simple
191 //- approach [K]
192 dimensionedScalar Trad() const;
193
194 //- Calculate the saturation pressure based on 7730:2005
195 //- Possible options: adding different calculation methods such as
196 //- the formulation based on Magnus or others [Pa]
197 tmp<volScalarField> pSat() const;
198
199 //- Calculate and return the surface temperature of the cloth [K]
200 //- and the heat transfer coefficient hc [W/m^2/K]
201 tmp<volScalarField> Tcloth
202 (
203 volScalarField& hc,
204 const dimensionedScalar& metabolicRateSI,
205 const dimensionedScalar& extWorkSI,
206 const volScalarField& TdegC,
207 const dimensionedScalar& Trad
208 );
209
210 //- Return true if the cloth temperature iteration has converged
211 bool converged(const volScalarField&) const;
212
213
214public:
215
216 //- Runtime type information
217 TypeName("comfort");
218
219
220 // Constructors
221
222 //- Construct from name, Time and dictionary
223 comfort
224 (
225 const word& name,
226 const Time& runTime,
227 const dictionary& dict
228 );
229
230
231 //- Destructor
232 virtual ~comfort() = default;
233
234
235 // Member Functions
236
237 //- Read the function-object dictionary
238 virtual bool read(const dictionary& dict);
239
240 //- Execute the function-object operations
241 virtual bool execute();
242
243 //- Write the function-object results
244 virtual bool write();
245};
246
247
248// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
249
250} // End namespace functionObjects
251} // End namespace Foam
252
253// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
254
255#endif
256
257// ************************************************************************* //
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition Time.H:75
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
const word & name() const noexcept
Return the name of this functionObject.
Calculates the thermal comfort quantities predicted mean vote (PMV), predicted percentage of dissatis...
Definition comfort.H:243
TypeName("comfort")
Runtime type information.
virtual bool read(const dictionary &dict)
Read the function-object dictionary.
Definition comfort.C:313
virtual ~comfort()=default
Destructor.
comfort(const word &name, const Time &runTime, const dictionary &dict)
Construct from name, Time and dictionary.
Definition comfort.C:285
virtual bool execute()
Execute the function-object operations.
Definition comfort.C:355
virtual bool write()
Write the function-object results.
Definition comfort.C:531
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
fvMeshFunctionObject(const fvMeshFunctionObject &)=delete
No copy construct.
A class for managing temporary objects.
Definition tmp.H:75
A class for handling words, derived from Foam::string.
Definition word.H:66
engineTime & runTime
Function objects are OpenFOAM utilities to ease workflow configurations and enhance workflows.
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition List.H:62
GeometricField< scalar, fvPatchField, volMesh > volScalarField
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68