44 fixedValueFvPatchVectorField(
p, iF),
47 cyclicPatchLabel_(-1),
54 maxOpenFractionDelta_(0),
68 fixedValueFvPatchVectorField(ptf,
p, iF, mapper),
70 cyclicPatchName_(ptf.cyclicPatchName_),
71 cyclicPatchLabel_(ptf.cyclicPatchLabel_),
72 orientation_(ptf.orientation_),
73 initWallSf_(ptf.initWallSf_),
74 initCyclicSf_(ptf.initCyclicSf_),
75 nbrCyclicSf_(ptf.nbrCyclicSf_),
76 openFraction_(ptf.openFraction_),
77 openingTime_(ptf.openingTime_),
78 maxOpenFractionDelta_(ptf.maxOpenFractionDelta_),
92 pName_(
dict.getOrDefault<
word>(
"p",
"p")),
95 orientation_(
dict.
get<label>(
"orientation")),
104 ).neighbFvPatch().Sf()
106 openFraction_(
dict.
get<scalar>(
"openFraction")),
107 openingTime_(
dict.
get<scalar>(
"openingTime")),
108 maxOpenFractionDelta_(
dict.
get<scalar>(
"maxOpenFractionDelta")),
111 fvPatchVectorField::operator=(
Zero);
121 fixedValueFvPatchVectorField(ptf),
123 cyclicPatchName_(ptf.cyclicPatchName_),
124 cyclicPatchLabel_(ptf.cyclicPatchLabel_),
125 orientation_(ptf.orientation_),
126 initWallSf_(ptf.initWallSf_),
127 initCyclicSf_(ptf.initCyclicSf_),
128 nbrCyclicSf_(ptf.nbrCyclicSf_),
129 openFraction_(ptf.openFraction_),
130 openingTime_(ptf.openingTime_),
131 maxOpenFractionDelta_(ptf.maxOpenFractionDelta_),
143 fixedValueFvPatchVectorField(ptf, iF),
145 cyclicPatchName_(ptf.cyclicPatchName_),
146 cyclicPatchLabel_(ptf.cyclicPatchLabel_),
147 orientation_(ptf.orientation_),
148 initWallSf_(ptf.initWallSf_),
149 initCyclicSf_(ptf.initCyclicSf_),
150 nbrCyclicSf_(ptf.nbrCyclicSf_),
151 openFraction_(ptf.openFraction_),
152 openingTime_(ptf.openingTime_),
153 maxOpenFractionDelta_(ptf.maxOpenFractionDelta_),
165 fixedValueFvPatchVectorField::autoMap(m);
174 initWallSf_ =
patch().patchSlice(areas);
175 initCyclicSf_ =
patch().boundaryMesh()
179 nbrCyclicSf_ = refCast<const cyclicFvPatch>
181 patch().boundaryMesh()
185 ).neighbFvPatch().patch().patchSlice(areas);
195 fixedValueFvPatchVectorField::rmap(ptf, addr);
199 initWallSf_ =
patch().patchSlice(areas);
200 initCyclicSf_ =
patch().boundaryMesh()
204 nbrCyclicSf_ = refCast<const cyclicFvPatch>
206 patch().boundaryMesh()
210 ).neighbFvPatch().patch().patchSlice(areas);
222 if (curTimeIndex_ != this->db().time().
timeIndex())
229 const fvPatch& cyclicPatch =
patch().boundaryMesh()[cyclicPatchLabel_];
230 const labelList& cyclicFaceCells = cyclicPatch.patch().faceCells();
231 const fvPatch& nbrPatch = refCast<const cyclicFvPatch>
235 const labelList& nbrFaceCells = nbrPatch.patch().faceCells();
237 scalar forceDiff = 0;
240 forAll(cyclicFaceCells, facei)
242 forceDiff +=
p[cyclicFaceCells[facei]]*
mag(initCyclicSf_[facei]);
246 forAll(nbrFaceCells, facei)
248 forceDiff -=
p[nbrFaceCells[facei]]*
mag(nbrCyclicSf_[facei]);
256 this->db().time().deltaTValue()/openingTime_,
257 maxOpenFractionDelta_
259 *(orientation_*
sign(forceDiff))
262 openFraction_ =
clamp(openFraction_, scalar(1
e-6), scalar(1 - 1
e-6));
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();
299 os.
writeEntry(
"maxOpenFractionDelta", maxOpenFractionDelta_);
312 activeBaffleVelocityFvPatchVectorField
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
dimensionedScalar sign(const dimensionedScalar &ds)
fvPatchField< vector > fvPatchVectorField
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface...
Ostream & endl(Ostream &os)
Add newline and flush stream.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
void writeValueEntry(Ostream &os) const
Write *this field as a "value" entry.
virtual void write(Ostream &) const
Write.
Lookup type of boundary radiation properties.
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
virtual void write(Ostream &) const
Write.
const dimensionedScalar e
Elementary charge.
A class for handling words, derived from Foam::string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
activeBaffleVelocityFvPatchVectorField(const fvPatch &, const DimensionedField< vector, volMesh > &)
Construct from patch and internal field.
virtual void rmap(const fvPatchVectorField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
A FieldMapper for finite-volume patch fields.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Ostream & writeEntryIfDifferent(const word &key, const T &value1, const T &value2)
Write a keyword/value entry only when the two values differ.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const std::string patch
OpenFOAM patch number as a std::string.
messageStream Info
Information stream (stdout output on master, null elsewhere)
SubField< vector > subField
Declare type of subField.
Field< vector > vectorField
Specialisation of Field<T> for vector.
List< label > labelList
A List of labels.
This velocity boundary condition simulates the opening of a baffle due to local flow conditions...
makePatchTypeField(fvPatchScalarField, atmBoundaryLayerInletEpsilonFvPatchScalarField)
dimensionSet clamp(const dimensionSet &a, const dimensionSet &range)
static constexpr const zero Zero
Global zero (0)