42 fixedValueFvPatchVectorField(
p, iF,
dict, false),
43 pName_(
dict.lookupOrDefault<
word>(
"p",
"p")),
44 cyclicPatchName_(
dict.lookup(
"cyclicPatch")),
45 cyclicPatchLabel_(
p.patch().boundaryMesh().findPatchID(cyclicPatchName_)),
46 orientation_(
dict.lookup<
label>(
"orientation")),
48 initCyclicSf_(
p.boundaryMesh()[cyclicPatchLabel_].Sf()),
53 p.boundaryMesh()[cyclicPatchLabel_]
54 ).neighbFvPatch().Sf()
56 openFraction_(
dict.lookup<scalar>(
"openFraction")),
57 openingTime_(
dict.lookup<scalar>(
"openingTime")),
58 maxOpenFractionDelta_(
dict.lookup<scalar>(
"maxOpenFractionDelta")),
74 fixedValueFvPatchVectorField(ptf,
p, iF, mapper),
76 cyclicPatchName_(ptf.cyclicPatchName_),
77 cyclicPatchLabel_(ptf.cyclicPatchLabel_),
78 orientation_(ptf.orientation_),
79 initWallSf_(ptf.initWallSf_),
80 initCyclicSf_(ptf.initCyclicSf_),
81 nbrCyclicSf_(ptf.nbrCyclicSf_),
82 openFraction_(ptf.openFraction_),
83 openingTime_(ptf.openingTime_),
84 maxOpenFractionDelta_(ptf.maxOpenFractionDelta_),
96 fixedValueFvPatchVectorField(ptf, iF),
98 cyclicPatchName_(ptf.cyclicPatchName_),
99 cyclicPatchLabel_(ptf.cyclicPatchLabel_),
100 orientation_(ptf.orientation_),
101 initWallSf_(ptf.initWallSf_),
102 initCyclicSf_(ptf.initCyclicSf_),
103 nbrCyclicSf_(ptf.nbrCyclicSf_),
104 openFraction_(ptf.openFraction_),
105 openingTime_(ptf.openingTime_),
106 maxOpenFractionDelta_(ptf.maxOpenFractionDelta_),
119 fixedValueFvPatchVectorField::map(ptf, mapper);
128 const vectorField& areas = patch().boundaryMesh().mesh().faceAreas();
129 initWallSf_ = patch().patchSlice(areas);
130 initCyclicSf_ = patch().boundaryMesh()
134 nbrCyclicSf_ = refCast<const cyclicFvPatch>
136 patch().boundaryMesh()
140 ).neighbFvPatch().patch().patchSlice(areas);
149 fixedValueFvPatchVectorField::reset(ptf);
152 const vectorField& areas = patch().boundaryMesh().mesh().faceAreas();
153 initWallSf_ = patch().patchSlice(areas);
154 initCyclicSf_ = patch().boundaryMesh()
158 nbrCyclicSf_ = refCast<const cyclicFvPatch>
160 patch().boundaryMesh()
164 ).neighbFvPatch().patch().patchSlice(areas);
176 if (curTimeIndex_ != this->db().time().
timeIndex())
184 const labelList& cyclicFaceCells = cyclicPatch.patch().faceCells();
185 const fvPatch& nbrPatch = refCast<const cyclicFvPatch>
191 scalar forceDiff = 0;
194 forAll(cyclicFaceCells, facei)
196 forceDiff +=
p[cyclicFaceCells[facei]]*
mag(initCyclicSf_[facei]);
200 forAll(nbrFaceCells, facei)
202 forceDiff -=
p[nbrFaceCells[facei]]*
mag(nbrCyclicSf_[facei]);
213 this->db().time().deltaTValue()/openingTime_,
214 maxOpenFractionDelta_
216 *(orientation_*
sign(forceDiff)),
222 Info<<
"openFraction = " << openFraction_ <<
endl;
225 const vectorField newSfw((1 - openFraction_)*initWallSf_);
228 Sfw[facei] = newSfw[facei];
234 openFraction_*initCyclicSf_;
236 mag(cyclicPatch.Sf());
239 openFraction_*nbrCyclicSf_;
243 curTimeIndex_ = this->db().time().timeIndex();
246 fixedValueFvPatchVectorField::updateCoeffs();
253 writeEntryIfDifferent<word>(os,
"p",
"p", pName_);
254 writeEntry(os,
"cyclicPatch", cyclicPatchName_);
257 writeEntry(os,
"maxOpenFractionDelta", maxOpenFractionDelta_);
258 writeEntry(os,
"openFraction", openFraction_);
259 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 map(const fvPatchVectorField &, const fvPatchFieldMapper &)
Map the given fvPatchField onto this fvPatchField.
virtual void reset(const fvPatchVectorField &)
Reset the fvPatchField to the given fvPatchField.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Foam::fvPatchFieldMapper.
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)
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
dimensioned< scalar > mag(const dimensioned< Type > &)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)