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),
72 supplyTotalTemperature_
82 inletDischargeCoefficient_
92 if (dict.
found(
"rho"))
108 fixedValueFvPatchScalarField(ptf, p, iF, mapper),
111 supplyMassFlowRate_(ptf.supplyMassFlowRate_),
112 supplyTotalTemperature_(ptf.supplyTotalTemperature_),
113 plenumVolume_(ptf.plenumVolume_),
114 plenumDensity_(ptf.plenumDensity_),
115 plenumTemperature_(ptf.plenumTemperature_),
117 hasRho_(ptf.hasRho_),
118 inletAreaRatio_(ptf.inletAreaRatio_),
119 inletDischargeCoefficient_(ptf.inletDischargeCoefficient_),
120 timeScale_(ptf.timeScale_),
121 phiName_(ptf.phiName_),
131 fixedValueFvPatchScalarField(tppsf),
132 gamma_(tppsf.gamma_),
134 supplyMassFlowRate_(tppsf.supplyMassFlowRate_),
135 supplyTotalTemperature_(tppsf.supplyTotalTemperature_),
136 plenumVolume_(tppsf.plenumVolume_),
137 plenumDensity_(tppsf.plenumDensity_),
138 plenumTemperature_(tppsf.plenumTemperature_),
140 hasRho_(tppsf.hasRho_),
141 inletAreaRatio_(tppsf.inletAreaRatio_),
142 inletDischargeCoefficient_(tppsf.inletDischargeCoefficient_),
143 timeScale_(tppsf.timeScale_),
144 phiName_(tppsf.phiName_),
155 fixedValueFvPatchScalarField(tppsf, iF),
156 gamma_(tppsf.gamma_),
158 supplyMassFlowRate_(tppsf.supplyMassFlowRate_),
159 supplyTotalTemperature_(tppsf.supplyTotalTemperature_),
160 plenumVolume_(tppsf.plenumVolume_),
161 plenumDensity_(tppsf.plenumDensity_),
162 plenumTemperature_(tppsf.plenumTemperature_),
164 hasRho_(tppsf.hasRho_),
165 inletAreaRatio_(tppsf.inletAreaRatio_),
166 inletDischargeCoefficient_(tppsf.inletDischargeCoefficient_),
167 timeScale_(tppsf.timeScale_),
168 phiName_(tppsf.phiName_),
187 internalField().name()
188 ).
oldTime().boundaryField()[patch().index()];
199 if (timeIndex_ != db().time().
timeIndex())
201 timeIndex_ = db().time().timeIndex();
202 plenumDensityOld_ = plenumDensity_;
203 plenumTemperatureOld_ = plenumTemperature_;
207 scalar massFlowRate(1.0);
212 massFlowRate = -
gSum(rho_*phi);
217 <<
"The density must be specified when using a volumetric flux." 223 phi.internalField().dimensions()
230 <<
"The density must be not specified when using a mass flux." 235 massFlowRate = -
gSum(phi);
241 <<
"dimensions of phi are not correct" 242 <<
"\n on patch " << patch().name()
243 <<
" of field " << internalField().name()
244 <<
" in file " << internalField().objectPath() <<
nl 249 const scalar cv = R_/(gamma_ - 1),
cp = R_*gamma_/(gamma_ - 1);
254 + (dt/plenumVolume_)*(supplyMassFlowRate_ - massFlowRate);
256 plenumTemperatureOld_
257 + (dt/(plenumDensity_*cv*plenumVolume_))
260 *(
cp*supplyTotalTemperature_ - cv*plenumTemperature_)
261 - massFlowRate*R_*plenumTemperature_
263 const scalar plenumPressure = plenumDensity_*R_*plenumTemperature_;
271 1.0 - (gamma_ - 1.0)*U_e/(2.0*gamma_*R_*plenumTemperature_)
277 (1.0 - r)/(r*r*inletDischargeCoefficient_*inletDischargeCoefficient_)
289 (1.0 -
pos(phi))*t*plenumPressure +
pos(phi)*
max(p, plenumPressure)
293 const scalar oneByFraction = timeScale_/dt;
294 const scalar fraction = oneByFraction < 1.0 ? 1.0 : 1.0/oneByFraction;
297 operator==((1.0 - fraction)*p_old + fraction*p_new);
298 fixedValueFvPatchScalarField::updateCoeffs();
309 os.
writeKeyword(
"supplyMassFlowRate") << supplyMassFlowRate_
311 os.
writeKeyword(
"supplyTotalTemperature") << supplyTotalTemperature_
317 os.
writeKeyword(
"plenumTemperature") << plenumTemperature_
326 os.
writeKeyword(
"inletDischargeCoefficient") << inletDischargeCoefficient_
328 writeEntryIfDifferent<scalar>(os,
"timeScale", 0.0, timeScale_);
329 writeEntryIfDifferent<word>(os,
"phi",
"phi", phiName_);
330 writeEntryIfDifferent<word>(os,
"U",
"U", UName_);
331 writeEntry(
"value", os);
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.
dimensionedScalar sqrt(const dimensionedScalar &ds)
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...
bool cp(const fileName &src, const fileName &dst)
Copy, recursively if necessary, the source to the destination.
GeometricField< vector, fvPatchField, volMesh > volVectorField
Macros for easy insertion into run-time selection tables.
makePatchTypeField(fvPatchVectorField, SRFFreestreamVelocityFvPatchVectorField)
dimensionedScalar pos(const dimensionedScalar &ds)
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.
const Time & time() const
Return time.
Foam::fvPatchFieldMapper.
virtual label size() const
Return size.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
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...
volScalarField scalarField(fieldObject, mesh)
Ostream & writeKeyword(const keyType &)
Write the keyword followed by an appropriate indentation.
scalar deltaTValue() const
Return time step value.
const dimensionSet dimDensity
virtual void write(Ostream &) const
Write.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
An abstract base class with a fat-interface to all derived classes covering all possible ways in whic...
const dimensionSet dimArea(sqr(dimLength))
virtual void write(Ostream &) const
Write.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
const dimensionSet dimVelocity