41 fluctuationScale_(
Zero),
58 fluctuationScale_(
dict.get<Type>(
"fluctuationScale")),
59 referenceField_(
"referenceField",
dict,
p.size()),
60 alpha_(
dict.getOrDefault<scalar>(
"alpha", 0.1)),
73 const turbulentInletFvPatchField<Type>& ptf,
75 const DimensionedField<Type, volMesh>& iF,
76 const fvPatchFieldMapper& mapper
79 fixedValueFvPatchField<Type>(ptf,
p, iF, mapper),
81 fluctuationScale_(ptf.fluctuationScale_),
82 referenceField_(ptf.referenceField_, mapper),
96 fluctuationScale_(ptf.fluctuationScale_),
97 referenceField_(ptf.referenceField_),
111 ranGen_(ptf.ranGen_),
112 fluctuationScale_(ptf.fluctuationScale_),
113 referenceField_(ptf.referenceField_),
128 referenceField_.autoMap(m);
144 referenceField_.rmap(tiptf.referenceField_, addr);
156 if (curTimeIndex_ != this->db().time().
timeIndex())
158 Field<Type>& patchField = *
this;
160 Field<Type> randomField(this->size());
164 ranGen_.randomise01<Type>(randomField[facei]);
169 scalar rmsCorr =
sqrt(12*(2*alpha_ -
sqr(alpha_)))/alpha_;
172 (1 - alpha_)*patchField
180 )*
mag(referenceField_)
183 curTimeIndex_ = this->db().time().timeIndex();
194 os.writeEntry(
"fluctuationScale", fluctuationScale_);
195 referenceField_.writeEntry(
"referenceField",
os);
196 os.writeEntry(
"alpha", alpha_);
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
bool get(const label i) const
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
fixedValueFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
const objectRegistry & db() const
The associated objectRegistry.
bool updated() const noexcept
True if the boundary condition has already been updated.
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...
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
virtual void write(Ostream &) const
Write.
void writeValueEntry(Ostream &os) const
Write *this field as a "value" entry.
virtual void operator=(const UList< Type > &)
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
bool readValueEntry(const dictionary &dict, IOobjectOption::readOption readOpt=IOobjectOption::LAZY_READ)
Read the "value" entry into *this.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
A traits class, which is primarily used for primitives and vector-space.
This boundary condition produces spatiotemporal-variant field by summing a set of pseudo-random numbe...
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
virtual void write(Ostream &) const
Write.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
turbulentInletFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
virtual void rmap(const fvPatchField< Type > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
OBJstream os(runTime.globalPath()/outputName)
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
List< label > labelList
A List of labels.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
static constexpr const zero Zero
Global zero (0).
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
#define forAll(list, i)
Loop across all elements in list.