40 fixedValueFvPatchScalarField(p, iF),
43 supplyMassFlowRate_(1.0),
44 supplyTotalTemperature_(300.0),
47 plenumDensityOld_(1.0),
48 plenumTemperature_(300.0),
49 plenumTemperatureOld_(300.0),
53 inletDischargeCoefficient_(1.0),
68 fixedValueFvPatchScalarField(p, iF, dict),
72 supplyTotalTemperature_
82 inletDischargeCoefficient_
90 if (dict.
found(
"rho"))
106 fixedValueFvPatchScalarField(ptf, p, iF, mapper),
109 supplyMassFlowRate_(ptf.supplyMassFlowRate_),
110 supplyTotalTemperature_(ptf.supplyTotalTemperature_),
111 plenumVolume_(ptf.plenumVolume_),
112 plenumDensity_(ptf.plenumDensity_),
113 plenumTemperature_(ptf.plenumTemperature_),
115 hasRho_(ptf.hasRho_),
116 inletAreaRatio_(ptf.inletAreaRatio_),
117 inletDischargeCoefficient_(ptf.inletDischargeCoefficient_),
118 timeScale_(ptf.timeScale_),
119 phiName_(ptf.phiName_),
129 fixedValueFvPatchScalarField(tppsf),
130 gamma_(tppsf.gamma_),
132 supplyMassFlowRate_(tppsf.supplyMassFlowRate_),
133 supplyTotalTemperature_(tppsf.supplyTotalTemperature_),
134 plenumVolume_(tppsf.plenumVolume_),
135 plenumDensity_(tppsf.plenumDensity_),
136 plenumTemperature_(tppsf.plenumTemperature_),
138 hasRho_(tppsf.hasRho_),
139 inletAreaRatio_(tppsf.inletAreaRatio_),
140 inletDischargeCoefficient_(tppsf.inletDischargeCoefficient_),
141 timeScale_(tppsf.timeScale_),
142 phiName_(tppsf.phiName_),
153 fixedValueFvPatchScalarField(tppsf, iF),
154 gamma_(tppsf.gamma_),
156 supplyMassFlowRate_(tppsf.supplyMassFlowRate_),
157 supplyTotalTemperature_(tppsf.supplyTotalTemperature_),
158 plenumVolume_(tppsf.plenumVolume_),
159 plenumDensity_(tppsf.plenumDensity_),
160 plenumTemperature_(tppsf.plenumTemperature_),
162 hasRho_(tppsf.hasRho_),
163 inletAreaRatio_(tppsf.inletAreaRatio_),
164 inletDischargeCoefficient_(tppsf.inletDischargeCoefficient_),
165 timeScale_(tppsf.timeScale_),
166 phiName_(tppsf.phiName_),
185 internalField().name()
186 ).
oldTime().boundaryField()[patch().index()];
197 if (timeIndex_ != db().time().
timeIndex())
199 timeIndex_ = db().time().timeIndex();
200 plenumDensityOld_ = plenumDensity_;
201 plenumTemperatureOld_ = plenumTemperature_;
205 scalar massFlowRate(1.0);
210 massFlowRate = -
gSum(rho_*phi);
215 <<
"The density must be specified when using a volumetric flux." 221 phi.internalField().dimensions()
228 <<
"The density must be not specified when using a mass flux." 233 massFlowRate = -
gSum(phi);
239 <<
"dimensions of phi are not correct" 240 <<
"\n on patch " << patch().name()
241 <<
" of field " << internalField().name()
242 <<
" in file " << internalField().objectPath() <<
nl 247 const scalar cv = R_/(gamma_ - 1),
cp = R_*gamma_/(gamma_ - 1);
252 + (dt/plenumVolume_)*(supplyMassFlowRate_ - massFlowRate);
254 plenumTemperatureOld_
255 + (dt/(plenumDensity_*cv*plenumVolume_))
258 *(
cp*supplyTotalTemperature_ - cv*plenumTemperature_)
259 - massFlowRate*R_*plenumTemperature_
261 const scalar plenumPressure = plenumDensity_*R_*plenumTemperature_;
269 1.0 - (gamma_ - 1.0)*U_e/(2.0*gamma_*R_*plenumTemperature_)
275 (1.0 - r)/(r*r*inletDischargeCoefficient_*inletDischargeCoefficient_)
287 (1.0 -
pos0(phi))*t*plenumPressure +
pos0(phi)*
max(p, plenumPressure)
291 const scalar oneByFraction = timeScale_/dt;
292 const scalar fraction = oneByFraction < 1.0 ? 1.0 : 1.0/oneByFraction;
295 operator==((1.0 - fraction)*p_old + fraction*p_new);
296 fixedValueFvPatchScalarField::updateCoeffs();
307 os.
writeKeyword(
"supplyMassFlowRate") << supplyMassFlowRate_
309 os.
writeKeyword(
"supplyTotalTemperature") << supplyTotalTemperature_
315 os.
writeKeyword(
"plenumTemperature") << plenumTemperature_
324 os.
writeKeyword(
"inletDischargeCoefficient") << inletDischargeCoefficient_
326 writeEntryIfDifferent<scalar>(os,
"timeScale", 0.0, timeScale_);
327 writeEntryIfDifferent<word>(os,
"phi",
"phi", phiName_);
328 writeEntryIfDifferent<word>(os,
"U",
"U", UName_);
329 writeEntry(
"value", os);
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
This boundary condition provides a plenum pressure inlet condition. This condition creates a zero-dim...
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.
virtual void write(Ostream &) const
Write.
dimensionedScalar sqrt(const dimensionedScalar &ds)
bool cp(const fileName &src, const fileName &dst, const bool followLink=true)
Copy, recursively if necessary, the source to the destination.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
virtual void write(Ostream &) const
Write.
GeometricField< vector, fvPatchField, volMesh > volVectorField
Macros for easy insertion into run-time selection tables.
makePatchTypeField(fvPatchVectorField, SRFFreestreamVelocityFvPatchVectorField)
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Type gSum(const FieldField< Field, Type > &f)
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
A class for handling words, derived from string.
Foam::fvPatchFieldMapper.
scalar deltaTValue() const
Return time step value.
plenumPressureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
dimensionedScalar pos0(const dimensionedScalar &ds)
Ostream & writeKeyword(const keyType &)
Write the keyword followed by an appropriate indentation.
const dimensionSet dimDensity
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
const Time & time() const
Return time.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
An abstract base class with a fat-interface to all derived classes covering all possible ways in whic...
const dimensionSet dimArea(sqr(dimLength))
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
const dimensionSet dimVelocity