FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

activeBaffleVelocityFvPatchVectorField.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software: you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::activeBaffleVelocityFvPatchVectorField
00026 
00027 Description
00028     Boundary condition that modifies mesh areas based on velocity.
00029 
00030 SourceFiles
00031     activeBaffleVelocityFvPatchVectorField.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef activeBaffleVelocityFvPatchVectorField_H
00036 #define activeBaffleVelocityFvPatchVectorField_H
00037 
00038 #include <finiteVolume/fvPatchFields.H>
00039 #include <finiteVolume/fixedValueFvPatchFields.H>
00040 
00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00042 
00043 namespace Foam
00044 {
00045 
00046 /*---------------------------------------------------------------------------*\
00047                  Class activeBaffleVelocityFvPatch Declaration
00048 \*---------------------------------------------------------------------------*/
00049 
00050 class activeBaffleVelocityFvPatchVectorField
00051 :
00052     public fixedValueFvPatchVectorField
00053 {
00054     // Private data
00055 
00056         //- Name of the pressure field used to calculate the force
00057         //  on the active baffle
00058         word pName_;
00059 
00060         //- Name of the cyclic patch used when the active baffle is open
00061         word cyclicPatchName_;
00062 
00063         //- Index of the cyclic patch used when the active baffle is open
00064         label cyclicPatchLabel_;
00065 
00066         //- Orientation (1 or -1) of the active baffle patch.
00067         //  Used to change the direction of opening without the need for
00068         //  reordering the patch faces
00069         label orientation_;
00070 
00071         //- Initial wall patch areas
00072         vectorField initWallSf_;
00073 
00074         //- Initial cyclic patch areas
00075         vectorField initCyclicSf_;
00076 
00077         //- Current fraction of the active baffle which is open
00078         scalar openFraction_;
00079 
00080         //- Time taken for the active baffle to open
00081         scalar openingTime_;
00082 
00083         //- Maximum fractional change to the active baffle openness
00084         //  per time-step
00085         scalar maxOpenFractionDelta_;
00086 
00087         label curTimeIndex_;
00088 
00089 
00090 public:
00091 
00092     //- Runtime type information
00093     TypeName("activeBaffleVelocity");
00094 
00095 
00096     // Constructors
00097 
00098         //- Construct from patch and internal field
00099         activeBaffleVelocityFvPatchVectorField
00100         (
00101             const fvPatch&,
00102             const DimensionedField<vector, volMesh>&
00103         );
00104 
00105         //- Construct from patch, internal field and dictionary
00106         activeBaffleVelocityFvPatchVectorField
00107         (
00108             const fvPatch&,
00109             const DimensionedField<vector, volMesh>&,
00110             const dictionary&
00111         );
00112 
00113         //- Construct by mapping given activeBaffleVelocityFvPatchVectorField
00114         //  onto a new patch
00115         activeBaffleVelocityFvPatchVectorField
00116         (
00117             const activeBaffleVelocityFvPatchVectorField&,
00118             const fvPatch&,
00119             const DimensionedField<vector, volMesh>&,
00120             const fvPatchFieldMapper&
00121         );
00122 
00123         //- Construct as copy
00124         activeBaffleVelocityFvPatchVectorField
00125         (
00126             const activeBaffleVelocityFvPatchVectorField&
00127         );
00128 
00129         //- Construct and return a clone
00130         virtual tmp<fvPatchVectorField> clone() const
00131         {
00132             return tmp<fvPatchVectorField>
00133             (
00134                 new activeBaffleVelocityFvPatchVectorField(*this)
00135             );
00136         }
00137 
00138         //- Construct as copy setting internal field reference
00139         activeBaffleVelocityFvPatchVectorField
00140         (
00141             const activeBaffleVelocityFvPatchVectorField&,
00142             const DimensionedField<vector, volMesh>&
00143         );
00144 
00145         //- Construct and return a clone setting internal field reference
00146         virtual tmp<fvPatchVectorField> clone
00147         (
00148             const DimensionedField<vector, volMesh>& iF
00149         ) const
00150         {
00151             return tmp<fvPatchVectorField>
00152             (
00153                 new activeBaffleVelocityFvPatchVectorField(*this, iF)
00154             );
00155         }
00156 
00157 
00158     // Member functions
00159 
00160         // Mapping functions
00161 
00162             //- Map (and resize as needed) from self given a mapping object
00163             virtual void autoMap
00164             (
00165                 const fvPatchFieldMapper&
00166             );
00167 
00168             //- Reverse map the given fvPatchField onto this fvPatchField
00169             virtual void rmap
00170             (
00171                 const fvPatchVectorField&,
00172                 const labelList&
00173             );
00174 
00175 
00176         //- Update the coefficients associated with the patch field
00177         virtual void updateCoeffs();
00178 
00179         //- Write
00180         virtual void write(Ostream&) const;
00181 };
00182 
00183 
00184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00185 
00186 } // End namespace Foam
00187 
00188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00189 
00190 #endif
00191 
00192 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines