MRFZoneList.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2012-2018 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::MRFZoneList
28 
29 Description
30  List container for MRF zomes
31 
32 SourceFiles
33  MRFZoneList.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef MRFZoneList_H
38 #define MRFZoneList_H
39 
40 #include "fvMesh.H"
41 #include "dictionary.H"
42 #include "fvMatricesFwd.H"
43 #include "MRFZone.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 // Forward declaration of friend functions and operators
51 class MRFZoneList;
52 Ostream& operator<<(Ostream& os, const MRFZoneList& models);
53 
54 /*---------------------------------------------------------------------------*\
55  Class MRFZoneList Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 class MRFZoneList
59 :
60  public PtrList<MRFZone>
61 {
62  // Private Member Functions
63 
64  //- No copy construct
65  MRFZoneList(const MRFZoneList&) = delete;
66 
67  //- No copy assignment
68  void operator=(const MRFZoneList&) = delete;
69 
70 
71 protected:
72 
73  // Protected data
74 
75  //- Reference to the mesh database
76  const fvMesh& mesh_;
77 
78 
79 public:
80 
81  //- Constructor
82  MRFZoneList(const fvMesh& mesh, const dictionary& dict);
83 
84  //- Destructor
85  ~MRFZoneList();
86 
87 
88  // Member Functions
89 
90  //- Return active status
91  bool active(const bool warn = false) const;
92 
93  //- Reset the source list
94  void reset(const dictionary& dict);
95 
96  //- Add the frame acceleration
97  void addAcceleration
98  (
99  const volVectorField& U,
100  volVectorField& ddtU
101  ) const;
102 
103  //- Add the frame acceleration contribution to the momentum equation
104  void addAcceleration(fvVectorMatrix& UEqn) const;
105 
106  //- Add the frame acceleration contribution to the momentum equation
107  void addAcceleration
108  (
109  const volScalarField& rho,
111  ) const;
112 
113  //- Return the frame acceleration
115  (
116  const volVectorField& U
117  ) const;
118 
119  //- Return the frame acceleration
121  (
122  const volScalarField& rho,
123  const volVectorField& U
124  ) const;
125 
126  //- Make the given absolute velocity relative within the MRF region
127  void makeRelative(volVectorField& U) const;
128 
129  //- Make the given absolute flux relative within the MRF region
130  void makeRelative(surfaceScalarField& phi) const;
131 
132  //- Return the given absolute flux relative within the MRF region
134  (
136  ) const;
137 
138  //- Return the given absolute boundary flux relative within
139  // the MRF region
141  (
143  ) const;
144 
145  //- Return the given absolute patch flux relative within
146  // the MRF region
148  (
149  const tmp<Field<scalar>>& tphi,
150  const label patchi
151  ) const;
152 
153  //- Make the given absolute mass-flux relative within the MRF region
154  void makeRelative
155  (
156  const surfaceScalarField& rho,
158  ) const;
159 
160  //- Make the given relative velocity absolute within the MRF region
161  void makeAbsolute(volVectorField& U) const;
162 
163  //- Make the given relative flux absolute within the MRF region
164  void makeAbsolute(surfaceScalarField& phi) const;
165 
166  //- Return the given relative flux absolute within the MRF region
168  (
170  ) const;
171 
172  //- Make the given relative mass-flux absolute within the MRF region
173  void makeAbsolute
174  (
175  const surfaceScalarField& rho,
177  ) const;
178 
179  //- Correct the boundary velocity for the rotation of the MRF region
181 
182  //- Correct the boundary flux for the rotation of the MRF region
184  (
185  const volVectorField& U,
187  ) const;
188 
189  //- Filter-out the MRF region contribution from the given field
190  // setting the corresponding values to zero
191  template<class Type>
193  (
195  ) const;
196 
197  //- Update MRFZone faces if the mesh topology changes
198  void update();
199 
200 
201  // I-O
202 
203  //- Read dictionary
204  bool read(const dictionary& dict);
205 
206  //- Write data to Ostream
207  bool writeData(Ostream& os) const;
208 
209  //- Ostream operator
210  friend Ostream& operator<<
211  (
212  Ostream& os,
213  const MRFZoneList& models
214  );
215 };
216 
217 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218 
219 } // End namespace Foam
220 
221 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
222 
223 #ifdef NoRepository
224  #include "MRFZoneListTemplates.C"
225 #endif
226 
227 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
228 
229 #endif
230 
231 // ************************************************************************* //
Foam::MRFZoneList::addAcceleration
void addAcceleration(const volVectorField &U, volVectorField &ddtU) const
Add the frame acceleration.
Definition: MRFZoneList.C:133
Foam::FieldField
A field of fields is a PtrList of fields with reference counting.
Definition: FieldField.H:53
MRFZoneListTemplates.C
Foam::MRFZoneList::writeData
bool writeData(Ostream &os) const
Write data to Ostream.
Definition: MRFZoneList.C:120
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::MRFZoneList
List container for MRF zomes.
Definition: MRFZoneList.H:57
Foam::MRFZoneList::reset
void reset(const dictionary &dict)
Reset the source list.
Definition: MRFZoneList.C:74
MRFZone.H
fvMatricesFwd.H
Forward declarations of fvMatrix specializations.
rho
rho
Definition: readInitialConditions.H:88
Foam::MRFZoneList::correctBoundaryVelocity
void correctBoundaryVelocity(volVectorField &U) const
Correct the boundary velocity for the rotation of the MRF region.
Definition: MRFZoneList.C:384
Foam::MRFZoneList::active
bool active(const bool warn=false) const
Return active status.
Definition: MRFZoneList.C:57
Foam::operator<<
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
Foam::Field< scalar >
Foam::MRFZoneList::makeRelative
void makeRelative(volVectorField &U) const
Make the given absolute velocity relative within the MRF region.
Definition: MRFZoneList.C:207
Foam::MRFZoneList::absolute
tmp< surfaceScalarField > absolute(const tmp< surfaceScalarField > &phi) const
Return the given relative flux absolute within the MRF region.
Definition: MRFZoneList.C:341
Foam::MRFZoneList::DDt
tmp< volVectorField > DDt(const volVectorField &U) const
Return the frame acceleration.
Definition: MRFZoneList.C:168
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:62
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:83
fvMesh.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::MRFZoneList::mesh_
const fvMesh & mesh_
Reference to the mesh database.
Definition: MRFZoneList.H:75
Foam::MRFZoneList::relative
tmp< surfaceScalarField > relative(const tmp< surfaceScalarField > &phi) const
Return the given absolute flux relative within the MRF region.
Definition: MRFZoneList.C:226
U
U
Definition: pEqn.H:72
Foam::MRFZoneList::zeroFilter
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > zeroFilter(const tmp< GeometricField< Type, fvsPatchField, surfaceMesh >> &tphi) const
Filter-out the MRF region contribution from the given field.
Foam::MRFZoneList::makeAbsolute
void makeAbsolute(volVectorField &U) const
Make the given relative velocity absolute within the MRF region.
Definition: MRFZoneList.C:322
dictionary.H
Foam::MRFZoneList::correctBoundaryFlux
void correctBoundaryFlux(const volVectorField &U, surfaceScalarField &phi) const
Correct the boundary flux for the rotation of the MRF region.
Definition: MRFZoneList.C:394
Foam::MRFZoneList::update
void update()
Update MRFZone faces if the mesh topology changes.
Definition: MRFZoneList.C:420
Foam::fvMatrix
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvPatchField.H:76
UEqn
fvVectorMatrix & UEqn
Definition: UEqn.H:13
Foam::MRFZoneList::read
bool read(const dictionary &dict)
Read dictionary.
Definition: MRFZoneList.C:107
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::MRFZoneList::~MRFZoneList
~MRFZoneList()
Destructor.
Definition: MRFZoneList.C:51
Foam::GeometricField< vector, fvPatchField, volMesh >