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 6-DOF solver using quaternions
29 Dubravko Matijasevic, FSB Zagreb. All rights reserved.
30 Updates by Hrvoje Jasak, Wikki Ltd.
32 \*---------------------------------------------------------------------------*/
34 #include "finiteRotation.H"
36 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
38 const Foam::dimensionedScalar& Foam::sixDOFqODE::mass() const
44 const Foam::dimensionedDiagTensor& Foam::sixDOFqODE::momentOfInertia() const
46 return momentOfInertia_;
50 const Foam::dimensionedVector& Foam::sixDOFqODE::Xequilibrium() const
56 const Foam::dimensionedVector& Foam::sixDOFqODE::Xrel() const
62 const Foam::dimensionedVector& Foam::sixDOFqODE::omega() const
68 Foam::dimensionedVector Foam::sixDOFqODE::omegaDot() const
70 return OmegaDot(rotation_.eCurrent(), omega_);
74 Foam::dimensionedVector Foam::sixDOFqODE::X() const
76 return Xequilibrium_ + Xrel_;
80 const Foam::dimensionedVector& Foam::sixDOFqODE::U() const
86 Foam::dimensionedVector Foam::sixDOFqODE::A() const
88 return A(Xrel_, U_, rotation_.eCurrent());
92 Foam::vector Foam::sixDOFqODE::rotVector() const
94 return rotation_.rotVector();
98 Foam::dimensionedScalar Foam::sixDOFqODE::rotAngle() const
100 return dimensionedScalar("rotAngle", dimless, rotation_.rotAngle());
104 Foam::dimensionedVector& Foam::sixDOFqODE::U()
110 Foam::dimensionedVector& Foam::sixDOFqODE::omega()
116 const Foam::dimensionedVector& Foam::sixDOFqODE::Uaverage() const
122 Foam::vector Foam::sixDOFqODE::rotVectorAverage() const
124 return rotation_.rotVectorAverage();
128 const Foam::dimensionedVector& Foam::sixDOFqODE::omegaAverage() const
130 return omegaAverage_;
134 const Foam::dimensionedVector& Foam::sixDOFqODE::omegaAverageAbsolute() const
136 return omegaAverageAbsolute_;
140 const Foam::dimensionedVector& Foam::sixDOFqODE::force() const
146 Foam::dimensionedVector& Foam::sixDOFqODE::force()
152 const Foam::dimensionedVector& Foam::sixDOFqODE::moment() const
158 Foam::dimensionedVector& Foam::sixDOFqODE::moment()
164 const Foam::dimensionedVector& Foam::sixDOFqODE::forceRelative() const
166 return forceRelative_;
170 Foam::dimensionedVector& Foam::sixDOFqODE::forceRelative()
172 return forceRelative_;
176 const Foam::dimensionedVector& Foam::sixDOFqODE::momentRelative() const
178 return momentRelative_;
182 Foam::dimensionedVector& Foam::sixDOFqODE::momentRelative()
184 return momentRelative_;
188 Foam::dimensionedVector Foam::sixDOFqODE::forceTotal() const
190 return force() + (toAbsolute() & forceRelative());
194 Foam::dimensionedVector Foam::sixDOFqODE::momentTotal() const
196 return moment() + (toAbsolute() & momentRelative());
200 Foam::tensor Foam::sixDOFqODE::toRelative() const
202 return rotation_.eCurrent().R();
206 Foam::tensor Foam::sixDOFqODE::toAbsolute() const
208 return rotation_.eCurrent().invR();
212 const Foam::tensor& Foam::sixDOFqODE::rotIncrementTensor() const
214 return rotation_.rotIncrementTensor();
218 // ************************************************************************* //