34 namespace functionObjects
46 tmp<volScalarField> tmagU =
mag(lookupObject<volVectorField>(
"U"));
52 tmagU.ref() = tmagU->weightedAverage(
mesh_.
V());
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.value() - 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);
268 tolerance_ =
dict.lookupOrDefault(
"tolerance", 1
e-4);
269 maxClothIter_ =
dict.lookupOrDefault(
"maxClothIter", 100);
270 meanVelocity_ =
dict.lookupOrDefault<
Switch>(
"meanVelocity",
false);
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();
371 (metabolicRateSI - extWorkSI).value() < factor8.
value() ? 0 : 0.42
374 Info<<
"Calculating the predicted mean vote (PMV)\n";
384 (factor1*
exp(factor2*metabolicRateSI) + factor3)
386 (metabolicRateSI - extWorkSI)
392 - factor6*(metabolicRateSI - extWorkSI)
397 - factor7*(metabolicRateSI - extWorkSI - factor8)
400 - factor9*metabolicRateSI*(factor10 - pSat*relHumidity_)
403 - factor11*metabolicRateSI*(factor12 -
T)
406 - factor13*fcl_*(
pow4(Tcloth) -
pow4(Trad))
409 - fcl_*hc*(Tcloth -
T)
414 Info<<
"Calculating the predicted percentage of dissatisfaction (PPD)\n";
422 100 - 95*
exp(-0.03353*
pow4(PMV()) - 0.21790*
sqr(PMV()))
426 Info<<
"Calculating the draught rating (DR)\n";
451 if (foundObject<volScalarField>(
"k"))
454 TI =
sqrt(2/3*
k)/Umag;
471 correctUnit*(factor12 -
T)*
pow(Umag - Umin, 0.62)*(pre*Umag*TI + C1)
486 && writeObject(
"PPD")
487 && writeObject(
"DR");
static const Foam::dimensionedScalar A("A", Foam::dimPressure, 611.21)
static const Foam::dimensionedScalar B("B", Foam::dimless, 18.678)
static const Foam::dimensionedScalar C("C", Foam::dimTemperature, 234.5)
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
Generic GeometricField class.
void maxMin(const dimensioned< Type > &minDt, const dimensioned< Type > &maxDt)
GeometricBoundaryField< Type, PatchField, GeoMesh > Boundary
Type of the boundary field.
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, const Internal &, const PtrList< PatchField< Type >> &)
Return a temporary field constructed from name,.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Dimension set for the base types.
const dimensionSet & dimensions() const
Return const reference to dimensions.
const Type & value() const
Return const reference to value.
Abstract base-class for Time/database functionObjects.
Calculates the thermal comfort quantities predicted mean vote (PMV), predicted percentage of dissatis...
virtual wordList fields() const
Return the list of fields required.
comfort(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
virtual bool execute()
Calculate the predicted mean vote (PMV)
virtual bool write()
Write the PPD and PMV fields.
virtual bool read(const dictionary &)
Read the data needed for the comfort calculation.
virtual ~comfort()
Destructor.
Specialisation of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
const fvMesh & mesh_
Reference to the fvMesh.
const DimensionedField< scalar, volMesh > & V() const
Return cell volumes.
A class for managing temporary objects.
A class for handling words, derived from string.
#define WarningInFunction
Report a warning using Foam::Warning.
defineTypeNameAndDebug(adjustTimeStepToCombustion, 0)
addToRunTimeSelectionTable(functionObject, adjustTimeStepToCombustion, dictionary)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
dimensionedScalar pos(const dimensionedScalar &ds)
Type gSum(const FieldField< Field, Type > &f)
dimensionedScalar exp(const dimensionedScalar &ds)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const dimensionSet dimPressure
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensionedScalar pow3(const dimensionedScalar &ds)
word name(const bool)
Return a word representation of a bool.
const dimensionSet dimless
const dimensionSet dimLength
const dimensionSet dimTemperature
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
const dimensionSet dimTime
dimensionedScalar sqrt(const dimensionedScalar &ds)
VolField< scalar > volScalarField
dimensioned< scalar > mag(const dimensioned< Type > &)
dimensionedScalar pow4(const dimensionedScalar &ds)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
const dimensionSet dimMass
const dimensionSet dimVelocity
dimensionedScalar neg0(const dimensionedScalar &ds)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
fvPatchField< scalar > fvPatchScalarField
dimensionedScalar pow025(const dimensionedScalar &ds)