multiDisplacementMotionSolver.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) 2024 OpenCFD Ltd.
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::multiDisplacementMotionSolver
28 
29 Group
30  grpMeshMotionSolvers
31 
32 Description
33  Mesh motion solver for a polyMesh. Applies multiple (displacement) motion
34  solvers in order.
35 
36  Not very efficient : all displacementMotionSolvers store a copy
37  of the initial points (points0) and the displacement (pointDisplacement
38  or also cellDisplacement).
39  Used to combine large-scale, implicit displacement smoothing (e.g.
40  displacementLaplacian) with point smoothing.
41 
42 Usage
43  Example of the dynamicMeshDict specification:
44  \verbatim
45  motionSolver multiDisplacement;
46  solvers
47  {
48  // Solve finite volume laplacian to efficiently smooth displacement
49  // (not point locations)
50  displacementLaplacian
51  {
52  motionSolver displacementLaplacian;
53  diffusivity uniform;
54  }
55 
56  // Apply few iterations of smoothing of point locations
57  displacementPointSmoothing
58  {
59  motionSolver displacementPointSmoothing;
60  pointSmoother laplacian;
61  nPointSmootherIter 10;
62  }
63  }
64  \endverbatim
65 
66 Note
67  When using displacementLaplacian: the default behaviour for the
68  cellDisplacement is to apply fixed value boundary conditions (by averaging
69  point values) only to those pointDisplacement boundary conditions that
70  are fixed value. Quite a few point boundary conditions (e.g. surfaceSlip,
71  edgeSlip) are not so require an explicitly provided cellDisplacement
72  field with 'cellMotion' boundary conditions for those patches.
73 
74 SourceFiles
75  isplacementMultiMotionSolver.C
76 \*----------------------------------------------------------------------------*/
77 
78 #ifndef Foam_multiDisplacementMotionSolver_H
79 #define Foam_multiDisplacementMotionSolver_H
80 
82 
83 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
84 
85 namespace Foam
86 {
87 
88 /*---------------------------------------------------------------------------*\
89  Class multiDisplacementMotionSolver Declaration
90 \*---------------------------------------------------------------------------*/
91 
93 :
95 {
96  // Private data
97 
98  //- Current points
99  pointField curPoints_;
100 
101  //- List of motion solvers
102  PtrList<displacementMotionSolver> motionSolvers_;
103 
104 
105  // Private Member Functions
106 
107  //- No copy construct
109  (
111  ) = delete;
112 
113  //- No copy assignment
114  void operator=(const multiDisplacementMotionSolver&) = delete;
115 
116 
117 public:
118 
119  //- Runtime type information
120  TypeName("multiDisplacement");
121 
122 
123  // Constructors
124 
125  //- Construct from polyMesh and IOdictionary
127  (
128  const polyMesh&,
129  const IOdictionary&
130  );
131 
132  //- Construct from components
134  (
135  const polyMesh& mesh,
136  const IOdictionary& dict,
138  const pointIOField& points0
139  );
140 
141 
142  //- Destructor
143  ~multiDisplacementMotionSolver() = default;
144 
145 
146  // Member Functions
147 
148  //- Provide current points for motion
149  virtual tmp<pointField> curPoints() const;
150 
151  //- Solve for motion
152  virtual void solve();
153 
154  //- Update local data for geometry changes
155  virtual void movePoints(const pointField&);
156 
157  //- Update local data for topology changes
158  virtual void updateMesh(const mapPolyMesh&);
159 };
160 
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 } // End namespace Foam
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 #endif
169 
170 // ************************************************************************* //
dictionary dict
Virtual base class for displacement motion solver.
virtual tmp< pointField > curPoints() const
Provide current points for motion.
~multiDisplacementMotionSolver()=default
Destructor.
pointVectorField & pointDisplacement() noexcept
Return reference to the point motion displacement field.
virtual void updateMesh(const mapPolyMesh &)
Update local data for topology changes.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
Mesh motion solver for a polyMesh. Applies multiple (displacement) motion solvers in order...
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:50
TypeName("multiDisplacement")
Runtime type information.
virtual void movePoints(const pointField &)
Update local data for geometry changes.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
Definition: PtrList.H:56
pointField & points0() noexcept
Return reference to the reference (&#39;0&#39;) pointField.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:75
const polyMesh & mesh() const
Return reference to mesh.
Definition: motionSolver.H:165
A class for managing temporary objects.
Definition: HashPtrTable.H:50
A primitive field of type <T> with automated input and output.
Namespace for OpenFOAM.