1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 Foam::activeBaffleVelocityFvPatchVectorField
29 Boundary condition that modifies mesh areas based on velocity.
32 activeBaffleVelocityFvPatchVectorField.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef activeBaffleVelocityFvPatchVectorField_H
37 #define activeBaffleVelocityFvPatchVectorField_H
39 #include "fvPatchFields.H"
40 #include "fixedValueFvPatchFields.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 /*---------------------------------------------------------------------------*\
48 Class activeBaffleVelocityFvPatch Declaration
49 \*---------------------------------------------------------------------------*/
51 class activeBaffleVelocityFvPatchVectorField
53 public fixedValueFvPatchVectorField
57 //- Name of the pressure field used to calculate the force
58 // on the active baffle
61 //- Name of the cyclic patch used when the active baffle is open
62 word cyclicPatchName_;
64 //- Index of the cyclic patch used when the active baffle is open
65 label cyclicPatchLabel_;
67 //- Orientation (1 or -1) of the active baffle patch.
68 // Used to change the direction of opening without the need for
69 // reordering the patch faces
72 //- Initial wall patch areas
73 vectorField initWallSf_;
75 //- Initial cyclic patch areas
76 vectorField initCyclicSf_;
78 //- Current fraction of the active baffle which is open
81 //- Time taken for the active baffle to open
84 //- Maximum fractional change to the active baffle openness
86 scalar maxOpenFractionDelta_;
93 //- Runtime type information
94 TypeName("activeBaffleVelocity");
99 //- Construct from patch and internal field
100 activeBaffleVelocityFvPatchVectorField
103 const DimensionedField<vector, volMesh>&
106 //- Construct from patch, internal field and dictionary
107 activeBaffleVelocityFvPatchVectorField
110 const DimensionedField<vector, volMesh>&,
114 //- Construct by mapping given activeBaffleVelocityFvPatchVectorField
116 activeBaffleVelocityFvPatchVectorField
118 const activeBaffleVelocityFvPatchVectorField&,
120 const DimensionedField<vector, volMesh>&,
121 const fvPatchFieldMapper&
124 //- Construct as copy
125 activeBaffleVelocityFvPatchVectorField
127 const activeBaffleVelocityFvPatchVectorField&
130 //- Construct and return a clone
131 virtual tmp<fvPatchVectorField> clone() const
133 return tmp<fvPatchVectorField>
135 new activeBaffleVelocityFvPatchVectorField(*this)
139 //- Construct as copy setting internal field reference
140 activeBaffleVelocityFvPatchVectorField
142 const activeBaffleVelocityFvPatchVectorField&,
143 const DimensionedField<vector, volMesh>&
146 //- Construct and return a clone setting internal field reference
147 virtual tmp<fvPatchVectorField> clone
149 const DimensionedField<vector, volMesh>& iF
152 return tmp<fvPatchVectorField>
154 new activeBaffleVelocityFvPatchVectorField(*this, iF)
163 //- Map (and resize as needed) from self given a mapping object
166 const fvPatchFieldMapper&
169 //- Reverse map the given fvPatchField onto this fvPatchField
172 const fvPatchVectorField&,
177 //- Update the coefficients associated with the patch field
178 virtual void updateCoeffs();
181 virtual void write(Ostream&) const;
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 } // End namespace Foam
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 // ************************************************************************* //