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()),
158 const int dir = 2*direction_ - 1;
161 scalar volFlowRate = 0;
165 volFlowRate = dir*
gSum(phip);
170 volFlowRate = dir*
gSum(phip/rhop);
175 <<
"dimensions of phi are not correct\n" 176 <<
" on patch " <<
patch().name()
177 <<
" of field " << internalField().name()
178 <<
" in file " << internalField().objectPath() <<
nl 189 rpm = rpm_->value(this->db().time().timeOutputValue());
190 meanDiam = dm_->value(this->db().time().timeOutputValue());
203 scalar pdFan = fanCurve_->value(
max(volFlowRate, scalar(0)));
211 *
sqr(rpm * meanDiam) / 1800.0
218 patch().lookupPatchField<volVectorField>(
UName())
226 fanCurve_->writeData(
os);
227 os.
writeEntry(
"direction", fanFlowDirectionNames_[direction_]);
245 fanPressureFvPatchScalarField
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
Templated table container function where data are read from file.
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const word UName(propsDict.getOrDefault< word >("U", "U"))
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
constexpr char nl
The newline '\n' character (0x0a)
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
This boundary condition can be applied to assign either a pressure inlet or outlet total pressure con...
dimensionedScalar stabilise(const dimensionedScalar &x, const dimensionedScalar &y)
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
virtual void write(Ostream &) const
Write.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Macros for easy insertion into run-time selection tables.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
const dimensionSet dimVolume(pow3(dimLength))
Type gSum(const FieldField< Field, Type > &f)
fvPatchField< scalar > fvPatchScalarField
static const Enum< fanFlowDirection > fanFlowDirectionNames_
Fan flow direction names.
A FieldMapper for finite-volume patch fields.
constexpr scalar pi(M_PI)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
dimensionedScalar pow3(const dimensionedScalar &ds)
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
fanFlowDirection
Fan flow direction.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
dimensionedScalar pow4(const dimensionedScalar &ds)
const std::string patch
OpenFOAM patch number as a std::string.
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
const volScalarField & p0
virtual void write(Ostream &os) const
Write.
fanPressureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
This boundary condition provides a total pressure condition. Four variants are possible: ...