34 namespace functionObjects
46 tmp<volScalarField> tmagU =
mag(lookupObject<volVectorField>(
"U"));
52 tmagU.ref() = tmagU->weightedAverage(mesh_.V());
70 const volScalarField::Boundary& TBf =
71 lookupObject<volScalarField>(
"T").boundaryField();
73 scalar areaIntegral = 0;
74 scalar TareaIntegral = 0;
79 const fvPatch& pTBf = TBf[
patchi].patch();
82 if (isType<wallFvPatch>(pTBf))
84 areaIntegral +=
gSum(pSf);
85 TareaIntegral +=
gSum(pSf*pT);
89 Trad.value() = TareaIntegral/areaIntegral;
93 if ((Trad.value() < 283.15) || (Trad.value() > 313.15))
96 <<
"The calculated mean wall radiation temperature is out of the\n" 97 <<
"bounds specified in EN ISO 7730:2006\n" 98 <<
"Valid range is 10 degC < T < 40 degC\n" 99 <<
"The actual value is: " << Trad - 273.15 <<
nl <<
endl;
116 if (pSat_.value() == 0)
121 tpSat = kPaToPa*
exp(A - B/(T + C));
147 dimensionSet(1, 0, -3, -4, 0, 0, 0),
159 tmp<volScalarField> tTcl
181 Tcl = (Tcl + Tcl.prevIter())/2;
193 pos(hcForced - hcNatural)*hcForced
194 +
neg0(hcForced - hcNatural)*hcNatural;
199 - factor2*(metabolicRateSI - extWorkSI)
200 - Icl_*factor3*fcl_*(
pow4(Tcl) -
pow4(Trad))
201 - Icl_*fcl_*hc*(Tcl - T);
203 }
while (!converged(Tcl) && i++ < maxClothIter_);
205 if (i == maxClothIter_)
208 <<
"The surface cloth temperature did not converge within " << i
216 bool Foam::functionObjects::comfort::converged
222 max(
mag(phi.primitiveField() - phi.prevIter().primitiveField()))
237 clothing_(
"clothing",
dimless, 0),
242 relHumidity_(
"relHumidity",
dimless, 0.5),
264 clothing_.readIfPresent(dict);
265 metabolicRate_.readIfPresent(dict);
266 extWork_.readIfPresent(dict);
267 pSat_.readIfPresent(dict);
273 if (dict.
found(relHumidity_.name()))
275 relHumidity_.read(dict);
280 if (dict.
found(Trad_.name()))
293 Icl_.value() <= 0.078
294 ? 1.0 + 1.290*Icl_.value()
295 : 1.05 + 0.645*Icl_.value();
318 mesh_.time().timeName(),
365 (metabolicRateSI - extWorkSI).value() < factor8.
value() ? 0 : 0.42
368 Info<<
"Calculating the predicted mean vote (PMV)\n";
378 (factor1*
exp(factor2*metabolicRateSI) + factor3)
380 (metabolicRateSI - extWorkSI)
386 - factor6*(metabolicRateSI - extWorkSI)
391 - factor7*(metabolicRateSI - extWorkSI - factor8)
394 - factor9*metabolicRateSI*(factor10 - pSat*relHumidity_)
397 - factor11*metabolicRateSI*(factor12 - T)
400 - factor13*fcl_*(
pow4(Tcloth) -
pow4(Trad))
403 - fcl_*hc*(Tcloth - T)
408 Info<<
"Calculating the predicted percentage of dissatisfaction (PPD)\n";
416 100 - 95*
exp(-0.03353*
pow4(PMV()) - 0.21790*
sqr(PMV()))
420 return store(PMV) && store(PPD);
426 return writeObject(
"PMV") && writeObject(
"PPD");
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A list of keyword definitions, which are a keyword followed by any number of values (e...
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
const dimensionSet dimPressure
addToRunTimeSelectionTable(functionObject, Qdot, dictionary)
static tmp< GeometricField< scalar, fvPatchField, volMesh > > New(const word &name, const Internal &, const PtrList< fvPatchField< scalar >> &)
Return a temporary field constructed from name,.
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensionedScalar pow025(const dimensionedScalar &ds)
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none/any.
const dimensionSet dimless
Generic dimensioned Type class.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Macros for easy insertion into run-time selection tables.
const dimensionSet dimLength
GeometricField< scalar, fvPatchField, volMesh > volScalarField
dimensionedScalar pos(const dimensionedScalar &ds)
const dimensionSet dimTime
Dimension set for the base types.
bool read(const char *, int32_t &)
Type gSum(const FieldField< Field, Type > &f)
dimensionedScalar exp(const dimensionedScalar &ds)
fvPatchField< scalar > fvPatchScalarField
A class for handling words, derived from string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
comfort(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
dimensionedScalar neg0(const dimensionedScalar &ds)
const Type & value() const
Return const reference to value.
virtual bool execute()
Calculate the predicted mean vote (PMV)
virtual bool read(const dictionary &)
Read the data needed for the comfort calculation.
const dimensionSet dimVelocity
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
const dimensionSet dimMass
defineTypeNameAndDebug(Qdot, 0)
Internal & ref()
Return a reference to the dimensioned internal field.
dimensionedScalar pow3(const dimensionedScalar &ds)
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
#define WarningInFunction
Report a warning using Foam::Warning.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
virtual ~comfort()
Destructor.
dimensionedScalar pow4(const dimensionedScalar &ds)
const dimensionSet & dimensions() const
Return const reference to dimensions.
dimensioned< scalar > mag(const dimensioned< Type > &)
const doubleScalar e
Elementary charge.
Specialisation of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
A class for managing temporary objects.
virtual bool write()
Write the PPD and PMV fields.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
const dimensionSet dimTemperature