33 void Foam::fanPressureJumpFvPatchScalarField::calcFanJump()
35 const fvsPatchField<scalar>& phip =
38 const scalar sign = reverse_ ? -1 : 1;
40 if (fanCurve_.
valid())
44 scalar volFlowRate = 0;
46 if (phip.internalField().dimensions() ==
dimFlux)
48 volFlowRate =
gSum(phip);
58 volFlowRate =
gSum(phip/rhop);
63 <<
"dimensions of phi are not correct" 64 <<
"\n on patch " << patch().name()
65 <<
" of field " << internalField().name()
66 <<
" in file " << internalField().objectPath() <<
nl 70 jump_ = sign*
max(fanCurve_->
value(
max(sign*volFlowRate, 0)), 0);
78 if (phip.internalField().dimensions() ==
dimFlux)
87 const fvPatchField<scalar>& rhop =
95 <<
"dimensions of phi are not correct" 96 <<
"\n on patch " << patch().name()
97 <<
" of field " << internalField().name()
98 <<
" in file " << internalField().objectPath() <<
nl 102 jump_ = sign*
max(jumpTable_->
value(Un), scalar(0));
115 fixedJumpFvPatchScalarField(p, iF),
131 fixedJumpFvPatchScalarField(p, iF),
138 if (cyclicPatch().owner())
140 if (dict.
found(
"fanCurve"))
145 else if (dict.
found(
"jumpTable"))
157 if (dict.
found(
"value"))
179 fixedJumpFvPatchScalarField(ptf, p, iF, mapper),
180 fanCurve_(ptf.fanCurve_,
false),
181 jumpTable_(ptf.jumpTable_,
false),
182 reverse_(ptf.reverse_),
183 phiName_(ptf.phiName_),
184 rhoName_(ptf.rhoName_)
194 fixedJumpFvPatchScalarField(ptf, iF),
195 fanCurve_(ptf.fanCurve_,
false),
196 jumpTable_(ptf.jumpTable_,
false),
197 reverse_(ptf.reverse_),
198 phiName_(ptf.phiName_),
199 rhoName_(ptf.rhoName_)
212 if (cyclicPatch().owner())
217 fixedJumpFvPatchScalarField::updateCoeffs();
225 if (cyclicPatch().owner())
227 if (fanCurve_.
valid())
237 writeEntryIfDifferent<Switch>(os,
"reverse",
false, reverse_);
238 writeEntryIfDifferent<word>(os,
"phi",
"phi", phiName_);
239 writeEntryIfDifferent<word>(os,
"rho",
"rho", rhoName_);
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
errorManipArg< error, int > exit(error &err, const int errNo=1)
void evaluate(GeometricField< Type, PatchField, GeoMesh > &result, const Function1< Type > &func, const GeometricField< Type, PatchField, GeoMesh > &x)
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 > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
friend Ostream & operator(Ostream &, const fvPatchField< Type > &)
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
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.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Macros for easy insertion into run-time selection tables.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Type gSum(const FieldField< Field, Type > &f)
virtual Type value(const scalar x) const =0
Return value as a function of scalar x.
A class for handling words, derived from string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Foam::fvPatchFieldMapper.
const dimensionSet dimFlux
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
bool valid() const
Return true if the autoPtr valid (ie, the pointer is set)
virtual void write(Ostream &) const
Write.
virtual label size() const
Return size.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
This boundary condition provides a pressure jump condition, using the cyclic condition as a base...
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
const dimensionSet dimMassFlux
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
fanPressureJumpFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
static autoPtr< Function1< Type > > New(const word &name, const dictionary &dict)
Selector.