35 void Foam::flowRateInletVelocityFvPatchVectorField::setWallDist()
41 patch().poly().boundaryMesh().findIndices<wallPolyPatch>()
44 const patchPatchDist pwd(patch().poly(), otherPatchIDs);
49 area_ =
gSum(patch().magSf());
54 Foam::flowRateInletVelocityFvPatchVectorField::profile()
58 return profile_->value(y_);
62 return tmp<scalarField>(
new scalarField(size(), scalar(1)));
67 template<
class ScaleType,
class AlphaType,
class RhoType>
68 void Foam::flowRateInletVelocityFvPatchVectorField::updateValues
70 const ScaleType& scale,
71 const AlphaType&
alpha,
79 *flowRate_->value(
time().value())
86 template<
class AlphaType>
87 void Foam::flowRateInletVelocityFvPatchVectorField::updateValues
89 const AlphaType&
alpha
94 updateValues(area_,
alpha, one());
96 else if (volumetric_ || rhoName_ ==
"none")
98 updateValues(one(),
alpha, one());
103 if (db().foundObject<volScalarField>(rhoName_))
105 const fvPatchField<scalar>& rhop =
108 updateValues(one(),
alpha, rhop);
116 <<
"Did not find registered density field " << rhoName_
117 <<
" and no constant density 'rhoInlet' specified"
121 updateValues(one(),
alpha, rhoInlet_);
143 rhoInlet_(
dict.lookupOrDefault<scalar>(
"rhoInlet",
dimDensity, -vGreat)),
144 alphaName_(
dict.lookupOrDefault<
word>(
"alpha",
word::null)),
148 if (
dict.found(
"meanVelocity"))
150 meanVelocity_ =
true;
161 else if (
dict.found(
"volumetricFlowRate"))
163 meanVelocity_ =
false;
168 "volumetricFlowRate",
174 else if (
dict.found(
"massFlowRate"))
176 meanVelocity_ =
false;
186 rhoName_ =
word(
dict.lookupOrDefault<
word>(
"rho",
"rho"));
191 <<
"Please supply 'meanVelocity', 'volumetricFlowRate' or"
195 if (
dict.found(
"profile"))
200 if (!
p.time().completeCase() ||
dict.found(
"value"))
224 flowRate_(ptf.flowRate_, false),
225 meanVelocity_(ptf.meanVelocity_),
226 volumetric_(ptf.volumetric_),
227 profile_(ptf.profile_, false),
228 rhoName_(ptf.rhoName_),
229 rhoInlet_(ptf.rhoInlet_),
230 alphaName_(ptf.alphaName_),
244 flowRate_(ptf.flowRate_, false),
245 meanVelocity_(ptf.meanVelocity_),
246 volumetric_(ptf.volumetric_),
247 profile_(ptf.profile_, false),
248 rhoName_(ptf.rhoName_),
249 rhoInlet_(ptf.rhoInlet_),
250 alphaName_(ptf.alphaName_),
264 fixedValueFvPatchVectorField::map(ptf, mapper);
276 fixedValueFvPatchVectorField::reset(ptf);
290 if (!patch().
time().completeCase())
293 <<
"Cannot evaluate flow rate on a non-parallel processor case"
307 updateValues(alphap);
314 fixedValueFvPatchVectorField::updateCoeffs();
322 if (profile_.valid())
328 writeEntryIfDifferent<word>(os,
"rho",
"rho", rhoName_);
329 writeEntryIfDifferent<scalar>(os,
"rhoInlet", -vGreat, rhoInlet_);
331 writeEntryIfDifferent<word>(os,
"alpha",
word::null, alphaName_);
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.
static autoPtr< Function1< Type > > New(const word &name, const Function1s::unitSets &units, const dictionary &dict)
Select from dictionary.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Abstract base class for field mapping.
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
Velocity inlet boundary condition creating a velocity field with optionally specified profile normal ...
flowRateInletVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, fvMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
virtual void write(Ostream &) const
Write.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual void reset(const fvPatchVectorField &)
Reset the fvPatchField to the given fvPatchField.
virtual void map(const fvPatchVectorField &, const fieldMapper &)
Map the given fvPatchField onto this fvPatchField.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
virtual void write(Ostream &) const
Write.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
A class representing the concept of 1 (scalar(1)) used to avoid unnecessary manipulations for objects...
A class for managing temporary objects.
A class for handling words, derived from string.
static const word null
An empty word.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
errorManipArg< error, int > exit(error &err, const int errNo=1)
const dimensionSet & dimless
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
const dimensionSet & dimMassFlux
makePatchTypeField(fvPatchScalarField, atmosphericBoundaryLayerTurbulentEpsilonFvPatchScalarField)
Type gSum(const UList< Type > &f, const label comm)
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const dimensionSet & dimVelocity
void evaluate(GeometricField< Type, GeoMesh > &result, const Function1< Type > &func, const GeometricField< Type, GeoMesh > &x)
VolField< scalar > volScalarField
const dimensionSet & dimDensity
Field< vector > vectorField
Specialisation of Field<T> for vector.
Type gMax(const UList< Type > &f, const label comm)
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
void writeEntry(Ostream &os, const word &key, const DimensionedFieldFunction< DimensionedFieldType > &f)
const dimensionSet & dimVolumetricFlux