sixDoFSolverI.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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.
20 
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/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
27 
29 {
30  return body_.motionState_.centreOfRotation();
31 }
32 
34 {
35  return body_.motionState_.Q();
36 }
37 
39 {
40  return body_.motionState_.v();
41 }
42 
44 {
45  return body_.motionState_.a();
46 }
47 
49 {
50  return body_.motionState_.pi();
51 }
52 
54 {
55  return body_.motionState_.tau();
56 }
57 
58 
60 {
61  return body_.motionState0_.centreOfRotation();
62 }
63 
64 inline const Foam::tensor& Foam::sixDoFSolver::Q0() const
65 {
66  return body_.motionState0_.Q();
67 }
68 
69 
70 inline const Foam::vector& Foam::sixDoFSolver::v0() const
71 {
72  return body_.motionState0_.v();
73 }
74 
75 
76 inline const Foam::vector& Foam::sixDoFSolver::a0() const
77 {
78  return body_.motionState0_.a();
79 }
80 
81 
83 {
84  return body_.motionState0_.pi();
85 }
86 
87 
89 {
90  return body_.motionState0_.tau();
91 }
92 
93 inline Foam::scalar Foam::sixDoFSolver::aDamp() const
94 {
95  return body_.aDamp_;
96 }
97 
99 {
100  return body_.tConstraints_;
101 }
102 
104 {
105  return body_.rConstraints_;
106 }
107 
108 //- Apply rotation tensors to Q0 for the given torque (pi) and deltaT
109 // and return the rotated Q and pi as a tuple
111 (
112  const tensor& Q0,
113  const vector& pi,
114  const scalar deltaT
115 ) const
116 {
117  return body_.rotate(Q0, pi, deltaT);
118 }
119 
120 //- Update and relax accelerations from the force and torque
122 (
123  const vector& fGlobal,
124  const vector& tauGlobal
125 )
126 {
127  body_.updateAcceleration(fGlobal, tauGlobal);
128 }
129 
130 
131 // ************************************************************************* //
vector & v()
Return non-const access to vector.
Definition: sixDoFSolverI.H:38
tensor tConstraints() const
Translational constraint tensor.
Definition: sixDoFSolverI.H:98
tensor rConstraints() const
Rotational constraint tensor.
point & centreOfRotation()
Return the current centre of rotation.
Definition: sixDoFSolverI.H:28
const vector & a() const
Return access to acceleration.
A 2-tuple for storing two objects of different types.
Definition: HashTable.H:66
const vector & v() const
Return access to velocity.
const vector & tau() const
Return access to torque.
const vector & pi0() const
Return the angular momentum at previous time-step.
Definition: sixDoFSolverI.H:82
tensor & Q()
Return the orientation.
Definition: sixDoFSolverI.H:33
const point & centreOfRotation() const
Return access to the centre of mass.
Tuple2< tensor, vector > rotate(const tensor &Q0, const vector &pi, const scalar deltaT) const
Apply rotation tensors to Q0 for the given torque (pi) and deltaT.
const vector & pi() const
Return access to angular momentum.
vector & pi()
Return non-const access to angular momentum.
Definition: sixDoFSolverI.H:48
const tensor & Q0() const
Return the orientation at previous time-step.
Definition: sixDoFSolverI.H:64
void updateAcceleration(const vector &fGlobal, const vector &tauGlobal)
Update and relax accelerations from the force and torque.
sixDoFRigidBodyMotion & body_
The rigid body.
Definition: sixDoFSolver.H:56
const point & centreOfRotation0() const
Return the centre of rotation at previous time-step.
Definition: sixDoFSolverI.H:59
const vector & a0() const
Return the acceleration at previous time-step.
Definition: sixDoFSolverI.H:76
const tensor & Q() const
Return access to the orientation.
const vector & tau0() const
Return the torque at previous time-step.
Definition: sixDoFSolverI.H:88
vector & a()
Return non-const access to acceleration.
Definition: sixDoFSolverI.H:43
vector & tau()
Return non-const access to torque.
Definition: sixDoFSolverI.H:53
scalar aDamp() const
Acceleration damping coefficient (for steady-state simulations)
Definition: sixDoFSolverI.H:93
const vector & v0() const
Return the velocity at previous time-step.
Definition: sixDoFSolverI.H:70