41 fixedValueFvPatchVectorField(p, iF),
44 cyclicPatchLabel_(-1),
51 maxOpenFractionDelta_(0),
64 fixedValueFvPatchVectorField(p, iF, dict,
false),
66 cyclicPatchName_(dict.
lookup(
"cyclicPatch")),
73 refCast<const cyclicFvPatch>
76 ).neighbFvPatch().Sf()
78 openFraction_(dict.
lookup<scalar>(
"openFraction")),
79 openingTime_(dict.
lookup<scalar>(
"openingTime")),
80 maxOpenFractionDelta_(dict.
lookup<scalar>(
"maxOpenFractionDelta")),
83 fvPatchVectorField::operator=(
Zero);
96 fixedValueFvPatchVectorField(ptf, p, iF, mapper),
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_),
118 fixedValueFvPatchVectorField(ptf, iF),
120 cyclicPatchName_(ptf.cyclicPatchName_),
121 cyclicPatchLabel_(ptf.cyclicPatchLabel_),
122 orientation_(ptf.orientation_),
123 initWallSf_(ptf.initWallSf_),
124 initCyclicSf_(ptf.initCyclicSf_),
125 nbrCyclicSf_(ptf.nbrCyclicSf_),
126 openFraction_(ptf.openFraction_),
127 openingTime_(ptf.openingTime_),
128 maxOpenFractionDelta_(ptf.maxOpenFractionDelta_),
140 fixedValueFvPatchVectorField::autoMap(m);
148 const vectorField& areas = patch().boundaryMesh().mesh().faceAreas();
149 initWallSf_ = patch().patchSlice(areas);
150 initCyclicSf_ = patch().boundaryMesh()
154 nbrCyclicSf_ = refCast<const cyclicFvPatch>
156 patch().boundaryMesh()
160 ).neighbFvPatch().patch().patchSlice(areas);
170 fixedValueFvPatchVectorField::rmap(ptf, addr);
173 const vectorField& areas = patch().boundaryMesh().mesh().faceAreas();
174 initWallSf_ = patch().patchSlice(areas);
175 initCyclicSf_ = patch().boundaryMesh()
179 nbrCyclicSf_ = refCast<const cyclicFvPatch>
181 patch().boundaryMesh()
185 ).neighbFvPatch().patch().patchSlice(areas);
197 if (curTimeIndex_ != this->db().time().
timeIndex())
205 const labelList& cyclicFaceCells = cyclicPatch.patch().faceCells();
206 const fvPatch& nbrPatch = refCast<const cyclicFvPatch>
212 scalar forceDiff = 0;
215 forAll(cyclicFaceCells, facei)
217 forceDiff += p[cyclicFaceCells[facei]]*
mag(initCyclicSf_[facei]);
221 forAll(nbrFaceCells, facei)
223 forceDiff -= p[nbrFaceCells[facei]]*
mag(nbrCyclicSf_[facei]);
234 this->db().time().deltaTValue()/openingTime_,
235 maxOpenFractionDelta_
237 *(orientation_*
sign(forceDiff)),
243 Info<<
"openFraction = " << openFraction_ <<
endl;
246 const vectorField newSfw((1 - openFraction_)*initWallSf_);
249 Sfw[facei] = newSfw[facei];
255 openFraction_*initCyclicSf_;
257 mag(cyclicPatch.Sf());
260 openFraction_*nbrCyclicSf_;
264 curTimeIndex_ = this->db().time().timeIndex();
267 fixedValueFvPatchVectorField::updateCoeffs();
274 writeEntryIfDifferent<word>(os,
"p",
"p", pName_);
275 writeEntry(os,
"cyclicPatch", cyclicPatchName_);
278 writeEntry(os,
"maxOpenFractionDelta", maxOpenFractionDelta_);
279 writeEntry(os,
"openFraction", openFraction_);
280 writeEntryIfDifferent<word>(os,
"p",
"p", pName_);
const fvBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
dimensionedScalar sign(const dimensionedScalar &ds)
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const scalarField & magSf() const
Return face area magnitudes.
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 > &)
const polyBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
Ostream & endl(Ostream &os)
Add newline and flush stream.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
label findPatchID(const word &patchName) const
Find patch index given a name.
virtual void write(Ostream &) const
Write.
Pre-declare related SubField type.
Macros for easy insertion into run-time selection tables.
virtual void write(Ostream &) const
Write.
const labelUList & faceCells() const
Return face-cell addressing.
A class for handling words, derived from string.
activeBaffleVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
const polyPatch & patch() const
Return the polyPatch.
virtual void rmap(const fvPatchVectorField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Foam::fvPatchFieldMapper.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
const vectorField & Sf() const
Return face area vectors.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
dimensioned< scalar > mag(const dimensioned< Type > &)
const doubleScalar e
Elementary charge.
This velocity boundary condition simulates the opening of a baffle due to local flow conditions...
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.