1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
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
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 Foam::solidBodyMotionFunction::graphVelocity
29 Prescribed translational and rotational velocity given graphs for surge,
30 sway, heave, roll, pitch and yaw. Hence, the velocity is given in graphs,
31 not the motion (trajectory).
37 Vuko Vukcevic, FMENA Zagreb. All rights reserved.
39 \*---------------------------------------------------------------------------*/
41 #ifndef graphVelocity_H
42 #define graphVelocity_H
44 #include "solidBodyMotionFunction.H"
46 #include "primitiveFields.H"
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 namespace solidBodyMotionFunctions
57 /*---------------------------------------------------------------------------*\
58 Class graphVelocity Declaration
59 \*---------------------------------------------------------------------------*/
63 public solidBodyMotionFunction
70 //- Integrated translation
71 mutable vector translation_;
73 //- Integrated rotation
74 mutable vector rotation_;
76 //- Integrated old translation
77 mutable vector translationOld_;
79 //- Integrated old rotation
80 mutable vector rotationOld_;
82 //- Time index, avoid integrating more than once per time step
83 mutable label localTimeIndex_;
86 // Prescribed translation members
88 // - Graph for surge translational velocity (x-translation)
91 // - Graph for sway translational velocity (y-translation)
94 // - Graph for heave translational motion (z-translation)
98 // Prescribed rotation members
100 // - Graph for roll rotational velocity (x-rotation)
103 // - Graph for pitch rotational velocity (y-rotation)
106 // - Graph for yaw rotational velocity (z-rotation)
109 //- Is the rotational velocity given in degrees/sec
115 //- Return translational velocity vector
116 vector translationalVelocity() const;
118 // -Return rotational velocity vector
119 vector rotationalVelocity() const;
121 //- Calculate transformation septernion
122 septernion calcTransformation() const;
127 //- Runtime type information
128 TypeName("graphVelocity");
133 //- Construct from components
136 const dictionary& SBMFCoeffs,
142 virtual ~graphVelocity()
148 //- Return the solid-body motion transformation septernion
149 virtual septernion transformation() const;
151 //- Return the solid-body motion velocity
152 virtual septernion velocity() const;
154 //- Update properties from given dictionary
155 virtual bool read(const dictionary& SBMFCoeffs);
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 } // End namespace solidBodyMotionFunctions
162 } // End namespace Foam
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 // ************************************************************************* //