Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::solidBodyMotionFunctions::tabulated6DoFMotion
29
30Description
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
37SourceFiles
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
51namespace Foam
52{
54{
56/*---------------------------------------------------------------------------*\
57 Class tabulated6DoFMotion Declaration
58\*---------------------------------------------------------------------------*/
59
60class tabulated6DoFMotion
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"
89 typedef Vector2D<vector> translationRotationVectors;
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
107public:
108
109 //- Runtime type information
110 TypeName("tabulated6DoFMotion");
111
112
113 // Constructors
114
115 //- Construct from components
116 tabulated6DoFMotion
117 (
118 const dictionary& SBMFCoeffs,
119 const Time& runTime
120 );
121
122 //- Construct and return a clone
124 {
126 (
127 new tabulated6DoFMotion
128 (
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// ************************************************************************* //
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Definition Enum.H:57
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Definition Field.H:172
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition Time.H:75
Templated 2D Vector derived from VectorSpace adding construction from 2 components,...
Definition Vector2D.H:54
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
A class for handling file names.
Definition fileName.H:75
Septernion class used to perform translations and rotations in 3D space.
Definition septernion.H:63
solidBodyMotionFunction(const solidBodyMotionFunction &)=delete
No copy construct.
TypeName("tabulated6DoFMotion")
Runtime type information.
virtual septernion transformation() const
Return the solid-body motion transformation septernion.
virtual autoPtr< solidBodyMotionFunction > clone() const
Construct and return a clone.
virtual ~tabulated6DoFMotion()=default
Destructor.
virtual bool read(const dictionary &SBMFCoeffs)
Update properties from given dictionary.
engineTime & runTime
Namespace for solid-body motions.
Namespace for OpenFOAM.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Vector< scalar > vector
Definition vector.H:57
Specialisations of Field<T> for scalar, vector and tensor.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68