43 { fanFlowDirection::ffdIn,
"in" },
44 { fanFlowDirection::ffdOut,
"out" },
59 nonDimensional_(false),
74 fanCurve_(rhs.fanCurve_.clone()),
75 direction_(rhs.direction_),
76 nonDimensional_(rhs.nonDimensional_),
77 rpm_(rhs.rpm_.clone()),
91 direction_(fanFlowDirectionNames_.get(
"direction",
dict)),
92 nonDimensional_(
dict.getOrDefault(
"nonDimensional", false)),
123 fanCurve_(rhs.fanCurve_.clone()),
124 direction_(rhs.direction_),
125 nonDimensional_(rhs.nonDimensional_),
126 rpm_(rhs.rpm_.clone()),
138 fanCurve_(rhs.fanCurve_.clone()),
139 direction_(rhs.direction_),
140 nonDimensional_(rhs.nonDimensional_),
141 rpm_(rhs.rpm_.clone()),
160 const int dir = 2*direction_ - 1;
163 scalar volFlowRate = 0;
167 volFlowRate = dir*
gSum(phip);
173 volFlowRate = dir*
gSum(phip/rhop);
178 <<
"dimensions of phi are not correct\n"
179 <<
" on patch " << patch().name()
180 <<
" of field " << internalField().name()
181 <<
" in file " << internalField().objectPath() <<
nl
192 rpm = rpm_->value(this->db().time().timeOutputValue());
193 meanDiam = dm_->value(this->db().time().timeOutputValue());
206 scalar pdFan = fanCurve_->value(
max(volFlowRate, scalar(0)));
214 *
sqr(rpm * meanDiam) / 1800.0
221 patch().lookupPatchField<volVectorField, vector>(
UName())
229 fanCurve_->writeData(
os);
230 os.
writeEntry(
"direction", fanFlowDirectionNames_[direction_]);
Macros for easy insertion into run-time selection tables.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const dimensionSet & dimensions() const
Return dimensions.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Templated table container function where data are read from file.
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Search for an entry (const access) with the given keyword.
This boundary condition can be applied to assign either a pressure inlet or outlet total pressure con...
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
static const Enum< fanFlowDirection > fanFlowDirectionNames_
Fan flow direction names.
fanFlowDirection
Fan flow direction.
virtual bool write()
Write the output fields.
A FieldMapper for finite-volume patch fields.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
This boundary condition provides a total pressure condition. Four variants are possible:
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
const volScalarField & p0
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
#define makePatchTypeField(PatchTypeField, typePatchTypeField)
constexpr scalar pi(M_PI)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Type gSum(const FieldField< Field, Type > &f)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedScalar pow3(const dimensionedScalar &ds)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
const dimensionSet dimArea(sqr(dimLength))
const dimensionSet dimVelocity
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
dimensionedScalar pow4(const dimensionedScalar &ds)
dimensionedScalar stabilise(const dimensionedScalar &x, const dimensionedScalar &y)
const dimensionSet dimDensity
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)
const word UName(propsDict.getOrDefault< word >("U", "U"))