OpenFOAM logo
The Open Source CFD Toolbox
  Programmer’s C++ Doxygen OpenCFD Solutions Contact OpenFOAM

MRFZone.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-2007 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     MRFZone
00027 
00028 Description
00029     MRF zone definition based on both cell and face zones and parameters
00030     obtained from a control dictionary constructed from the given stream.
00031     The rotation of the MRF region is defined by an origin and axis of
00032     rotation and a angular speed.
00033 
00034 SourceFiles
00035     MRFZone.C
00036 
00037 \*---------------------------------------------------------------------------*/
00038 
00039 #ifndef MRFZone_H
00040 #define MRFZone_H
00041 
00042 #include "dictionary.H"
00043 #include "wordList.H"
00044 #include "labelList.H"
00045 #include "dimensionedScalar.H"
00046 #include "dimensionedVector.H"
00047 #include "volFieldsFwd.H"
00048 #include "surfaceFieldsFwd.H"
00049 #include "fvMatricesFwd.H"
00050 #include "fvMatrices.H"
00051 
00052 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00053 
00054 namespace Foam
00055 {
00056 
00057 // Class forward declarations
00058 class fvMesh;
00059 
00060 /*---------------------------------------------------------------------------*\
00061                            Class MRFZone Declaration
00062 \*---------------------------------------------------------------------------*/
00063 
00064 class MRFZone
00065 {
00066     // Private data
00067 
00068         const fvMesh& mesh_;
00069 
00070         word name_;
00071 
00072         dictionary dict_;
00073 
00074         label cellZoneID_;
00075         label faceZoneID_;
00076         wordList patchNames_;
00077         labelList patchLabels_;
00078 
00079         dimensionedVector origin_;
00080         dimensionedVector axis_;
00081         dimensionedScalar omega_;
00082         dimensionedVector Omega_;
00083 
00084 
00085     // Private Member Functions
00086 
00087         //- Disallow default bitwise copy construct
00088         MRFZone(const MRFZone&);
00089 
00090         //- Disallow default bitwise assignment
00091         void operator=(const MRFZone&);
00092 
00093 
00094 public:
00095 
00096     // Constructors
00097 
00098         //- Construct from fvMesh and Istream
00099         MRFZone(const fvMesh& mesh, Istream& is);
00100 
00101         //- Return clone
00102         autoPtr<MRFZone> clone() const
00103         {
00104             notImplemented("autoPtr<MRFZone> clone() const");
00105             return autoPtr<MRFZone>(NULL);
00106         }
00107 
00108         //- Return a pointer to a new injector created on freestore
00109         //  from Istream
00110         class iNew
00111         {
00112             const fvMesh& mesh_;
00113 
00114         public:
00115 
00116             iNew(const fvMesh& mesh)
00117             :
00118                 mesh_(mesh)
00119             {}
00120 
00121             autoPtr<MRFZone> operator()(Istream& is) const
00122             {
00123                 return autoPtr<MRFZone>(new MRFZone(mesh_, is));
00124             }
00125         };
00126 
00127 
00128     // Member Functions
00129 
00130         //- Add the Coriolis force contribution to the momentum equation
00131         void addCoriolis(fvVectorMatrix& UEqn) const;
00132 
00133         //- Make the given absolute flux relative within the MRF region
00134         void relativeFlux(surfaceScalarField& phi) const;
00135 
00136         //- Correct the boundary velocity for the roation of the MRF region
00137         void correctBoundaryVelocity(volVectorField& U) const;
00138 
00139 
00140     // Ostream Operator
00141 
00142         friend Ostream& operator<<(Ostream& os, const MRFZone&)
00143         {
00144             notImplemented("Ostream& operator<<(Ostream& os, const MRFZone&)");
00145             return os;
00146         }
00147 };
00148 
00149 
00150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00151 
00152 } // End namespace Foam
00153 
00154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00155 
00156 #endif
00157 
00158 // ************************************************************************* //
Copyright © 2000-2007 OpenCFD Ltd