tabulated6DoFMotion.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) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::solidBodyMotionFunctions::tabulated6DoFMotion
29 
30 Description
31  Tabulated 6DoF motion function.
32 
33  Obtained by interpolating tabulated data for surge (x-translation),
34  sway (y-translation), heave (z-translation), roll (rotation about x),
35  pitch (rotation about y) and yaw (rotation about z).
36 
37 SourceFiles
38  tabulated6DoFMotion.C
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef tabulated6DoFMotion_H
43 #define tabulated6DoFMotion_H
44 
46 #include "primitiveFields.H"
47 #include "Vector2D.H"
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 namespace Foam
52 {
53 namespace solidBodyMotionFunctions
54 {
55 
56 /*---------------------------------------------------------------------------*\
57  Class tabulated6DoFMotion Declaration
58 \*---------------------------------------------------------------------------*/
59 
61 :
63 {
64  // Private Enumerations
65 
66  //- Options for the interpolation algorithm
67  enum class interpolationType : char
68  {
69  SPLINE = 0,
70  LINEAR
71  };
72 
73  //- Names for interpolationType
74  static const Enum<interpolationType> interpolationTypeNames;
75 
76 
77  // Private Data
78 
79  //- Interpolation algorithm
80  interpolationType interpolator_;
81 
82  //- Time data file name read from dictionary
83  fileName timeDataFileName_;
84 
85  //- Center of gravity read from dictionary
86  vector CofG_;
87 
88  //- Type used to read in the translation and rotation "vectors"
90 
91  //- Field of times
92  scalarField times_;
93 
94  //- Field of translation and rotation "vectors"
96 
97 
98  // Private Member Functions
99 
100  //- No copy construct
101  tabulated6DoFMotion(const tabulated6DoFMotion&) = delete;
102 
103  //- No copy assignment
104  void operator=(const tabulated6DoFMotion&) = delete;
105 
106 
107 public:
108 
109  //- Runtime type information
110  TypeName("tabulated6DoFMotion");
111 
112 
113  // Constructors
114 
115  //- Construct from components
117  (
118  const dictionary& SBMFCoeffs,
119  const Time& runTime
120  );
121 
122  //- Construct and return a clone
124  {
126  (
128  (
129  SBMFCoeffs_,
130  time_
131  )
132  );
133  }
134 
135 
136  //- Destructor
137  virtual ~tabulated6DoFMotion() = default;
138 
139 
140  // Member Functions
141 
142  //- Return the solid-body motion transformation septernion
143  virtual septernion transformation() const;
145  //- Update properties from given dictionary
146  virtual bool read(const dictionary& SBMFCoeffs);
147 };
148 
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 } // End namespace solidBodyMotionFunctions
153 } // End namespace Foam
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 #endif
158 
159 // ************************************************************************* //
virtual septernion transformation() const
Return the solid-body motion transformation septernion.
A class for handling file names.
Definition: fileName.H:72
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
engineTime & runTime
virtual ~tabulated6DoFMotion()=default
Destructor.
Septernion class used to perform translations and rotations in 3D space.
Definition: septernion.H:62
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:69
Base class for defining solid-body motions.
virtual autoPtr< solidBodyMotionFunction > clone() const
Construct and return a clone.
TypeName("tabulated6DoFMotion")
Runtime type information.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
virtual bool read(const dictionary &SBMFCoeffs)
Update properties from given dictionary.
Specialisations of Field<T> for scalar, vector and tensor.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
Templated 2D Vector derived from VectorSpace adding construction from 2 components, element access using x() and y() member functions and the inner-product (dot-product).
Definition: Vector2D.H:51
Namespace for OpenFOAM.