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;
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);
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_)
193 fixedJumpFvPatchScalarField(ptf),
194 fanCurve_(ptf.fanCurve_,
false),
195 jumpTable_(ptf.jumpTable_,
false),
196 reverse_(ptf.reverse_),
197 phiName_(ptf.phiName_),
198 rhoName_(ptf.rhoName_)
208 fixedJumpFvPatchScalarField(ptf, iF),
209 fanCurve_(ptf.fanCurve_,
false),
210 jumpTable_(ptf.jumpTable_,
false),
211 reverse_(ptf.reverse_),
212 phiName_(ptf.phiName_),
213 rhoName_(ptf.rhoName_)
226 if (cyclicPatch().owner())
231 fixedJumpFvPatchScalarField::updateCoeffs();
239 if (cyclicPatch().owner())
241 if (fanCurve_.
valid())
251 writeEntryIfDifferent<Switch>(os,
"reverse",
false, reverse_);
252 writeEntryIfDifferent<word>(os,
"phi",
"phi", phiName_);
253 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)
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) independent variable.
A class for handling words, derived from string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Foam::fvPatchFieldMapper.
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 dimDensity
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)
static autoPtr< Function1< Type > > New(const word &entryName, const dictionary &dict)
Selector.
fanPressureJumpFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
const dimensionSet dimArea(sqr(dimLength))
const dimensionSet dimVelocity