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

rotatingPressureInletOutletVelocityFvPatchVectorField.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::rotatingPressureInletOutletVelocityFvPatchVectorField
00026 
00027 Description
00028     Velocity inlet/outlet boundary condition in a rotating frame
00029     for patches where the pressure is specified.  zero-gradient is applied for
00030     outflow (as defined by the flux) and for inflow the velocity is obtained
00031     from the flux with a direction normal to the patch faces.
00032 
00033 SourceFiles
00034     rotatingPressureInletOutletVelocityFvPatchVectorField.C
00035 
00036 \*---------------------------------------------------------------------------*/
00037 
00038 #ifndef rotatingPressureInletOutletVelocityFvPatchVectorField_H
00039 #define rotatingPressureInletOutletVelocityFvPatchVectorField_H
00040 
00041 #include <finiteVolume/fvPatchFields.H>
00042 #include <finiteVolume/pressureInletOutletVelocityFvPatchVectorField.H>
00043 
00044 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00045 
00046 namespace Foam
00047 {
00048 
00049 /*---------------------------------------------------------------------------*\
00050               Class rotatingPressureInletOutletVelocityFvPatch Declaration
00051 \*---------------------------------------------------------------------------*/
00052 
00053 class rotatingPressureInletOutletVelocityFvPatchVectorField
00054 :
00055     public pressureInletOutletVelocityFvPatchVectorField
00056 {
00057     // Private data
00058 
00059         //- Angular velocity of the frame
00060         vector omega_;
00061 
00062 
00063     // Private member functions
00064 
00065         //- Calculate the tangentialVelocity from omega
00066         void calcTangentialVelocity();
00067 
00068 
00069 public:
00070 
00071     //- Runtime type information
00072     TypeName("rotatingPressureInletOutletVelocity");
00073 
00074 
00075     // Constructors
00076 
00077         //- Construct from patch and internal field
00078         rotatingPressureInletOutletVelocityFvPatchVectorField
00079         (
00080             const fvPatch&,
00081             const DimensionedField<vector, volMesh>&
00082         );
00083 
00084         //- Construct from patch, internal field and dictionary
00085         rotatingPressureInletOutletVelocityFvPatchVectorField
00086         (
00087             const fvPatch&,
00088             const DimensionedField<vector, volMesh>&,
00089             const dictionary&
00090         );
00091 
00092         //- Construct by mapping given
00093         //  rotatingPressureInletOutletVelocityFvPatchVectorField
00094         //  onto a new patch
00095         rotatingPressureInletOutletVelocityFvPatchVectorField
00096         (
00097             const rotatingPressureInletOutletVelocityFvPatchVectorField&,
00098             const fvPatch&,
00099             const DimensionedField<vector, volMesh>&,
00100             const fvPatchFieldMapper&
00101         );
00102 
00103         //- Construct as copy
00104         rotatingPressureInletOutletVelocityFvPatchVectorField
00105         (
00106             const rotatingPressureInletOutletVelocityFvPatchVectorField&
00107         );
00108 
00109         //- Construct and return a clone
00110         virtual tmp<fvPatchVectorField> clone() const
00111         {
00112             return tmp<fvPatchVectorField>
00113             (
00114                 new rotatingPressureInletOutletVelocityFvPatchVectorField(*this)
00115             );
00116         }
00117 
00118         //- Construct as copy setting internal field reference
00119         rotatingPressureInletOutletVelocityFvPatchVectorField
00120         (
00121             const rotatingPressureInletOutletVelocityFvPatchVectorField&,
00122             const DimensionedField<vector, volMesh>&
00123         );
00124 
00125         //- Construct and return a clone setting internal field reference
00126         virtual tmp<fvPatchVectorField> clone
00127         (
00128             const DimensionedField<vector, volMesh>& iF
00129         ) const
00130         {
00131             return tmp<fvPatchVectorField>
00132             (
00133                 new rotatingPressureInletOutletVelocityFvPatchVectorField
00134                 (
00135                     *this,
00136                     iF
00137                 )
00138             );
00139         }
00140 
00141 
00142     // Member functions
00143 
00144         // Access
00145 
00146             //- Return the angular velocity of rotation
00147             const vector& omega() const
00148             {
00149                 return omega_;
00150             }
00151 
00152             //- Reset the angular velocity of rotation
00153             //  and update the tangentialVelocity
00154             void setOmega(const vector& omega)
00155             {
00156                 omega_ = omega;
00157                 calcTangentialVelocity();
00158             }
00159 
00160 
00161         //- Write
00162         virtual void write(Ostream&) const;
00163 };
00164 
00165 
00166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00167 
00168 } // End namespace Foam
00169 
00170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00171 
00172 #endif
00173 
00174 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines