1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
25 Foam::activeBaffleVelocityFvPatchVectorField
28 Boundary condition that modifies mesh areas based on velocity.
31 activeBaffleVelocityFvPatchVectorField.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef activeBaffleVelocityFvPatchVectorField_H
36 #define activeBaffleVelocityFvPatchVectorField_H
38 #include "fvPatchFields.H"
39 #include "fixedValueFvPatchFields.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 /*---------------------------------------------------------------------------*\
47 Class activeBaffleVelocityFvPatch Declaration
48 \*---------------------------------------------------------------------------*/
50 class activeBaffleVelocityFvPatchVectorField
52 public fixedValueFvPatchVectorField
56 //- Name of the pressure field used to calculate the force
57 // on the active baffle
60 //- Name of the cyclic patch used when the active baffle is open
61 word cyclicPatchName_;
63 //- Index of the cyclic patch used when the active baffle is open
64 label cyclicPatchLabel_;
66 //- Orientation (1 or -1) of the active baffle patch.
67 // Used to change the direction of opening without the need for
68 // reordering the patch faces
71 //- Initial wall patch areas
72 vectorField initWallSf_;
74 //- Initial this-side cyclic patch areas
75 vectorField initCyclicSf_;
77 //- Initial neighbour-side cyclic patch areas
78 vectorField nbrCyclicSf_;
80 //- Current fraction of the active baffle which is open
83 //- Time taken for the active baffle to open
86 //- Maximum fractional change to the active baffle openness
88 scalar maxOpenFractionDelta_;
95 //- Runtime type information
96 TypeName("activeBaffleVelocity");
101 //- Construct from patch and internal field
102 activeBaffleVelocityFvPatchVectorField
105 const DimensionedField<vector, volMesh>&
108 //- Construct from patch, internal field and dictionary
109 activeBaffleVelocityFvPatchVectorField
112 const DimensionedField<vector, volMesh>&,
116 //- Construct by mapping given activeBaffleVelocityFvPatchVectorField
118 activeBaffleVelocityFvPatchVectorField
120 const activeBaffleVelocityFvPatchVectorField&,
122 const DimensionedField<vector, volMesh>&,
123 const fvPatchFieldMapper&
126 //- Construct as copy
127 activeBaffleVelocityFvPatchVectorField
129 const activeBaffleVelocityFvPatchVectorField&
132 //- Construct and return a clone
133 virtual tmp<fvPatchVectorField> clone() const
135 return tmp<fvPatchVectorField>
137 new activeBaffleVelocityFvPatchVectorField(*this)
141 //- Construct as copy setting internal field reference
142 activeBaffleVelocityFvPatchVectorField
144 const activeBaffleVelocityFvPatchVectorField&,
145 const DimensionedField<vector, volMesh>&
148 //- Construct and return a clone setting internal field reference
149 virtual tmp<fvPatchVectorField> clone
151 const DimensionedField<vector, volMesh>& iF
154 return tmp<fvPatchVectorField>
156 new activeBaffleVelocityFvPatchVectorField(*this, iF)
165 //- Map (and resize as needed) from self given a mapping object
168 const fvPatchFieldMapper&
171 //- Reverse map the given fvPatchField onto this fvPatchField
174 const fvPatchVectorField&,
179 //- Update the coefficients associated with the patch field
180 virtual void updateCoeffs();
183 virtual void write(Ostream&) const;
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 } // End namespace Foam
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 // ************************************************************************* //