Go to the documentation of this file.
41 fixedValueFvPatchVectorField(
p, iF),
44 cyclicPatchLabel_(-1),
51 maxOpenFractionDelta_(0),
53 minThresholdValue_(0),
68 fixedValueFvPatchVectorField(ptf,
p, iF, mapper),
94 fixedValueFvPatchVectorField(
p, iF),
95 pName_(
dict.lookupOrDefault<
word>(
"p",
"p")),
96 cyclicPatchName_(
dict.lookup(
"cyclicPatch")),
97 cyclicPatchLabel_(
p.patch().boundaryMesh().findPatchID(cyclicPatchName_)),
104 maxOpenFractionDelta_(
readScalar(
dict.lookup(
"maxOpenFractionDelta"))),
110 fvPatchVectorField::operator=(vector::zero);
114 initWallSf_ =
p.Sf();
115 initCyclicSf_ =
p.boundaryMesh()[cyclicPatchLabel_].Sf();
116 nbrCyclicSf_ = refCast<const cyclicFvPatch>
118 p.boundaryMesh()[cyclicPatchLabel_]
119 ).neighbFvPatch().Sf();
124 dict.lookup(
"p") >> pName_;
135 fixedValueFvPatchVectorField(ptf),
160 fixedValueFvPatchVectorField(ptf, iF),
185 fixedValueFvPatchVectorField::autoMap(m);
197 Info <<
"faceArea[active] "<< i <<
endl;
200 if (patch().size() > 0)
202 const vectorField& areas = patch().boundaryMesh().mesh().faceAreas();
203 initWallSf_ = patch().patchSlice(areas);
204 initCyclicSf_ = patch().boundaryMesh()
208 nbrCyclicSf_ = refCast<const cyclicFvPatch>
214 ).neighbFvPatch().patch().patchSlice(areas);
224 fixedValueFvPatchVectorField::rmap(ptf, addr);
227 const vectorField& areas = patch().boundaryMesh().mesh().faceAreas();
228 initWallSf_ = patch().patchSlice(areas);
229 initCyclicSf_ = patch().boundaryMesh()
233 nbrCyclicSf_ = refCast<const cyclicFvPatch>
239 ).neighbFvPatch().patch().patchSlice(areas);
258 const labelList& cyclicFaceCells = cyclicPatch.patch().faceCells();
259 const fvPatch& nbrPatch = refCast<const cyclicFvPatch>
266 scalar valueDiff = 0;
271 forAll(cyclicFaceCells, facei)
277 forAll(nbrFaceCells, facei)
282 Info<<
"Force difference = " << valueDiff <<
endl;
286 forAll(cyclicFaceCells, facei)
288 valueDiff +=
p[cyclicFaceCells[facei]];
291 forAll(nbrFaceCells, facei)
293 valueDiff -=
p[nbrFaceCells[facei]];
296 Info<<
"Pressure difference = " << valueDiff <<
endl;
328 Sfw[facei] = newSfw[facei];
337 mag(cyclicPatch.Sf());
349 fixedValueFvPatchVectorField::updateCoeffs();
357 writeEntryIfDifferent<word>(os,
"p",
"p", pName_);
372 writeEntry(
"value", os);
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
virtual void write(Ostream &) const
Write.
const vectorField & Sf() const
Return face area vectors.
vectorField initWallSf_
Initial wall patch areas.
label orientation_
Orientation (1 or -1) of the active baffle mode.
A class for handling words, derived from string.
#define forAll(list, i)
Loop across all elements in list.
label cyclicPatchLabel_
Index of the cyclic patch used when the active baffle is open.
word cyclicPatchName_
Name of the cyclic patch used when the active baffle is open.
Ostream & endl(Ostream &os)
Add newline and flush stream.
scalar openingTime_
Time taken for the active baffle to open.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
dimensioned< scalar > mag(const dimensioned< Type > &)
word pName_
Name of the pressure field used to calculate the force.
scalar minThresholdValue_
Minimum value for the active baffle to start opening.
const fvBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
Pre-declare related SubField type.
bool fBased_
Force based active baffle.
Pre-declare SubField and related Field type.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
virtual void write(Ostream &) const
Write.
scalar openFraction_
Current fraction of the active baffle which is open.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Macros for easy insertion into run-time selection tables.
vectorField nbrCyclicSf_
Initial neighbour-side cyclic patch areas.
const labelUList & faceCells() const
Return face-cell addressing.
const double e
Elementary charge.
makePatchTypeField(fvPatchVectorField, SRFFreestreamVelocityFvPatchVectorField)
activePressureForceBaffleVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
scalar maxOpenFractionDelta_
Maximum fractional change to the active baffle openness.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
virtual void rmap(const fvPatchVectorField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Ostream & writeKeyword(const keyType &)
Write the keyword followed by an appropriate indentation.
label readLabel(Istream &is)
const polyPatch & patch() const
Return the polyPatch.
vectorField initCyclicSf_
Initial cyclic patch areas.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
Foam::fvPatchFieldMapper.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
const scalarField & magSf() const
Return face area magnitudes.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Generic GeometricField class.
This boundary condition is applied to the flow velocity, to simulate the opening or closure of a baff...
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
bool baffleActivated_
Baffle is activated.