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_),
91 fixedValueFvPatchVectorField(
p, iF,
dict, false),
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]);
259 this->db().time().deltaTValue()/openingTime_,
260 maxOpenFractionDelta_
262 *(orientation_*
sign(forceDiff)),
268 Info<<
"openFraction = " << openFraction_ <<
endl;
271 const vectorField newSfw((1 - openFraction_)*initWallSf_);
274 Sfw[facei] = newSfw[facei];
280 openFraction_*initCyclicSf_;
282 mag(cyclicPatch.Sf());
285 openFraction_*nbrCyclicSf_;
289 curTimeIndex_ = this->db().time().timeIndex();
292 fixedValueFvPatchVectorField::updateCoeffs();
303 os.
writeEntry(
"maxOpenFractionDelta", maxOpenFractionDelta_);
305 writeEntry(
"value",
os);
316 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...
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Type & refCast(U &obj)
A dynamic_cast (for references) that generates FatalError on failed casts, uses the virtual type() me...
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.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/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.
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)
static constexpr const zero Zero
Global zero (0)