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

rotatingWallVelocityFvPatchVectorField.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::rotatingWallVelocityFvPatchVectorField
00026 
00027 Description
00028     Foam::rotatingWallVelocityFvPatchVectorField
00029 
00030 SourceFiles
00031     rotatingWallVelocityFvPatchVectorField.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef rotatingWallVelocityFvPatchVectorField_H
00036 #define rotatingWallVelocityFvPatchVectorField_H
00037 
00038 #include <finiteVolume/fixedValueFvPatchFields.H>
00039 
00040 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00041 
00042 namespace Foam
00043 {
00044 
00045 /*---------------------------------------------------------------------------*\
00046                  Class rotatingWallVelocityFvPatch Declaration
00047 \*---------------------------------------------------------------------------*/
00048 
00049 class rotatingWallVelocityFvPatchVectorField
00050 :
00051     public fixedValueFvPatchVectorField
00052 {
00053     // Private data
00054 
00055         //- Origin of the rotation
00056         vector origin_;
00057 
00058         //- Axis of the rotation
00059         vector axis_;
00060 
00061         //- Rotational speed
00062         scalar omega_;
00063 
00064 
00065 public:
00066 
00067     //- Runtime type information
00068     TypeName("rotatingWallVelocity");
00069 
00070 
00071     // Constructors
00072 
00073         //- Construct from patch and internal field
00074         rotatingWallVelocityFvPatchVectorField
00075         (
00076             const fvPatch&,
00077             const DimensionedField<vector, volMesh>&
00078         );
00079 
00080         //- Construct from patch, internal field and dictionary
00081         rotatingWallVelocityFvPatchVectorField
00082         (
00083             const fvPatch&,
00084             const DimensionedField<vector, volMesh>&,
00085             const dictionary&
00086         );
00087 
00088         //- Construct by mapping given rotatingWallVelocityFvPatchVectorField
00089         //  onto a new patch
00090         rotatingWallVelocityFvPatchVectorField
00091         (
00092             const rotatingWallVelocityFvPatchVectorField&,
00093             const fvPatch&,
00094             const DimensionedField<vector, volMesh>&,
00095             const fvPatchFieldMapper&
00096         );
00097 
00098         //- Construct as copy
00099         rotatingWallVelocityFvPatchVectorField
00100         (
00101             const rotatingWallVelocityFvPatchVectorField&
00102         );
00103 
00104         //- Construct and return a clone
00105         virtual tmp<fvPatchVectorField> clone() const
00106         {
00107             return tmp<fvPatchVectorField>
00108             (
00109                 new rotatingWallVelocityFvPatchVectorField(*this)
00110             );
00111         }
00112 
00113         //- Construct as copy setting internal field reference
00114         rotatingWallVelocityFvPatchVectorField
00115         (
00116             const rotatingWallVelocityFvPatchVectorField&,
00117             const DimensionedField<vector, volMesh>&
00118         );
00119 
00120         //- Construct and return a clone setting internal field reference
00121         virtual tmp<fvPatchVectorField> clone
00122         (
00123              const DimensionedField<vector, volMesh>& iF
00124         ) const
00125         {
00126             return tmp<fvPatchVectorField>
00127             (
00128                 new rotatingWallVelocityFvPatchVectorField(*this, iF)
00129             );
00130         }
00131 
00132 
00133 
00134     // Member functions
00135 
00136         // Access functions
00137 
00138             //- Return the origin of the rotation
00139             const vector& origin() const
00140             {
00141                 return origin_;
00142             }
00143 
00144             //- Return the axis of the rotation
00145             const vector& axis() const
00146             {
00147                 return axis_;
00148             }
00149 
00150             //- Return the rotational speed
00151             const scalar& omega() const
00152             {
00153                 return omega_;
00154             }
00155 
00156             //- Return non-const access to the origin of the rotation
00157             vector& origin()
00158             {
00159                 return origin_;
00160             }
00161 
00162             //- Return non-const access to the axis of the rotation
00163             vector& axis()
00164             {
00165                 return axis_;
00166             }
00167 
00168             //- Return non-const access to the rotational speed
00169             scalar& omega()
00170             {
00171                 return omega_;
00172             }
00173 
00174 
00175         //- Update the coefficients associated with the patch field
00176         virtual void updateCoeffs();
00177 
00178         //- Write
00179         virtual void write(Ostream&) const;
00180 };
00181 
00182 
00183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00184 
00185 } // End namespace Foam
00186 
00187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00188 
00189 #endif
00190 
00191 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines