41 fixedValueFvPatchVectorField(p, iF),
44 cyclicPatchLabel_(-1),
51 maxOpenFractionDelta_(0),
65 fixedValueFvPatchVectorField(ptf, p, iF, mapper),
67 cyclicPatchName_(ptf.cyclicPatchName_),
68 cyclicPatchLabel_(ptf.cyclicPatchLabel_),
69 orientation_(ptf.orientation_),
70 initWallSf_(ptf.initWallSf_),
71 initCyclicSf_(ptf.initCyclicSf_),
72 nbrCyclicSf_(ptf.nbrCyclicSf_),
73 openFraction_(ptf.openFraction_),
74 openingTime_(ptf.openingTime_),
75 maxOpenFractionDelta_(ptf.maxOpenFractionDelta_),
88 fixedValueFvPatchVectorField(p, iF, dict,
false),
90 cyclicPatchName_(dict.
lookup(
"cyclicPatch")),
97 refCast<const cyclicFvPatch>
100 ).neighbFvPatch().Sf()
107 fvPatchVectorField::operator=(
Zero);
117 fixedValueFvPatchVectorField(ptf),
119 cyclicPatchName_(ptf.cyclicPatchName_),
120 cyclicPatchLabel_(ptf.cyclicPatchLabel_),
121 orientation_(ptf.orientation_),
122 initWallSf_(ptf.initWallSf_),
123 initCyclicSf_(ptf.initCyclicSf_),
124 nbrCyclicSf_(ptf.nbrCyclicSf_),
125 openFraction_(ptf.openFraction_),
126 openingTime_(ptf.openingTime_),
127 maxOpenFractionDelta_(ptf.maxOpenFractionDelta_),
139 fixedValueFvPatchVectorField(ptf, iF),
141 cyclicPatchName_(ptf.cyclicPatchName_),
142 cyclicPatchLabel_(ptf.cyclicPatchLabel_),
143 orientation_(ptf.orientation_),
144 initWallSf_(ptf.initWallSf_),
145 initCyclicSf_(ptf.initCyclicSf_),
146 nbrCyclicSf_(ptf.nbrCyclicSf_),
147 openFraction_(ptf.openFraction_),
148 openingTime_(ptf.openingTime_),
149 maxOpenFractionDelta_(ptf.maxOpenFractionDelta_),
161 fixedValueFvPatchVectorField::autoMap(m);
169 const vectorField& areas = patch().boundaryMesh().mesh().faceAreas();
170 initWallSf_ = patch().patchSlice(areas);
171 initCyclicSf_ = patch().boundaryMesh()
175 nbrCyclicSf_ = refCast<const cyclicFvPatch>
177 patch().boundaryMesh()
181 ).neighbFvPatch().patch().patchSlice(areas);
191 fixedValueFvPatchVectorField::rmap(ptf, addr);
194 const vectorField& areas = patch().boundaryMesh().mesh().faceAreas();
195 initWallSf_ = patch().patchSlice(areas);
196 initCyclicSf_ = patch().boundaryMesh()
200 nbrCyclicSf_ = refCast<const cyclicFvPatch>
202 patch().boundaryMesh()
206 ).neighbFvPatch().patch().patchSlice(areas);
218 if (curTimeIndex_ != this->db().time().
timeIndex())
226 const labelList& cyclicFaceCells = cyclicPatch.patch().faceCells();
227 const fvPatch& nbrPatch = refCast<const cyclicFvPatch>
233 scalar forceDiff = 0;
236 forAll(cyclicFaceCells, facei)
238 forceDiff += p[cyclicFaceCells[facei]]*
mag(initCyclicSf_[facei]);
242 forAll(nbrFaceCells, facei)
244 forceDiff -= p[nbrFaceCells[facei]]*
mag(nbrCyclicSf_[facei]);
255 this->db().time().deltaTValue()/openingTime_,
256 maxOpenFractionDelta_
258 *(orientation_*
sign(forceDiff)),
264 Info<<
"openFraction = " << openFraction_ <<
endl;
267 const vectorField newSfw((1 - openFraction_)*initWallSf_);
270 Sfw[facei] = newSfw[facei];
276 openFraction_*initCyclicSf_;
278 mag(cyclicPatch.Sf());
281 openFraction_*nbrCyclicSf_;
285 curTimeIndex_ = this->db().time().timeIndex();
288 fixedValueFvPatchVectorField::updateCoeffs();
295 writeEntryIfDifferent<word>(os,
"p",
"p", pName_);
296 os.writeKeyword(
"cyclicPatch")
298 os.writeKeyword(
"orientation")
300 os.writeKeyword(
"openingTime")
302 os.writeKeyword(
"maxOpenFractionDelta")
304 os.writeKeyword(
"openFraction")
306 writeEntryIfDifferent<word>(os,
"p",
"p", pName_);
307 writeEntry(
"value", os);
const fvBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
dimensionedScalar sign(const dimensionedScalar &ds)
#define forAll(list, i)
Loop across all elements in list.
const double e
Elementary charge.
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.
makePatchTypeField(fvPatchVectorField, SRFFreestreamVelocityFvPatchVectorField)
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.
label readLabel(Istream &is)
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.
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 > &)
This velocity boundary condition simulates the opening of a baffle due to local flow conditions...
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.