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-2024 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 
61 public:
62 
63  //- Runtime type information
64  TypeName("fvMeshMover");
65 
66 
67  // Declare run-time constructor selection table
68 
70  (
71  autoPtr,
73  fvMesh,
74  (fvMesh& mesh, const dictionary& dict),
75  (mesh, dict)
76  );
77 
78 
79  //- Helper class to update the velocity boundary conditions
80  // following mesh motion
82  {
83  // Private Data
84 
85  const fvMesh& mesh_;
86 
87  wordList velocityFields_;
88 
89  public:
90 
91  // Constructors
92 
94  (
95  const fvMesh& mesh,
96  const dictionary& dict
97  );
98 
99 
100  // Member Functions
101 
102  void update() const;
103  };
104 
105 
106  // Constructors
107 
108  //- Construct from fvMesh
109  explicit fvMeshMover(fvMesh&);
110 
111  //- Disallow default bitwise copy construction
112  fvMeshMover(const fvMeshMover&) = delete;
113 
114 
115  // Selectors
116 
117  //- Select, construct and return the fvMeshMover
118  // If the constant/dynamicMeshDict does not exist
119  // a staticFvMesh is returned
121 
122 
123  //- Destructor
124  virtual ~fvMeshMover();
125 
126 
127  // Member Functions
128 
129  //- Return the fvMesh
130  fvMesh& mesh()
131  {
132  return mesh_;
133  }
134 
135  //- Return the fvMesh
136  const fvMesh& mesh() const
137  {
138  return mesh_;
139  }
140 
141  //- Is mesh dynamic, i.e. might it change?
142  // Defaults to true, set to false in the fvMeshMovers::none
143  virtual bool dynamic() const
144  {
145  return true;
146  }
147 
148  //- Is the motion solid body? I.e., are the volumes and area magnitudes
149  // unchanged? Defaults to false. Set to true by fvMeshMovers::none and
150  // delegated to the motion solver by fvMeshMovers::motionSolver.
151  virtual bool solidBody() const
152  {
153  return false;
154  }
155 
156  //- Update the mesh for both mesh motion and topology change
157  virtual bool update() = 0;
158 
159  //- Update local data for topology changes
160  virtual void topoChange(const polyTopoChangeMap&) = 0;
161 
162  //- Update from another mesh using the given map
163  virtual void mapMesh(const polyMeshMap&) = 0;
164 
165  //- Update corresponding to the given distribution map
166  virtual void distribute(const polyDistributionMap&) = 0;
167 
168  //- Write the mover state
169  virtual bool write(const bool write = true) const
170  {
171  return true;
172  }
173 
174 
175  // Member Operators
176 
177  //- Disallow default bitwise assignment
178  void operator=(const fvMeshMover&) = delete;
179 };
180 
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 } // End namespace Foam
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 #endif
189 
190 // ************************************************************************* //
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 keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Helper class to update the velocity boundary conditions.
Definition: fvMeshMover.H:81
velocityMotionCorrection(const fvMesh &mesh, const dictionary &dict)
Definition: fvMeshMover.C:47
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.
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:142
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:129
virtual bool solidBody() const
Is the motion solid body? I.e., are the volumes and area magnitudes.
Definition: fvMeshMover.H:150
declareRunTimeSelectionTable(autoPtr, fvMeshMover, fvMesh,(fvMesh &mesh, const dictionary &dict),(mesh, dict))
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:59
virtual bool write(const bool write=true) const
Write the mover state.
Definition: fvMeshMover.H:168
virtual void topoChange(const polyTopoChangeMap &)=0
Update local data for topology changes.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:96
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.
dictionary dict