rigidBodyMotion_pointMeshMover.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) 2016-2026 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::pointMeshMovers::rigidBodyMotion
26 
27 Description
28  Multiple rigid body mesh motion in which movement of the bodies is
29  generated by RBD::rigidBodyMotion.
30 
31  Applies distance weighted SLERP interpolation between the septernion
32  transformations for each body returned provided by the
33  RBD::rigidBodyMotion solution of the multi-body + joint system.
34 
35  The mesh patches for each body must be specified and optionally pointZones
36  that move with each body. The motion of the mesh around each body may be
37  constrained by the optional \c innerDistance and \c outerDistance, the mesh
38  within the \c innerDistance moves with the body without distortion and the
39  mesh beyond the \c outerDistance does not move with body but may move by the
40  proximity of other bodies.
41 
42  Example of the motion of a single constrained and restrained floating hull
43  in a stationary region:
44  \verbatim
45  mover
46  {
47  type pointMeshMover;
48 
49  libs ("librigidBodyMotion_pointMeshMover.so");
50 
51  pointMeshMover
52  {
53  type rigidBodyMotion;
54 
55  report on;
56 
57  solver
58  {
59  type Newmark;
60  }
61 
62  accelerationRelaxation 0.4;
63 
64  bodies
65  {
66  hull
67  {
68  type rigidBody;
69  parent root;
70 
71  centreOfMass (0 0 0);
72  mass 412.73;
73  inertia (40 0 0 921 0 921);
74  transform (1 0 0 0 1 0 0 0 1) (2.929541 0 0.2);
75 
76  joint
77  {
78  type composite;
79  joints
80  (
81  {
82  type Pz;
83  }
84  {
85  type Ry;
86  }
87  );
88  }
89 
90  patches (hull);
91  innerDistance 0.3;
92  outerDistance 1;
93  }
94  }
95 
96  restraints
97  {
98  translationDamper
99  {
100  type linearDamper;
101  body hull;
102  coeff 8596;
103  }
104 
105  rotationDamper
106  {
107  type sphericalAngularDamper;
108  body hull;
109  coeff 11586;
110  }
111  }
112  }
113  }
114  \endverbatim
115 
116 See also
117  Foam::RBD::rigidBodyMotion
118  Foam::pointMeshMovers::multiRigidBody
119 
120 SourceFiles
121  rigidBodyMotion_pointMeshMover.C
122 
123 \*---------------------------------------------------------------------------*/
124 
125 #ifndef rigidBodyMotion_pointMeshMover_H
126 #define rigidBodyMotion_pointMeshMover_H
127 
129 #include "rigidBodyMotion.H"
130 #include "Function1.H"
131 
132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133 
134 namespace Foam
135 {
136 namespace pointMeshMovers
137 {
138 
139 /*---------------------------------------------------------------------------*\
140  Class rigidBodyMotion Declaration
141 \*---------------------------------------------------------------------------*/
142 
143 class rigidBodyMotion
144 :
146  public RBD::rigidBodyMotion
147 {
148  // Private Data
149 
150  //- Switch for test-mode in which only the
151  // gravitational body-force is applied
152  Switch test_;
153 
154  //- Number of iterations in test-mode
155  label nIter_;
156 
157  //- Reference density required by the forces object for
158  // incompressible calculations, required if rho == rhoInf
159  scalar rhoInf_;
160 
161  //- Name of density field, optional unless used for an
162  // incompressible simulation, when this needs to be specified
163  // as rhoInf
164  word rhoName_;
165 
166  //- Ramp the forces according to the specified function and period
168 
169  //- Current time index (used for updating)
170  label curTimeIndex_;
171 
172 
173  // Private Member Functions
174 
175  //- To avoid warning from clang
177 
178  //- Return the list of transformation for each body from time 0
179  virtual List<septernion> transforms0() const;
180 
181  //- Move the bodies
182  virtual void moveBodies();
183 
184 
185 public:
186 
187  //- Runtime type information
188  TypeName("rigidBodyMotion");
189 
190 
191  // Constructors
192 
193  //- Construct from polyMesh and dictionary
194  rigidBodyMotion(const polyMesh&, const dictionary& dict);
195 
196  //- Disallow default bitwise copy construction
197  rigidBodyMotion(const rigidBodyMotion&) = delete;
198 
199 
200  //- Destructor
202 
203 
204  // Member Functions
205 
206  //- Write motion state information for restart
207  virtual bool write() const;
208 
209 
210  // Member Operators
211 
212  //- Disallow default bitwise assignment
213  void operator=(const rigidBodyMotion&) = delete;
214 };
215 
216 
217 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218 
219 } // End namespace pointMeshMovers
220 } // End namespace Foam
221 
222 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
223 
224 #endif
225 
226 // ************************************************************************* //
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:91
Six degree of freedom motion for a rigid body.
virtual void write(Ostream &) const
Write.
rigidBodyMotion()
Construct null.
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:61
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
Abstract base-class for multiple rigid body mesh motion.
Multiple rigid body mesh motion in which movement of the bodies is generated by RBD::rigidBodyMotion.
TypeName("rigidBodyMotion")
Runtime type information.
void operator=(const rigidBodyMotion &)=delete
Disallow default bitwise assignment.
virtual bool write() const
Write motion state information for restart.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:78
A class for handling words, derived from string.
Definition: word.H:63
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
dictionary dict