Go to the documentation of this file.
43 { fanFlowDirection::ffdIn,
"in" },
44 { fanFlowDirection::ffdOut,
"out" },
53 const DimensionedField<scalar, volMesh>& iF
56 totalPressureFvPatchScalarField(
p, iF),
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)),
97 if (
dict.found(
"file"))
106 fanCurve_.reset(Function1<scalar>::New(
"fanCurve",
dict, &this->db()));
119 const fanPressureFvPatchScalarField& rhs
122 totalPressureFvPatchScalarField(rhs),
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_]);
248 fanPressureFvPatchScalarField
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
This boundary condition can be applied to assign either a pressure inlet or outlet total pressure con...
fvPatchField< scalar > fvPatchScalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
const dimensionSet dimVelocity
const dimensionSet dimDensity
const word UName(propsDict.getOrDefault< word >("U", "U"))
virtual void write(Ostream &os) const
Type gSum(const FieldField< Field, Type > &f)
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
fanPressureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
dimensionedScalar pow4(const dimensionedScalar &ds)
This boundary condition provides a total pressure condition. Four variants are possible:
const dimensionSet dimArea(sqr(dimLength))
Generic templated field type.
dimensionedScalar pow3(const dimensionedScalar &ds)
tmp< DimensionedField< scalar, GeoMesh > > stabilise(const DimensionedField< scalar, GeoMesh > &dsf, const dimensioned< scalar > &ds)
const word & phiName() const
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
const word & UName() const
Templated table container function where data are read from file.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
label max(const labelHashSet &set, label maxValue=labelMin)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
OBJstream os(runTime.globalPath()/outputName)
Macros for easy insertion into run-time selection tables.
const word & rhoName() const
const scalarField & p0() const
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
dimensionedSymmTensor sqr(const dimensionedVector &dv)
constexpr scalar pi(M_PI)
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
virtual void updateCoeffs()
virtual void updateCoeffs()
Ostream & writeEntry(const keyType &key, const T &value)
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
virtual void write(Ostream &) const
Foam::fvPatchFieldMapper.
static const Enum< fanFlowDirection > fanFlowDirectionNames_
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
const volScalarField & p0
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
Generic GeometricField class.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...