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::solidBodyMotionFunctions::harmonicOscillation
29 Prescribed translational and rotational harmonic motion.
30 The motion is of the following form: x = x_a*sin(omega*t + phi_x).
31 Hence, velocities go with cosine instead of sine.
37 Vuko Vukcevic, FMENA Zagreb. All rights reserved.
39 \*---------------------------------------------------------------------------*/
41 #ifndef harmonicOscillation_H
42 #define harmonicOscillation_H
44 #include "solidBodyMotionFunction.H"
45 #include "primitiveFields.H"
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 namespace solidBodyMotionFunctions
55 /*---------------------------------------------------------------------------*\
56 Class harmonicOscillation Declaration
57 \*---------------------------------------------------------------------------*/
59 class harmonicOscillation
61 public solidBodyMotionFunction
69 // Prescribed translation members
71 //- Translational amplitudes
72 vector transAmplitudes_;
74 //- Translational angular frequencies
75 vector transAngularFreq_;
77 //- Translational phase angles
78 vector transPhaseAngles_;
81 // Prescribed rotation members
83 //- Rotational amplitudes
84 vector rotAmplitudes_;
86 //- Rotational angular frequencies
87 vector rotAngularFreq_;
89 //- Rotational phase angles
90 vector rotPhaseAngles_;
92 //- Is the rotational velocity given in degrees/sec
96 // Private Member Functions
98 //- Disallow copy construct
99 harmonicOscillation(const harmonicOscillation&);
101 //- Disallow default bitwise assignment
102 void operator=(const harmonicOscillation&);
104 //- Calculate tranformation
105 septernion calcTransformation(const scalar t) const;
110 //- Runtime type information
111 TypeName("harmonicOscillation");
116 //- Construct from components
119 const dictionary& SBMFCoeffs,
125 virtual ~harmonicOscillation()
131 //- Return the solid-body motion transformation septernion
132 virtual septernion transformation() const;
134 //- Return the solid-body motion velocity
135 virtual septernion velocity() const;
137 //- Update properties from given dictionary
138 virtual bool read(const dictionary& SBMFCoeffs);
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 } // End namespace solidBodyMotionFunctions
145 } // End namespace Foam
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 // ************************************************************************* //