OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

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-2009 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 the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     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, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     Foam::rotatingWallVelocityFvPatchVectorField
00027 
00028 Description
00029     Foam::rotatingWallVelocityFvPatchVectorField
00030 
00031 SourceFiles
00032     rotatingWallVelocityFvPatchVectorField.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef rotatingWallVelocityFvPatchVectorField_H
00037 #define rotatingWallVelocityFvPatchVectorField_H
00038 
00039 #include "fixedValueFvPatchFields.H"
00040 
00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00042 
00043 namespace Foam
00044 {
00045 
00046 /*---------------------------------------------------------------------------*\
00047                  Class rotatingWallVelocityFvPatch Declaration
00048 \*---------------------------------------------------------------------------*/
00049 
00050 class rotatingWallVelocityFvPatchVectorField
00051 :
00052     public fixedValueFvPatchVectorField
00053 {
00054     // Private data
00055 
00056         //- Origin of the rotation
00057         vector origin_;
00058 
00059         //- Axis of the rotation
00060         vector axis_;
00061 
00062         //- Rotational speed
00063         scalar omega_;
00064 
00065 
00066 public:
00067 
00068     //- Runtime type information
00069     TypeName("rotatingWallVelocity");
00070 
00071 
00072     // Constructors
00073 
00074         //- Construct from patch and internal field
00075         rotatingWallVelocityFvPatchVectorField
00076         (
00077             const fvPatch&,
00078             const DimensionedField<vector, volMesh>&
00079         );
00080 
00081         //- Construct from patch, internal field and dictionary
00082         rotatingWallVelocityFvPatchVectorField
00083         (
00084             const fvPatch&,
00085             const DimensionedField<vector, volMesh>&,
00086             const dictionary&
00087         );
00088 
00089         //- Construct by mapping given rotatingWallVelocityFvPatchVectorField
00090         //  onto a new patch
00091         rotatingWallVelocityFvPatchVectorField
00092         (
00093             const rotatingWallVelocityFvPatchVectorField&,
00094             const fvPatch&,
00095             const DimensionedField<vector, volMesh>&,
00096             const fvPatchFieldMapper&
00097         );
00098 
00099         //- Construct as copy
00100         rotatingWallVelocityFvPatchVectorField
00101         (
00102             const rotatingWallVelocityFvPatchVectorField&
00103         );
00104 
00105         //- Construct and return a clone
00106         virtual tmp<fvPatchVectorField> clone() const
00107         {
00108             return tmp<fvPatchVectorField>
00109             (
00110                 new rotatingWallVelocityFvPatchVectorField(*this)
00111             );
00112         }
00113 
00114         //- Construct as copy setting internal field reference
00115         rotatingWallVelocityFvPatchVectorField
00116         (
00117             const rotatingWallVelocityFvPatchVectorField&,
00118             const DimensionedField<vector, volMesh>&
00119         );
00120 
00121         //- Construct and return a clone setting internal field reference
00122         virtual tmp<fvPatchVectorField> clone
00123         (
00124              const DimensionedField<vector, volMesh>& iF
00125         ) const
00126         {
00127             return tmp<fvPatchVectorField>
00128             (
00129                 new rotatingWallVelocityFvPatchVectorField(*this, iF)
00130             );
00131         }
00132 
00133 
00134 
00135     // Member functions
00136 
00137         // Access functions
00138 
00139             //- Return the origin of the rotation
00140             const vector& origin() const
00141             {
00142                 return origin_;
00143             }
00144 
00145             //- Return the axis of the rotation
00146             const vector& axis() const
00147             {
00148                 return axis_;
00149             }
00150 
00151             //- Return the rotational speed
00152             const scalar& omega() const
00153             {
00154                 return omega_;
00155             }
00156 
00157             //- Return non-const access to the origin of the rotation
00158             vector& origin()
00159             {
00160                 return origin_;
00161             }
00162 
00163             //- Return non-const access to the axis of the rotation
00164             vector& axis()
00165             {
00166                 return axis_;
00167             }
00168 
00169             //- Return non-const access to the rotational speed
00170             scalar& omega()
00171             {
00172                 return omega_;
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 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd