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 data
65 
66  //- Time data file name read from dictionary
67  fileName timeDataFileName_;
68 
69  //- Center of gravity read from dictionary
70  vector CofG_;
71 
72  //- Type used to read in the translation and rotation "vectors"
74 
75  //- Field of times
76  scalarField times_;
77 
78  //- Field of translation and rotation "vectors"
80 
81 
82  // Private Member Functions
83 
84  //- No copy construct
86 
87  //- No copy assignment
88  void operator=(const tabulated6DoFMotion&) = delete;
89 
90 
91 public:
92 
93  //- Runtime type information
94  TypeName("tabulated6DoFMotion");
95 
96 
97  // Constructors
98 
99  //- Construct from components
101  (
102  const dictionary& SBMFCoeffs,
103  const Time& runTime
104  );
105 
106  //- Construct and return a clone
108  {
110  (
112  (
113  SBMFCoeffs_,
114  time_
115  )
116  );
117  }
118 
119 
120  //- Destructor
121  virtual ~tabulated6DoFMotion() = default;
122 
123 
124  // Member Functions
125 
126  //- Return the solid-body motion transformation septernion
127  virtual septernion transformation() const;
128 
129  //- Update properties from given dictionary
130  virtual bool read(const dictionary& SBMFCoeffs);
131 };
132 
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 } // End namespace solidBodyMotionFunctions
137 } // End namespace Foam
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 #endif
142 
143 // ************************************************************************* //
runTime
engineTime & runTime
Definition: createEngineTime.H:13
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
solidBodyMotionFunction.H
Foam::solidBodyMotionFunctions::tabulated6DoFMotion::clone
virtual autoPtr< solidBodyMotionFunction > clone() const
Construct and return a clone.
Definition: tabulated6DoFMotion.H:106
Foam::fileName
A class for handling file names.
Definition: fileName.H:73
Foam::septernion
Septernion class used to perform translations and rotations in 3D space.
Definition: septernion.H:66
Foam::solidBodyMotionFunctions::tabulated6DoFMotion::read
virtual bool read(const dictionary &SBMFCoeffs)
Update properties from given dictionary.
Definition: tabulated6DoFMotion.C:113
Foam::Vector2D
Templated 2D Vector derived from VectorSpace adding construction from 2 components,...
Definition: Vector2D.H:55
primitiveFields.H
Specialisations of Field<T> for scalar, vector and tensor.
Foam::solidBodyMotionFunctions::tabulated6DoFMotion
Tabulated 6DoF motion function.
Definition: tabulated6DoFMotion.H:59
Vector2D.H
Foam::Field< scalar >
Foam::solidBodyMotionFunctions::tabulated6DoFMotion::transformation
virtual septernion transformation() const
Return the solid-body motion transformation septernion.
Definition: tabulated6DoFMotion.C:71
Foam::solidBodyMotionFunction::SBMFCoeffs_
dictionary SBMFCoeffs_
Definition: solidBodyMotionFunction.H:69
Foam::solidBodyMotionFunction
Base class for defining solid-body motions.
Definition: solidBodyMotionFunction.H:63
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::Vector< scalar >
Foam::solidBodyMotionFunctions::tabulated6DoFMotion::~tabulated6DoFMotion
virtual ~tabulated6DoFMotion()=default
Destructor.
Foam::solidBodyMotionFunction::time_
const Time & time_
Definition: solidBodyMotionFunction.H:71
Foam::solidBodyMotionFunctions::tabulated6DoFMotion::TypeName
TypeName("tabulated6DoFMotion")
Runtime type information.