interpolatingSolidBodyMotionSolver.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) 2018-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::interpolatingSolidBodyMotionSolver
26 
27 Description
28  Solid-body motion of the mesh specified by a run-time selectable motion
29  function. Applies SLERP interpolation of movement as function of
30  distance to the object surface to move the mesh points.
31 
32 SourceFiles
33  interpolatingSolidBodyMotionSolver.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef interpolatingSolidBodyMotionSolver_H
38 #define interpolatingSolidBodyMotionSolver_H
39 
40 #include "points0MotionSolver.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class interpolatingSolidBodyMotionSolver Declaration
50 \*---------------------------------------------------------------------------*/
51 
53 :
54  public points0MotionSolver
55 {
56  // Private Data
57 
58  //- The motion control function
60 
61  wordReList patches_;
62 
63  //- Patches to integrate forces
64  const labelHashSet patchSet_;
65 
66  //- Center of gravity read from dictionary
67  vector CofG_;
68 
69  //- Inner morphing distance (limit of solid-body region)
70  const scalar di_;
71 
72  //- Outer morphing distance (limit of linear interpolation region)
73  const scalar do_;
74 
75  //- Current interpolation scale (1 at patches, 0 at distance_)
76  pointScalarField scale_;
77 
78  void calcScale();
79 
80 
81 public:
82 
83  //- Runtime type information
84  TypeName("interpolatingSolidBody");
85 
86 
87  // Constructors
88 
89  //- Construct from polyMesh and dictionary
91  (
92  const word& name,
93  const polyMesh&,
94  const dictionary& dict
95  );
96 
97  //- Disallow default bitwise copy construction
99  (
101  ) = delete;
102 
103 
104  //- Destructor
106 
107 
108  // Member Functions
109 
110  //- Return point location obtained from the current motion field
111  virtual tmp<pointField> curPoints() const;
112 
113  //- Solve for motion
114  virtual void solve()
115  {}
116 
117  //- Update local data for topology changes
118  virtual void topoChange(const polyTopoChangeMap&);
119 
120  //- Update from another mesh using the given map
121  virtual void mapMesh(const polyMeshMap&);
122 
123 
124  // Member Operators
125 
126  //- Disallow default bitwise assignment
127  void operator=(const interpolatingSolidBodyMotionSolver&) = delete;
128 };
129 
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 } // End namespace Foam
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 #endif
138 
139 // ************************************************************************* //
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:160
Solid-body motion of the mesh specified by a run-time selectable motion function. Applies SLERP inter...
virtual tmp< pointField > curPoints() const
Return point location obtained from the current motion field.
virtual void topoChange(const polyTopoChangeMap &)
Update local data for topology changes.
interpolatingSolidBodyMotionSolver(const word &name, const polyMesh &, const dictionary &dict)
Construct from polyMesh and dictionary.
TypeName("interpolatingSolidBody")
Runtime type information.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
void operator=(const interpolatingSolidBodyMotionSolver &)=delete
Disallow default bitwise assignment.
const word & name() const
Return name.
Definition: motionSolver.H:125
Virtual base class for displacement motion solvers.
Class containing mesh-to-mesh mapping information.
Definition: polyMeshMap.H:51
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
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.
dictionary dict