displacementLayeredMotionSolver.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) 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::displacementLayeredMotionSolver
26 
27 Description
28  Interpolating motion solver for extruded/layered meshes
29 
30  Uses a topological walk from points along edges to points from one patch to
31  the opposite, accumulating distance and propagating displacement and then
32  again in the return direction and uses the distances from each point to the
33  two opposite patches to linearly interpolate the displacements of
34  these two patches to the each point.
35 
36  This motion solver is very simple to configure, only the two opposite
37  patches between which the mesh is layered need be specified as a pair of
38  patch names following the \c oppositePatches keyword, e.g.
39 
40  \verbatim
41  mover
42  {
43  type motionSolver;
44 
45  libs ("libfvMotionSolvers.so");
46 
47  motionSolver displacementLayered;
48 
49  oppositePatches (top bottom);
50  }
51  \endverbatim
52 
53 SourceFiles
54  displacementLayeredMotionSolver.C
55 
56 \*---------------------------------------------------------------------------*/
57 
58 #ifndef displacementLayeredMotionSolver_H
59 #define displacementLayeredMotionSolver_H
60 
62 
63 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
64 
65 namespace Foam
66 {
67 
68 /*---------------------------------------------------------------------------*\
69  Class displacementLayeredMotionSolver Declaration
70 \*---------------------------------------------------------------------------*/
71 
73 :
75 {
76  // Private Member Data
77 
78  //- Names of the opposite patches of the layered mesh
79  Pair<word> oppositePatchNames_;
80 
81  //- Indices of the opposite patches of the layered mesh
82  Pair<label> oppositePatches_;
83 
84 
85  // Private Member Functions
86 
87  //- Walk across the layers from the startPatch to the opposite patch
88  // accumulating the distance and setting the displacement
89  void walkLayers
90  (
91  const polyPatch& startPatch,
92  scalarField& distance,
93  vectorField& displacement
94  ) const;
95 
96 
97 public:
98 
99  //- Runtime type information
100  TypeName("displacementLayered");
101 
102 
103  // Constructors
104 
105  //- Construct from polyMesh and dictionary
107  (
108  const word& name,
109  const polyMesh&,
110  const dictionary&
111  );
112 
113  //- Disallow default bitwise copy construction
115  (
117  ) = delete;
118 
119 
120  //- Destructor
122 
123 
124  // Member Functions
125 
126  //- Return point location obtained from the current motion field
127  virtual tmp<pointField> curPoints() const;
128 
129  //- Solve for motion
130  virtual void solve();
131 
132  //- Update topology (not implemented)
133  virtual void topoChange(const polyTopoChangeMap&);
134 
135 
136  // Member Operators
137 
138  //- Disallow default bitwise assignment
139  void operator=(const displacementLayeredMotionSolver&) = delete;
140 };
141 
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 } // End namespace Foam
146 
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 
149 #endif
150 
151 // ************************************************************************* //
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Interpolating motion solver for extruded/layered meshes.
virtual tmp< pointField > curPoints() const
Return point location obtained from the current motion field.
virtual void topoChange(const polyTopoChangeMap &)
Update topology (not implemented)
void operator=(const displacementLayeredMotionSolver &)=delete
Disallow default bitwise assignment.
displacementLayeredMotionSolver(const word &name, const polyMesh &, const dictionary &)
Construct from polyMesh and dictionary.
TypeName("displacementLayered")
Runtime type information.
Virtual base class for displacement motion solver.
const word & name() const
Return name.
Definition: motionSolver.H:121
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:70
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.