Merge remote-tracking branch 'origin/nr/multiSolverFix' into nextRelease
[foam-extend-3.2.git] / src / ODE / sixDOF / sixDOFqODE / sixDOFqODEI.H
blob6a37ce301cee8ac36aa87e1271bef6a131cbb7a9
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright held by original author
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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
25 Description
26     6-DOF solver using quaternions
28 Author
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
40     return mass_;
44 const Foam::dimensionedDiagTensor& Foam::sixDOFqODE::momentOfInertia() const
46     return momentOfInertia_;
50 const Foam::dimensionedVector& Foam::sixDOFqODE::Xequilibrium() const
52     return Xequilibrium_;
56 const Foam::dimensionedVector& Foam::sixDOFqODE::Xrel() const
58     return Xrel_;
62 const Foam::dimensionedVector& Foam::sixDOFqODE::omega() const
64     return omega_;
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
82     return U_;
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()
106     return U_;
110 Foam::dimensionedVector& Foam::sixDOFqODE::omega()
112     return omega_;
116 const Foam::dimensionedVector& Foam::sixDOFqODE::Uaverage() const
118     return Uaverage_;
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
142     return force_;
146 Foam::dimensionedVector& Foam::sixDOFqODE::force()
148     return force_;
152 const Foam::dimensionedVector& Foam::sixDOFqODE::moment() const
154     return moment_;
158 Foam::dimensionedVector& Foam::sixDOFqODE::moment()
160     return 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 // ************************************************************************* //