1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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::activePressureForceBaffleVelocityFvPatchVectorField
28 Bounday which emulates the operation of a release pressure panel.
30 The boundary condition modifies mesh areas based on difference
31 of pressure or force face beween both sides of the panel. Once opened the
32 panel continues to open at a fixed rate.
35 activePressureForceBaffleVelocityFvPatchVectorField.C
37 \*---------------------------------------------------------------------------*/
39 #ifndef activePressureForceBaffleVelocityFvPatchVectorField_H
40 #define activePressureForceBaffleVelocityFvPatchVectorField_H
42 #include "fvPatchFields.H"
43 #include "fixedValueFvPatchFields.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 /*---------------------------------------------------------------------------*\
51 Class activePressureForceBaffleVelocityFvPatch Declaration
52 \*---------------------------------------------------------------------------*/
54 class activePressureForceBaffleVelocityFvPatchVectorField
56 public fixedValueFvPatchVectorField
60 //- Name of the pressure field used to calculate the force
61 // on the active baffle
64 //- Name of the cyclic patch used when the active baffle is open
65 word cyclicPatchName_;
67 //- Index of the cyclic patch used when the active baffle is open
68 label cyclicPatchLabel_;
70 //- Orientation (1 or -1) of the active baffle patch.
71 // Used to change the direction of opening without the need for
72 // reordering the patch faces
75 //- Initial wall patch areas
76 vectorField initWallSf_;
78 //- Initial cyclic patch areas
79 vectorField initCyclicSf_;
81 //- Initial neighbour-side cyclic patch areas
82 vectorField nbrCyclicSf_;
84 //- Current fraction of the active baffle which is open
87 //- Time taken for the active baffle to open
90 //- Maximum fractional change to the active baffle openness
92 scalar maxOpenFractionDelta_;
96 //- Minimum value for the active baffle to start opening
97 scalar minThresholdValue_;
99 //- Force based active baffle
102 //- Baffle is activated
103 bool baffleActivated_;
107 //- Runtime type information
108 TypeName("activePressureForceBaffleVelocity");
113 //- Construct from patch and internal field
114 activePressureForceBaffleVelocityFvPatchVectorField
117 const DimensionedField<vector, volMesh>&
120 //- Construct from patch, internal field and dictionary
121 activePressureForceBaffleVelocityFvPatchVectorField
124 const DimensionedField<vector, volMesh>&,
128 //- Construct by mapping
129 activePressureForceBaffleVelocityFvPatchVectorField
131 const activePressureForceBaffleVelocityFvPatchVectorField&,
133 const DimensionedField<vector, volMesh>&,
134 const fvPatchFieldMapper&
137 //- Construct as copy
138 activePressureForceBaffleVelocityFvPatchVectorField
140 const activePressureForceBaffleVelocityFvPatchVectorField&
143 //- Construct and return a clone
144 virtual tmp<fvPatchVectorField> clone() const
146 return tmp<fvPatchVectorField>
148 new activePressureForceBaffleVelocityFvPatchVectorField(*this)
152 //- Construct as copy setting internal field reference
153 activePressureForceBaffleVelocityFvPatchVectorField
155 const activePressureForceBaffleVelocityFvPatchVectorField&,
156 const DimensionedField<vector, volMesh>&
159 //- Construct and return a clone setting internal field reference
160 virtual tmp<fvPatchVectorField> clone
162 const DimensionedField<vector, volMesh>& iF
165 return tmp<fvPatchVectorField>
167 new activePressureForceBaffleVelocityFvPatchVectorField
180 //- Map (and resize as needed) from self given a mapping object
183 const fvPatchFieldMapper&
186 //- Reverse map the given fvPatchField onto this fvPatchField
189 const fvPatchVectorField&,
194 //- Update the coefficients associated with the patch field
195 virtual void updateCoeffs();
198 virtual void write(Ostream&) const;
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 } // End namespace Foam
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 // ************************************************************************* //