This velocity boundary condition simulates the opening of a baffle due to local flow conditions, by merging the behaviours of wall and cyclic conditions. The baffle joins two mesh regions, where the open fraction determines the interpolation weights applied to each cyclic- and neighbour-patch contribution. More...
Public Member Functions | |
TypeName ("activeBaffleVelocity") | |
Runtime type information. More... | |
activeBaffleVelocityFvPatchVectorField (const fvPatch &, const DimensionedField< vector, volMesh > &) | |
Construct from patch and internal field. More... | |
activeBaffleVelocityFvPatchVectorField (const fvPatch &, const DimensionedField< vector, volMesh > &, const dictionary &) | |
Construct from patch, internal field and dictionary. More... | |
activeBaffleVelocityFvPatchVectorField (const activeBaffleVelocityFvPatchVectorField &, const fvPatch &, const DimensionedField< vector, volMesh > &, const fvPatchFieldMapper &) | |
Construct by mapping given activeBaffleVelocityFvPatchVectorField. More... | |
activeBaffleVelocityFvPatchVectorField (const activeBaffleVelocityFvPatchVectorField &) | |
Construct as copy. More... | |
virtual tmp< fvPatchVectorField > | clone () const |
Construct and return a clone. More... | |
activeBaffleVelocityFvPatchVectorField (const activeBaffleVelocityFvPatchVectorField &, const DimensionedField< vector, volMesh > &) | |
Construct as copy setting internal field reference. More... | |
virtual tmp< fvPatchVectorField > | clone (const DimensionedField< vector, volMesh > &iF) const |
Construct and return a clone setting internal field reference. More... | |
virtual void | autoMap (const fvPatchFieldMapper &) |
Map (and resize as needed) from self given a mapping object. More... | |
virtual void | rmap (const fvPatchVectorField &, const labelList &) |
Reverse map the given fvPatchField onto this fvPatchField. More... | |
virtual void | updateCoeffs () |
Update the coefficients associated with the patch field. More... | |
virtual void | write (Ostream &) const |
Write. More... | |
Private Attributes | |
word | pName_ |
Name of the pressure field used to calculate the force. More... | |
word | cyclicPatchName_ |
Name of the cyclic patch used when the active baffle is open. More... | |
label | cyclicPatchLabel_ |
Index of the cyclic patch used when the active baffle is open. More... | |
label | orientation_ |
Orientation (1 or -1) of the active baffle patch. More... | |
vectorField | initWallSf_ |
Initial wall patch areas. More... | |
vectorField | initCyclicSf_ |
Initial this-side cyclic patch areas. More... | |
vectorField | nbrCyclicSf_ |
Initial neighbour-side cyclic patch areas. More... | |
scalar | openFraction_ |
Current fraction of the active baffle which is open. More... | |
scalar | openingTime_ |
Time taken for the active baffle to open. More... | |
scalar | maxOpenFractionDelta_ |
Maximum fractional change to the active baffle openness. More... | |
label | curTimeIndex_ |
This velocity boundary condition simulates the opening of a baffle due to local flow conditions, by merging the behaviours of wall and cyclic conditions. The baffle joins two mesh regions, where the open fraction determines the interpolation weights applied to each cyclic- and neighbour-patch contribution.
We determine whether the baffle is opening or closing from the sign of the net force across the baffle, from which the baffle open fraction is updated using:
where
![]() | = | baffle open fraction [0-1] |
![]() | = | baffle open fraction on previous evaluation |
![]() | = | simulation time step |
![]() | = | time taken to open the baffle |
![]() | = | net force across the baffle |
The open fraction is then applied to scale the patch areas.
Patch usage
Property | Description | Required | Default value |
---|---|---|---|
p | pressure field name | no | p |
cyclicPatch | cylclic patch name | yes | |
orientation | 1 or -1 used to switch flow direction | yes | |
openFraction | current opatch open fraction [0-1] | yes | |
openingTime | time taken to open the baffle | yes | |
maxOpenFractionDelta | max open fraction change per timestep | yes |
Example of the boundary condition specification:
myPatch { type activeBaffleVelocity; p p; cyclicPatch cyclic1; orientation 1; openFraction 0.2; openingTime 5.0; maxOpenFractionDelta 0.1; }
Definition at line 161 of file activeBaffleVelocityFvPatchVectorField.H.
activeBaffleVelocityFvPatchVectorField | ( | const fvPatch & | p, |
const DimensionedField< vector, volMesh > & | iF | ||
) |
Construct from patch and internal field.
Definition at line 36 of file activeBaffleVelocityFvPatchVectorField.C.
Referenced by activeBaffleVelocityFvPatchVectorField::clone().
activeBaffleVelocityFvPatchVectorField | ( | const fvPatch & | p, |
const DimensionedField< vector, volMesh > & | iF, | ||
const dictionary & | dict | ||
) |
Construct from patch, internal field and dictionary.
Definition at line 82 of file activeBaffleVelocityFvPatchVectorField.C.
activeBaffleVelocityFvPatchVectorField | ( | const activeBaffleVelocityFvPatchVectorField & | ptf, |
const fvPatch & | p, | ||
const DimensionedField< vector, volMesh > & | iF, | ||
const fvPatchFieldMapper & | mapper | ||
) |
Construct by mapping given activeBaffleVelocityFvPatchVectorField.
onto a new patch
Definition at line 58 of file activeBaffleVelocityFvPatchVectorField.C.
Construct as copy.
Definition at line 113 of file activeBaffleVelocityFvPatchVectorField.C.
activeBaffleVelocityFvPatchVectorField | ( | const activeBaffleVelocityFvPatchVectorField & | ptf, |
const DimensionedField< vector, volMesh > & | iF | ||
) |
Construct as copy setting internal field reference.
Definition at line 134 of file activeBaffleVelocityFvPatchVectorField.C.
TypeName | ( | "activeBaffleVelocity" | ) |
Runtime type information.
|
inlinevirtual |
Construct and return a clone.
Definition at line 244 of file activeBaffleVelocityFvPatchVectorField.H.
References activeBaffleVelocityFvPatchVectorField::activeBaffleVelocityFvPatchVectorField().
|
inlinevirtual |
Construct and return a clone setting internal field reference.
Definition at line 261 of file activeBaffleVelocityFvPatchVectorField.H.
References activeBaffleVelocityFvPatchVectorField::activeBaffleVelocityFvPatchVectorField().
|
virtual |
Map (and resize as needed) from self given a mapping object.
Note: cannot map field from cyclic patch anyway so just recalculate
Areas should be consistent when doing autoMap except in case of topo changes. ! Note: we don't want to use Sf here since triggers rebuilding of /*! fvMesh::S() which will give problems when mapped (since already on new mesh)
Definition at line 157 of file activeBaffleVelocityFvPatchVectorField.C.
|
virtual |
Reverse map the given fvPatchField onto this fvPatchField.
Definition at line 186 of file activeBaffleVelocityFvPatchVectorField.C.
|
virtual |
Update the coefficients associated with the patch field.
Definition at line 210 of file activeBaffleVelocityFvPatchVectorField.C.
References fvPatch::boundaryMesh(), activeBaffleVelocityFvPatchVectorField::curTimeIndex_, activeBaffleVelocityFvPatchVectorField::cyclicPatchLabel_, Foam::e, Foam::endl(), polyPatch::faceCells(), forAll, Foam::Info, activeBaffleVelocityFvPatchVectorField::initCyclicSf_, activeBaffleVelocityFvPatchVectorField::initWallSf_, Foam::mag(), fvPatch::magSf(), Foam::max(), activeBaffleVelocityFvPatchVectorField::maxOpenFractionDelta_, Foam::min(), activeBaffleVelocityFvPatchVectorField::nbrCyclicSf_, activeBaffleVelocityFvPatchVectorField::openFraction_, activeBaffleVelocityFvPatchVectorField::openingTime_, activeBaffleVelocityFvPatchVectorField::orientation_, p, fvPatch::patch(), activeBaffleVelocityFvPatchVectorField::pName_, fvPatch::Sf(), Foam::sign(), and timeIndex.
|
virtual |
Write.
Definition at line 292 of file activeBaffleVelocityFvPatchVectorField.C.
References token::END_STATEMENT, Foam::nl, fvPatchField::write(), and Ostream::writeKeyword().
|
private |
Name of the pressure field used to calculate the force.
on the active baffle
Definition at line 169 of file activeBaffleVelocityFvPatchVectorField.H.
Referenced by activeBaffleVelocityFvPatchVectorField::updateCoeffs().
|
private |
Name of the cyclic patch used when the active baffle is open.
Definition at line 172 of file activeBaffleVelocityFvPatchVectorField.H.
|
private |
Index of the cyclic patch used when the active baffle is open.
Definition at line 175 of file activeBaffleVelocityFvPatchVectorField.H.
Referenced by activeBaffleVelocityFvPatchVectorField::updateCoeffs().
|
private |
Orientation (1 or -1) of the active baffle patch.
Used to change the direction of opening without the need for reordering the patch faces
Definition at line 180 of file activeBaffleVelocityFvPatchVectorField.H.
Referenced by activeBaffleVelocityFvPatchVectorField::updateCoeffs().
|
private |
Initial wall patch areas.
Definition at line 183 of file activeBaffleVelocityFvPatchVectorField.H.
Referenced by activeBaffleVelocityFvPatchVectorField::updateCoeffs().
|
private |
Initial this-side cyclic patch areas.
Definition at line 186 of file activeBaffleVelocityFvPatchVectorField.H.
Referenced by activeBaffleVelocityFvPatchVectorField::updateCoeffs().
|
private |
Initial neighbour-side cyclic patch areas.
Definition at line 189 of file activeBaffleVelocityFvPatchVectorField.H.
Referenced by activeBaffleVelocityFvPatchVectorField::updateCoeffs().
|
private |
Current fraction of the active baffle which is open.
Definition at line 192 of file activeBaffleVelocityFvPatchVectorField.H.
Referenced by activeBaffleVelocityFvPatchVectorField::updateCoeffs().
|
private |
Time taken for the active baffle to open.
Definition at line 195 of file activeBaffleVelocityFvPatchVectorField.H.
Referenced by activeBaffleVelocityFvPatchVectorField::updateCoeffs().
|
private |
Maximum fractional change to the active baffle openness.
per time-step
Definition at line 199 of file activeBaffleVelocityFvPatchVectorField.H.
Referenced by activeBaffleVelocityFvPatchVectorField::updateCoeffs().
|
private |
Definition at line 201 of file activeBaffleVelocityFvPatchVectorField.H.
Referenced by activeBaffleVelocityFvPatchVectorField::updateCoeffs().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.