MRFZoneList.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2012-2026 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
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
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::MRFZoneList
26 
27 Description
28  List container for MRF zones
29 
30 SourceFiles
31  MRFZoneList.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef MRFZoneList_H
36 #define MRFZoneList_H
37 
38 #include "MRFZone.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 // Forward declaration of friend functions and operators
47 Ostream& operator<<(Ostream& os, const MRFZoneList& models);
48 
49 /*---------------------------------------------------------------------------*\
50  Class MRFZoneList Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class MRFZoneList
54 :
55  public PtrList<MRFZone>
56 {
57 protected:
58 
59  // Protected data
60 
61  //- Reference to the mesh database
62  const fvMesh& mesh_;
63 
64  //- Update MRFZone faces if the mesh topology changes
65  void update();
66 
67 
68 public:
69 
70  // Constructors
71 
72  //- Construct an empty list
73  MRFZoneList(const fvMesh& mesh);
74 
75  //- Construct list from given dictionary
76  MRFZoneList(const fvMesh& mesh, const dictionary& dict);
77 
78  //- Disallow default bitwise copy construction
79  MRFZoneList(const MRFZoneList&) = delete;
80 
81 
82  //- Destructor
83  ~MRFZoneList();
84 
85 
86  // Member Functions
87 
88  //- Reset the source list
89  void reset(const dictionary& dict);
90 
91  //- Return the Coriolis acceleration
93  (
94  const volVectorField& U
95  ) const;
96 
97  //- Return the Coriolis acceleration
99  (
100  const volScalarField& rho,
101  const volVectorField& U
102  ) const;
103 
104  //- Return the centrifugal acceleration
106 
107  //- Make the given absolute velocity relative within the MRF region
108  void makeRelative(volVectorField& U) const;
109 
110  //- Make the given absolute flux relative within the MRF region
111  void makeRelative(surfaceScalarField& phi) const;
112 
113  //- Return the given absolute flux relative within the MRF region
115  (
116  const tmp<surfaceScalarField>& phi
117  ) const;
118 
119  //- Return the given absolute boundary flux relative within
120  // the MRF region
122  (
124  ) const;
125 
126  //- Return the given absolute patch flux relative within
127  // the MRF region
129  (
130  const tmp<Field<scalar>>& tphi,
131  const label patchi
132  ) const;
133 
134  //- Make the given absolute mass-flux relative within the MRF region
135  void makeRelative
136  (
137  const surfaceScalarField& rho,
138  surfaceScalarField& phi
139  ) const;
140 
141  //- Make the given relative velocity absolute within the MRF region
142  void makeAbsolute(volVectorField& U) const;
143 
144  //- Make the given relative flux absolute within the MRF region
145  void makeAbsolute(surfaceScalarField& phi) const;
146 
147  //- Return the given relative flux absolute within the MRF region
149  (
150  const tmp<surfaceScalarField>& phi
151  ) const;
152 
153  //- Make the given relative mass-flux absolute within the MRF region
154  void makeAbsolute
155  (
156  const surfaceScalarField& rho,
157  surfaceScalarField& phi
158  ) const;
159 
160  //- Return the given relative flux absolute within the MRF region
162  (
163  const tmp<surfaceScalarField>& phi,
164  const volScalarField& rho
165  ) const;
166 
167  void makeAbsolute(Field<vector>& Up, const label patchi) const;
168 
169 
170  // I-O
171 
172  //- Read dictionary
173  bool read(const dictionary& dict);
174 
175 
176  // Member Operators
177 
178  //- Disallow default bitwise assignment
179  void operator=(const MRFZoneList&) = delete;
180 };
181 
182 
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 
185 } // End namespace Foam
186 
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 
189 #endif
190 
191 // ************************************************************************* //
Generic field type.
Definition: FieldField.H:77
Generic GeometricField class.
List container for MRF zones.
Definition: MRFZoneList.H:55
tmp< surfaceScalarField > relative(const tmp< surfaceScalarField > &phi) const
Return the given absolute flux relative within the MRF region.
Definition: MRFZoneList.C:192
void reset(const dictionary &dict)
Reset the source list.
Definition: MRFZoneList.C:62
const fvMesh & mesh_
Reference to the mesh database.
Definition: MRFZoneList.H:61
MRFZoneList(const fvMesh &mesh)
Construct an empty list.
Definition: MRFZoneList.C:33
tmp< volVectorField > centrifugalAcceleration() const
Return the centrifugal acceleration.
Definition: MRFZoneList.C:150
tmp< surfaceScalarField > absolute(const tmp< surfaceScalarField > &phi) const
Return the given relative flux absolute within the MRF region.
Definition: MRFZoneList.C:307
bool read(const dictionary &dict)
Read dictionary.
Definition: MRFZoneList.C:101
void makeAbsolute(volVectorField &U) const
Make the given relative velocity absolute within the MRF region.
Definition: MRFZoneList.C:288
void makeRelative(volVectorField &U) const
Make the given absolute velocity relative within the MRF region.
Definition: MRFZoneList.C:173
void update()
Update MRFZone faces if the mesh topology changes.
Definition: MRFZoneList.C:382
void operator=(const MRFZoneList &)=delete
Disallow default bitwise assignment.
~MRFZoneList()
Destructor.
Definition: MRFZoneList.C:56
tmp< volVectorField > DDt(const volVectorField &U) const
Return the Coriolis acceleration.
Definition: MRFZoneList.C:115
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: PtrList.H:75
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:98
A class for managing temporary objects.
Definition: tmp.H:55
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
label patchi
U
Definition: pEqn.H:72
rho
Definition: pEqn.H:1
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Ostream & operator<<(Ostream &os, const fvConstraints &constraints)
dictionary dict