1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2008 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 optional face 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 //- label of face zone with faces on outside of cell zone.
80 //- Do patches move with frame (true) or are explicitly provided (false,
82 Switch allPatchesMove_;
84 const wordList patchNames_;
85 labelList patchLabels_;
87 //- Internal faces that are part of MRF
88 labelList internalFaces_;
90 //- Outside faces (per patch) that move with the MRF
91 labelListList includedFaces_;
93 //- Excluded faces (per patch) that do not move with the MRF
94 labelListList excludedFaces_;
96 const dimensionedVector origin_;
97 dimensionedVector axis_;
98 const dimensionedScalar omega_;
99 dimensionedVector Omega_;
102 // Private Member Functions
104 //- Divide faces in frame according to patch
108 const labelList& excludedPatchIDs
111 //- Divide faces in frame according to patch
115 //- Disallow default bitwise copy construct
116 MRFZone(const MRFZone&);
118 //- Disallow default bitwise assignment
119 void operator=(const MRFZone&);
126 //- Construct from fvMesh and Istream
127 MRFZone(const fvMesh& mesh, Istream& is);
130 autoPtr<MRFZone> clone() const
132 notImplemented("autoPtr<MRFZone> clone() const");
133 return autoPtr<MRFZone>(NULL);
136 //- Return a pointer to a new MRFZone created on freestore
144 iNew(const fvMesh& mesh)
149 autoPtr<MRFZone> operator()(Istream& is) const
151 return autoPtr<MRFZone>(new MRFZone(mesh_, is));
158 //- Update the mesh corresponding to given map
159 void updateMesh(const mapPolyMesh& mpm)
161 // Only updates face addressing
165 //- Add the Coriolis force contribution to the momentum equation
166 void addCoriolis(fvVectorMatrix& UEqn) const;
168 //- Make the given absolute flux relative within the MRF region
169 void relativeFlux(surfaceScalarField& phi) const;
171 //- Correct the boundary velocity for the roation of the MRF region
172 void correctBoundaryVelocity(volVectorField& U) const;
177 friend Ostream& operator<<(Ostream& os, const MRFZone&)
179 notImplemented("Ostream& operator<<(Ostream& os, const MRFZone&)");
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 } // End namespace Foam
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 // ************************************************************************* //