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

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