45 const scalar error =
max(
magSqr(patchNormal + nf));
50 <<
"Patch " << this->
patch().name() <<
" is not planar"
54 return patchNormal.normalise();
63 AMIPtr_->calculate(this->
patch().
patch(), L_.patch());
65 patchNormal_ = calcPatchNormal();
75 Field<Type> sourceFld;
77 if (Pstream::master())
79 sourceFld = L_.convolve();
86 AMIPtr_->interpolateToSource
89 multiplyWeightedOp<Type, plusEqOp<Type>>(cop),
108 const scalar t = this->db().time().timeOutputValue();
125 const scalar t = this->db().time().timeOutputValue();
129 for (symmTensor& r : R)
136 r.yz() = (r.yz() - r.xy()*r.xz())/r.yy();
147 u.z() = u.x()*r.xz() + u.y()*r.yz() + u.z()*r.zz();
148 u.y() = u.x()*r.xy() + u.y()*r.yy();
149 u.x() = u.x()*r.xx();
160 const scalar t = this->db().time().timeOutputValue();
162 fld += meanPtr_->value(t);
172 const scalar t = this->db().time().timeOutputValue();
173 tmp<vectorField> tmean = meanPtr_->value(t);
180 /(
gSum(this->
patch().magSf()) + ROOTVSMALL)
185 gSum((bulk & patchNormal_)*this->
patch().magSf())
228 AMIPtr_(ptf.AMIPtr_.clone()),
229 meanPtr_(ptf.meanPtr_.clone(this->patch().patch())),
230 Rptr_(ptf.Rptr_.clone(this->patch().patch())),
231 curTimeIndex_(ptf.curTimeIndex_),
232 patchNormal_(ptf.patchNormal_),
260 this->patch().patch(),
269 this->patch().patch(),
281 if (!L_.fsm() && this->db().time().isAdjustTimeStep())
284 <<
"Varying time-step computations are not "
285 <<
"supported by the digital filter method."
304 AMIPtr_(ptf.AMIPtr_.clone()),
305 meanPtr_(ptf.meanPtr_.clone(this->patch().patch())),
306 Rptr_(ptf.Rptr_.clone(this->patch().patch())),
307 curTimeIndex_(ptf.curTimeIndex_),
308 patchNormal_(ptf.patchNormal_),
322 AMIPtr_(ptf.AMIPtr_.clone()),
323 meanPtr_(ptf.meanPtr_.clone(this->patch().patch())),
324 Rptr_(ptf.Rptr_.clone(this->patch().patch())),
325 curTimeIndex_(ptf.curTimeIndex_),
326 patchNormal_(ptf.patchNormal_),
343 meanPtr_->autoMap(m);
362 refCast<const turbulentDigitalFilterInletFvPatchField<Type>>(ptf);
366 meanPtr_->rmap(dfmptf.meanPtr_(), addr);
370 Rptr_->rmap(dfmptf.Rptr_(), addr);
383 if (curTimeIndex_ == -1)
388 if (curTimeIndex_ != this->db().time().
timeIndex())
399 curTimeIndex_ = this->db().time().timeIndex();
416 meanPtr_->writeData(
os);
420 Rptr_->writeData(
os);
428 this->writeEntry(
"value",
os);
#define R(A, B, C, D, E, F, K, M)
Macros for easy insertion into run-time selection tables.
Info<< nl<< "Wrote faMesh in vtk format: "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.mesh().time().globalPath()/"finiteArea-edges"));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
Interpolation class dealing with transfer of data between two primitive patches with an arbitrary mes...
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic templated field type.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
scalar timeOutputValue() const
Return current time value.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
void rmap(const atmBoundaryLayer &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Face area weighted Arbitrary Mesh Interface (AMI) method.
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
virtual bool write()
Write the output fields.
A FieldMapper for finite-volume patch fields.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
const objectRegistry & db() const
Return local objectRegistry.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
const Time & time() const noexcept
Return time registry.
Class to describe the integral-scale container being used in the turbulentDigitalFilterInletFvPatchFi...
static void checkStresses(const symmTensorField &R)
Check if input Reynolds stresses are valid.
Digital-filter based boundary condition for vector- and scalar-based quantities (e....
virtual void rmap(const fvPatchField< Type > &ptf, const labelList &addr)
Reverse map the given fvPatchField onto this fvPatchField.
virtual void autoMap(const fvPatchFieldMapper &m)
Map (and resize as needed) from self given a mapping object.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
OBJstream os(runTime.globalPath()/outputName)
#define WarningInFunction
Report a warning using Foam::Warning.
const std::string patch
OpenFOAM patch number as a std::string.
Type gSum(const FieldField< Field, Type > &f)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
SymmTensor< scalar > symmTensor
SymmTensor of scalars, i.e. SymmTensor<scalar>.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensionedScalar sqrt(const dimensionedScalar &ds)
Field< vector > vectorField
Specialisation of Field<T> for vector.
Field< symmTensor > symmTensorField
Specialisation of Field<T> for symmTensor.
Type gAverage(const FieldField< Field, Type > &f)
static constexpr const zero Zero
Global zero (0)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
#define forAll(list, i)
Loop across all elements in list.