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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2015 OpenFOAM Foundation
9  Copyright (C) 2023 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
29 // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
30 
32 {
33  return body_.motionState_.centreOfRotation();
34 }
35 
37 {
38  return body_.motionState_.Q();
39 }
40 
42 {
43  return body_.motionState_.v();
44 }
45 
47 {
48  return body_.motionState_.a();
49 }
50 
52 {
53  return body_.motionState_.pi();
54 }
55 
57 {
58  return body_.motionState_.tau();
59 }
60 
61 
63 {
64  return body_.motionState0_.centreOfRotation();
65 }
66 
67 inline const Foam::tensor& Foam::sixDoFSolver::Q0() const
68 {
69  return body_.motionState0_.Q();
70 }
71 
72 
73 inline const Foam::vector& Foam::sixDoFSolver::v0() const
74 {
75  return body_.motionState0_.v();
76 }
77 
78 
79 inline const Foam::vector& Foam::sixDoFSolver::a0() const
80 {
81  return body_.motionState0_.a();
82 }
83 
84 
85 inline const Foam::vector& Foam::sixDoFSolver::pi0() const
86 {
87  return body_.motionState0_.pi();
88 }
89 
90 
91 inline const Foam::vector& Foam::sixDoFSolver::tau0() const
92 {
93  return body_.motionState0_.tau();
94 }
95 
96 inline Foam::scalar Foam::sixDoFSolver::aDamp() const
97 {
98  return body_.aDamp_;
99 }
100 
102 {
103  return body_.tConstraints_;
104 }
105 
107 {
108  return body_.rConstraints_;
109 }
111 //- Apply rotation tensors to Q0 for the given torque (pi) and deltaT
112 // and return the rotated Q and pi as a tuple
114 (
115  const tensor& Q0,
116  const vector& pi,
117  const scalar deltaT
118 ) const
119 {
120  return body_.rotate(Q0, pi, deltaT);
121 }
122 
123 //- Update and relax accelerations from the force and torque
125 (
126  const vector& fGlobal,
127  const vector& tauGlobal
128 )
129 {
130  body_.updateAcceleration(fGlobal, tauGlobal);
131 }
132 
134 {
135  body_.updateConstraints();
136 }
137 
138 
139 // ************************************************************************* //
vector & v()
Return non-const access to vector.
Definition: sixDoFSolverI.H:34
tensor tConstraints() const
Translational constraint tensor.
Definition: sixDoFSolverI.H:94
tensor rConstraints() const
Rotational constraint tensor.
Definition: sixDoFSolverI.H:99
point & centreOfRotation()
Return the current centre of rotation.
Definition: sixDoFSolverI.H:24
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
Definition: stringOps.H:54
const vector & pi0() const
Return the angular momentum at previous time-step.
Definition: sixDoFSolverI.H:78
tensor & Q()
Return the orientation.
Definition: sixDoFSolverI.H:29
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.
constexpr scalar pi(M_PI)
vector & pi()
Return non-const access to angular momentum.
Definition: sixDoFSolverI.H:44
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
const tensor & Q0() const
Return the orientation at previous time-step.
Definition: sixDoFSolverI.H:60
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:60
const point & centreOfRotation0() const
Return the centre of rotation at previous time-step.
Definition: sixDoFSolverI.H:55
const vector & a0() const
Return the acceleration at previous time-step.
Definition: sixDoFSolverI.H:72
const vector & tau0() const
Return the torque at previous time-step.
Definition: sixDoFSolverI.H:84
void updateConstraints()
Update the constraints to the object.
vector & a()
Return non-const access to acceleration.
Definition: sixDoFSolverI.H:39
Tensor of scalars, i.e. Tensor<scalar>.
vector & tau()
Return non-const access to torque.
Definition: sixDoFSolverI.H:49
scalar aDamp() const
Acceleration damping coefficient (for steady-state simulations)
Definition: sixDoFSolverI.H:89
const vector & v0() const
Return the velocity at previous time-step.
Definition: sixDoFSolverI.H:66