All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fvMeshMover.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) 2021-2023 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::fvMeshMover
26 
27 Description
28  Abstract base class for fvMesh movers.
29 
30  These classes move the mesh points, update the cell volumes and generate
31  the corresponding mesh fluxes without any topology change.
32 
33 SourceFiles
34  fvMeshMover.C
35  fvMeshMoverNew.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef fvMeshMover_H
40 #define fvMeshMover_H
41 
42 #include "fvMesh.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class fvMeshMover Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class fvMeshMover
54 {
55  // Private Data
56 
57  //- Non-const fvMesh reference to allow update
58  fvMesh& mesh_;
59 
60  //- The dynamicMeshDict
61  dictionary dynamicMeshDict_;
62 
63 
64 public:
65 
66  //- Runtime type information
67  TypeName("fvMeshMover");
68 
69 
70  // Declare run-time constructor selection table
71 
73  (
74  autoPtr,
76  fvMesh,
77  (fvMesh& mesh),
78  (mesh)
79  );
80 
81 
82  //- Helper class to update the velocity boundary conditions
83  // following mesh motion
85  {
86  // Private Data
87 
88  const fvMesh& mesh_;
89 
90  wordList velocityFields_;
91 
92  public:
93 
94  // Constructors
95 
97  (
98  const fvMesh& mesh,
99  const dictionary& dict
100  );
101 
102 
103  // Member Functions
104 
105  void update() const;
106  };
107 
108 
109  // Constructors
110 
111  //- Construct from fvMesh
112  explicit fvMeshMover(fvMesh&);
113 
114  //- Disallow default bitwise copy construction
115  fvMeshMover(const fvMeshMover&) = delete;
116 
117 
118  // Selectors
119 
120  //- Select, construct and return the fvMeshMover
121  // If the constant/dynamicMeshDict does not exist
122  // a staticFvMesh is returned
124 
125 
126  //- Destructor
127  virtual ~fvMeshMover();
128 
129 
130  // Member Functions
131 
132  //- Return the fvMesh
133  fvMesh& mesh()
134  {
135  return mesh_;
136  }
137 
138  //- Return the fvMesh
139  const fvMesh& mesh() const
140  {
141  return mesh_;
142  }
143 
144  //- Return the dynamicMeshDict/mover dict
145  const dictionary& dict() const
146  {
147  return dynamicMeshDict_.subDict("mover");
148  }
149 
150  //- Is mesh dynamic, i.e. might it change?
151  // Defaults to true, set to false in the fvMeshMovers::none
152  virtual bool dynamic() const
153  {
154  return true;
155  }
156 
157  //- Is the motion solid body? I.e., are the volumes and area magnitudes
158  // unchanged? Defaults to false. Set to true by fvMeshMovers::none and
159  // delegated to the motion solver by fvMeshMovers::motionSolver.
160  virtual bool solidBody() const
161  {
162  return false;
163  }
164 
165  //- Update the mesh for both mesh motion and topology change
166  virtual bool update() = 0;
167 
168  //- Update local data for topology changes
169  virtual void topoChange(const polyTopoChangeMap&) = 0;
170 
171  //- Update from another mesh using the given map
172  virtual void mapMesh(const polyMeshMap&) = 0;
173 
174  //- Update corresponding to the given distribution map
175  virtual void distribute(const polyDistributionMap&) = 0;
176 
177  //- Write the mover state
178  virtual bool write(const bool write = true) const
179  {
180  return true;
181  }
182 
183 
184  // Member Operators
185 
186  //- Disallow default bitwise assignment
187  void operator=(const fvMeshMover&) = delete;
188 };
189 
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 } // End namespace Foam
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 #endif
198 
199 // ************************************************************************* //
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
Definition: dictionary.C:843
Helper class to update the velocity boundary conditions.
Definition: fvMeshMover.H:84
velocityMotionCorrection(const fvMesh &mesh, const dictionary &dict)
Definition: fvMeshMover.C:62
Abstract base class for fvMesh movers.
Definition: fvMeshMover.H:53
virtual void mapMesh(const polyMeshMap &)=0
Update from another mesh using the given map.
void operator=(const fvMeshMover &)=delete
Disallow default bitwise assignment.
const dictionary & dict() const
Return the dynamicMeshDict/mover dict.
Definition: fvMeshMover.H:144
virtual void distribute(const polyDistributionMap &)=0
Update corresponding to the given distribution map.
virtual bool dynamic() const
Is mesh dynamic, i.e. might it change?
Definition: fvMeshMover.H:151
TypeName("fvMeshMover")
Runtime type information.
virtual bool update()=0
Update the mesh for both mesh motion and topology change.
fvMesh & mesh()
Return the fvMesh.
Definition: fvMeshMover.H:132
virtual bool solidBody() const
Is the motion solid body? I.e., are the volumes and area magnitudes.
Definition: fvMeshMover.H:159
declareRunTimeSelectionTable(autoPtr, fvMeshMover, fvMesh,(fvMesh &mesh),(mesh))
fvMeshMover(fvMesh &)
Construct from fvMesh.
Definition: fvMeshMover.C:40
static autoPtr< fvMeshMover > New(fvMesh &)
Select, construct and return the fvMeshMover.
virtual ~fvMeshMover()
Destructor.
Definition: fvMeshMover.C:74
virtual bool write(const bool write=true) const
Write the mover state.
Definition: fvMeshMover.H:177
virtual void topoChange(const polyTopoChangeMap &)=0
Update local data for topology changes.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:99
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Definition: polyMeshMap.H:51
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Namespace for OpenFOAM.