1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 MRF zone definition based on cell zone and parameters
30 obtained from a control dictionary constructed from the given stream.
32 The rotation of the MRF region is defined by an origin and axis of
33 rotation and an angular speed.
38 \*---------------------------------------------------------------------------*/
43 #include "dictionary.H"
45 #include "labelList.H"
46 #include "dimensionedScalar.H"
47 #include "dimensionedVector.H"
48 #include "volFieldsFwd.H"
49 #include "surfaceFieldsFwd.H"
50 #include "fvMatricesFwd.H"
51 #include "fvMatrices.H"
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
58 // Forward declaration of classes
61 /*---------------------------------------------------------------------------*\
62 Class MRFZone Declaration
63 \*---------------------------------------------------------------------------*/
73 const dictionary dict_;
77 const wordList excludedPatchNames_;
78 labelList excludedPatchLabels_;
80 //- Internal faces that are part of MRF
81 labelList internalFaces_;
83 //- Outside faces (per patch) that move with the MRF
84 labelListList includedFaces_;
86 //- Excluded faces (per patch) that do not move with the MRF
87 labelListList excludedFaces_;
89 const dimensionedVector origin_;
90 dimensionedVector axis_;
91 const dimensionedScalar omega_;
92 dimensionedVector Omega_;
95 // Private Member Functions
97 //- Divide faces in frame according to patch
100 //- Disallow default bitwise copy construct
101 MRFZone(const MRFZone&);
103 //- Disallow default bitwise assignment
104 void operator=(const MRFZone&);
109 // Declare name of the class and its debug switch
110 ClassName("MRFZone");
115 //- Construct from fvMesh and Istream
116 MRFZone(const fvMesh& mesh, Istream& is);
119 autoPtr<MRFZone> clone() const
121 notImplemented("autoPtr<MRFZone> clone() const");
122 return autoPtr<MRFZone>(NULL);
125 //- Return a pointer to a new MRFZone created on freestore
133 iNew(const fvMesh& mesh)
138 autoPtr<MRFZone> operator()(Istream& is) const
140 return autoPtr<MRFZone>(new MRFZone(mesh_, is));
147 //- Update the mesh corresponding to given map
148 void updateMesh(const mapPolyMesh& mpm)
150 // Only updates face addressing
154 //- Add the Coriolis force contribution to the momentum equation
155 void addCoriolis(fvVectorMatrix& UEqn) const;
157 //- Add the Coriolis force contribution to the momentum equation
158 void addCoriolis(const volScalarField& rho, fvVectorMatrix& UEqn) const;
160 //- Make the given absolute velocity relative within the MRF region
161 void relativeVelocity(volVectorField& U) const;
163 //- Make the given absolute flux relative within the MRF region
164 void relativeFlux(surfaceScalarField& phi) const;
166 //- Make the given relative flux absolute within the MRF region
167 void absoluteFlux(surfaceScalarField& phi) const;
169 //- Correct the boundary velocity for the roation of the MRF region
170 void correctBoundaryVelocity(volVectorField& U) const;
175 friend Ostream& operator<<(Ostream& os, const MRFZone&)
177 notImplemented("Ostream& operator<<(Ostream& os, const MRFZone&)");
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 } // End namespace Foam
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 // ************************************************************************* //