sixDoFMotion.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) 2011-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::solidBodyMotionFunctions::sixDoFMotion
26 
27 Description
28  Tabulated 6DoF motion function.
29 
30  Obtained by interpolating tabulated data for surge (x-translation),
31  sway (y-translation), heave (z-translation), roll (rotation about x),
32  pitch (rotation about y) and yaw (rotation about z).
33 
34 SourceFiles
35  sixDoFMotion.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef sixDoFMotion_H
40 #define sixDoFMotion_H
41 
43 #include "Function1.H"
44 #include "Vector2D.H"
45 #include "primitiveFields.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 namespace solidBodyMotionFunctions
52 {
53 
54 /*---------------------------------------------------------------------------*\
55  Class sixDoFMotion Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 class sixDoFMotion
59 :
61 {
62 private:
63 
64  // Private Data
65 
66  //- Center of gravity read from dictionary
67  vector CofG_;
68 
69  //- Translation function
70  autoPtr<Function1<vector>> translation_;
71 
72  //- Rotation function
73  autoPtr<Function1<vector>> rotation_;
74 
75 
76 public:
77 
78  //- Runtime type information
79  TypeName("sixDoFMotion");
80 
81 
82  // Constructors
83 
84  //- Construct from components
86  (
87  const word& name,
88  const dictionary& SBMFCoeffs,
89  const Time& runTime
90  );
91 
92  //- Disallow default bitwise copy construction
93  sixDoFMotion(const sixDoFMotion&) = delete;
94 
95  //- Construct and return a clone
97  {
99  (
100  new sixDoFMotion
101  (
102  name_,
103  SBMFCoeffs_,
104  time_
105  )
106  );
107  }
108 
109 
110  //- Destructor
111  virtual ~sixDoFMotion();
112 
113 
114  // Member Functions
115 
116  //- Return the solid-body motion transformation septernion
117  virtual septernion transformation() const;
118 
119  //- Update properties from given dictionary
120  virtual bool read(const dictionary& SBMFCoeffs);
121 
122 
123  // Member Operators
124 
125  //- Disallow default bitwise assignment
126  void operator=(const sixDoFMotion&) = delete;
127 };
128 
129 
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131 
132 } // End namespace solidBodyMotionFunctions
133 } // End namespace Foam
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 #endif
138 
139 // ************************************************************************* //
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:76
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
Septernion class used to perform translations and rotations in 3D space.
Definition: septernion.H:66
Base class for defining solid-body motions.
Tabulated 6DoF motion function.
Definition: sixDoFMotion.H:60
void operator=(const sixDoFMotion &)=delete
Disallow default bitwise assignment.
TypeName("sixDoFMotion")
Runtime type information.
virtual autoPtr< solidBodyMotionFunction > clone() const
Construct and return a clone.
Definition: sixDoFMotion.H:95
sixDoFMotion(const word &name, const dictionary &SBMFCoeffs, const Time &runTime)
Construct from components.
Definition: sixDoFMotion.C:51
virtual septernion transformation() const
Return the solid-body motion transformation septernion.
Definition: sixDoFMotion.C:72
virtual bool read(const dictionary &SBMFCoeffs)
Update properties from given dictionary.
Definition: sixDoFMotion.C:89
A class for handling words, derived from string.
Definition: word.H:63
Namespace for OpenFOAM.
Specialisations of Field<T> for scalar, vector and tensor.