42 fixedValueFvPatchVectorField(
p, iF,
dict, false),
43 pName_(
dict.lookupOrDefault<
word>(
"p",
"p")),
44 cyclicPatchName_(
dict.lookup(
"cyclicPatch")),
45 cyclicPatchLabel_(
p.patch().boundaryMesh().
findIndex(cyclicPatchName_)),
46 orientation_(
dict.lookup<
label>(
"orientation")),
48 initCyclicSf_(
p.boundaryMesh()[cyclicPatchLabel_].Sf()),
53 p.boundaryMesh()[cyclicPatchLabel_]
54 ).neighbFvPatch().Sf()
57 openingTime_(
dict.lookup<scalar>(
"openingTime",
dimTime)),
77 fixedValueFvPatchVectorField(ptf,
p, iF, mapper),
79 cyclicPatchName_(ptf.cyclicPatchName_),
80 cyclicPatchLabel_(ptf.cyclicPatchLabel_),
81 orientation_(ptf.orientation_),
82 initWallSf_(ptf.initWallSf_),
83 initCyclicSf_(ptf.initCyclicSf_),
84 nbrCyclicSf_(ptf.nbrCyclicSf_),
85 openFraction_(ptf.openFraction_),
86 openingTime_(ptf.openingTime_),
87 maxOpenFractionDelta_(ptf.maxOpenFractionDelta_),
99 fixedValueFvPatchVectorField(ptf, iF),
101 cyclicPatchName_(ptf.cyclicPatchName_),
102 cyclicPatchLabel_(ptf.cyclicPatchLabel_),
103 orientation_(ptf.orientation_),
104 initWallSf_(ptf.initWallSf_),
105 initCyclicSf_(ptf.initCyclicSf_),
106 nbrCyclicSf_(ptf.nbrCyclicSf_),
107 openFraction_(ptf.openFraction_),
108 openingTime_(ptf.openingTime_),
109 maxOpenFractionDelta_(ptf.maxOpenFractionDelta_),
122 fixedValueFvPatchVectorField::map(ptf, mapper);
131 const vectorField& areas = patch().boundaryMesh().mesh().faceAreas();
132 initWallSf_ = patch().patchSlice(areas);
133 initCyclicSf_ = patch().boundaryMesh()
137 nbrCyclicSf_ = refCast<const cyclicFvPatch>
139 patch().boundaryMesh()
143 ).neighbFvPatch().patch().patchSlice(areas);
152 fixedValueFvPatchVectorField::reset(ptf);
155 const vectorField& areas = patch().boundaryMesh().mesh().faceAreas();
156 initWallSf_ = patch().patchSlice(areas);
157 initCyclicSf_ = patch().boundaryMesh()
161 nbrCyclicSf_ = refCast<const cyclicFvPatch>
163 patch().boundaryMesh()
167 ).neighbFvPatch().patch().patchSlice(areas);
179 if (curTimeIndex_ != this->db().time().
timeIndex())
187 const labelList& cyclicFaceCells = cyclicPatch.patch().faceCells();
188 const fvPatch& nbrPatch = refCast<const cyclicFvPatch>
194 scalar forceDiff = 0;
197 forAll(cyclicFaceCells, facei)
199 forceDiff +=
p[cyclicFaceCells[facei]]*
mag(initCyclicSf_[facei]);
203 forAll(nbrFaceCells, facei)
205 forceDiff -=
p[nbrFaceCells[facei]]*
mag(nbrCyclicSf_[facei]);
216 this->db().time().deltaTValue()/openingTime_,
217 maxOpenFractionDelta_
219 *(orientation_*
sign(forceDiff)),
225 Info<<
"openFraction = " << openFraction_ <<
endl;
228 const vectorField newSfw((1 - openFraction_)*initWallSf_);
231 Sfw[facei] = newSfw[facei];
237 openFraction_*initCyclicSf_;
239 mag(cyclicPatch.Sf());
242 openFraction_*nbrCyclicSf_;
246 curTimeIndex_ = this->db().time().timeIndex();
249 fixedValueFvPatchVectorField::updateCoeffs();
256 writeEntryIfDifferent<word>(os,
"p",
"p", pName_);
257 writeEntry(os,
"cyclicPatch", cyclicPatchName_);
260 writeEntry(os,
"maxOpenFractionDelta", maxOpenFractionDelta_);
261 writeEntry(os,
"openFraction", openFraction_);
262 writeEntryIfDifferent<word>(os,
"p",
"p", pName_);
#define forAll(list, i)
Loop across all elements in list.
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...
Generic GeometricField class.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Pre-declare related SubField type.
This velocity boundary condition simulates the opening of a baffle due to local flow conditions,...
virtual void write(Ostream &) const
Write.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
activeBaffleVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
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.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Abstract base class for field mapping.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
virtual void write(Ostream &) const
Write.
virtual void operator=(const UList< Type > &)
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
const polyPatch & patch() const
Return the polyPatch.
const scalarField & magSf() const
Return face area magnitudes.
const fvBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
const vectorField & Sf() const
Return face area vectors.
const labelUList & faceCells() const
Return face-cell addressing.
A class for handling words, derived from string.
dimensionedScalar sign(const dimensionedScalar &ds)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
To & refCast(From &r)
Reference type cast template function.
Ostream & endl(Ostream &os)
Add newline and flush stream.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
const dimensionSet dimTime
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
dimensioned< scalar > mag(const dimensioned< Type > &)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurrence of given element and return index,.
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
const unitConversion unitFraction