Added more controls to the active-baffles.
[OpenFOAM-1.5.x.git] / src / finiteVolume / fields / fvPatchFields / derived / activeBaffleVelocity / activeBaffleVelocityFvPatchVectorField.H
blobf49c780645b1002c9fa6e314ba92adc91691f403
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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
25 Class
26     Foam::activeBaffleVelocityFvPatchVectorField
28 Description
29     Foam::activeBaffleVelocityFvPatchVectorField
31 SourceFiles
32     activeBaffleVelocityFvPatchVectorField.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef activeBaffleVelocityFvPatchVectorField_H
37 #define activeBaffleVelocityFvPatchVectorField_H
39 #include "fvPatchFields.H"
40 #include "fixedValueFvPatchFields.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 namespace Foam
47 /*---------------------------------------------------------------------------*\
48                  Class activeBaffleVelocityFvPatch Declaration
49 \*---------------------------------------------------------------------------*/
51 class activeBaffleVelocityFvPatchVectorField
53     public fixedValueFvPatchVectorField
55     // Private data
57         //- Name of the pressure field used to calculate the force
58         //  on the active baffle
59         word pName_;
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
70         label orientation_;
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
79         scalar openFraction_;
81         //- Time taken for the active baffle to open
82         scalar openingTime_;
84         //- Maximum fractional change to the active baffle openness
85         //  per time-step
86         scalar maxOpenFractionDelta_;
88         label curTimeIndex_;
91 public:
93     //- Runtime type information
94     TypeName("activeBaffleVelocity");
97     // Constructors
99         //- Construct from patch and internal field
100         activeBaffleVelocityFvPatchVectorField
101         (
102             const fvPatch&,
103             const DimensionedField<vector, volMesh>&
104         );
106         //- Construct from patch, internal field and dictionary
107         activeBaffleVelocityFvPatchVectorField
108         (
109             const fvPatch&,
110             const DimensionedField<vector, volMesh>&,
111             const dictionary&
112         );
114         //- Construct by mapping given activeBaffleVelocityFvPatchVectorField
115         //  onto a new patch
116         activeBaffleVelocityFvPatchVectorField
117         (
118             const activeBaffleVelocityFvPatchVectorField&,
119             const fvPatch&,
120             const DimensionedField<vector, volMesh>&,
121             const fvPatchFieldMapper&
122         );
124         //- Construct as copy
125         activeBaffleVelocityFvPatchVectorField
126         (
127             const activeBaffleVelocityFvPatchVectorField&
128         );
130         //- Construct and return a clone
131         virtual tmp<fvPatchVectorField> clone() const
132         {
133             return tmp<fvPatchVectorField>
134             (
135                 new activeBaffleVelocityFvPatchVectorField(*this)
136             );
137         }
139         //- Construct as copy setting internal field reference
140         activeBaffleVelocityFvPatchVectorField
141         (
142             const activeBaffleVelocityFvPatchVectorField&,
143             const DimensionedField<vector, volMesh>&
144         );
146         //- Construct and return a clone setting internal field reference
147         virtual tmp<fvPatchVectorField> clone
148         (
149             const DimensionedField<vector, volMesh>& iF
150         ) const
151         {
152             return tmp<fvPatchVectorField>
153             (
154                 new activeBaffleVelocityFvPatchVectorField(*this, iF)
155             );
156         }
159     // Member functions
161         // Mapping functions
163             //- Map (and resize as needed) from self given a mapping object
164             virtual void autoMap
165             (
166                 const fvPatchFieldMapper&
167             );
169             //- Reverse map the given fvPatchField onto this fvPatchField
170             virtual void rmap
171             (
172                 const fvPatchVectorField&,
173                 const labelList&
174             );
177         //- Update the coefficients associated with the patch field
178         virtual void updateCoeffs();
180         //- Write
181         virtual void write(Ostream&) const;
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 } // End namespace Foam
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 #endif
193 // ************************************************************************* //