1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "linearMotion.H"
27 #include "addToRunTimeSelectionTable.H"
29 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33 namespace solidBodyMotionFunctions
35 defineTypeNameAndDebug(linearMotion, 0);
36 addToRunTimeSelectionTable
38 solidBodyMotionFunction,
46 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
48 Foam::solidBodyMotionFunctions::linearMotion::linearMotion
50 const dictionary& SBMFCoeffs,
54 solidBodyMotionFunction(SBMFCoeffs, runTime)
60 // * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
62 Foam::solidBodyMotionFunctions::linearMotion::~linearMotion()
66 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
69 Foam::solidBodyMotionFunctions::linearMotion::transformation() const
71 scalar t = time_.value();
73 // Translation of centre of gravity with constant velocity
74 const vector displacement = velocity_*t;
76 quaternion R(0, 0, 0);
77 septernion TR(septernion(displacement)*R);
79 Info<< "solidBodyMotionFunctions::linearMotion::transformation(): "
80 << "Time = " << t << " transformation: " << TR << endl;
86 bool Foam::solidBodyMotionFunctions::linearMotion::read
88 const dictionary& SBMFCoeffs
91 solidBodyMotionFunction::read(SBMFCoeffs);
93 SBMFCoeffs_.lookup("velocity") >> velocity_;
98 // ************************************************************************* //